@scalar/cli 2.10.0 → 2.11.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 (99) hide show
  1. package/README.md +82 -1290
  2. package/chunks/{action-YSVTZVKV.js → action-25QMCP5G.js} +37 -26
  3. package/chunks/{action-X7BA7PQQ.js → action-2VF6LODL.js} +20 -18
  4. package/chunks/{action-5N3P43MD.js → action-5I4XDPPG.js} +16 -15
  5. package/chunks/action-6M5PTDF6.js +100 -0
  6. package/chunks/{action-PAM2EZ22.js → action-73ELLN3T.js} +8 -7
  7. package/chunks/{action-XOADBXSX.js → action-7H3AWCHX.js} +17 -16
  8. package/chunks/{action-KDUFU7TZ.js → action-BRSLSOE5.js} +19 -16
  9. package/chunks/{action-7XOHYWYM.js → action-CQQCKSNS.js} +13 -15
  10. package/chunks/action-D5QWDNQ2.js +65 -0
  11. package/chunks/{action-5RL4NWUZ.js → action-DQDHBOLJ.js} +33 -30
  12. package/chunks/{action-DKDRAIKV.js → action-EYPYQQVM.js} +13 -15
  13. package/chunks/{action-ZFI77WA5.js → action-FMA5ECUA.js} +10 -10
  14. package/chunks/{action-DTEO4YNX.js → action-GXDJLF2G.js} +13 -11
  15. package/chunks/{action-657A4K2D.js → action-HUICEXJZ.js} +26 -23
  16. package/chunks/action-IH6G77C5.js +38 -0
  17. package/chunks/{action-H3RTILLM.js → action-IIQMZVRJ.js} +1 -1
  18. package/chunks/action-IQM54ITT.js +164 -0
  19. package/chunks/{action-EAUTQ77U.js → action-J5TO3UJW.js} +26 -24
  20. package/chunks/{action-UUL6SWV4.js → action-KC3ZCNDR.js} +12 -14
  21. package/chunks/{action-HT42NUUX.js → action-L7TMS3Q3.js} +40 -38
  22. package/chunks/{action-GWYYTUTM.js → action-LAAHRDSR.js} +5 -5
  23. package/chunks/{action-5LF4XYHX.js → action-LR75GHBA.js} +12 -12
  24. package/chunks/{action-PPTFYZWD.js → action-MJMLQFLT.js} +12 -12
  25. package/chunks/action-NHU4CUKT.js +130 -0
  26. package/chunks/{action-4GZI2M5B.js → action-NKTFNFU7.js} +19 -17
  27. package/chunks/{action-CB55NWAU.js → action-NMW5WPD2.js} +9 -9
  28. package/chunks/{action-GFLRD7LO.js → action-OTPXODUE.js} +8 -8
  29. package/chunks/{action-R4PGILN4.js → action-RPCDNGCI.js} +47 -36
  30. package/chunks/{action-TOBU74JH.js → action-RQCXSJPZ.js} +51 -27
  31. package/chunks/{action-JEYDBB3P.js → action-SOYSVG67.js} +15 -15
  32. package/chunks/action-Y7EBKCUU.js +16 -0
  33. package/chunks/{action-XLE37MZL.js → action-YN4TE7TG.js} +23 -22
  34. package/chunks/{action-CABLS46Q.js → action-ZGNVWTHZ.js} +11 -11
  35. package/chunks/{action-4W5GUGEG.js → action-ZKKRPLDK.js} +20 -19
  36. package/chunks/{action-ZKA3RR3S.js → action-ZUZL7R3H.js} +18 -17
  37. package/chunks/{actions-3SAMH7A5.js → actions-S6K76HCW.js} +23 -20
  38. package/chunks/{agent-2ESZI7NO.js → agent-IRNEV4K5.js} +44 -9
  39. package/chunks/{asyncapi-4HGVM3PR.js → asyncapi-WQPIQMEZ.js} +13 -12
  40. package/chunks/{build.action-VBGFGACM.js → build.action-CLBVKFWD.js} +28 -26
  41. package/chunks/chunk-25XERWCE.js +1058 -0
  42. package/chunks/{chunk-35Z7VTJT.js → chunk-3RIUDHLG.js} +52 -38
  43. package/chunks/{chunk-ZYBLQ5CT.js → chunk-3TFOA64C.js} +9 -4
  44. package/chunks/{chunk-CWVYOXXM.js → chunk-4JKXZ5CF.js} +11 -7
  45. package/chunks/{chunk-XAGJJNQW.js → chunk-5L7V7RCH.js} +10 -10
  46. package/chunks/{chunk-KZNRQVMY.js → chunk-ALYM4ZB2.js} +1 -1
  47. package/chunks/chunk-AVZFSWPD.js +37 -0
  48. package/chunks/{chunk-GYRQPDTK.js → chunk-BQYVSPAI.js} +14 -2
  49. package/chunks/{chunk-UDBSV3CK.js → chunk-CSSTCHHF.js} +6083 -4167
  50. package/chunks/{chunk-ZGNDXPLU.js → chunk-DQD2753S.js} +3 -3
  51. package/chunks/{action-F2ZJNURT.js → chunk-EBNFCIKS.js} +7 -10
  52. package/chunks/{chunk-ATNTXKMS.js → chunk-F3OPMYME.js} +118 -38
  53. package/chunks/{chunk-KHF2QXBG.js → chunk-FG5AOTDN.js} +1433 -641
  54. package/chunks/{chunk-K2HIB5BA.js → chunk-GKCVATQJ.js} +3 -3
  55. package/chunks/{chunk-BIMLCGKS.js → chunk-GMHIK5K2.js} +1 -1
  56. package/chunks/{chunk-5SMP756H.js → chunk-GYR5E6RB.js} +2 -2
  57. package/chunks/{chunk-MC4EMNOR.js → chunk-HZN6IIPZ.js} +7 -6
  58. package/chunks/{chunk-VVRUSQCY.js → chunk-I57ID5K7.js} +13 -0
  59. package/chunks/{chunk-VYFGRLVQ.js → chunk-KOD2HX5I.js} +1 -1
  60. package/chunks/{chunk-ZKJPLWRJ.js → chunk-LOLVJNI5.js} +4 -4
  61. package/chunks/{chunk-GLWTVLKM.js → chunk-MN2AFJXM.js} +9 -2
  62. package/chunks/{chunk-WB6PWTMU.js → chunk-N5CJ5MTY.js} +1 -1
  63. package/chunks/{chunk-JXGF5EHC.js → chunk-NWJ37GI2.js} +23 -13
  64. package/chunks/{chunk-3ZJYGGAA.js → chunk-ORCUZITN.js} +1 -1
  65. package/chunks/{chunk-H467HDVV.js → chunk-QMLRYD76.js} +1 -1
  66. package/chunks/{chunk-43WALAW3.js → chunk-SEURG74P.js} +64 -115
  67. package/chunks/{chunk-G4HRW2FZ.js → chunk-SOV4POMS.js} +366 -253
  68. package/chunks/chunk-T34TL6KL.js +222 -0
  69. package/chunks/{chunk-WDIWLXLV.js → chunk-U6VE6JOS.js} +3 -3
  70. package/chunks/{chunk-MMWSCTDB.js → chunk-UFSFY7Z4.js} +19 -19
  71. package/chunks/{chunk-WIEXQUTD.js → chunk-ULRJZXMS.js} +1 -1
  72. package/chunks/{chunk-DHZW7Q7U.js → chunk-US54KYOJ.js} +2 -4
  73. package/chunks/{chunk-36LXIJIZ.js → chunk-V6LUKXBV.js} +1 -16
  74. package/chunks/{chunk-6M7TL2G2.js → chunk-VRZSDUZK.js} +45 -5
  75. package/chunks/chunk-VUXPDHTQ.js +22 -0
  76. package/chunks/chunk-XP5UM7SF.js +21 -0
  77. package/chunks/{chunk-IPZP3VRA.js → chunk-Y6XGC4K5.js} +5 -21
  78. package/chunks/{create.action-DBNIS665.js → create.action-ITEOQ644.js} +34 -32
  79. package/chunks/{delete.action-K7BLK7DK.js → delete.action-77MFPLUN.js} +29 -27
  80. package/chunks/{delete.action-GBOZC45K.js → delete.action-C6VX4S5Q.js} +30 -28
  81. package/chunks/{get.action-N3JOY3OU.js → get.action-3BP4FHZC.js} +16 -15
  82. package/chunks/{get.action-QHKMYZBK.js → get.action-LNBOWUVE.js} +24 -20
  83. package/chunks/{list.action-6SSO3JVN.js → list.action-6CRFQPJT.js} +39 -29
  84. package/chunks/{list.action-TJCS6UEY.js → list.action-KR5YIDR4.js} +37 -26
  85. package/chunks/{publish.action-T24VHRMR.js → publish.action-YBORRPBM.js} +45 -43
  86. package/chunks/{scripts-VIBLGKYG.js → scripts-6CI6U32J.js} +1 -1
  87. package/chunks/{update.action-VOE6PH5F.js → update.action-O7TSXDGV.js} +29 -27
  88. package/chunks/{update.action-OGYNBXRU.js → update.action-QZI7M2MV.js} +30 -28
  89. package/index.js +283 -278
  90. package/package.json +2 -2
  91. package/skills/scalar-cli/SKILL.md +49 -49
  92. package/template.md +66 -253
  93. package/chunks/action-FBRY5JKU.js +0 -37
  94. package/chunks/action-LYCNT3KA.js +0 -73
  95. package/chunks/action-OJ2NK25F.js +0 -121
  96. package/chunks/action-U2L5DCFG.js +0 -91
  97. package/chunks/chunk-MNNGUUKJ.js +0 -405
  98. package/chunks/chunk-ZGVZU6L2.js +0 -422
  99. package/docs.html +0 -6977
@@ -1,33 +1,42 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ mcpEnvironmentSchema
4
+ } from "./chunk-T34TL6KL.js";
2
5
  import {
3
6
  billingPlanSchema
4
- } from "./chunk-GYRQPDTK.js";
7
+ } from "./chunk-BQYVSPAI.js";
5
8
  import {
6
9
  sharedProjectSchema
7
- } from "./chunk-6M7TL2G2.js";
10
+ } from "./chunk-VRZSDUZK.js";
8
11
  import {
9
12
  SCALAR_AGENT_KEY_HEADER,
10
13
  agentDocsProjectSchema,
11
14
  agentKeySchema,
15
+ createdMcpServerSchema,
12
16
  docsProjectTypes,
13
17
  embedStatuses,
14
- mcpAuthConfigSchema,
18
+ emptyDocumentAuthSchema,
19
+ mcpChannelModes,
20
+ mcpClientCredentialSchema,
15
21
  mcpDocsProjectTrackModes,
16
22
  mcpDocumentTrackModes,
17
23
  mcpInstallationSchema,
24
+ mcpServerChannelSchema,
18
25
  mcpServerDocsPageToolSchema,
19
- mcpServerOperationToolSchema,
26
+ mcpServerHistorySchema,
20
27
  mcpServerSchema,
21
- mcpServerToolModes,
22
28
  mcpServerVersionSchema,
23
29
  monthlyUsageSchema
24
- } from "./chunk-ZGVZU6L2.js";
30
+ } from "./chunk-25XERWCE.js";
31
+ import {
32
+ environmentSlugSchema
33
+ } from "./chunk-AVZFSWPD.js";
25
34
  import {
26
35
  external_exports,
27
36
  namespaceSchema,
28
37
  nanoidSchema,
29
38
  slugSchema
30
- } from "./chunk-VVRUSQCY.js";
39
+ } from "./chunk-I57ID5K7.js";
31
40
 
32
41
  // ../../packages/entities/dist/api/agent/shared.js
33
42
  var agentApiErrorSchema = external_exports.object({
@@ -48,7 +57,7 @@ var pubsubPushMessageSchema = external_exports.object({
48
57
  });
49
58
  var bumpKindSchema = external_exports.enum(["patch", "minor", "major"]);
50
59
  var bumpStrategySchema = external_exports.enum(["new-version", "in-place"]);
51
- var semverParamSchema = external_exports.string().regex(/^\d+\.\d+\.\d+$/, "semver MAJOR.MINOR.PATCH");
60
+ var versionLabelParamSchema = external_exports.string().min(1).regex(/^[^/]+$/, 'a version label without "/"');
52
61
  var installationParamSchema = external_exports.string().regex(/^[^@/]+(@[^@/]+)?$/, "installationId or installationId@version");
53
62
 
54
63
  // ../../packages/entities/dist/api/agent/analytics.js
@@ -324,10 +333,20 @@ var dashboardRoutes = {
324
333
  var docsProjectAgentInfoSchema = external_exports.object({
325
334
  id: external_exports.string(),
326
335
  mcpServerId: external_exports.string().nullable(),
327
- mcpInstallationId: external_exports.string().nullable(),
336
+ /**
337
+ * The environment of `mcpServerId` docs chat calls. Defaulted so a
338
+ * not-yet-redeployed agent service still parses.
339
+ */
340
+ mcpEnvironment: external_exports.string().nullish().default(null),
328
341
  mcpServerName: external_exports.string().nullable(),
329
342
  mcpServerSlug: external_exports.string().nullable(),
330
- mcpInstallationSlug: external_exports.string().nullable()
343
+ /** Defaulted so a not-yet-redeployed agent service still parses. */
344
+ mcpServerNamespace: external_exports.string().nullish().default(null),
345
+ /**
346
+ * The record uid of `mcpServerId`. Defaulted so a not-yet-redeployed agent
347
+ * service still parses.
348
+ */
349
+ mcpServerUid: external_exports.string().nullish().default(null)
331
350
  });
332
351
  var docsChatContextSchema = external_exports.object({
333
352
  /** The Vue-router path of the current page, without the hash. */
@@ -357,7 +376,8 @@ var docsRoutes = {
357
376
  params: external_exports.object({ projectUid: external_exports.string() }),
358
377
  body: external_exports.object({
359
378
  mcpServerId: external_exports.string().nullable(),
360
- mcpInstallationId: external_exports.string().nullable()
379
+ /** An environment slug of the bound server. */
380
+ mcpEnvironment: external_exports.string().nullable()
361
381
  }).partial(),
362
382
  response: agentDocsProjectSchema,
363
383
  responses: { 400: agentApiErrorSchema, 404: agentApiErrorSchema },
@@ -485,18 +505,22 @@ var internalRoutes = {
485
505
  */
486
506
  namespace: namespaceSchema.optional(),
487
507
  serverSlug: slugSchema,
488
- installationSlug: slugSchema
508
+ /** The environment slug; one of this or `installationSlug` is required. */
509
+ environment: slugSchema.optional(),
510
+ /** The name `environment` had in scalar configs, kept as an alias. */
511
+ installationSlug: slugSchema.optional()
489
512
  }),
490
513
  response: external_exports.object({
491
514
  mcpServerId: external_exports.string(),
492
- mcpInstallationId: external_exports.string()
515
+ /** Defaulted so a not-yet-redeployed agent service still parses. */
516
+ environment: external_exports.string().nullish().default(null)
493
517
  }),
494
518
  responses: {
495
519
  400: agentApiErrorSchema,
496
520
  404: agentApiErrorSchema,
497
521
  409: agentApiErrorSchema
498
522
  },
499
- summary: "Resolve an MCP installation by team and slugs"
523
+ summary: "Resolve an MCP environment by team and slugs"
500
524
  },
501
525
  createDocsProject: {
502
526
  method: "POST",
@@ -519,8 +543,9 @@ var internalRoutes = {
519
543
  },
520
544
  /**
521
545
  * Which of the given record uids have a Postgres row, with the identity
522
- * fields the row holds. Core's reconcile sweep deletes the records the
523
- * agent does not know and patches the ones whose fields drifted.
546
+ * and channel fields the row holds. Core's reconcile sweep deletes the
547
+ * records the agent does not know and patches the ones whose fields
548
+ * drifted.
524
549
  */
525
550
  knownMcpServers: {
526
551
  method: "POST",
@@ -531,7 +556,11 @@ var internalRoutes = {
531
556
  uid: external_exports.string(),
532
557
  namespace: external_exports.string(),
533
558
  name: external_exports.string(),
534
- slug: external_exports.string()
559
+ slug: external_exports.string(),
560
+ /** Omitted by an agent that predates channels. */
561
+ channelMode: external_exports.enum(mcpChannelModes).optional(),
562
+ /** Omitted by an agent that predates channels. */
563
+ channels: mcpServerChannelSchema.array().optional()
535
564
  }).array()
536
565
  }),
537
566
  summary: "The MCP server rows behind the given record uids"
@@ -564,19 +593,99 @@ var internalRoutes = {
564
593
  }
565
594
  };
566
595
 
596
+ // ../../packages/entities/dist/api/agent/mcp-environments.js
597
+ var mcpSettingsRefusalSchema = external_exports.object({
598
+ path: external_exports.union([external_exports.string(), external_exports.number()]).array(),
599
+ message: external_exports.string()
600
+ });
601
+ var mcpEnvironmentsRefusedSchema = agentApiErrorSchema.extend({
602
+ refusals: mcpSettingsRefusalSchema.array()
603
+ });
604
+ var mcpEnvironmentRoutes = {
605
+ provisionMcpEnvironments: {
606
+ method: "PUT",
607
+ path: (p) => `/internal/mcp/servers/${p.uid}/environments`,
608
+ params: external_exports.object({ uid: external_exports.string() }),
609
+ body: external_exports.object({
610
+ teamUid: external_exports.string(),
611
+ recordBuilds: external_exports.boolean().optional(),
612
+ /**
613
+ * Skip the save-time refusals: the save is the agent's own write of
614
+ * what a description says today (a tool selection with the Config
615
+ * defaults), relayed back by core, not a Config edit.
616
+ */
617
+ unchecked: external_exports.boolean().optional(),
618
+ userUid: external_exports.string().optional(),
619
+ environments: external_exports.record(environmentSlugSchema, mcpEnvironmentSchema)
620
+ }),
621
+ response: external_exports.object({
622
+ environments: external_exports.object({ slug: external_exports.string(), id: external_exports.string() }).array()
623
+ }),
624
+ responses: {
625
+ 403: agentApiErrorSchema,
626
+ 404: agentApiErrorSchema,
627
+ 422: mcpEnvironmentsRefusedSchema
628
+ },
629
+ summary: "Sync an MCP server's environment rows with its record"
630
+ }
631
+ };
632
+ var mcpChannelOverridesSchema = external_exports.object({
633
+ /**
634
+ * The channel's Config as parsed from JSON or YAML: an OpenAPI-shaped patch
635
+ * over the API description, replacing the environment's own whole; `{}`
636
+ * clears it. Its root `x-scalar-access` sets the environment's login portal
637
+ * and access groups by slug. The agent validates it with `validateMcpConfig`
638
+ * and answers 422 with the refusals.
639
+ */
640
+ config: external_exports.record(external_exports.string(), external_exports.unknown())
641
+ });
642
+ var mcpChannelOverrideRoutes = {
643
+ saveChannelOverrides: {
644
+ method: "PUT",
645
+ path: (p) => `/mcp/servers/${p.id}/environments/${p.env}/channels/${p.documentUid}`,
646
+ params: external_exports.object({
647
+ id: external_exports.uuid(),
648
+ env: environmentSlugSchema,
649
+ documentUid: external_exports.string().min(1)
650
+ }),
651
+ body: mcpChannelOverridesSchema,
652
+ response: external_exports.object({
653
+ /** The environment's entry as written; null when the record was left as it was. */
654
+ environment: mcpEnvironmentSchema.nullable(),
655
+ /** The build the save recorded and made active; null when nothing serves the environment yet. */
656
+ buildId: external_exports.string().nullable()
657
+ }),
658
+ responses: {
659
+ 403: agentApiErrorSchema,
660
+ 404: agentApiErrorSchema,
661
+ 409: agentApiErrorSchema,
662
+ 422: mcpEnvironmentsRefusedSchema,
663
+ 502: agentApiErrorSchema
664
+ },
665
+ summary: "Save one channel's Config in one environment and record one build"
666
+ }
667
+ };
668
+
567
669
  // ../../packages/entities/dist/api/agent/mcp-installations.js
568
670
  var installationToolSchema = external_exports.object({
569
671
  name: external_exports.string(),
570
672
  description: external_exports.string().optional(),
571
673
  inputSchema: external_exports.unknown()
572
674
  });
675
+ var legacyAddressSchema = external_exports.object({
676
+ /** The last hour a UUID request arrived in; null when none has since the map was filled. */
677
+ lastHitAt: external_exports.string().nullable(),
678
+ expiresAt: external_exports.string()
679
+ });
573
680
  var installationSummarySchema = external_exports.object({
574
681
  id: external_exports.string(),
575
682
  name: external_exports.string(),
576
683
  slug: external_exports.string(),
577
684
  isPrivate: external_exports.boolean(),
578
685
  /** Defaulted so a not-yet-redeployed agent service still parses. */
579
- mcpVersion: external_exports.string().nullable().default(null)
686
+ mcpVersion: external_exports.string().nullable().default(null),
687
+ /** Defaulted so a not-yet-redeployed agent service still parses. */
688
+ legacyAddress: legacyAddressSchema.nullish().default(null)
580
689
  });
581
690
  var serverParams = external_exports.object({ id: external_exports.uuid() });
582
691
  var installationParams = external_exports.object({
@@ -596,24 +705,29 @@ var mcpInstallationRoutes = {
596
705
  method: "GET",
597
706
  path: (p) => `/mcp/servers/${p.id}/installations/${p.installationId}`,
598
707
  params: installationParams,
599
- response: mcpInstallationSchema,
708
+ response: mcpInstallationSchema.extend({
709
+ /** Defaulted so a not-yet-redeployed agent service still parses. */
710
+ legacyAddress: legacyAddressSchema.nullish().default(null),
711
+ /**
712
+ * The one credential the environment asks an MCP client for, which the
713
+ * install snippets offer. Null while no version serves the environment,
714
+ * and defaulted so a not-yet-redeployed agent service still parses.
715
+ */
716
+ clientCredential: mcpClientCredentialSchema.nullish().default(null)
717
+ }),
600
718
  responses: { 400: agentApiErrorSchema, 404: agentApiErrorSchema },
601
719
  summary: "Get an MCP installation"
602
720
  },
603
- createInstallation: {
604
- method: "POST",
605
- path: (p) => `/mcp/servers/${p.id}/installations`,
606
- params: external_exports.object({ id: external_exports.string() }),
607
- body: external_exports.object({
608
- name: external_exports.string().min(1).max(100),
609
- slug: slugSchema.optional(),
610
- documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
611
- /** Private when omitted; the dashboard sends false for Production. */
612
- isPrivate: external_exports.boolean().optional()
613
- }),
614
- response: mcpInstallationSchema,
615
- responses: { 400: agentApiErrorSchema },
616
- summary: "Create an MCP installation"
721
+ getLegacyAddress: {
722
+ method: "GET",
723
+ path: (p) => `/mcp/servers/${p.id}/legacy-addresses/${p.installationId}`,
724
+ params: installationParams,
725
+ response: external_exports.object({ environment: external_exports.string() }),
726
+ responses: {
727
+ 404: agentApiErrorSchema,
728
+ 410: agentApiErrorSchema.extend({ address: external_exports.string() })
729
+ },
730
+ summary: "Resolve an installation id to its environment through the legacy address map"
617
731
  },
618
732
  updateInstallation: {
619
733
  method: "PATCH",
@@ -622,11 +736,7 @@ var mcpInstallationRoutes = {
622
736
  body: external_exports.object({
623
737
  name: external_exports.string().min(1).max(100),
624
738
  slug: slugSchema,
625
- documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
626
- isPrivate: external_exports.boolean(),
627
- loginPortalUid: external_exports.string().nullable(),
628
- authConfig: mcpAuthConfigSchema,
629
- mcpVersion: semverParamSchema.nullable()
739
+ mcpVersion: versionLabelParamSchema.nullable()
630
740
  }).partial(),
631
741
  response: mcpInstallationSchema,
632
742
  responses: { 400: agentApiErrorSchema },
@@ -764,12 +874,18 @@ var mcpServerRoutes = {
764
874
  projectUid: external_exports.string(),
765
875
  trackMode: external_exports.enum(mcpDocsProjectTrackModes)
766
876
  })).optional(),
767
- toolMode: external_exports.enum(mcpServerToolModes).optional()
768
- }),
769
- response: external_exports.object({
770
- server: mcpServerSchema,
771
- installation: mcpInstallationSchema
877
+ /** Single when omitted and exactly one API document is linked. */
878
+ channelMode: external_exports.enum(mcpChannelModes).optional(),
879
+ /**
880
+ * Write every operation of the linked versions into production's Config
881
+ * with the state its description gives it, so a root
882
+ * `x-scalar-expose.enabled: false` holds back only operations a document
883
+ * gains later.
884
+ */
885
+ pinCurrentOperations: external_exports.boolean().optional(),
886
+ documentAuth: emptyDocumentAuthSchema.optional()
772
887
  }),
888
+ response: createdMcpServerSchema,
773
889
  responses: { 400: agentApiErrorSchema },
774
890
  summary: "Create an MCP server",
775
891
  description: "Provisions the Postgres half of a server whose identity record core has already written. Called by core with the provision secret header; the dashboard creates servers through core."
@@ -785,16 +901,18 @@ var mcpServerRoutes = {
785
901
  name: external_exports.string().min(1).max(100),
786
902
  slug: slugSchema,
787
903
  versionUid: external_exports.string(),
788
- /** Defaults to Production, the environment the bare address serves. */
789
- installationName: external_exports.string().min(1).max(100).optional(),
790
- installationSlug: slugSchema.optional(),
791
- documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
792
- toolMode: external_exports.enum(mcpServerToolModes).optional()
793
- }),
794
- response: external_exports.object({
795
- server: mcpServerSchema,
796
- installation: mcpInstallationSchema
904
+ documentAuth: emptyDocumentAuthSchema,
905
+ /** Single when omitted and the API document is linked. */
906
+ channelMode: external_exports.enum(mcpChannelModes).optional(),
907
+ /**
908
+ * Write every operation of the linked version into production's Config
909
+ * with the state its description gives it, so a root
910
+ * `x-scalar-expose.enabled: false` holds back only operations the
911
+ * document gains later.
912
+ */
913
+ pinCurrentOperations: external_exports.boolean().optional()
797
914
  }),
915
+ response: createdMcpServerSchema,
798
916
  responses: { 400: agentApiErrorSchema },
799
917
  summary: "Create an MCP server with an installation in one call"
800
918
  },
@@ -805,7 +923,12 @@ var mcpServerRoutes = {
805
923
  body: external_exports.object({
806
924
  name: external_exports.string().min(1).max(100),
807
925
  slug: slugSchema,
808
- autoAddOperations: external_exports.boolean(),
926
+ /**
927
+ * Operations to expose as tools: their API document versions are
928
+ * linked, then production's Config is written with each as a tool. A
929
+ * version this call links for the first time has its other operations
930
+ * written as not tools; a version already linked keeps its other tools.
931
+ */
809
932
  operations: external_exports.array(external_exports.uuid()),
810
933
  docsPages: external_exports.array(external_exports.uuid()),
811
934
  bumpStrategy: bumpStrategySchema,
@@ -819,6 +942,16 @@ var mcpServerRoutes = {
819
942
  },
820
943
  summary: "Update an MCP server"
821
944
  },
945
+ setChannelMode: {
946
+ method: "POST",
947
+ path: (p) => `/mcp/servers/${p.id}/channel-mode`,
948
+ params: serverParams2,
949
+ body: external_exports.object({ to: external_exports.enum(mcpChannelModes) }),
950
+ response: mcpServerSchema,
951
+ responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
952
+ summary: "Convert an MCP server to multi-channel",
953
+ description: "One way: a single-channel server becomes multi-channel and keeps its version labels. Asking for single is refused. Each line then serves its highest label rather than the version linked to the document version it tracks, so a server rolled back to an older document version starts serving its highest label. Requires a team admin or owner, and applies at once with no draft or approval."
954
+ },
822
955
  deleteServer: {
823
956
  method: "DELETE",
824
957
  path: (p) => `/mcp/servers/${p.id}`,
@@ -835,68 +968,6 @@ var mcpServerRoutes = {
835
968
  responses: { 400: agentApiErrorSchema },
836
969
  summary: "List operation tools for a linked document version"
837
970
  },
838
- updateOperationTools: {
839
- method: "PATCH",
840
- path: (p) => `/mcp/servers/${p.id}/operation-tools`,
841
- params: serverParams2,
842
- body: external_exports.object({
843
- operationTools: external_exports.array(external_exports.object({
844
- operationId: external_exports.uuid(),
845
- searchToolEnabled: external_exports.boolean(),
846
- executeRequestToolEnabled: external_exports.boolean(),
847
- curatedToolEnabled: external_exports.boolean()
848
- }).partial({
849
- searchToolEnabled: true,
850
- executeRequestToolEnabled: true,
851
- curatedToolEnabled: true
852
- }).refine((tool) => tool.searchToolEnabled !== void 0 || tool.executeRequestToolEnabled !== void 0 || tool.curatedToolEnabled !== void 0, { message: "At least one flag must be provided." })).min(1),
853
- bumpStrategy: bumpStrategySchema.optional(),
854
- bumpKind: bumpKindSchema.optional()
855
- }),
856
- response: external_exports.array(mcpServerOperationToolSchema),
857
- responses: {
858
- 400: agentApiErrorSchema,
859
- 403: agentApiErrorSchema,
860
- 409: agentApiErrorSchema
861
- },
862
- summary: "Update operation tool flags"
863
- },
864
- deleteOperationTool: {
865
- method: "DELETE",
866
- path: (p) => `/mcp/servers/${p.id}/operation-tools/${p.toolId}`,
867
- params: external_exports.object({ id: external_exports.uuid(), toolId: external_exports.uuid() }),
868
- response: external_exports.null(),
869
- responses: { 400: agentApiErrorSchema },
870
- summary: "Delete an operation tool"
871
- },
872
- deleteOperationToolsByVersion: {
873
- method: "DELETE",
874
- path: (p) => `/mcp/servers/${p.id}/operation-tools/versions/${p.versionId}`,
875
- params: external_exports.object({ id: external_exports.uuid(), versionId: external_exports.uuid() }),
876
- response: external_exports.null(),
877
- responses: { 400: agentApiErrorSchema },
878
- summary: "Delete all operation tools of a linked version"
879
- },
880
- setOperationToolMetadata: {
881
- method: "PATCH",
882
- path: (p) => `/mcp/servers/${p.id}/operation-tools/${p.operationToolId}/metadata`,
883
- params: external_exports.object({ id: external_exports.uuid(), operationToolId: external_exports.uuid() }),
884
- body: external_exports.object({
885
- name: external_exports.string().nullable().optional(),
886
- description: external_exports.string().nullable().optional(),
887
- deprecated: external_exports.boolean().optional(),
888
- deprecationMessage: external_exports.string().nullable().optional()
889
- }),
890
- response: external_exports.object({
891
- operationToolId: external_exports.string(),
892
- name: external_exports.string().nullable().optional(),
893
- description: external_exports.string().nullable().optional(),
894
- deprecated: external_exports.boolean().optional(),
895
- deprecationMessage: external_exports.string().nullable().optional()
896
- }),
897
- responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
898
- summary: "Set custom name and description on an operation tool"
899
- },
900
971
  getDocsPageToolsByPublish: {
901
972
  method: "GET",
902
973
  path: (p) => `/mcp/servers/${p.id}/docs-page-tools/${p.publishId}`,
@@ -917,16 +988,10 @@ var mcpServerRoutes = {
917
988
  }).partial({
918
989
  searchToolEnabled: true,
919
990
  executeRequestToolEnabled: true
920
- }).refine((tool) => tool.searchToolEnabled !== void 0 || tool.executeRequestToolEnabled !== void 0, { message: "At least one flag must be provided." })).min(1),
921
- bumpStrategy: bumpStrategySchema.optional(),
922
- bumpKind: bumpKindSchema.optional()
991
+ }).refine((tool) => tool.searchToolEnabled !== void 0 || tool.executeRequestToolEnabled !== void 0, { message: "At least one flag must be provided." })).min(1)
923
992
  }),
924
993
  response: external_exports.array(mcpServerDocsPageToolSchema),
925
- responses: {
926
- 400: agentApiErrorSchema,
927
- 403: agentApiErrorSchema,
928
- 409: agentApiErrorSchema
929
- },
994
+ responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
930
995
  summary: "Update docs page tool flags"
931
996
  },
932
997
  deleteDocsPageTool: {
@@ -934,7 +999,7 @@ var mcpServerRoutes = {
934
999
  path: (p) => `/mcp/servers/${p.id}/docs-page-tools/${p.toolId}`,
935
1000
  params: external_exports.object({ id: external_exports.uuid(), toolId: external_exports.uuid() }),
936
1001
  response: external_exports.null(),
937
- responses: { 400: agentApiErrorSchema },
1002
+ responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
938
1003
  summary: "Delete a docs page tool"
939
1004
  },
940
1005
  deleteDocsPageToolsByPublish: {
@@ -942,7 +1007,7 @@ var mcpServerRoutes = {
942
1007
  path: (p) => `/mcp/servers/${p.id}/docs-page-tools/publishes/${p.publishId}`,
943
1008
  params: external_exports.object({ id: external_exports.uuid(), publishId: external_exports.uuid() }),
944
1009
  response: external_exports.null(),
945
- responses: { 400: agentApiErrorSchema },
1010
+ responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
946
1011
  summary: "Delete all docs page tools of a publish"
947
1012
  },
948
1013
  listServerPublishes: {
@@ -978,8 +1043,7 @@ var mcpServerRoutes = {
978
1043
  slug: external_exports.string(),
979
1044
  namespace: external_exports.string(),
980
1045
  createdAt: external_exports.date(),
981
- updatedAt: external_exports.date(),
982
- toolMode: external_exports.enum(mcpServerToolModes)
1046
+ updatedAt: external_exports.date()
983
1047
  }).array(),
984
1048
  responses: { 400: agentApiErrorSchema },
985
1049
  summary: "List document versions linked to an MCP server"
@@ -1025,31 +1089,17 @@ var mcpServerRoutes = {
1025
1089
  responses: { 400: agentApiErrorSchema },
1026
1090
  summary: "List docs pages available to link for a project"
1027
1091
  },
1028
- setDocumentToolMode: {
1029
- method: "PATCH",
1030
- path: (p) => `/mcp/servers/${p.id}/document-versions/${p.versionId}/tool-mode`,
1031
- params: external_exports.object({ id: external_exports.uuid(), versionId: external_exports.uuid() }),
1032
- body: external_exports.object({
1033
- toolMode: external_exports.enum(mcpServerToolModes),
1034
- bumpStrategy: bumpStrategySchema.optional(),
1035
- bumpKind: bumpKindSchema.optional()
1036
- }),
1037
- response: external_exports.object({
1038
- documentVersionId: external_exports.string(),
1039
- toolMode: external_exports.enum(mcpServerToolModes)
1040
- }),
1041
- responses: {
1042
- 400: agentApiErrorSchema,
1043
- 403: agentApiErrorSchema,
1044
- 409: agentApiErrorSchema
1045
- },
1046
- summary: "Set the tool mode of a linked document version"
1047
- },
1048
1092
  linkDocumentVersion: {
1049
1093
  method: "POST",
1050
1094
  path: (p) => `/mcp/servers/${p.id}/document-versions/${p.versionUid}`,
1051
1095
  params: external_exports.object({ id: external_exports.uuid(), versionUid: external_exports.string() }),
1052
1096
  body: external_exports.object({
1097
+ /**
1098
+ * The linked version's operations to expose as tools, written into
1099
+ * production's Config as `x-scalar-expose.enabled`; its other operations
1100
+ * are written as not tools. Empty or absent leaves production's Config as
1101
+ * it is. A version already linked is left as it is.
1102
+ */
1053
1103
  operationIds: external_exports.array(external_exports.uuid()).optional(),
1054
1104
  bumpKind: bumpKindSchema.optional()
1055
1105
  }),
@@ -1143,8 +1193,7 @@ var mcpVersionToolsSchema = external_exports.object({
1143
1193
  slug: external_exports.string(),
1144
1194
  title: external_exports.string(),
1145
1195
  documentUid: external_exports.string(),
1146
- trackMode: external_exports.enum(mcpDocumentTrackModes),
1147
- toolMode: external_exports.enum(mcpServerToolModes)
1196
+ trackMode: external_exports.enum(mcpDocumentTrackModes)
1148
1197
  })),
1149
1198
  linkedDocsPublishes: external_exports.array(external_exports.object({
1150
1199
  id: external_exports.string(),
@@ -1157,7 +1206,11 @@ var mcpVersionToolsSchema = external_exports.object({
1157
1206
  }))
1158
1207
  });
1159
1208
  var serverParams3 = external_exports.object({ id: external_exports.uuid() });
1160
- var versionParams = external_exports.object({ id: external_exports.uuid(), semver: semverParamSchema });
1209
+ var versionParams = external_exports.object({
1210
+ id: external_exports.uuid(),
1211
+ semver: versionLabelParamSchema
1212
+ });
1213
+ var environmentParams = external_exports.object({ id: external_exports.uuid(), env: slugSchema });
1161
1214
  var mcpVersionRoutes = {
1162
1215
  listVersions: {
1163
1216
  method: "GET",
@@ -1172,7 +1225,7 @@ var mcpVersionRoutes = {
1172
1225
  },
1173
1226
  getVersion: {
1174
1227
  method: "GET",
1175
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}`,
1228
+ path: (p) => `/mcp/servers/${p.id}/versions/${encodeURIComponent(p.semver)}`,
1176
1229
  params: versionParams,
1177
1230
  response: mcpServerVersionSchema,
1178
1231
  responses: { 400: agentApiErrorSchema },
@@ -1180,97 +1233,23 @@ var mcpVersionRoutes = {
1180
1233
  },
1181
1234
  getVersionTools: {
1182
1235
  method: "GET",
1183
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/tools`,
1236
+ path: (p) => `/mcp/servers/${p.id}/versions/${encodeURIComponent(p.semver)}/tools`,
1184
1237
  params: versionParams,
1185
1238
  response: mcpVersionToolsSchema,
1186
1239
  responses: { 400: agentApiErrorSchema },
1187
1240
  summary: "Get the tools and links of a version"
1188
1241
  },
1189
- updateVersionTools: {
1190
- method: "PATCH",
1191
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/tools`,
1192
- params: versionParams,
1193
- body: external_exports.object({
1194
- operationTools: external_exports.array(external_exports.object({
1195
- operationId: external_exports.uuid(),
1196
- searchToolEnabled: external_exports.boolean().optional(),
1197
- executeRequestToolEnabled: external_exports.boolean().optional(),
1198
- curatedToolEnabled: external_exports.boolean().optional(),
1199
- name: external_exports.string().nullable().optional(),
1200
- description: external_exports.string().nullable().optional(),
1201
- deprecated: external_exports.boolean().optional(),
1202
- deprecationMessage: external_exports.string().nullable().optional()
1203
- })).optional(),
1204
- docsPageTools: external_exports.array(external_exports.object({
1205
- docsPageId: external_exports.uuid(),
1206
- searchToolEnabled: external_exports.boolean().optional(),
1207
- executeRequestToolEnabled: external_exports.boolean().optional()
1208
- })).optional()
1209
- }),
1210
- response: mcpServerVersionSchema,
1211
- responses: {
1212
- 400: agentApiErrorSchema,
1213
- 403: agentApiErrorSchema,
1214
- 409: agentApiErrorSchema
1215
- },
1216
- summary: "Update tool flags and metadata on a version"
1217
- },
1218
- updateVersion: {
1219
- method: "PATCH",
1220
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}`,
1221
- params: versionParams,
1222
- body: external_exports.object({ changeNote: external_exports.string().nullable().optional() }),
1223
- response: mcpServerVersionSchema,
1224
- responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1225
- summary: "Update a draft version"
1226
- },
1227
1242
  deleteVersion: {
1228
1243
  method: "DELETE",
1229
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}`,
1244
+ path: (p) => `/mcp/servers/${p.id}/versions/${encodeURIComponent(p.semver)}`,
1230
1245
  params: versionParams,
1231
1246
  response: external_exports.null(),
1232
1247
  responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1233
1248
  summary: "Delete an MCP server version"
1234
1249
  },
1235
- approveVersion: {
1236
- method: "POST",
1237
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/approve`,
1238
- params: versionParams,
1239
- response: mcpServerVersionSchema,
1240
- responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1241
- summary: "Approve a draft version"
1242
- },
1243
- requestVersionApproval: {
1244
- method: "POST",
1245
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/request-approval`,
1246
- params: versionParams,
1247
- response: mcpServerVersionSchema,
1248
- responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1249
- summary: "Send a draft version for approval"
1250
- },
1251
- getOpenDraft: {
1252
- method: "GET",
1253
- path: (p) => `/mcp/servers/${p.id}/draft`,
1254
- params: serverParams3,
1255
- response: mcpServerVersionSchema.nullable(),
1256
- responses: { 400: agentApiErrorSchema },
1257
- summary: "Get the open draft version, if any"
1258
- },
1259
- publishDraft: {
1260
- method: "POST",
1261
- path: (p) => `/mcp/servers/${p.id}/draft/publish`,
1262
- params: serverParams3,
1263
- body: external_exports.object({
1264
- bumpKind: bumpKindSchema.optional(),
1265
- customSemver: external_exports.string().optional()
1266
- }),
1267
- response: mcpServerVersionSchema,
1268
- responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1269
- summary: "Publish the open draft version"
1270
- },
1271
1250
  getVersionSuggestedTools: {
1272
1251
  method: "GET",
1273
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/suggested-tools`,
1252
+ path: (p) => `/mcp/servers/${p.id}/versions/${encodeURIComponent(p.semver)}/suggested-tools`,
1274
1253
  params: versionParams,
1275
1254
  response: external_exports.object({
1276
1255
  suggestions: external_exports.array(external_exports.object({
@@ -1288,33 +1267,12 @@ var mcpVersionRoutes = {
1288
1267
  },
1289
1268
  dismissVersionSuggestions: {
1290
1269
  method: "POST",
1291
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/dismiss-suggestions`,
1270
+ path: (p) => `/mcp/servers/${p.id}/versions/${encodeURIComponent(p.semver)}/dismiss-suggestions`,
1292
1271
  params: versionParams,
1293
1272
  response: external_exports.null(),
1294
1273
  responses: { 400: agentApiErrorSchema },
1295
1274
  summary: "Dismiss tool suggestions for a version"
1296
1275
  },
1297
- setVersionDocumentToolMode: {
1298
- method: "PATCH",
1299
- path: (p) => `/mcp/servers/${p.id}/versions/${p.semver}/document-versions/${p.documentVersionId}/tool-mode`,
1300
- params: external_exports.object({
1301
- id: external_exports.uuid(),
1302
- semver: semverParamSchema,
1303
- documentVersionId: external_exports.uuid()
1304
- }),
1305
- body: external_exports.object({ toolMode: external_exports.enum(mcpServerToolModes) }),
1306
- response: external_exports.object({
1307
- documentVersionId: external_exports.string(),
1308
- toolMode: external_exports.enum(mcpServerToolModes),
1309
- semver: external_exports.string()
1310
- }),
1311
- responses: {
1312
- 400: agentApiErrorSchema,
1313
- 403: agentApiErrorSchema,
1314
- 409: agentApiErrorSchema
1315
- },
1316
- summary: "Set the tool mode of a document version within a version"
1317
- },
1318
1276
  listDocumentTracking: {
1319
1277
  method: "GET",
1320
1278
  path: (p) => `/mcp/servers/${p.id}/document-tracking`,
@@ -1388,6 +1346,24 @@ var mcpVersionRoutes = {
1388
1346
  }),
1389
1347
  responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1390
1348
  summary: "Set how a docs project is tracked"
1349
+ },
1350
+ getHistory: {
1351
+ method: "GET",
1352
+ path: (p) => `/mcp/servers/${p.id}/history`,
1353
+ params: serverParams3,
1354
+ query: external_exports.object({ env: slugSchema.default("production") }),
1355
+ response: mcpServerHistorySchema,
1356
+ responses: { 400: agentApiErrorSchema },
1357
+ summary: "List the builds of an environment's line"
1358
+ },
1359
+ setActiveBuild: {
1360
+ method: "PUT",
1361
+ path: (p) => `/mcp/servers/${p.id}/environments/${p.env}/active`,
1362
+ params: environmentParams,
1363
+ body: external_exports.object({ buildId: external_exports.uuid() }),
1364
+ response: mcpServerHistorySchema,
1365
+ responses: { 400: agentApiErrorSchema, 403: agentApiErrorSchema },
1366
+ summary: "Make a build the one an environment serves"
1391
1367
  }
1392
1368
  };
1393
1369
 
@@ -1532,6 +1508,108 @@ var registrySearchResultSchema = external_exports.object({
1532
1508
  searchEnabled: external_exports.boolean(),
1533
1509
  rank: external_exports.number()
1534
1510
  });
1511
+ var mcpDocumentServerSchema = external_exports.object({
1512
+ url: external_exports.string(),
1513
+ variables: external_exports.record(external_exports.string(), external_exports.object({
1514
+ default: external_exports.string().optional(),
1515
+ enum: external_exports.string().array().optional()
1516
+ })).optional()
1517
+ });
1518
+ var mcpDocumentSecurityRequirementSchema = external_exports.record(external_exports.string(), external_exports.string().array());
1519
+ var mcpDocumentParameterSchema = external_exports.object({
1520
+ name: external_exports.string(),
1521
+ in: external_exports.string(),
1522
+ required: external_exports.boolean().optional()
1523
+ });
1524
+ var mcpDocumentExposeSchema = external_exports.union([
1525
+ external_exports.boolean(),
1526
+ external_exports.object({
1527
+ enabled: external_exports.union([
1528
+ external_exports.boolean(),
1529
+ external_exports.object({ sdk: external_exports.boolean().optional(), mcp: external_exports.boolean().optional() })
1530
+ ]).optional(),
1531
+ name: external_exports.string().optional(),
1532
+ description: external_exports.string().optional(),
1533
+ deprecated: external_exports.boolean().optional(),
1534
+ deprecationMessage: external_exports.string().optional(),
1535
+ toolMode: external_exports.string().optional()
1536
+ })
1537
+ ]);
1538
+ var mcpDocumentOperationSchema = external_exports.object({
1539
+ operationId: external_exports.string().optional(),
1540
+ summary: external_exports.string().optional(),
1541
+ deprecated: external_exports.boolean().optional(),
1542
+ tags: external_exports.string().array().optional(),
1543
+ security: mcpDocumentSecurityRequirementSchema.array().optional(),
1544
+ servers: mcpDocumentServerSchema.array().optional(),
1545
+ parameters: mcpDocumentParameterSchema.array().optional(),
1546
+ "x-scalar-expose": mcpDocumentExposeSchema.optional(),
1547
+ "x-scalar-ignore": external_exports.boolean().optional(),
1548
+ "x-internal": external_exports.boolean().optional(),
1549
+ "x-scalar-stability": external_exports.string().optional(),
1550
+ /** The message, or the per-target object the SDK config also takes. */
1551
+ "x-scalar-deprecation-message": external_exports.union([external_exports.string(), external_exports.record(external_exports.string(), external_exports.string())]).optional()
1552
+ });
1553
+ var mcpDocumentPathItemSchema = external_exports.object({
1554
+ servers: mcpDocumentServerSchema.array().optional(),
1555
+ parameters: mcpDocumentParameterSchema.array().optional(),
1556
+ get: mcpDocumentOperationSchema.optional(),
1557
+ put: mcpDocumentOperationSchema.optional(),
1558
+ post: mcpDocumentOperationSchema.optional(),
1559
+ delete: mcpDocumentOperationSchema.optional(),
1560
+ options: mcpDocumentOperationSchema.optional(),
1561
+ head: mcpDocumentOperationSchema.optional(),
1562
+ patch: mcpDocumentOperationSchema.optional(),
1563
+ trace: mcpDocumentOperationSchema.optional()
1564
+ });
1565
+ var mcpDocumentOAuthFlowSchema = external_exports.object({
1566
+ authorizationUrl: external_exports.string().optional(),
1567
+ deviceAuthorizationUrl: external_exports.string().optional(),
1568
+ tokenUrl: external_exports.string().optional(),
1569
+ refreshUrl: external_exports.string().optional(),
1570
+ scopes: external_exports.record(external_exports.string(), external_exports.string()).optional()
1571
+ });
1572
+ var mcpDocumentSecuritySchemeSchema = external_exports.object({
1573
+ type: external_exports.string().optional(),
1574
+ name: external_exports.string().optional(),
1575
+ in: external_exports.string().optional(),
1576
+ scheme: external_exports.string().optional(),
1577
+ bearerFormat: external_exports.string().optional(),
1578
+ openIdConnectUrl: external_exports.string().optional(),
1579
+ oauth2MetadataUrl: external_exports.string().optional(),
1580
+ deprecated: external_exports.boolean().optional(),
1581
+ flows: external_exports.object({
1582
+ implicit: mcpDocumentOAuthFlowSchema.optional(),
1583
+ password: mcpDocumentOAuthFlowSchema.optional(),
1584
+ clientCredentials: mcpDocumentOAuthFlowSchema.optional(),
1585
+ authorizationCode: mcpDocumentOAuthFlowSchema.optional(),
1586
+ deviceAuthorization: mcpDocumentOAuthFlowSchema.optional()
1587
+ }).optional(),
1588
+ "x-scalar-access": external_exports.boolean().optional()
1589
+ });
1590
+ var mcpDocumentStripIssueSchema = external_exports.object({
1591
+ /** JSON pointer of the dropped node in the source document. */
1592
+ pointer: external_exports.string(),
1593
+ /** The `$ref` that could not be followed. */
1594
+ ref: external_exports.string(),
1595
+ reason: external_exports.enum(["dangling", "cyclic", "external"])
1596
+ });
1597
+ var mcpStrippedDocumentSchema = external_exports.object({
1598
+ openapi: external_exports.string().optional(),
1599
+ info: external_exports.object({ title: external_exports.string().optional(), version: external_exports.string().optional() }).optional(),
1600
+ servers: mcpDocumentServerSchema.array().optional(),
1601
+ security: mcpDocumentSecurityRequirementSchema.array().optional(),
1602
+ tags: external_exports.object({
1603
+ name: external_exports.string(),
1604
+ "x-scalar-expose": mcpDocumentExposeSchema.optional()
1605
+ }).array().optional(),
1606
+ paths: external_exports.record(external_exports.string(), mcpDocumentPathItemSchema),
1607
+ components: external_exports.object({
1608
+ securitySchemes: external_exports.record(external_exports.string(), mcpDocumentSecuritySchemeSchema).optional()
1609
+ }).optional(),
1610
+ "x-scalar-expose": mcpDocumentExposeSchema.optional(),
1611
+ "x-scalar-strip-issues": mcpDocumentStripIssueSchema.array().optional()
1612
+ });
1535
1613
  var registryRoutes = {
1536
1614
  getDocument: {
1537
1615
  method: "GET",
@@ -1588,6 +1666,20 @@ var registryRoutes = {
1588
1666
  responses: { 400: agentApiErrorSchema, 404: agentApiErrorSchema },
1589
1667
  summary: "List the operations of a document version"
1590
1668
  },
1669
+ getVersionMcpDocument: {
1670
+ method: "GET",
1671
+ path: (p) => `/registry/versions/${p.versionUid}/mcp-document`,
1672
+ params: external_exports.object({ versionUid: external_exports.string() }),
1673
+ response: mcpStrippedDocumentSchema,
1674
+ responses: {
1675
+ 400: agentApiErrorSchema,
1676
+ 404: agentApiErrorSchema,
1677
+ 413: agentApiErrorSchema,
1678
+ 422: agentApiErrorSchema
1679
+ },
1680
+ summary: "Get the stripped MCP document of a document version",
1681
+ description: "The bundled document reduced to what MCP configuration reads, with every `$ref` resolved. Served with a content `ETag` and `Cache-Control: private, no-cache`; a matching `If-None-Match` answers 304 with no body. 413 when the stripped document is over 5 MB, 422 when the version has external references that could not be fetched."
1682
+ },
1591
1683
  updateVersionOperations: {
1592
1684
  method: "PATCH",
1593
1685
  path: (p) => `/registry/versions/${p.versionUid}/operations`,
@@ -1677,6 +1769,11 @@ var registryRoutes = {
1677
1769
 
1678
1770
  // ../../packages/entities/dist/api/agent/usage.js
1679
1771
  var usageRecordSchema = monthlyUsageSchema.extend({
1772
+ /**
1773
+ * What the row is for, by name; null when that is gone. An MCP row, of type
1774
+ * `mcp-environment` or `mcp-installation`, names its server, with the
1775
+ * environment in parentheses outside production.
1776
+ */
1680
1777
  name: external_exports.string().nullable(),
1681
1778
  projectType: external_exports.string().nullable(),
1682
1779
  documentUid: external_exports.string().nullable(),
@@ -1705,7 +1802,8 @@ var agentApi = {
1705
1802
  mcp: {
1706
1803
  ...mcpServerRoutes,
1707
1804
  ...mcpVersionRoutes,
1708
- ...mcpInstallationRoutes
1805
+ ...mcpInstallationRoutes,
1806
+ ...mcpChannelOverrideRoutes
1709
1807
  },
1710
1808
  registry: registryRoutes,
1711
1809
  docs: docsRoutes,
@@ -1714,7 +1812,7 @@ var agentApi = {
1714
1812
  openapi: openapiRoutes,
1715
1813
  analytics: analyticsRoutes,
1716
1814
  usage: usageRoutes,
1717
- internal: internalRoutes,
1815
+ internal: { ...internalRoutes, ...mcpEnvironmentRoutes },
1718
1816
  pubsub: pubsubRoutes
1719
1817
  };
1720
1818
 
@@ -1723,7 +1821,7 @@ export {
1723
1821
  pubsubPushMessageSchema,
1724
1822
  bumpKindSchema,
1725
1823
  bumpStrategySchema,
1726
- semverParamSchema,
1824
+ versionLabelParamSchema,
1727
1825
  installationParamSchema,
1728
1826
  analyticsRangeSchema,
1729
1827
  analyticsGranularitySchema,
@@ -1762,7 +1860,13 @@ export {
1762
1860
  pullRequestDescriptionBodySchema,
1763
1861
  editorRoutes,
1764
1862
  internalRoutes,
1863
+ mcpSettingsRefusalSchema,
1864
+ mcpEnvironmentsRefusedSchema,
1865
+ mcpEnvironmentRoutes,
1866
+ mcpChannelOverridesSchema,
1867
+ mcpChannelOverrideRoutes,
1765
1868
  installationToolSchema,
1869
+ legacyAddressSchema,
1766
1870
  installationSummarySchema,
1767
1871
  mcpInstallationRoutes,
1768
1872
  mcpServerWithInstallationsSchema,
@@ -1776,6 +1880,15 @@ export {
1776
1880
  registryDocumentSchema,
1777
1881
  registryVersionOperationSchema,
1778
1882
  registrySearchResultSchema,
1883
+ mcpDocumentServerSchema,
1884
+ mcpDocumentSecurityRequirementSchema,
1885
+ mcpDocumentParameterSchema,
1886
+ mcpDocumentExposeSchema,
1887
+ mcpDocumentOperationSchema,
1888
+ mcpDocumentPathItemSchema,
1889
+ mcpDocumentSecuritySchemeSchema,
1890
+ mcpDocumentStripIssueSchema,
1891
+ mcpStrippedDocumentSchema,
1779
1892
  registryRoutes,
1780
1893
  usageRecordSchema,
1781
1894
  teamUsageResponseSchema,