@redocly/realm 0.136.0-next.1 → 0.136.0-next.10

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 (495) hide show
  1. package/CHANGELOG.md +191 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/cli/build/analytics/collect-analytics.js +1 -1
  4. package/dist/cli/build/index.js +1 -1
  5. package/dist/cli/eject/ejectComponent.d.ts +1 -1
  6. package/dist/cli/eject/ejectTheme.d.ts +1 -1
  7. package/dist/cli/eject/resolveEjectParams.js +1 -1
  8. package/dist/cli/eject/themeOperations.d.ts +2 -2
  9. package/dist/cli/stats/collectors/openapi/index.js +1 -1
  10. package/dist/cli/stats/index.js +1 -1
  11. package/dist/client/App.js +1 -1
  12. package/dist/client/ErrorBoundary.js +1 -1
  13. package/dist/client/TestProvider.d.ts +1 -1
  14. package/dist/client/TestProvider.js +1 -1
  15. package/dist/client/api-docs-builder-entry.d.ts +3 -0
  16. package/dist/client/api-docs-builder-entry.js +1 -0
  17. package/dist/client/app/ConditionalLink.d.ts +1 -1
  18. package/dist/client/app/Feedback/useSubmitFeedback.js +1 -1
  19. package/dist/client/app/Sidebar/Sidebar.js +3 -3
  20. package/dist/client/app/Sidebar/helpers/hide-empty-separators.d.ts +13 -0
  21. package/dist/client/app/Sidebar/helpers/hide-empty-separators.js +1 -0
  22. package/dist/client/app/Sidebar/useActions.js +1 -1
  23. package/dist/client/app/Sidebar/utils.js +1 -1
  24. package/dist/client/app/hooks/catalog/useCatalogFilter.d.ts +1 -1
  25. package/dist/client/app/hooks/catalog/useCatalogViewMode.js +1 -1
  26. package/dist/client/app/hooks/catalog/useFetchCatalogEntities.d.ts +1 -1
  27. package/dist/client/app/hooks/catalog/useFetchCatalogEntities.js +1 -1
  28. package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.d.ts +2 -2
  29. package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.js +1 -1
  30. package/dist/client/app/hooks/catalog/useFetchCatalogEntityRevisions.d.ts +1 -1
  31. package/dist/client/app/hooks/catalog/useSearchTracker.d.ts +2 -5
  32. package/dist/client/app/hooks/catalog/useSearchTracker.js +1 -1
  33. package/dist/client/app/hooks/codeHighlight/useCodeHighlight.d.ts +1 -6
  34. package/dist/client/app/hooks/codeHighlight/useCodeHighlight.js +1 -1
  35. package/dist/client/app/hooks/index.d.ts +1 -0
  36. package/dist/client/app/hooks/index.js +1 -1
  37. package/dist/client/app/hooks/useAutoScroll.js +1 -1
  38. package/dist/client/app/hooks/useUserClaims.js +1 -1
  39. package/dist/client/app/l10n/hooks/index.d.ts +1 -0
  40. package/dist/client/app/l10n/hooks/index.js +1 -1
  41. package/dist/client/app/l10n/hooks/useTranslate.js +1 -1
  42. package/dist/client/app/l10n/hooks/useTranslationKeys.d.ts +2 -0
  43. package/dist/client/app/l10n/hooks/useTranslationKeys.js +1 -0
  44. package/dist/client/app/l10n/initL10n.js +1 -1
  45. package/dist/client/app/markdoc/custom-components/openapi/json-schema.d.ts +1 -1
  46. package/dist/client/app/markdoc/custom-components/openapi/json-schema.js +1 -1
  47. package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.d.ts +1 -5
  48. package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.js +1 -1
  49. package/dist/client/app/markdoc/custom-components/openapi/openapi-example.js +1 -1
  50. package/dist/client/app/markdoc/custom-components/openapi/openapi-response-sample.js +1 -1
  51. package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.d.ts +8 -24
  52. package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.js +1 -1
  53. package/dist/client/app/markdoc/hooks/use-store.d.ts +8 -6
  54. package/dist/client/app/markdoc/utils/build-replay-operation-source-map.d.ts +20 -0
  55. package/dist/client/app/markdoc/utils/build-replay-operation-source-map.js +1 -0
  56. package/dist/client/app/markdoc/utils/find-api-item.d.ts +15 -0
  57. package/dist/client/app/markdoc/utils/find-api-item.js +1 -0
  58. package/dist/client/app/markdoc/utils/find-code-sample-panel.d.ts +11 -0
  59. package/dist/client/app/markdoc/utils/find-code-sample-panel.js +1 -0
  60. package/dist/client/app/markdoc/utils/find-openapi-response-samples.d.ts +15 -0
  61. package/dist/client/app/markdoc/utils/find-openapi-response-samples.js +1 -0
  62. package/dist/client/app/markdoc/utils/openapi-panel-entry.d.ts +18 -0
  63. package/dist/client/app/markdoc/utils/openapi-panel-entry.js +1 -0
  64. package/dist/client/app/pages/DevLogin/DevLoginForm.d.ts +1 -1
  65. package/dist/client/app/useGlobalData.d.ts +1 -1
  66. package/dist/client/app/usePreloadHistory.d.ts +2 -2
  67. package/dist/client/app/usePreloadHistory.js +1 -1
  68. package/dist/client/app/utils/loadAndNavigate.d.ts +1 -1
  69. package/dist/client/app/utils/loadAndNavigate.js +1 -1
  70. package/dist/client/app/utils/resolveRouteBySlug.js +1 -1
  71. package/dist/client/app/utils/same-resolved-route.d.ts +5 -0
  72. package/dist/client/app/utils/same-resolved-route.js +1 -0
  73. package/dist/client/browser-entry.js +2 -2
  74. package/dist/client/providers/page-data/hooks.d.ts +2 -2
  75. package/dist/client/providers/post-message/PostMessageProvider.js +1 -1
  76. package/dist/client/providers/post-message/use-post-message.d.ts +1 -1
  77. package/dist/client/providers/theme/ThemeDataProvider.js +1 -1
  78. package/dist/client/runtime/loader.js +1 -1
  79. package/dist/client/templates/api-docs/helpers.d.ts +10 -0
  80. package/dist/client/templates/api-docs/helpers.js +1 -0
  81. package/dist/client/templates/api-docs/template.d.ts +17 -0
  82. package/dist/client/templates/api-docs/template.js +14 -0
  83. package/dist/client/templates/openapi-docs/helpers.d.ts +1 -1
  84. package/dist/client/templates/openapi-docs/helpers.js +2 -2
  85. package/dist/client/types/sidebar.d.ts +0 -1
  86. package/dist/client/utils/utils.d.ts +0 -2
  87. package/dist/client/utils/utils.js +1 -1
  88. package/dist/constants/common.d.ts +14 -1
  89. package/dist/constants/common.js +1 -1
  90. package/dist/constants/l10n/langs/ar.js +1 -1
  91. package/dist/constants/l10n/langs/de.js +1 -1
  92. package/dist/constants/l10n/langs/en.js +1 -1
  93. package/dist/constants/l10n/langs/es.js +1 -1
  94. package/dist/constants/l10n/langs/fr.js +1 -1
  95. package/dist/constants/l10n/langs/hi.js +1 -1
  96. package/dist/constants/l10n/langs/it.js +1 -1
  97. package/dist/constants/l10n/langs/ja.js +1 -1
  98. package/dist/constants/l10n/langs/ko.js +1 -1
  99. package/dist/constants/l10n/langs/pl.js +1 -1
  100. package/dist/constants/l10n/langs/pt-BR.js +1 -1
  101. package/dist/constants/l10n/langs/pt.js +1 -1
  102. package/dist/constants/l10n/langs/ru.js +1 -1
  103. package/dist/constants/l10n/langs/uk.js +1 -1
  104. package/dist/constants/l10n/langs/zh.js +1 -1
  105. package/dist/markdoc/tags/index.d.ts +48 -2
  106. package/dist/server/api-routes/helpers/enhance-context.js +1 -1
  107. package/dist/server/api-routes/helpers/read-stream-with-size-limit.d.ts +1 -1
  108. package/dist/server/api-routes/run-api-routes-worker.d.ts +1 -1
  109. package/dist/server/api-routes/run-api-routes-worker.js +1 -1
  110. package/dist/server/config/env-config.d.ts +2 -4
  111. package/dist/server/config/env-schema.d.ts +5 -10
  112. package/dist/server/config/env-schemas/feature-flags.d.ts +4 -8
  113. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  114. package/dist/server/constants/common.d.ts +2 -0
  115. package/dist/server/constants/common.js +1 -1
  116. package/dist/server/constants/entitlements.js +1 -1
  117. package/dist/server/constants/plugins/api-docs.d.ts +3 -0
  118. package/dist/server/constants/plugins/api-docs.js +1 -0
  119. package/dist/server/esbuild/esbuild-logger.js +3 -3
  120. package/dist/server/esbuild/esbuild.js +3 -3
  121. package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-check.d.ts +9 -0
  122. package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-check.js +1 -0
  123. package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-overlay.d.ts +2 -0
  124. package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-overlay.js +1 -0
  125. package/dist/server/esbuild/plugins/api-docs-module-replacer/index.d.ts +6 -0
  126. package/dist/server/esbuild/plugins/api-docs-module-replacer/index.js +1 -0
  127. package/dist/server/persistence/cache/mappers/create-cache-db-record.d.ts +1 -1
  128. package/dist/server/persistence/file-hashes/mappers/create-file-hash-db-record.d.ts +1 -1
  129. package/dist/server/persistence/kv/mappers/create-kv-db-record.d.ts +1 -1
  130. package/dist/server/plugins/api-docs/get-server-props.d.ts +4 -0
  131. package/dist/server/plugins/api-docs/get-server-props.js +1 -0
  132. package/dist/server/plugins/api-docs/get-template-path.d.ts +2 -0
  133. package/dist/server/plugins/api-docs/get-template-path.js +1 -0
  134. package/dist/server/plugins/api-docs/import-api-docs-builder.d.ts +8 -0
  135. package/dist/server/plugins/api-docs/import-api-docs-builder.js +1 -0
  136. package/dist/server/plugins/api-docs/index.d.ts +19 -0
  137. package/dist/server/plugins/api-docs/index.js +1 -0
  138. package/dist/server/plugins/api-docs/loader.d.ts +35 -0
  139. package/dist/server/plugins/api-docs/loader.js +3 -0
  140. package/dist/server/plugins/api-docs/options.d.ts +14 -0
  141. package/dist/server/plugins/api-docs/options.js +1 -0
  142. package/dist/server/plugins/api-docs/search/get-ai-search-documents.d.ts +20 -0
  143. package/dist/server/plugins/api-docs/search/get-ai-search-documents.js +105 -0
  144. package/dist/server/plugins/api-docs/search/search-facets.d.ts +10 -0
  145. package/dist/server/plugins/api-docs/search/search-facets.js +1 -0
  146. package/dist/server/plugins/api-docs/search/search-indexer.d.ts +9 -0
  147. package/dist/server/plugins/api-docs/search/search-indexer.js +1 -0
  148. package/dist/server/plugins/api-docs/search/search-resolver.d.ts +5 -0
  149. package/dist/server/plugins/api-docs/search/search-resolver.js +1 -0
  150. package/dist/server/plugins/api-docs/spec-download.api.d.ts +4 -0
  151. package/dist/server/plugins/api-docs/spec-download.api.js +1 -0
  152. package/dist/server/plugins/api-docs/store-definition-bundles.d.ts +3 -0
  153. package/dist/server/plugins/api-docs/store-definition-bundles.js +1 -0
  154. package/dist/server/plugins/api-docs/utils/build-item-positions.d.ts +17 -0
  155. package/dist/server/plugins/api-docs/utils/build-item-positions.js +1 -0
  156. package/dist/server/plugins/api-docs/utils/build-routes-mapping.d.ts +3 -0
  157. package/dist/server/plugins/api-docs/utils/build-routes-mapping.js +1 -0
  158. package/dist/server/plugins/api-docs/utils/collect-item-routes.d.ts +12 -0
  159. package/dist/server/plugins/api-docs/utils/collect-item-routes.js +1 -0
  160. package/dist/server/plugins/api-docs/utils/decorators.d.ts +26 -0
  161. package/dist/server/plugins/api-docs/utils/decorators.js +1 -0
  162. package/dist/server/plugins/api-docs/utils/format-bundle-error.d.ts +6 -0
  163. package/dist/server/plugins/api-docs/utils/format-bundle-error.js +5 -0
  164. package/dist/server/plugins/api-docs/utils/normalize-api-version.d.ts +2 -0
  165. package/dist/server/plugins/api-docs/utils/normalize-api-version.js +1 -0
  166. package/dist/server/plugins/api-docs/utils/normalize-feedback-options.d.ts +2 -0
  167. package/dist/server/plugins/api-docs/utils/normalize-feedback-options.js +1 -0
  168. package/dist/server/plugins/api-docs/utils/relative-path-to-base-slug.d.ts +20 -0
  169. package/dist/server/plugins/api-docs/utils/relative-path-to-base-slug.js +1 -0
  170. package/dist/server/plugins/api-docs/utils/replace-file-extension.d.ts +2 -0
  171. package/dist/server/plugins/api-docs/utils/replace-file-extension.js +1 -0
  172. package/dist/server/plugins/api-docs/utils/resolve-api-doc-title.d.ts +3 -0
  173. package/dist/server/plugins/api-docs/utils/resolve-api-doc-title.js +1 -0
  174. package/dist/server/plugins/api-docs/utils/resolve-config-rbac.d.ts +10 -0
  175. package/dist/server/plugins/api-docs/utils/resolve-config-rbac.js +1 -0
  176. package/dist/server/plugins/api-docs/utils/to-relative-slug.d.ts +2 -0
  177. package/dist/server/plugins/api-docs/utils/to-relative-slug.js +1 -0
  178. package/dist/server/plugins/api-functions/index.js +1 -1
  179. package/dist/server/plugins/arazzo-docs/index.js +1 -1
  180. package/dist/server/plugins/asyncapi-docs/index.js +1 -1
  181. package/dist/server/plugins/catalog-classic/index.js +1 -1
  182. package/dist/server/plugins/catalog-entities/database/catalog-entities-diff-publisher.d.ts +1 -1
  183. package/dist/server/plugins/catalog-entities/database/catalog-entities-revisions-pruner.d.ts +4 -2
  184. package/dist/server/plugins/catalog-entities/database/catalog-entities-revisions-pruner.js +23 -3
  185. package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +5 -5
  186. package/dist/server/plugins/catalog-entities/database/mappers/create-entity-attributes-db-record.d.ts +1 -1
  187. package/dist/server/plugins/catalog-entities/database/mappers/create-entity-db-record.d.ts +1 -1
  188. package/dist/server/plugins/catalog-entities/database/mappers/create-entity-relation-db-record-from-file-schema.d.ts +1 -1
  189. package/dist/server/plugins/catalog-entities/database/remote-publish-lock-service.d.ts +3 -3
  190. package/dist/server/plugins/catalog-entities/database/repositories/bffEntities/bff-entities-read-repository.d.ts +2 -2
  191. package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.js +1 -1
  192. package/dist/server/plugins/catalog-entities/database/repositories/common/filters-repository.d.ts +1 -1
  193. package/dist/server/plugins/catalog-entities/database/repositories/common/revision-repository.d.ts +1 -1
  194. package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-read-repository.d.ts +1 -1
  195. package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.d.ts +2 -2
  196. package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.js +1 -1
  197. package/dist/server/plugins/catalog-entities/database/repositories/entityAttributes/entity-attributes-write-repository.d.ts +1 -1
  198. package/dist/server/plugins/catalog-entities/database/repositories/relations/relations-read-repository.d.ts +1 -1
  199. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.js +1 -1
  200. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.d.ts +13 -5
  201. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js +1 -1
  202. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.d.ts +5 -2
  203. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js +1 -1
  204. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.d.ts +6 -5
  205. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.js +2 -2
  206. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.d.ts +12 -5
  207. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js +1 -1
  208. package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.d.ts +1 -1
  209. package/dist/server/plugins/catalog-entities/plugin.js +1 -1
  210. package/dist/server/plugins/catalog-entities/template/index.js +1 -1
  211. package/dist/server/plugins/catalog-entities/types/openapi.d.ts +1 -1
  212. package/dist/server/plugins/catalog-entities/utils/get-not-accessible-catalog-resources.d.ts +1 -1
  213. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.d.ts +4 -4
  214. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.js +1 -1
  215. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.d.ts +4 -3
  216. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.js +1 -1
  217. package/dist/server/plugins/config-parser/index.js +1 -1
  218. package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
  219. package/dist/server/plugins/create-slugify.d.ts +17 -0
  220. package/dist/server/plugins/create-slugify.js +1 -0
  221. package/dist/server/plugins/default-theme/index.js +1 -1
  222. package/dist/server/plugins/dev-onboarding/index.d.ts +1 -1
  223. package/dist/server/plugins/dev-onboarding/index.js +1 -1
  224. package/dist/server/plugins/dev-onboarding/template/components/RevokeAPIKey.d.ts +1 -1
  225. package/dist/server/plugins/dev-onboarding/template/components/RollAPIKey.d.ts +1 -1
  226. package/dist/server/plugins/entitlements/index.js +1 -1
  227. package/dist/server/plugins/graphql-docs/index.js +1 -1
  228. package/dist/server/plugins/graphql-docs/search/ai/utils.d.ts +1 -1
  229. package/dist/server/plugins/helpers/parse-partials.d.ts +3 -0
  230. package/dist/server/plugins/helpers/parse-partials.js +1 -0
  231. package/dist/server/plugins/l10n/index.js +1 -1
  232. package/dist/server/plugins/lifecycle.js +2 -2
  233. package/dist/server/plugins/markdown/attribute-resolvers/helpers/load-openapi-bundle.d.ts +5 -3
  234. package/dist/server/plugins/markdown/attribute-resolvers/helpers/load-openapi-bundle.js +1 -1
  235. package/dist/server/plugins/markdown/attribute-resolvers/resolve-json-example-ref.js +1 -1
  236. package/dist/server/plugins/markdown/attribute-resolvers/resolve-open-api-ref.js +1 -1
  237. package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-code-samples.js +1 -1
  238. package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-response-samples.js +1 -1
  239. package/dist/server/plugins/markdown/index.js +1 -1
  240. package/dist/server/plugins/markdown/markdoc/markdoc-options.d.ts +9 -9
  241. package/dist/server/plugins/markdown/markdoc/plugins/utils.d.ts +5 -0
  242. package/dist/server/plugins/markdown/markdoc/plugins/utils.js +1 -1
  243. package/dist/server/plugins/markdown/runtime-transform.js +1 -1
  244. package/dist/server/plugins/markdown/search/create-render-tag-fn.d.ts +2 -1
  245. package/dist/server/plugins/markdown/search/create-render-tag-fn.js +1 -1
  246. package/dist/server/plugins/markdown/search/get-ai-search-documents.js +9 -9
  247. package/dist/server/plugins/markdown/search/walk-sections.js +1 -1
  248. package/dist/server/plugins/markdown/utils/resolve-markdown-template.d.ts +1 -1
  249. package/dist/server/plugins/mcp/auth/auth-handlers.d.ts +3 -0
  250. package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
  251. package/dist/server/plugins/mcp/codemode/capabilities/types.d.ts +1 -1
  252. package/dist/server/plugins/mcp/codemode/capabilities/utils.d.ts +1 -1
  253. package/dist/server/plugins/mcp/codemode/code-audit.d.ts +12 -0
  254. package/dist/server/plugins/mcp/codemode/code-audit.js +1 -0
  255. package/dist/server/plugins/mcp/codemode/code-execution-telemetry.d.ts +11 -0
  256. package/dist/server/plugins/mcp/codemode/code-execution-telemetry.js +1 -0
  257. package/dist/server/plugins/mcp/codemode/constants.js +1 -1
  258. package/dist/server/plugins/mcp/codemode/prompts.js +1 -1
  259. package/dist/server/plugins/mcp/codemode/tools/describe-tools.d.ts +2 -3
  260. package/dist/server/plugins/mcp/codemode/tools/execute-schema.d.ts +1 -1
  261. package/dist/server/plugins/mcp/codemode/tools/execute-schema.js +1 -1
  262. package/dist/server/plugins/mcp/codemode/tools/execute.d.ts +1 -0
  263. package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
  264. package/dist/server/plugins/mcp/constants.d.ts +2 -1
  265. package/dist/server/plugins/mcp/constants.js +1 -1
  266. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.d.ts +1 -0
  267. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
  268. package/dist/server/plugins/mcp/docs-mcp/tools/core/create-anonymous-session.d.ts +11 -0
  269. package/dist/server/plugins/mcp/docs-mcp/tools/core/create-anonymous-session.js +1 -0
  270. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/constants.d.ts +4 -0
  271. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/constants.js +1 -0
  272. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type-list.js +1 -1
  273. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type.js +7 -4
  274. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/types.d.ts +7 -1
  275. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/types.js +0 -1
  276. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/utils.d.ts +5 -1
  277. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/utils.js +4 -2
  278. package/dist/server/plugins/mcp/docs-mcp/tools/index.d.ts +4 -0
  279. package/dist/server/plugins/mcp/docs-mcp/tools/index.js +1 -1
  280. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/constants.d.ts +2 -0
  281. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/constants.js +1 -0
  282. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoint-info.js +1 -1
  283. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoints.js +1 -1
  284. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-full-api-description.js +1 -1
  285. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-security-schemes.js +1 -1
  286. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -1
  287. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.d.ts +6 -2
  288. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.js +1 -1
  289. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/types.d.ts +2 -0
  290. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.d.ts +2 -2
  291. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.js +1 -1
  292. package/dist/server/plugins/mcp/docs-mcp/utils.d.ts +3 -3
  293. package/dist/server/plugins/mcp/docs-mcp/utils.js +1 -1
  294. package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +28 -0
  295. package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +2 -0
  296. package/dist/server/plugins/mcp/gateway-mcp/eligibility.d.ts +5 -17
  297. package/dist/server/plugins/mcp/gateway-mcp/eligibility.js +1 -1
  298. package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.d.ts +9 -9
  299. package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.js +1 -1
  300. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.d.ts +17 -1
  301. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
  302. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-errors.d.ts +11 -0
  303. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-errors.js +1 -0
  304. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-telemetry.d.ts +14 -0
  305. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-telemetry.js +1 -0
  306. package/dist/server/plugins/mcp/gateway-mcp/fetch/normalize-path.d.ts +6 -0
  307. package/dist/server/plugins/mcp/gateway-mcp/fetch/normalize-path.js +1 -0
  308. package/dist/server/plugins/mcp/gateway-mcp/fetch/redact.d.ts +4 -0
  309. package/dist/server/plugins/mcp/gateway-mcp/fetch/redact.js +1 -0
  310. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-blocklist.d.ts +22 -0
  311. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-blocklist.js +1 -0
  312. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.d.ts +1 -1
  313. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.js +1 -1
  314. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-safe-lookup.d.ts +13 -0
  315. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-safe-lookup.js +1 -0
  316. package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.d.ts +8 -1
  317. package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.js +1 -1
  318. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/apply-edge-rate-limit.d.ts +3 -0
  319. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/apply-edge-rate-limit.js +1 -0
  320. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/edge-limiter.d.ts +16 -0
  321. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/edge-limiter.js +1 -0
  322. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/ip-key.d.ts +2 -0
  323. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/ip-key.js +1 -0
  324. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/limits.d.ts +7 -0
  325. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/limits.js +1 -0
  326. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/rate-limit-telemetry.d.ts +8 -0
  327. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/rate-limit-telemetry.js +1 -0
  328. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/window-counter.d.ts +15 -0
  329. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/window-counter.js +1 -0
  330. package/dist/server/plugins/mcp/gateway-mcp/secret-store.d.ts +24 -0
  331. package/dist/server/plugins/mcp/gateway-mcp/secret-store.js +1 -0
  332. package/dist/server/plugins/mcp/gateway-mcp/subject.d.ts +20 -0
  333. package/dist/server/plugins/mcp/gateway-mcp/subject.js +1 -0
  334. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.d.ts +18 -0
  335. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.js +1 -0
  336. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.d.ts +10 -0
  337. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.js +1 -0
  338. package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
  339. package/dist/server/plugins/mcp/handlers/errors.d.ts +3 -3
  340. package/dist/server/plugins/mcp/handlers/errors.js +1 -1
  341. package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
  342. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.d.ts +5 -0
  343. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +101 -0
  344. package/dist/server/plugins/mcp/index.d.ts +1 -0
  345. package/dist/server/plugins/mcp/index.js +1 -1
  346. package/dist/server/plugins/mcp/servers/docs-server.d.ts +3 -1
  347. package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
  348. package/dist/server/plugins/mcp/servers/mcp-server.d.ts +15 -8
  349. package/dist/server/plugins/mcp/servers/mcp-server.js +1 -1
  350. package/dist/server/plugins/mcp/types.d.ts +16 -20
  351. package/dist/server/plugins/mcp/utils/json-schema-validator.d.ts +9 -0
  352. package/dist/server/plugins/mcp/utils/json-schema-validator.js +1 -0
  353. package/dist/server/plugins/mcp/utils/jwt.d.ts +0 -9
  354. package/dist/server/plugins/mcp/utils/jwt.js +1 -1
  355. package/dist/server/plugins/mcp/utils/mode.d.ts +12 -2
  356. package/dist/server/plugins/mcp/utils/mode.js +1 -1
  357. package/dist/server/plugins/mcp/utils/telemetry-attributes.d.ts +8 -0
  358. package/dist/server/plugins/mcp/utils/telemetry-attributes.js +1 -0
  359. package/dist/server/plugins/mcp/utils/xmcp-utils.d.ts +1 -1
  360. package/dist/server/plugins/mcp/utils.d.ts +17 -5
  361. package/dist/server/plugins/mcp/utils.js +1 -1
  362. package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
  363. package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.d.ts +10 -2
  364. package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.js +1 -1
  365. package/dist/server/plugins/openapi-docs/index.js +1 -1
  366. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +16 -16
  367. package/dist/server/plugins/openapi-docs/utils.js +1 -1
  368. package/dist/server/plugins/pages/index.js +1 -1
  369. package/dist/server/plugins/scorecard-classic/compute-scorecard.d.ts +1 -1
  370. package/dist/server/plugins/scorecard-classic/compute-scorecard.js +4 -4
  371. package/dist/server/plugins/scorecard-classic/index.d.ts +1 -1
  372. package/dist/server/plugins/scorecard-classic/index.js +1 -1
  373. package/dist/server/plugins/scorecard-classic/template/components.d.ts +1 -1
  374. package/dist/server/plugins/scorecard-classic/template/useData.d.ts +1 -1
  375. package/dist/server/plugins/scorecards/plugin.js +1 -1
  376. package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.d.ts +1 -1
  377. package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +2 -2
  378. package/dist/server/plugins/search/documents/search-documents.js +1 -1
  379. package/dist/server/plugins/search/engines/flexsearch/index.js +1 -1
  380. package/dist/server/plugins/search/engines/flexsearch/search-index.js +1 -1
  381. package/dist/server/plugins/search/engines/search-engine.d.ts +1 -1
  382. package/dist/server/plugins/search/engines/typesense/index.js +1 -1
  383. package/dist/server/plugins/search/index.js +1 -1
  384. package/dist/server/plugins/search/llmstxt/index.d.ts +1 -1
  385. package/dist/server/plugins/search/llmstxt/index.js +4 -4
  386. package/dist/server/plugins/sidebars/index.d.ts +1 -1
  387. package/dist/server/plugins/sidebars/index.js +1 -1
  388. package/dist/server/plugins/sitemap/index.js +1 -1
  389. package/dist/server/plugins/sso/index.js +1 -1
  390. package/dist/server/providers/database/database-path-generator.d.ts +2 -2
  391. package/dist/server/providers/database/utils/storage-limit-validator.d.ts +1 -1
  392. package/dist/server/sandbox/sandbox.js +2 -2
  393. package/dist/server/sandbox/types.d.ts +3 -2
  394. package/dist/server/sandbox/utils/execution-budget.d.ts +4 -3
  395. package/dist/server/sandbox/utils/execution-budget.js +1 -1
  396. package/dist/server/ssr/render.js +1 -1
  397. package/dist/server/ssr/server-side-props/get-default-static-props.d.ts +1 -1
  398. package/dist/server/ssr/server-side-props/get-server-props-from-user-handler.d.ts +1 -1
  399. package/dist/server/ssr/template.d.ts +1 -1
  400. package/dist/server/ssr/utils.d.ts +1 -0
  401. package/dist/server/ssr/utils.js +5 -5
  402. package/dist/server/store.d.ts +2 -6
  403. package/dist/server/store.js +1 -1
  404. package/dist/server/tools/notifiers/logger.js +1 -1
  405. package/dist/server/tools/notifiers/reporter.js +6 -6
  406. package/dist/server/types/plugins/common.d.ts +4 -6
  407. package/dist/server/types/plugins/markdown.d.ts +1 -3
  408. package/dist/server/types/plugins/search.d.ts +1 -0
  409. package/dist/server/utils/catalog-classic/get-route-slug-to-catalog-slug-map.test.js +1 -1
  410. package/dist/server/utils/crypto/constants.d.ts +5 -0
  411. package/dist/server/utils/crypto/constants.js +1 -0
  412. package/dist/server/utils/crypto/decrypt-aes-gcm.d.ts +6 -0
  413. package/dist/server/utils/crypto/decrypt-aes-gcm.js +1 -0
  414. package/dist/server/utils/crypto/decrypt-claim-value.d.ts +6 -0
  415. package/dist/server/utils/crypto/decrypt-claim-value.js +1 -0
  416. package/dist/server/utils/crypto/derive-key.d.ts +5 -0
  417. package/dist/server/utils/crypto/derive-key.js +1 -0
  418. package/dist/server/utils/crypto/encrypt-aes-gcm.d.ts +6 -0
  419. package/dist/server/utils/crypto/encrypt-aes-gcm.js +1 -0
  420. package/dist/server/utils/crypto/encrypt-claim-value.d.ts +6 -0
  421. package/dist/server/utils/crypto/encrypt-claim-value.js +1 -0
  422. package/dist/server/utils/l10n/get-build-translate-context.d.ts +7 -0
  423. package/dist/server/utils/l10n/get-build-translate-context.js +1 -0
  424. package/dist/server/utils/llmstxt/agent-feedback-llms-footer.js +1 -1
  425. package/dist/server/utils/rbac.d.ts +4 -0
  426. package/dist/server/utils/rbac.js +1 -1
  427. package/dist/server/utils/report-all-errors.js +1 -1
  428. package/dist/server/utils/sandbox-context.d.ts +18 -0
  429. package/dist/server/utils/sandbox-context.js +1 -0
  430. package/dist/server/utils/shared-data.js +1 -1
  431. package/dist/server/web-server/auth.d.ts +34 -4
  432. package/dist/server/web-server/auth.js +3 -3
  433. package/dist/server/web-server/handle-api-route-request.js +1 -1
  434. package/dist/server/web-server/middleware/catalogAuthMiddleware.d.ts +1 -1
  435. package/dist/server/web-server/middleware/telemetry-middleware.js +1 -1
  436. package/dist/server/web-server/routes/api-routes/api-routes.js +1 -1
  437. package/dist/server/web-server/routes/auth.js +1 -1
  438. package/dist/server/web-server/routes/catalog/bff-catalog-related-entities.js +1 -1
  439. package/dist/server/web-server/routes/catalog/bff-catalog-revisions.js +1 -1
  440. package/dist/server/web-server/routes/catalog/bff-catalog.js +1 -1
  441. package/dist/server/web-server/routes/catalog/catalog-relations.js +1 -1
  442. package/dist/server/web-server/routes/catalog/catalog.js +1 -1
  443. package/dist/server/web-server/routes/catalog/helpers/has-access-to-entity.d.ts +1 -1
  444. package/dist/server/web-server/routes/catalog/helpers/upsert-pages-stats.d.ts +1 -1
  445. package/dist/server/web-server/routes/dynamic-route.js +1 -1
  446. package/dist/server/web-server/routes/feedback.d.ts +1 -1
  447. package/dist/server/web-server/routes/helpers/process-redirects.d.ts +1 -1
  448. package/dist/server/web-server/routes/mcp-routes/a2a.js +1 -1
  449. package/dist/server/web-server/routes/mcp-routes/agent-card.js +1 -1
  450. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.d.ts +10 -6
  451. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
  452. package/dist/server/web-server/routes/mcp-routes/mcp-routes.js +1 -1
  453. package/dist/server/web-server/routes/mcp-routes/mcp-server-card.js +1 -1
  454. package/dist/server/web-server/routes/mcp-routes/utils/build-agent-card.d.ts +1 -1
  455. package/dist/server/web-server/routes/page-data.js +1 -1
  456. package/dist/server/web-server/routes/resolve-route.js +1 -1
  457. package/dist/server/web-server/routes/search.js +1 -1
  458. package/dist/server/web-server/routes/skills/skill-markdown.js +1 -1
  459. package/dist/server/web-server/routes/skills/skills-index.js +1 -1
  460. package/dist/server/web-server/utils/prepare-list-response.d.ts +1 -1
  461. package/dist/server/workers/api-routes-worker-pool.js +1 -1
  462. package/dist/server/workers/mcp-tool-worker-pool.js +1 -1
  463. package/dist/server/workers/worker-pool.d.ts +1 -0
  464. package/dist/server/workers/worker-pool.js +1 -1
  465. package/dist/types/entitlements.d.ts +6 -1
  466. package/dist/types/markdoc.d.ts +2 -1
  467. package/dist/utils/l10n/build-i18n-config.d.ts +24 -0
  468. package/dist/utils/l10n/build-i18n-config.js +1 -0
  469. package/dist/utils/l10n/create-translate.d.ts +19 -0
  470. package/dist/utils/l10n/create-translate.js +1 -0
  471. package/dist/utils/url/get-shared-data-fetch-url.d.ts +17 -0
  472. package/dist/utils/url/get-shared-data-fetch-url.js +1 -0
  473. package/dist/utils/url/parse-preview-url.d.ts +22 -0
  474. package/dist/utils/url/parse-preview-url.js +1 -0
  475. package/package.json +15 -14
  476. package/dist/markdoc/helpers/get-operation/get-operation-info-by-id.d.ts +0 -4
  477. package/dist/markdoc/helpers/get-operation/get-operation-info-by-id.js +0 -1
  478. package/dist/markdoc/helpers/get-operation/get-operation-info-by-pointer.d.ts +0 -4
  479. package/dist/markdoc/helpers/get-operation/get-operation-info-by-pointer.js +0 -1
  480. package/dist/markdoc/helpers/get-operation/get-operation.d.ts +0 -14
  481. package/dist/markdoc/helpers/get-operation/get-operation.js +0 -1
  482. package/dist/markdoc/helpers/get-operation/index.d.ts +0 -4
  483. package/dist/markdoc/helpers/get-operation/index.js +0 -1
  484. package/dist/markdoc/helpers/get-operation/types/index.d.ts +0 -4
  485. package/dist/markdoc/helpers/get-operation/types/index.js +0 -0
  486. package/dist/markdoc/helpers/get-operation/types/operation-identifier.d.ts +0 -5
  487. package/dist/markdoc/helpers/get-operation/types/operation-identifier.js +0 -0
  488. package/dist/markdoc/helpers/get-operation/types/operation-info.d.ts +0 -6
  489. package/dist/markdoc/helpers/get-operation/types/operation-info.js +0 -0
  490. package/dist/markdoc/helpers/get-operation/types/operation-parameters.d.ts +0 -3
  491. package/dist/markdoc/helpers/get-operation/types/operation-parameters.js +0 -0
  492. package/dist/server/plugins/markdown/attribute-resolvers/helpers/get-media-content-samples.d.ts +0 -4
  493. package/dist/server/plugins/markdown/attribute-resolvers/helpers/get-media-content-samples.js +0 -1
  494. package/dist/server/plugins/mcp/handlers/sse-keepalive.d.ts +0 -15
  495. package/dist/server/plugins/mcp/handlers/sse-keepalive.js +0 -3
@@ -1,4 +1,4 @@
1
- import type { ToolAnnotations } from '@redocly/mcp-typescript-sdk/types.js';
1
+ import type { ToolAnnotations } from '@modelcontextprotocol/server';
2
2
  import type { McpToolSchema } from '../../../../types';
3
3
  import type { McpToolContext } from '../../types.js';
4
4
  import type { SandboxCapability } from './types.js';
@@ -0,0 +1,12 @@
1
+ export type CodeAudit = {
2
+ sha256: string;
3
+ length: number;
4
+ flags: string;
5
+ };
6
+ /**
7
+ * Fingerprint model-supplied code for the audit trail. The body itself is never reported — it can
8
+ * contain data the model already pulled from a customer API — so callers get a hash plus flags for
9
+ * patterns worth reviewing. The sandbox blocks all of the flagged targets; a flag is an attempt.
10
+ */
11
+ export declare function auditCode(code: string): CodeAudit;
12
+ //# sourceMappingURL=code-audit.d.ts.map
@@ -0,0 +1 @@
1
+ import{createHash as e}from"node:crypto";const n=/(169\.254\.169\.254|metadata\.google\.internal|\.consul\b|\.internal\b|localhost|127\.0\.0\.1|\b10\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|\b192\.168\.\d{1,3}\.\d{1,3}\b|\b172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}\b)/i,a=/(process\s*(?:\.\s*env\b|\[)|globalThis|require\s*\(|__proto__)/;function r(t){const s=[];return a.test(t)&&s.push("env_probe"),n.test(t)&&s.push("internal_target"),{sha256:e("sha256").update(t,"utf8").digest("hex"),length:t.length,flags:s.sort().join(",")}}export{r as auditCode};
@@ -0,0 +1,11 @@
1
+ import type { CodeAudit } from './code-audit.js';
2
+ type CodeExecutedEvent = {
3
+ audit: CodeAudit;
4
+ fetchCount: number;
5
+ outcome: 'ok' | 'error';
6
+ durationMs: number;
7
+ };
8
+ /** Audit record for one sandbox run. Carries the code fingerprint, never the code. */
9
+ export declare function reportCodeExecuted({ audit, fetchCount, outcome, durationMs, }: CodeExecutedEvent): void;
10
+ export {};
11
+ //# sourceMappingURL=code-execution-telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ import{telemetry as c}from"../../../telemetry/index.js";import{logger as s}from"../../../tools/notifiers/logger.js";import{McpServerType as f}from"../constants.js";import{serverAttributes as g}from"../utils/telemetry-attributes.js";function p({audit:e,fetchCount:o,outcome:r,durationMs:t}){try{c.sendMcpCodeExecutedMessage([{...g(f.Docs),code_sha256:e.sha256,code_length:e.length,fetch_count:o,outcome:r,flags:e.flags,duration_ms:t}])}catch{}s.info(`Gateway MCP code executed [${e.sha256.slice(0,12)}] outcome=${r} codeLength=${e.length} fetchCount=${o}`+(e.flags?` flags=${e.flags}`:"")+` durationMs=${t}`)}export{p as reportCodeExecuted};
@@ -1 +1 @@
1
- const t="execute",_="describe-tools",E="fetch",e=new Set([t,_]),o="tools",O="__fetchBridge",c="fetch";export{e as CODE_MODE_TOOL_NAMES,_ as DESCRIBE_TOOLS_TOOL_NAME,t as EXECUTE_TOOL_NAME,c as FETCH_BRIDGE_FUNCTION_NAME,O as FETCH_BRIDGE_GLOBAL_NAME,E as FETCH_TOOL_NAME,o as TOOLS_BRIDGE_GLOBAL_NAME};
1
+ import{CREATE_ANONYMOUS_SESSION_TOOL_NAME as _}from"../constants.js";const E="execute",t="describe-tools",o="fetch",e=new Set([E,t,_]),N="tools",T="__fetchBridge",c="fetch";export{e as CODE_MODE_TOOL_NAMES,t as DESCRIBE_TOOLS_TOOL_NAME,E as EXECUTE_TOOL_NAME,c as FETCH_BRIDGE_FUNCTION_NAME,T as FETCH_BRIDGE_GLOBAL_NAME,o as FETCH_TOOL_NAME,N as TOOLS_BRIDGE_GLOBAL_NAME};
@@ -1,4 +1,4 @@
1
- const t="Both `execute` arguments are required: `code` (the JavaScript to run; return a value to receive it) and `description` (a short human-readable summary of what the code does).";function o(e){return["Run JavaScript in a sandbox against the documentation tools on the global `tools` object.",e?"The only extra globals are `tools` and `fetch` - there is no `console`, `setTimeout`, `require`, or Node.js API; all other I/O goes through `tools`.":"The only extra global is `tools` - there is no `fetch`, `console`, `setTimeout`, `require`, or Node.js API; all I/O goes through `tools`.","","Workflow - minimize round-trips; one `describe-tools` call plus one `execute` call covers most requests:","1. Analyze the request and decide which sandbox tools it needs (every tool name is listed in the `describe-tools` input schema / description).","2. Call `describe-tools` with those names to get their exact TypeScript signatures. NEVER call `execute` with guessed method names, parameter names, or enum values.","3. Batch everything into a SINGLE script: chain tool calls, pass one call's output into the next, process results in plain JavaScript, and `return` only what the request needs.","",...e?["Example - list the Billing API endpoints and call one of them:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const { endpoints } = await tools.getEndpoints({ name: items[0].name });","const ep = endpoints.find((e) => e.method === 'POST' && e.path.includes('invoices'));","const info = await tools.getEndpointInfo({ name: items[0].name, path: ep.path, method: ep.method });","const url = (info.servers?.[0]?.url ?? '') + ep.path;","try {"," const res = await fetch(url, { method: 'POST', body: JSON.stringify({ /* fields from info */ }) });"," return res.ok ? await res.json() : { status: res.status, error: await res.text() };","} catch (error) {"," return { error: error instanceof Error ? error.message : String(error), endpointId: info };","}","```"]:["Example - list the write endpoints of an API:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const { endpoints } = await tools.getEndpoints({ name: items[0].name });","const writes = endpoints.filter((e) => e.method !== 'GET');","return { api: items[0].name, writes: writes.map((e) => `${e.method} ${e.path}`) };","```"]].join(`
1
+ const t="Both `execute` arguments are required: `code` (the JavaScript to run; return a value to receive it) and `description` (a short human-readable summary of what the code does).";function o(e){return["Run JavaScript in a sandbox against the documentation tools on the global `tools` object.",e?"The only extra globals are `tools` and `fetch` - there is no `console`, `setTimeout`, `require`, or Node.js API; all other I/O goes through `tools`.":"The only extra global is `tools` - there is no `fetch`, `console`, `setTimeout`, `require`, or Node.js API; all I/O goes through `tools`.","","Workflow - minimize round-trips; one `describe-tools` call plus one `execute` call covers most requests:","1. Analyze the request and decide which sandbox tools it needs (every tool name is listed in the `describe-tools` input schema / description).","2. Call `describe-tools` with those names to get their exact TypeScript signatures - inputs AND result shapes. NEVER call `execute` with guessed method names, parameter names, enum values, or result field names: read fields off the declared return types, not from assumptions.","3. Batch everything into a SINGLE script: chain tool calls, pass one call's output into the next, process results in plain JavaScript, and `return` only what the request needs.","",...e?["Example - list the Billing API endpoints and call one of them:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const { endpoints } = await tools.getEndpoints({ name: items[0].name });","const ep = endpoints.find((e) => e.method === 'POST' && e.path.includes('invoices'));","const info = await tools.getEndpointInfo({ name: items[0].name, path: ep.path, method: ep.method });","const url = (info.servers?.[0]?.url ?? '') + ep.path;","try {"," const res = await fetch(url, { method: 'POST', body: JSON.stringify({ /* fields from info */ }) });"," return res.ok ? await res.json() : { status: res.status, error: await res.text() };","} catch (error) {"," return { error: error instanceof Error ? error.message : String(error), endpointId: info };","}","```"]:["Example - list the write endpoints of an API:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const { endpoints } = await tools.getEndpoints({ name: items[0].name });","const writes = endpoints.filter((e) => e.method !== 'GET');","return { api: items[0].name, writes: writes.map((e) => `${e.method} ${e.path}`) };","```"]].join(`
2
2
  `)}const s=["Get the exact TypeScript signatures of the sandbox tools available to `execute`.","Analyze the user request first, then pass `tools` with only the tool names the request needs (every name is listed in this input schema / description); omit `tools` only when you cannot tell which tools apply.","Always call this before your first `execute` and never guess signatures. Request every tool the task may need in ONE call instead of calling this repeatedly."].join(`
3
3
  `);function n(e){return["This server exposes documentation tools (API discovery, endpoint details, security schemes, full-text search) through two tools:","- `describe-tools` returns the exact TypeScript signatures of the sandbox tools.","- `execute` runs JavaScript that calls those tools on the global `tools` object.","Workflow: analyze the request, call `describe-tools` once with only the tool names it needs, then batch everything into a single `execute` script. Minimize round-trips and never guess tool signatures.",e?"The sandbox also has a global `fetch` that can call the documented APIs (allow-listed hosts only). Include `fetch` in your `describe-tools` call to get its contract and the list of callable APIs.":""].join(`
4
4
  `)}const i="Types named `OpenApi\u2026` are the standard OpenAPI Specification objects.";export{s as DESCRIBE_TOOLS_DESCRIPTION,t as EXECUTE_ARGS_NOTE,i as USAGE_NOTES,n as buildCodeModeInstructions,o as buildExecuteDescription};
@@ -1,7 +1,6 @@
1
- import type { ToolCallback } from '@redocly/mcp-typescript-sdk/server/mcp.js';
2
1
  import type { McpToolSchema } from '../../../../types';
3
- import type { McpToolContext } from '../../types.js';
2
+ import type { McpToolCallback, McpToolContext } from '../../types.js';
4
3
  import { type SandboxCapability } from '../capabilities/index.js';
5
4
  export declare function describeToolsSchema(tools: McpToolSchema[], capabilities: SandboxCapability[]): Record<string, unknown>;
6
- export declare function describeTools(tools: McpToolSchema[], isToolAvailable: (toolName: string) => Promise<boolean>, capabilities: SandboxCapability[], context: McpToolContext): ToolCallback<Record<string, unknown>>;
5
+ export declare function describeTools(tools: McpToolSchema[], isToolAvailable: (toolName: string) => Promise<boolean>, capabilities: SandboxCapability[], context: McpToolContext): McpToolCallback;
7
6
  //# sourceMappingURL=describe-tools.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ToolAnnotations } from '@redocly/mcp-typescript-sdk/types.js';
1
+ import type { ToolAnnotations } from '@modelcontextprotocol/server';
2
2
  import type { McpToolSchema } from '../../../../types';
3
3
  export declare const EXECUTE_BASE_ANNOTATIONS: ToolAnnotations;
4
4
  export declare const EXECUTE_TOOL_SCHEMA: McpToolSchema;
@@ -1 +1 @@
1
- import{EXECUTE_TOOL_NAME as e}from"../constants.js";import{buildExecuteDescription as t}from"../prompts.js";const i={title:"Execute code",readOnlyHint:!0,openWorldHint:!1},n={name:e,description:t(!1),annotations:i,schema:{type:"object",required:["code","description"],additionalProperties:!1,properties:{code:{type:"string",description:"JavaScript to run in the sandbox. Return a value to receive it as the result.",minLength:1},description:{type:"string",description:"A short, human-readable summary of what this code does.",minLength:1}}}};export{i as EXECUTE_BASE_ANNOTATIONS,n as EXECUTE_TOOL_SCHEMA};
1
+ import{EXECUTE_TOOL_NAME as e}from"../constants.js";import{buildExecuteDescription as t}from"../prompts.js";const n={title:"Execute code",readOnlyHint:!0,openWorldHint:!1},r={name:e,description:t(!1),annotations:n,schema:{type:"object",required:["code","description"],additionalProperties:!1,properties:{code:{type:"string",description:"JavaScript to run in the sandbox. Return a value to receive it as the result.",minLength:1},description:{type:"string",description:"A short, human-readable summary of what this code does.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by createAnonymousSession. Required when an API needs credentials. This parameter is only offered when createAnonymousSession is available, so pass it whenever you have called that tool.",minLength:1}}}};export{n as EXECUTE_BASE_ANNOTATIONS,r as EXECUTE_TOOL_SCHEMA};
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  execute: McpToolHandler<{
4
4
  code: string;
5
5
  description: string;
6
+ sessionHandle?: string;
6
7
  }>;
7
8
  };
8
9
  export default _default;
@@ -1 +1 @@
1
- import{mcpToolHandlers as s}from"../../../../../client/mcp-tool-handlers-entry.js";import{runInSandbox as c}from"../../../../sandbox/sandbox.js";import{isMcpToolAvailable as l}from"../../workers/execute-mcp-tool.js";import{buildExecuteHostFetch as m,isFetchCapable as f}from"../../gateway-mcp/fetch-capability.js";import{CODE_MODE_TOOL_NAMES as u,EXECUTE_TOOL_NAME as p}from"../constants.js";import{sanitizeToolName as d}from"../build-tool-type-declarations.js";import{invokeTool as b}from"../invoke-tool.js";import{createSandboxSetup as T}from"../sandbox/create-sandbox-setup.js";const E=async(e,t,i)=>{const o=await O(t,i),n=f(t)?m(t):void 0,{result:r,error:a}=await c(e.code,{setupContext:T(o,n)});return{content:[{type:"text",text:JSON.stringify({result:r,error:a})}],isError:a!==void 0}};async function O(e,t){const i={};for(const o of Object.keys(s))u.has(o)||!await l({toolName:o,context:e}).catch(()=>!1)||(i[d(o)]=r=>b(o,r,e,t));return i}var C={[p]:E};export{C as default};
1
+ import{mcpToolHandlers as l}from"../../../../../client/mcp-tool-handlers-entry.js";import{runInSandbox as p}from"../../../../sandbox/sandbox.js";import{isMcpToolAvailable as h}from"../../workers/execute-mcp-tool.js";import{buildExecuteHostFetch as b,isFetchCapable as E}from"../../gateway-mcp/fetch-capability.js";import{withAuthRequiredMeta as T}from"../../gateway-mcp/upstream-auth.js";import{CODE_MODE_TOOL_NAMES as O,EXECUTE_TOOL_NAME as A}from"../constants.js";import{sanitizeToolName as C}from"../build-tool-type-declarations.js";import{invokeTool as w}from"../invoke-tool.js";import{createSandboxSetup as x}from"../sandbox/create-sandbox-setup.js";import{auditCode as M}from"../code-audit.js";import{reportCodeExecuted as v}from"../code-execution-telemetry.js";const y=async(t,e,r)=>{const o=await N(e,r),n=[],i=E(e)?b(e,s=>n.push(s)):void 0;let c=0;const u=i?s=>(c+=1,i(s)):void 0,d=M(t.code),m=Date.now(),{result:f,error:a}=await p(t.code,{setupContext:x(o,u)});return v({audit:d,fetchCount:c,outcome:a===void 0?"ok":"error",durationMs:Date.now()-m}),T({content:[{type:"text",text:JSON.stringify({result:f,error:a})}],isError:a!==void 0},n)};async function N(t,e){const r={};for(const o of Object.keys(l))O.has(o)||!await h({toolName:o,context:t}).catch(()=>!1)||(r[C(o)]=i=>w(o,i,t,e));return r}var B={[A]:y};export{B as default};
@@ -8,10 +8,11 @@ export declare const McpErrorCodes: {
8
8
  readonly MethodNotFound: -32601;
9
9
  readonly InvalidParams: -32602;
10
10
  };
11
- export declare const MCP_PROTOCOL_VERSION = "2025-06-18";
11
+ export declare const MCP_PROTOCOL_VERSION = "2025-11-25";
12
12
  export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 30000;
13
13
  export declare const SSE_KEEPALIVE_INTERVAL_MS = 15000;
14
14
  export declare const MAX_DOCUMENTS_PER_CATEGORY = 3;
15
15
  export declare const MCP_NOT_ALLOWED_TEMPLATE_ID = "mcp-not-allowed";
16
16
  export declare const DEFAULT_DOCS_MCP_SERVER_NAME = "Docs MCP server";
17
+ export declare const CREATE_ANONYMOUS_SESSION_TOOL_NAME = "createAnonymousSession";
17
18
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- const o={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},E="2025-06-18",e=3e4,t=15e3,_=3,s="mcp-not-allowed",c="Docs MCP server";export{e as DEFAULT_CONNECTION_TIMEOUT_MS,c as DEFAULT_DOCS_MCP_SERVER_NAME,_ as MAX_DOCUMENTS_PER_CATEGORY,s as MCP_NOT_ALLOWED_TEMPLATE_ID,E as MCP_PROTOCOL_VERSION,r as McpErrorCodes,o as McpServerType,t as SSE_KEEPALIVE_INTERVAL_MS};
1
+ import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const E={Docs:"docs"},e={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},t=o,_=3e4,O=15e3,s=3,n="mcp-not-allowed",T="Docs MCP server",S="createAnonymousSession";export{S as CREATE_ANONYMOUS_SESSION_TOOL_NAME,_ as DEFAULT_CONNECTION_TIMEOUT_MS,T as DEFAULT_DOCS_MCP_SERVER_NAME,s as MAX_DOCUMENTS_PER_CATEGORY,n as MCP_NOT_ALLOWED_TEMPLATE_ID,t as MCP_PROTOCOL_VERSION,e as McpErrorCodes,E as McpServerType,O as SSE_KEEPALIVE_INTERVAL_MS};
@@ -5,5 +5,6 @@ export declare function getDefaultToolSchemas(config: {
5
5
  requiresLogin: boolean;
6
6
  rbac?: Record<string, unknown>;
7
7
  hasGraphqlApis?: boolean;
8
+ elicitationEnabled?: boolean;
8
9
  }): McpToolSchema[];
9
10
  //# sourceMappingURL=tool-schemas.d.ts.map
@@ -1 +1 @@
1
- import{shouldHandleMcpAuth as m}from"../auth/auth-handlers.js";import{GRAPHQL_TYPE_KINDS as o}from"./tools/graphql/types.js";const p=["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE"],t={type:"string",nullable:!0},n={limit:{type:"number"},total:{type:"number"},page:{type:"number"},totalPages:{type:"number"}},r={codemodeType:"OpenApiServer[]"},s={codemodeType:"OpenApiSecurityRequirement[]"},l={codemodeType:"Record<string, OpenApiSecurityScheme>"},d={codemodeType:"OpenApiDocument"},h={codemodeType:"OpenApiOperation & { path: string; method: string }"},y={type:"object",additionalProperties:!1,required:[],properties:{filter:{type:"string",description:"API name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of APIs per page. Default is 300",minimum:1,default:300,nullable:!0}}},a={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}},g={type:"object",required:["name","path","method"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},path:{type:"string",description:"Endpoint path (e.g. /api/v1/users)",minLength:1},method:{type:"string",description:"HTTP method (GET, POST, PUT, DELETE, etc.)",enum:[...p,...p.map(e=>e.toLowerCase())],minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}},f={type:"object",required:[],additionalProperties:!1,properties:{}};function q(e){const i=[{name:"list-apis",description:"Lists available APIs with their context and purpose",schema:y,annotations:{title:"List APIs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{name:{type:"string"},description:t,version:t,servers:r}}},...n}}},{name:"get-endpoints",description:"Get all endpoints for a specific API",schema:a,annotations:{title:"Get Endpoints",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{api:{type:"string"},version:{type:"string"},servers:r,endpoints:{type:"array",items:{type:"object",properties:{path:{type:"string"},method:{type:"string"},summary:t,description:t,security:s}}}}}},{name:"get-endpoint-info",description:"Get comprehensive information about specific endpoint including parameters, security, and examples",schema:g,annotations:{title:"Get Endpoint Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{api:{type:"string"},version:{type:"string"},servers:r,endpoint:h,globalSecurity:s,securitySchemes:l}}},{name:"get-security-schemes",description:"Get the security schemes for a specific API",schema:a,annotations:{title:"Get Security Schemes",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{name:t,version:t,securitySchemes:l,security:s}}},{name:"get-full-api-description",description:"Get the complete OpenAPI description",schema:a,annotations:{title:"Get Full API Description",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{api:{type:"string"},version:{type:"string"},definition:d}}},P(e.products,e.locales)];return m(e.requiresLogin,e.rbac)&&i.push({name:"whoami",description:"Get information about the currently authenticated user",schema:f,annotations:{title:"Who Am I",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{email:{type:"string"},name:{type:"string"},subject:{type:"string"},clientId:{type:"string"},scope:{type:"string"},issuedAt:{type:"string"},expiresAt:{type:"string"}}}}),e.hasGraphqlApis&&i.push(...L()),i}const b={type:"object",required:[],additionalProperties:!1,properties:{filter:{type:"string",description:"GraphQL schema name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},S={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},kind:{type:"string",description:"Optional: return only a single category of schema members",enum:[...o],nullable:!0},filter:{type:"string",description:'Optional: only members whose name contains this substring (e.g. "book")',minLength:1,nullable:!0},referencesType:{type:"string",description:'Optional: only members that reference this type directly or transitively (via return, field, argument, union-member or input-field types). Finds cross-cutting members that never name it \u2014 e.g. referencesType "Book" surfaces a search query returning a union that includes Book.',minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},H={type:"object",required:["name","type"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},type:{type:"string",description:"Name of the type, operation, or directive",minLength:1},includeReferencedTypes:{type:"boolean",description:"Also include the SDL of every type referenced transitively. Gives the whole subgraph at once, but can be large for highly-connected types.",default:!1,nullable:!0}}},v={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1}}};function L(){return[{name:"list-graphql-apis",description:"Lists available GraphQL schemas with their context and purpose",schema:b,annotations:{title:"List GraphQL APIs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{name:{type:"string"},description:t}}},...n}}},{name:"get-graphql-type-list",description:'List all operations and types in a GraphQL schema as a flat, paginated list. Each item is tagged with its kind (query, object, enum, \u2026) and carries a one-line description; operations also include their return type and argument signature \u2014 use it to decide which members to fetch in detail. Narrow the result with `kind` (one category), `filter` (member-name substring, e.g. "book"), or `referencesType` (only members that use a given type, directly or transitively) to explore a domain cheaply instead of pulling the full schema.',schema:S,annotations:{title:"Get GraphQL Type List",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{name:{type:"string"},items:{type:"array",items:{type:"object",properties:{kind:{type:"string",enum:o},name:{type:"string"},description:t,type:{type:"string"},args:{type:"string"}}}},...n}}},{name:"get-graphql-type",description:"Get the SDL for a single GraphQL type, operation (query/mutation/subscription field), or directive. Set includeReferencedTypes to also pull in every type it references transitively \u2014 the full structural subgraph in one call, ideal for complete exploration of an entity (e.g. Book and all the types it touches). That traversal only follows what the target depends on; to go the other direction and find the members that use a type, call get-graphql-type-list with `referencesType`.",schema:H,annotations:{title:"Get GraphQL Type",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"string"}},{name:"get-graphql-schema",description:"Get the complete GraphQL schema as SDL \u2014 the whole type graph in one call. Returns everything, so it can be very large and token-expensive for big schemas; prefer get-graphql-type-list (filter/paginate) plus targeted get-graphql-type calls, and reach for this only for small schemas or when you truly need the full SDL.",schema:v,annotations:{title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"string"}}]}function P(e,i){const c=e&&e.length>0,u=i&&i.length>0;return{name:"search",description:"Search across the documentation to fetch relevant content for a given query",schema:{type:"object",required:["query"],additionalProperties:!1,properties:{query:{type:"string",description:"Search query. Should be a single word or that phrase that is presented in a documentation.",minLength:1},...c?{product:{type:"string",description:"Optional product name to filter search results by specific product.",enum:e,nullable:!0}}:{},...u?{locale:{type:"string",description:"Optional locale code to filter search results by documentation language (e.g. 'en', 'ja'). Use the locale matching the language of the user's request. Defaults to the project's default locale.",enum:i,nullable:!0}}:{}}},annotations:{title:"Search Documentation",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},outputSchema:{type:"string"}}}export{q as getDefaultToolSchemas};
1
+ import{shouldHandleMcpAuth as d}from"../auth/auth-handlers.js";import{CREATE_ANONYMOUS_SESSION_TOOL_NAME as m}from"../constants.js";import{GRAPHQL_TYPE_KINDS as o,GRAPHQL_LIST_SCOPES as h}from"./tools/graphql/constants.js";import{OPERATION_METHODS as p}from"./tools/openapi/constants.js";const i={type:"string",nullable:!0},n={limit:{type:"number"},total:{type:"number"},page:{type:"number"},totalPages:{type:"number"}},r={codemodeType:"OpenApiServer[]"},s={codemodeType:"OpenApiSecurityRequirement[]"},l={codemodeType:"Record<string, OpenApiSecurityScheme>"},y={codemodeType:"OpenApiDocument"},f={codemodeType:"OpenApiOperation & { path: string; method: string }"},g={type:"object",additionalProperties:!1,required:[],properties:{filter:{type:"string",description:"API name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of APIs per page. Default is 300",minimum:1,default:300,nullable:!0}}},a={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version",nullable:!0},filePath:{type:"string",description:"API definition file path",nullable:!0}}},b={type:"object",required:["name","path","method"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},path:{type:"string",description:"Endpoint path (e.g. /api/v1/users)",minLength:1},method:{type:"string",description:"HTTP method (GET, POST, PUT, DELETE, etc.)",enum:[...p.map(e=>e.toUpperCase()),...p],minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0},filePath:{type:"string",description:"API definition file path",nullable:!0}}},S={type:"object",required:[],additionalProperties:!1,properties:{}},v={type:"object",required:[],additionalProperties:!1,properties:{}};function I(e){const t=[{name:"list-apis",description:"Lists available APIs with their context and purpose",schema:g,annotations:{title:"List APIs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{name:{type:"string"},description:i,version:i,servers:r,filePath:{type:"string",description:"API definition file path"}}}},...n}}},{name:"get-endpoints",description:"Get all endpoints for a specific API",schema:a,annotations:{title:"Get Endpoints",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{api:{type:"string"},version:{type:"string"},servers:r,endpoints:{type:"array",items:{type:"object",properties:{path:{type:"string"},method:{type:"string"},summary:i,description:i,security:s}}}}}},{name:"get-endpoint-info",description:"Get comprehensive information about specific endpoint including parameters, security, and examples",schema:b,annotations:{title:"Get Endpoint Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{api:{type:"string"},version:{type:"string"},servers:r,endpoint:f,globalSecurity:s,securitySchemes:l}}},{name:"get-security-schemes",description:"Get the security schemes for a specific API",schema:a,annotations:{title:"Get Security Schemes",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{name:i,version:i,securitySchemes:l,security:s}}},{name:"get-full-api-description",description:"Get the complete OpenAPI description",schema:a,annotations:{title:"Get Full API Description",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{api:{type:"string"},version:{type:"string"},definition:y}}},G(e.products,e.locales)];return d(e.requiresLogin,e.rbac)&&t.push({name:"whoami",description:"Get information about the currently authenticated user",schema:S,annotations:{title:"Who Am I",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{email:{type:"string"},name:{type:"string"},subject:{type:"string"},clientId:{type:"string"},scope:{type:"string"},issuedAt:{type:"string"},expiresAt:{type:"string"}}}}),e.hasGraphqlApis&&t.push(...T()),e.elicitationEnabled&&t.push({name:m,description:"Create an anonymous session handle for storing upstream API credentials. Pass the returned sessionHandle to execute when an API needs credentials and the caller is not signed in. Treat it as a secret and reuse it across calls.",schema:v,annotations:{title:"Create anonymous session",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},outputSchema:{type:"object",required:["sessionHandle"],properties:{sessionHandle:{type:"string"}}}}),t}const H={type:"object",required:[],additionalProperties:!1,properties:{filter:{type:"string",description:"GraphQL schema name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},P={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},kind:{type:"string",description:'Optional: return only a single category of schema members. With scope "fields", restricts to the fields of that parent category ("objects", "interfaces", or "inputs" only).',enum:[...o],nullable:!0},scope:{type:"string",description:'Optional: what each list item is. "members" (default) lists top-level types and operations. "fields" flattens every field of every object/interface/input type into "ParentType.fieldName" entries with their descriptions \u2014 combine with `filter` to search nested fields anywhere in the schema.',enum:[...h],nullable:!0},filter:{type:"string",description:'Optional: only members whose name or description contains this substring, case-insensitive (e.g. "custom tags")',minLength:1,nullable:!0},referencesType:{type:"string",description:'Optional: only members that reference this type directly or transitively (via return, field, argument, union-member or input-field types). Finds cross-cutting members that never name it \u2014 e.g. referencesType "Book" surfaces a search query returning a union that includes Book.',minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},A={type:"object",required:["name","type"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},type:{type:"string",description:"Name of the type, operation, or directive",minLength:1},includeReferencedTypes:{type:"boolean",description:"Also include the SDL of every type referenced transitively. Gives the whole subgraph at once, but can be large for highly-connected types.",default:!1,nullable:!0}}},L={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1}}};function T(){return[{name:"list-graphql-apis",description:"Lists available GraphQL schemas with their context and purpose",schema:H,annotations:{title:"List GraphQL APIs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{name:{type:"string"},description:i}}},...n}}},{name:"get-graphql-type-list",description:'List all operations and types in a GraphQL schema as a flat, paginated list. Each item is tagged with its kind (query, object, enum, \u2026) and carries a one-line description; operations also include their return type and argument signature \u2014 use it to decide which members to fetch in detail. Narrow the result with `kind` (one category), `filter` (case-insensitive substring of the member name or description, e.g. "book"), or `referencesType` (only members that use a given type, directly or transitively) to explore a domain cheaply instead of pulling the full schema. To search nested fields \u2014 not just type names \u2014 set scope "fields": it flattens every field of every object/interface/input type into "ParentType.fieldName" entries with their descriptions, so `filter` finds things like an input field whose docstring mentions your keyword.',schema:P,annotations:{title:"Get GraphQL Type List",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"object",properties:{name:{type:"string"},items:{type:"array",items:{type:"object",properties:{kind:{type:"string",enum:o},name:{type:"string"},description:i,type:{type:"string"},args:{type:"string"},directives:{type:"string"}}}},...n}}},{name:"get-graphql-type",description:'Get the SDL for a single GraphQL type, operation (query/mutation/subscription field), or directive. Without includeReferencedTypes, the SDL is followed by a one-level manifest of every directly referenced type\'s field names (e.g. "input ActionOperationInput { addTags, removeTags }"), so you can see what nested types contain before fetching them. Set includeReferencedTypes to instead pull in the full SDL of every type it references transitively \u2014 the whole structural subgraph in one call, ideal for complete exploration of an entity (e.g. Book and all the types it touches). That traversal only follows what the target depends on; to go the other direction and find the members that use a type, call get-graphql-type-list with `referencesType`.',schema:A,annotations:{title:"Get GraphQL Type",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"string"}},{name:"get-graphql-schema",description:"Get the complete GraphQL schema as SDL \u2014 the whole type graph in one call. Returns everything, so it can be very large and token-expensive for big schemas; prefer get-graphql-type-list (filter/paginate) plus targeted get-graphql-type calls, and reach for this only for small schemas or when you truly need the full SDL.",schema:L,annotations:{title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},outputSchema:{type:"string"}}]}function G(e,t){const c=e&&e.length>0,u=t&&t.length>0;return{name:"search",description:"Search across the documentation to fetch relevant content for a given query",schema:{type:"object",required:["query"],additionalProperties:!1,properties:{query:{type:"string",description:"Search query. Should be a single word or that phrase that is presented in a documentation.",minLength:1},...c?{product:{type:"string",description:"Optional product name to filter search results by specific product.",enum:e,nullable:!0}}:{},...u?{locale:{type:"string",description:"Optional locale code to filter search results by documentation language (e.g. 'en', 'ja'). Use the locale matching the language of the user's request. Defaults to the project's default locale.",enum:t,nullable:!0}}:{}}},annotations:{title:"Search Documentation",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},outputSchema:{type:"string"}}}export{I as getDefaultToolSchemas};
@@ -0,0 +1,11 @@
1
+ import type { McpToolContext, McpToolHandler } from '../../../types.js';
2
+ export type CreateAnonymousSessionArgs = Record<string, never>;
3
+ export declare function isAnonymousSessionToolAvailable(context: McpToolContext): boolean;
4
+ declare const _default: {
5
+ createAnonymousSession: {
6
+ execute: McpToolHandler<CreateAnonymousSessionArgs>;
7
+ isAvailable: typeof isAnonymousSessionToolAvailable;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=create-anonymous-session.d.ts.map
@@ -0,0 +1 @@
1
+ import{CREATE_ANONYMOUS_SESSION_TOOL_NAME as t}from"../../../constants.js";import{createSessionHandle as n}from"../../../gateway-mcp/subject.js";const o=async()=>({content:[{type:"text",text:JSON.stringify({sessionHandle:n()})}],isError:!1});function i(e){return!!e.elicitationEnabled&&!e.user?.isAuthenticated}var a={[t]:{execute:o,isAvailable:i}};export{a as default,i as isAnonymousSessionToolAvailable};
@@ -0,0 +1,4 @@
1
+ export declare const GRAPHQL_TYPE_KINDS: readonly ['queries', 'mutations', 'subscriptions', 'objects', 'interfaces', 'unions', 'enums', 'inputs', 'scalars', 'directives'];
2
+ export declare const GRAPHQL_LIST_SCOPES: readonly ['members', 'fields'];
3
+ export declare const FIELD_SCOPE_KINDS: readonly ['objects', 'interfaces', 'inputs'];
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ const s=["queries","mutations","subscriptions","objects","interfaces","unions","enums","inputs","scalars","directives"],e=["members","fields"],t=["objects","interfaces","inputs"];export{t as FIELD_SCOPE_KINDS,e as GRAPHQL_LIST_SCOPES,s as GRAPHQL_TYPE_KINDS};
@@ -1 +1 @@
1
- import{GRAPHQL_TYPE_KINDS as g}from"./types.js";import{respondWithGraphqlSchema as d,paginate as u}from"./tool-helpers.js";import{groupSchemaTypes as y,filterMembersReferencingType as h}from"./utils.js";const T=(i,a)=>d(i.name,a,({name:f,schema:o})=>{const{kind:p,filter:n,referencesType:l,page:s=1,limit:m=300}=i,c=y(o);let e=(p?[p]:g).flatMap(t=>c[t].map(r=>({kind:t,...r})));if(l&&(e=h(o,e,l)),n){const t=n.toLowerCase();e=e.filter(r=>r.name.toLowerCase().includes(t))}return JSON.stringify({name:f,...u(e,s,m)},null,2)});var G={"get-graphql-type-list":T};export{G as default};
1
+ import{FIELD_SCOPE_KINDS as n,GRAPHQL_TYPE_KINDS as u}from"./constants.js";import{respondWithGraphqlSchema as g,paginate as d}from"./tool-helpers.js";import{groupSchemaTypes as h,fieldMembers as y,filterMembersReferencingType as S,matchesFilter as b}from"./utils.js";function T(r,p,t){if(p==="fields"){if(t&&!n.some(e=>e===t))throw new Error(`scope "fields" lists the fields of object, interface, and input types; kind must be ${n.map(e=>`"${e}"`).join(", ")}, or omitted.`);return y(r,t)}const o=h(r);return(t?[t]:u).flatMap(e=>o[e].map(s=>({kind:e,...s})))}const E=(r,p)=>g(r.name,p,({name:t,schema:o})=>{const{kind:e,scope:s="members",filter:f,referencesType:l,page:m=1,limit:a=300}=r;let i=T(o,s,e);return l&&(i=S(o,i,l)),f&&(i=i.filter(c=>b(c,f))),JSON.stringify({name:t,...d(i,m,a)},null,2)});var D={"get-graphql-type-list":E};export{D as default};
@@ -1,7 +1,10 @@
1
- import{respondWithGraphqlSchema as d}from"./tool-helpers.js";import{printTypeOrField as y,printTypeOrFieldWithReferences as f}from"./utils.js";const l=(n,p)=>d(n.name,p,({name:r,schema:t})=>{const{type:e,includeReferencedTypes:i}=n;if(i){const{sdl:o,referencedCount:c}=f(t,e);return`# Schema: ${r}
2
- # Type: ${e} (+ ${c} referenced types)
1
+ import{respondWithGraphqlSchema as d}from"./tool-helpers.js";import{printTypeOrField as y,printTypeOrFieldWithReferences as a,referencedTypeManifest as $}from"./utils.js";const m=(r,c)=>d(r.name,c,({name:p,schema:n})=>{const{type:e,includeReferencedTypes:l}=r;if(l){const{sdl:t,referencedCount:s}=a(n,e);return`# Schema: ${p}
2
+ # Type: ${e} (+ ${s} referenced types)
3
3
 
4
- ${o}`}return`# Schema: ${r}
4
+ ${t}`}const o=`# Schema: ${p}
5
5
  # Type: ${e}
6
6
 
7
- ${y(t,e)}`});var m={"get-graphql-type":l};export{m as default};
7
+ ${y(n,e)}`,f=$(n,e);if(f.length===0)return o;const i=["# Referenced types (one level, names only; fetch a type or set includeReferencedTypes for full SDL):",...f.map(t=>`# ${t}`)].join(`
8
+ `);return`${o}
9
+
10
+ ${i}`});var h={"get-graphql-type":m};export{h as default};
@@ -1,10 +1,15 @@
1
- export declare const GRAPHQL_TYPE_KINDS: readonly ['queries', 'mutations', 'subscriptions', 'objects', 'interfaces', 'unions', 'enums', 'inputs', 'scalars', 'directives'];
1
+ import type { GRAPHQL_LIST_SCOPES, GRAPHQL_TYPE_KINDS } from './constants.js';
2
2
  export type GraphqlTypeKind = (typeof GRAPHQL_TYPE_KINDS)[number];
3
+ export type GraphqlListScope = (typeof GRAPHQL_LIST_SCOPES)[number];
3
4
  export type SchemaMember = {
4
5
  name: string;
5
6
  description?: string;
6
7
  type?: string;
7
8
  args?: string;
9
+ directives?: string;
10
+ };
11
+ export type SchemaMemberWithKind = SchemaMember & {
12
+ kind: GraphqlTypeKind;
8
13
  };
9
14
  export type GroupedSchemaTypes = Record<GraphqlTypeKind, SchemaMember[]>;
10
15
  export type ListGraphqlApisArgs = {
@@ -15,6 +20,7 @@ export type ListGraphqlApisArgs = {
15
20
  export type GetGraphqlTypeListArgs = {
16
21
  name: string;
17
22
  kind?: GraphqlTypeKind;
23
+ scope?: GraphqlListScope;
18
24
  filter?: string;
19
25
  referencesType?: string;
20
26
  page?: number;
@@ -1 +0,0 @@
1
- const s=["queries","mutations","subscriptions","objects","interfaces","unions","enums","inputs","scalars","directives"];export{s as GRAPHQL_TYPE_KINDS};
@@ -1,14 +1,18 @@
1
1
  import type { GraphQLSchema } from 'graphql';
2
2
  import type { GraphqlDescriptionInfo } from '../../../types.js';
3
- import type { GraphqlTypeKind, GroupedSchemaTypes } from './types.js';
3
+ import type { GraphqlTypeKind, GroupedSchemaTypes, SchemaMember, SchemaMemberWithKind } from './types.js';
4
4
  export declare function findGraphqlSchemaByName(graphqlDescriptions: GraphqlDescriptionInfo[], name: string): GraphqlDescriptionInfo | undefined;
5
5
  export declare function groupSchemaTypes(schema: GraphQLSchema): GroupedSchemaTypes;
6
+ export declare function fieldMembers(schema: GraphQLSchema, kind?: GraphqlTypeKind): SchemaMemberWithKind[];
7
+ /** Case-insensitive substring match against the member's name or description. */
8
+ export declare function matchesFilter(member: SchemaMember, filter: string): boolean;
6
9
  export declare function filterMembersReferencingType<T extends {
7
10
  kind: GraphqlTypeKind;
8
11
  name: string;
9
12
  }>(schema: GraphQLSchema, members: T[], targetName: string): T[];
10
13
  export declare function referencedTypeClosure(schema: GraphQLSchema, name: string): string[];
11
14
  export declare function printTypeOrField(schema: GraphQLSchema, name: string): string;
15
+ export declare function referencedTypeManifest(schema: GraphQLSchema, name: string): string[];
12
16
  export declare function printTypeOrFieldWithReferences(schema: GraphQLSchema, name: string): {
13
17
  sdl: string;
14
18
  referencedCount: number;
@@ -1,3 +1,5 @@
1
- import{getNamedType as p,isEnumType as v,isInputObjectType as y,isInterfaceType as g,isIntrospectionType as u,isObjectType as T,isScalarType as m,isSpecifiedScalarType as S,isUnionType as b,print as c,printType as N,specifiedDirectives as O}from"graphql";const j=new Set(["queries","mutations","subscriptions"]);function C(e,r){const t=r.toLowerCase();return e.find(i=>i.name.toLowerCase().includes(t))}function a(e,r){return e.getQueryType()?.getFields()[r]??e.getMutationType()?.getFields()[r]??e.getSubscriptionType()?.getFields()[r]}function w(e){return[p(e.type).name,...e.args.map(r=>p(r.type).name)]}function d(e){const r=new Set;if(T(e)||g(e)){for(const t of Object.values(e.getFields())){r.add(p(t.type).name);for(const i of t.args)r.add(p(i.type).name)}for(const t of e.getInterfaces())r.add(t.name)}else if(b(e))for(const t of e.getTypes())r.add(t.name);else if(y(e))for(const t of Object.values(e.getFields()))r.add(p(t.type).name);return r}function $(e){const r=new Set([e.getQueryType(),e.getMutationType(),e.getSubscriptionType()].filter(n=>!!n).map(n=>n.name)),t={queries:l(e.getQueryType()),mutations:l(e.getMutationType()),subscriptions:l(e.getSubscriptionType()),objects:[],interfaces:[],unions:[],enums:[],inputs:[],scalars:[],directives:[]};for(const n of Object.values(e.getTypeMap())){if(u(n)||r.has(n.name))continue;const o={name:n.name,description:n.description??void 0};m(n)?S(n)||t.scalars.push(o):T(n)?t.objects.push(o):g(n)?t.interfaces.push(o):b(n)?t.unions.push(o):v(n)?t.enums.push(o):y(n)&&t.inputs.push(o)}const i=new Set(O.map(n=>n.name));return t.directives=e.getDirectives().filter(n=>!i.has(n.name)).map(n=>({name:n.name,description:n.description??void 0})),t}function l(e){return e?Object.values(e.getFields()).map(r=>({name:r.name,description:r.description??void 0,type:r.type.toString(),args:r.args.length?`(${r.args.map(t=>{const i=t.astNode?.defaultValue?` = ${c(t.astNode.defaultValue)}`:"";return`${t.name}: ${t.type}${i}`}).join(", ")})`:void 0})):[]}function q(e,r,t){const i=h(e,t);if(!i)return[];const n=new Set([i,...x(e,i)]);return r.filter(o=>{if(!j.has(o.kind))return n.has(o.name);const s=a(e,o.name);return s?w(s).some(f=>n.has(f)):!1})}function F(e,r){const t=new Set,i=[...M(e,r)];for(let n=0;n<i.length;n+=1){const o=i[n];if(t.has(o))continue;t.add(o);const s=e.getType(o);if(s)for(const f of d(s))t.has(f)||i.push(f)}return[...t].filter(n=>n!==r&&D(e,n))}function M(e,r){const t=e.getType(r);if(t)return d(t);const i=a(e,r);if(i)return new Set(w(i));const n=e.getDirective(r);return n?new Set(n.args.map(o=>p(o.type).name)):new Set}function x(e,r){const t=new Map;for(const o of Object.values(e.getTypeMap()))if(!u(o))for(const s of d(o)){let f=t.get(s);f||(f=new Set,t.set(s,f)),f.add(o.name)}const i=new Set,n=[r];for(let o=0;o<n.length;o+=1)for(const s of t.get(n[o])??[])i.has(s)||(i.add(s),n.push(s));return i}function h(e,r){const t=r.toLowerCase();return Object.keys(e.getTypeMap()).find(i=>i.toLowerCase()===t)}function D(e,r){const t=e.getType(r);return!t||u(t)?!1:!(m(t)&&S(t))}function I(e,r){const t=e.getType(r);if(t)return N(t);const i=a(e,r);if(i?.astNode)return c(i.astNode);const n=e.getDirective(r);if(n?.astNode)return c(n.astNode);throw new Error(`No GraphQL type, operation, or directive named "${r}" found.`)}function L(e,r){const t=I(e,r),i=F(e,r).map(n=>e.getType(n)).filter(n=>!!n).map(n=>N(n));return{sdl:[t,...i].join(`
1
+ import{getNamedType as u,isEnumType as j,isInputObjectType as d,isInterfaceType as p,isIntrospectionType as l,isObjectType as g,isScalarType as y,isSpecifiedScalarType as v,isUnionType as T,print as a,printType as L,specifiedDirectives as I}from"graphql";const D=new Set(["queries","mutations","subscriptions"]);function w(e){return e.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean)}function V(e,n){const t=n.toLowerCase(),r=e.find(s=>s.name.toLowerCase().includes(t));if(r)return r;const i=new Set(w(t));let o,f=0;for(const s of e){const c=w(s.name);c.length>f&&c.every(k=>i.has(k))&&(o=s,f=c.length)}return o}function m(e,n){return e.getQueryType()?.getFields()[n]??e.getMutationType()?.getFields()[n]??e.getSubscriptionType()?.getFields()[n]}function N(e){return[u(e.type).name,...(e.args??[]).map(n=>u(n.type).name)]}function S(e){const n=new Set;if(g(e)||p(e)){for(const t of Object.values(e.getFields())){n.add(u(t.type).name);for(const r of t.args)n.add(u(r.type).name)}for(const t of e.getInterfaces())n.add(t.name)}else if(T(e))for(const t of e.getTypes())n.add(t.name);else if(d(e))for(const t of Object.values(e.getFields()))n.add(u(t.type).name);return n}function O(e){return new Set([e.getQueryType(),e.getMutationType(),e.getSubscriptionType()].filter(n=>!!n).map(n=>n.name))}function A(e){const n=O(e),t={queries:b(e.getQueryType()),mutations:b(e.getMutationType()),subscriptions:b(e.getSubscriptionType()),objects:[],interfaces:[],unions:[],enums:[],inputs:[],scalars:[],directives:[]};for(const i of Object.values(e.getTypeMap())){if(l(i)||n.has(i.name))continue;const o=$(i);o&&t[o].push({name:i.name,description:i.description??void 0})}const r=new Set(I.map(i=>i.name));return t.directives=e.getDirectives().filter(i=>!r.has(i.name)).map(i=>({name:i.name,description:i.description??void 0})),t}function $(e){if(y(e))return v(e)?void 0:"scalars";if(g(e))return"objects";if(p(e))return"interfaces";if(T(e))return"unions";if(j(e))return"enums";if(d(e))return"inputs"}function F(e){return g(e)||p(e)||d(e)?e:void 0}function x(e){const n=e.astNode?.directives;return n?.length?n.map(t=>a(t)).join(" "):void 0}function b(e){return e?Object.values(e.getFields()).map(n=>({name:n.name,description:n.description??void 0,type:n.type.toString(),args:n.args.length?`(${n.args.map(t=>{const r=t.astNode?.defaultValue?` = ${a(t.astNode.defaultValue)}`:"";return`${t.name}: ${t.type}${r}`}).join(", ")})`:void 0,directives:x(n)})):[]}function G(e,n){const t=O(e),r=[];for(const i of Object.values(e.getTypeMap())){if(l(i)||t.has(i.name))continue;const o=F(i);if(!o)continue;const f=$(o);if(!(!f||n&&n!==f))for(const s of Object.values(o.getFields()))r.push({kind:f,name:`${o.name}.${s.name}`,description:s.description??void 0,type:s.type.toString(),directives:x(s)})}return r}function K(e,n){const t=n.toLowerCase();return e.name.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}function R(e,n){const t=n.indexOf(".");return t===-1?void 0:F(e.getType(n.slice(0,t)))?.getFields()[n.slice(t+1)]}function _(e,n,t){const r=B(e,t);if(!r)return[];const i=new Set([r,...q(e,r)]);return n.filter(o=>{if(o.name.includes(".")){const s=R(e,o.name);return s?N(s).some(c=>i.has(c)):!1}if(!D.has(o.kind))return i.has(o.name);const f=m(e,o.name);return f?N(f).some(s=>i.has(s)):!1})}function z(e,n){const t=new Set,r=[...M(e,n)];for(let i=0;i<r.length;i+=1){const o=r[i];if(t.has(o))continue;t.add(o);const f=e.getType(o);if(f)for(const s of S(f))t.has(s)||r.push(s)}return[...t].filter(i=>i!==n&&h(e,i))}function M(e,n){const t=e.getType(n);if(t)return S(t);const r=m(e,n);if(r)return new Set(N(r));const i=e.getDirective(n);return i?new Set(i.args.map(o=>u(o.type).name)):new Set}function q(e,n){const t=new Map;for(const o of Object.values(e.getTypeMap()))if(!l(o))for(const f of S(o)){let s=t.get(f);s||(s=new Set,t.set(f,s)),s.add(o.name)}const r=new Set,i=[n];for(let o=0;o<i.length;o+=1)for(const f of t.get(i[o])??[])r.has(f)||(r.add(f),i.push(f));return r}function B(e,n){const t=n.toLowerCase();return Object.keys(e.getTypeMap()).find(r=>r.toLowerCase()===t)}function h(e,n){const t=e.getType(n);return!t||l(t)?!1:!(y(t)&&v(t))}function C(e){return e.astNode?[e.astNode,...e.extensionASTNodes??[]].map(n=>a(n)).join(`
2
2
 
3
- `),referencedCount:i.length}}export{q as filterMembersReferencingType,C as findGraphqlSchemaByName,$ as groupSchemaTypes,I as printTypeOrField,L as printTypeOrFieldWithReferences,F as referencedTypeClosure};
3
+ `):L(e)}function Q(e,n){const t=e.getType(n);if(t)return C(t);const r=m(e,n);if(r?.astNode)return a(r.astNode);const i=e.getDirective(n);if(i?.astNode)return a(i.astNode);throw new Error(`No GraphQL type, operation, or directive named "${n}" found.`)}function P(e,n){const t=[];for(const r of M(e,n)){if(r===n||!h(e,r))continue;const i=e.getType(r);g(i)?t.push(`type ${r} { ${Object.keys(i.getFields()).join(", ")} }`):p(i)?t.push(`interface ${r} { ${Object.keys(i.getFields()).join(", ")} }`):d(i)?t.push(`input ${r} { ${Object.keys(i.getFields()).join(", ")} }`):j(i)?t.push(`enum ${r} { ${i.getValues().map(o=>o.name).join(", ")} }`):T(i)?t.push(`union ${r} = ${i.getTypes().map(o=>o.name).join(" | ")}`):y(i)&&t.push(`scalar ${r}`)}return t}function U(e,n){const t=Q(e,n),r=z(e,n).map(i=>e.getType(i)).filter(i=>!!i).map(i=>C(i));return{sdl:[t,...r].join(`
4
+
5
+ `),referencedCount:r.length}}export{G as fieldMembers,_ as filterMembersReferencingType,V as findGraphqlSchemaByName,A as groupSchemaTypes,K as matchesFilter,Q as printTypeOrField,U as printTypeOrFieldWithReferences,z as referencedTypeClosure,P as referencedTypeManifest};
@@ -1,4 +1,8 @@
1
1
  declare const _default: {
2
+ createAnonymousSession: {
3
+ execute: import("../../types.js").McpToolHandler<import("./core/create-anonymous-session.js").CreateAnonymousSessionArgs>;
4
+ isAvailable: typeof import("./core/create-anonymous-session.js").isAnonymousSessionToolAvailable;
5
+ };
2
6
  'list-apis': import("../../types.js").McpToolHandler<import("./openapi/types.js").ListApisArgs>;
3
7
  'get-endpoints': import("../../types.js").McpToolHandler<import("./openapi/types.js").ApiNameVersionArgs>;
4
8
  'get-endpoint-info': import("../../types.js").McpToolHandler<import("./openapi/types.js").GetEndpointInfoArgs>;
@@ -1 +1 @@
1
- import r from"./openapi/list-apis.js";import o from"./openapi/get-endpoints.js";import t from"./openapi/get-endpoint-info.js";import m from"./openapi/get-security-schemes.js";import p from"./openapi/get-full-api-description.js";import i from"./core/search.js";import e from"./core/whoami.js";import f from"./graphql/list-graphql-apis.js";import l from"./graphql/get-graphql-type-list.js";import s from"./graphql/get-graphql-type.js";import a from"./graphql/get-graphql-schema.js";var E={...r,...o,...t,...m,...p,...i,...e,...f,...l,...s,...a};export{E as default};
1
+ import o from"./openapi/list-apis.js";import r from"./openapi/get-endpoints.js";import t from"./openapi/get-endpoint-info.js";import m from"./openapi/get-security-schemes.js";import i from"./openapi/get-full-api-description.js";import p from"./core/search.js";import e from"./core/whoami.js";import f from"./core/create-anonymous-session.js";import s from"./graphql/list-graphql-apis.js";import a from"./graphql/get-graphql-type-list.js";import l from"./graphql/get-graphql-type.js";import n from"./graphql/get-graphql-schema.js";var w={...o,...r,...t,...m,...i,...p,...e,...f,...s,...a,...l,...n};export{w as default};
@@ -0,0 +1,2 @@
1
+ export declare const OPERATION_METHODS: readonly ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace', 'query', 'x-query'];
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ const e=["get","put","post","delete","options","head","patch","trace","query","x-query"];export{e as OPERATION_METHODS};
@@ -1 +1 @@
1
- import{resolveParameters as h,resolveRequestBody as v,resolveResponses as x}from"../../utils.js";import{isMcpEndpoint as E}from"./utils.js";import{loadApiDescription as g}from"./load-api-description.js";import{checkEndpointAndDeleteXMcp as P}from"../../../utils/xmcp-utils.js";const S=async(s,i)=>{const{name:p,path:o,method:n,version:a}=s;let t;try{t=await g(p,i,a)}catch(y){return{content:[{type:"text",text:y.message}],isError:!0}}const c=o.startsWith("/")?o:`/${o}`,{title:d=""}=t.info||{},r=t.paths?.[c],m=n.toLowerCase();if(!r)return{content:[{type:"text",text:"Endpoint not found"}],isError:!0};const e=r[m];if(!E(e)||!P(e,"docs"))return{content:[{type:"text",text:"Endpoint not found"}],isError:!0};const u=r?.parameters||[],l=e.parameters||[],f={...e,parameters:h({pathParams:u,opParams:l,definition:t}),requestBody:v(e.requestBody,t),responses:x(e.responses,t)};return{content:[{type:"text",text:JSON.stringify({api:d,version:t.info?.version||"",servers:t.servers||[],endpoint:{path:o,method:n.toUpperCase(),...f},globalSecurity:t.security||[],securitySchemes:t.components?.securitySchemes||[]},null,2)}]}};var M={"get-endpoint-info":S};export{M as default};
1
+ import{resolveParameters as f,resolveRequestBody as y,resolveResponses as h}from"../../utils.js";import{isMcpEndpoint as x}from"./utils.js";import{loadApiDescription as E}from"./load-api-description.js";import{checkEndpointAndDeleteXMcp as v}from"../../../utils/xmcp-utils.js";const g=async(n,i)=>{const{path:o,method:s}=n;let t;try{t=await E(n,i)}catch(l){return{content:[{type:"text",text:l.message}],isError:!0}}const p=o.startsWith("/")?o:`/${o}`,{title:a=""}=t.info||{},r=t.paths?.[p],c=s.toLowerCase();if(!r)return{content:[{type:"text",text:"Endpoint not found"}],isError:!0};const e=r[c];if(!x(e)||!v(e,"docs"))return{content:[{type:"text",text:"Endpoint not found"}],isError:!0};const d=r?.parameters||[],m=e.parameters||[],u={...e,parameters:f({pathParams:d,opParams:m,definition:t}),requestBody:y(e.requestBody,t),responses:h(e.responses,t)};return{content:[{type:"text",text:JSON.stringify({api:a,version:t.info?.version||"",servers:t.servers||[],endpoint:{path:o,method:s.toUpperCase(),...u},globalSecurity:t.security||[],securitySchemes:t.components?.securitySchemes||{}},null,2)}]}};var B={"get-endpoint-info":g};export{B as default};
@@ -1 +1 @@
1
- import{loadApiDescription as p}from"./load-api-description.js";import{getEndpointsFromPaths as c}from"./utils.js";const a=async(n,r)=>{const{name:o,version:i}=n;let t;try{t=await p(o,r,i)}catch(s){return{content:[{type:"text",text:s.message}],isError:!0}}const e=c(t);return e.length===0?{content:[{type:"text",text:"No endpoints found"}]}:{content:[{type:"text",text:JSON.stringify({api:t.info?.title||"",version:t.info?.version||"",servers:t.servers||[],endpoints:e},null,2)}]}};var l={"get-endpoints":a};export{l as default};
1
+ import{loadApiDescription as i}from"./load-api-description.js";import{getEndpointsFromPaths as s}from"./utils.js";const p=async(n,r)=>{let t;try{t=await i(n,r)}catch(o){return{content:[{type:"text",text:o.message}],isError:!0}}const e=s(t);return e.length===0?{content:[{type:"text",text:"No endpoints found"}]}:{content:[{type:"text",text:JSON.stringify({api:t.info?.title||"",version:t.info?.version||"",servers:t.servers||[],endpoints:e},null,2)}]}};var d={"get-endpoints":p};export{d as default};
@@ -1 +1 @@
1
- import{loadApiDescription as s}from"./load-api-description.js";const p=async(e,i)=>{const{name:n,version:r}=e;let t;try{t=await s(n,i,r)}catch(o){return{content:[{type:"text",text:o.message}],isError:!0}}return{content:[{type:"text",text:JSON.stringify({api:t.info?.title||"",version:t.info?.version||"",definition:t},null,2)}]}};var a={"get-full-api-description":p};export{a as default};
1
+ import{loadApiDescription as n}from"./load-api-description.js";const o=async(e,i)=>{let t;try{t=await n(e,i)}catch(r){return{content:[{type:"text",text:r.message}],isError:!0}}return{content:[{type:"text",text:JSON.stringify({api:t.info?.title||"",version:t.info?.version||"",definition:t},null,2)}]}};var s={"get-full-api-description":o};export{s as default};
@@ -1 +1 @@
1
- import{loadApiDescription as c}from"./load-api-description.js";const o=async(t,r)=>{const{name:s,version:i}=t;let e;try{e=await c(s,r,i)}catch(n){return{content:[{type:"text",text:n.message}],isError:!0}}return{content:[{type:"text",text:JSON.stringify({name:e.info?.title,version:e.info?.version,securitySchemes:e.components?.securitySchemes||[],security:e.security||[]},null,2)}]}};var y={"get-security-schemes":o};export{y as default};
1
+ import{loadApiDescription as s}from"./load-api-description.js";const c=async(t,r)=>{let e;try{e=await s(t,r)}catch(i){return{content:[{type:"text",text:i.message}],isError:!0}}return{content:[{type:"text",text:JSON.stringify({name:e.info?.title,version:e.info?.version,securitySchemes:e.components?.securitySchemes||{},security:e.security||[]},null,2)}]}};var o={"get-security-schemes":c};export{o as default};
@@ -1 +1 @@
1
- import{filterApiDescriptionsByName as f}from"../../utils.js";const g=async(l,a)=>{const{filter:i,page:n=1,limit:e=300}=l;let t=Object.values(a.apiDescriptionsMap);i&&(t=f(t,i));const s=(n-1)*e,o=s+e,c=Math.ceil(t.length/e),r=t.length;return t=t.slice(s,o),t.length===0?{content:[{type:"text",text:"No APIs available"}]}:{content:[{type:"text",text:JSON.stringify({items:t.map(({relativePath:h,fetchEligible:x,...p})=>p),limit:e,total:r,page:n,totalPages:c})}]}};var u={"list-apis":g};export{u as default};
1
+ import{filterApiDescriptionsByName as g}from"../../utils.js";const h=async(l,a)=>{const{filter:i,page:n=1,limit:e=300}=l;let t=Object.values(a.apiDescriptionsMap);i&&(t=g(t,i));const s=(n-1)*e,o=s+e,c=Math.ceil(t.length/e),p=t.length;return t=t.slice(s,o),t.length===0?{content:[{type:"text",text:"No APIs available"}]}:{content:[{type:"text",text:JSON.stringify({items:t.map(({relativePath:r,fetchEligible:x,...f})=>({filePath:r,...f})),limit:e,total:p,page:n,totalPages:c})}]}};var u={"list-apis":h};export{u as default};
@@ -1,4 +1,8 @@
1
- import type { OpenAPIDefinition } from '@redocly/openapi-docs';
1
+ import type { OpenAPIDefinition } from '@redocly/api-docs';
2
2
  import type { McpToolContext } from '../../../types.js';
3
- export declare function loadApiDescription(name: string, context: McpToolContext, version?: string): Promise<OpenAPIDefinition>;
3
+ export declare function loadApiDescription({ name, version, filePath }: {
4
+ name: string;
5
+ version?: string;
6
+ filePath?: string;
7
+ }, context: McpToolContext): Promise<OpenAPIDefinition>;
4
8
  //# sourceMappingURL=load-api-description.d.ts.map
@@ -1 +1 @@
1
- import{findApiDescriptionByNameAndVersion as t}from"../../utils.js";import{getApiDescriptionFromFs as a}from"./utils.js";async function u(r,i,s){const o=t(i.apiDescriptionsMap,r,s);if(!o)throw new Error(`No API found matching "${r}".`);const e=!!i?.config?.access?.requiresLogin,c=i?.config?.access?.rbac||{},n=await a({relativePath:o.relativePath||"",outdir:i.outdir||"",user:i.user,rbac:c,requiresLogin:e});if(!n)throw new Error(`No API found matching "${r}".`);return n}export{u as loadApiDescription};
1
+ import{findApiDescriptionByNameAndVersion as p}from"../../utils.js";import{getApiDescriptionFromFs as u}from"./utils.js";async function g({name:o,version:n,filePath:r},i){const s=r?Object.values(i.apiDescriptionsMap).find(c=>c.relativePath===r):p(i.apiDescriptionsMap,o,n);if(!s)throw new Error(r?`No API found with filePath "${r}". File paths are returned by the list-apis tool.`:`No API found matching "${o}".`);const t=!!i?.config?.access?.requiresLogin,a=i?.config?.access?.rbac||{},e=await u({relativePath:s.relativePath||"",outdir:i.outdir||"",user:i.user,rbac:a,requiresLogin:t});if(!e)throw new Error(`No API found matching "${r||o}".`);return e}export{g as loadApiDescription};
@@ -6,11 +6,13 @@ export type ListApisArgs = {
6
6
  export type ApiNameVersionArgs = {
7
7
  name: string;
8
8
  version?: string;
9
+ filePath?: string;
9
10
  };
10
11
  export type GetEndpointInfoArgs = {
11
12
  name: string;
12
13
  path: string;
13
14
  method: string;
14
15
  version?: string;
16
+ filePath?: string;
15
17
  };
16
18
  //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { OpenAPIDefinition, OpenAPIOperation } from '@redocly/openapi-docs';
1
+ import type { OpenAPIDefinition, OpenAPIOperation } from '@redocly/api-docs';
2
2
  import type { ApiFunctionsUser, RbacConfig } from '@redocly/config';
3
3
  import type { McpEndpoint } from '../../../types';
4
4
  export declare function isMcpEndpoint(value: unknown): value is McpEndpoint;
@@ -7,7 +7,7 @@ type EndpointInfo = Pick<OpenAPIOperation, 'summary' | 'description' | 'security
7
7
  path: string;
8
8
  };
9
9
  export declare function getEndpointsFromPaths(def: OpenAPIDefinition): EndpointInfo[];
10
- export declare function getApiDescriptionFromFs({ relativePath, outdir, user, rbac, requiresLogin }: {
10
+ export declare function getApiDescriptionFromFs({ relativePath, outdir, user, rbac, requiresLogin, }: {
11
11
  relativePath: string;
12
12
  outdir: string;
13
13
  user: ApiFunctionsUser;
@@ -1 +1 @@
1
- import a from"node:path";import{existsSync as f}from"node:fs";import{readFile as d}from"node:fs/promises";import{replaceFileExtension as h}from"../../../../../plugins/openapi-docs/store-definition-bundles";import{PUBLIC_API_DEFINITIONS_FOLDER as l}from"../../../../../constants/common";import{filterDataByAccessDeep as u}from"../../../../../utils/rbac";import{checkEndpointAndDeleteXMcp as c}from"../../../utils/xmcp-utils.js";function I(t){return typeof t=="object"&&t!==null&&"responses"in t&&typeof t.responses=="object"}function O(t){const{paths:n={}}=t,e=[];for(const[r,i]of Object.entries(n)){const s=!c(i,"docs");for(const[p,o]of Object.entries(i))s||!c(o,"docs")||e.push({path:r,method:p.toUpperCase(),summary:o.summary,description:o.description,security:o.security})}return e}async function P({relativePath:t,outdir:n,user:e,rbac:r={},requiresLogin:i=!1}){const s=a.join(n||"",l,h(t,".json"));if(!f(s))return;const o=await d(s,"utf-8"),m=JSON.parse(o);return u(m,{isAuthenticated:e?.isAuthenticated,email:e?.email,teams:e?.teams},r,i)}export{P as getApiDescriptionFromFs,O as getEndpointsFromPaths,I as isMcpEndpoint};
1
+ import a from"node:path";import{existsSync as f}from"node:fs";import{readFile as d}from"node:fs/promises";import{replaceFileExtension as h}from"../../../../../plugins/openapi-docs/store-definition-bundles";import{PUBLIC_API_DEFINITIONS_FOLDER as u}from"../../../../../constants/common";import{filterDataByAccessDeep as l}from"../../../../../utils/rbac";import{checkEndpointAndDeleteXMcp as c}from"../../../utils/xmcp-utils.js";import{OPERATION_METHODS as E}from"./constants.js";function T(t){return typeof t=="object"&&t!==null&&"responses"in t&&typeof t.responses=="object"}const D=new Set(E);function b(t){const{paths:n={}}=t,e=[];for(const[r,i]of Object.entries(n)){const s=!c(i,"docs");for(const[p,o]of Object.entries(i))D.has(p.toLowerCase())&&(s||!c(o,"docs")||e.push({path:r,method:p.toUpperCase(),summary:o.summary,description:o.description,security:o.security}))}return e}async function _({relativePath:t,outdir:n,user:e,rbac:r={},requiresLogin:i=!1}){const s=a.join(n||"",u,h(t,".json"));if(!f(s))return;const o=await d(s,"utf-8"),m=JSON.parse(o);return l(m,{isAuthenticated:e?.isAuthenticated,email:e?.email,teams:e?.teams},r,i)}export{_ as getApiDescriptionFromFs,b as getEndpointsFromPaths,T as isMcpEndpoint};
@@ -1,4 +1,4 @@
1
- import type { OpenAPISchema, OpenAPIParameter, OpenAPIResponse, OpenAPIRequestBody, Referenced, OpenAPIDefinition } from '@redocly/openapi-docs/lib/types/open-api.js';
1
+ import type { OpenAPISchema, OpenAPIParameter, OpenAPIResponse, OpenAPIRequestBody, Referenced, OpenAPIDefinition } from '@redocly/api-docs';
2
2
  import type { ApiDescriptionInfo } from '../types.js';
3
3
  export declare function findApiDescriptionByNameAndVersion(apiDescriptionsMap: Record<string, ApiDescriptionInfo>, name: string, version?: string): ApiDescriptionInfo | undefined;
4
4
  export declare function filterApiDescriptionsByName(apiDescriptionsMap: ApiDescriptionInfo[], filter: string): ApiDescriptionInfo[];
@@ -10,13 +10,13 @@ type ResolveSchemaRefsParams = {
10
10
  maxDepth?: number;
11
11
  currentDepth?: number;
12
12
  };
13
- export declare function resolveSchemaRefs({ schema, definition, visitedRefs, maxDepth, currentDepth }: ResolveSchemaRefsParams): OpenAPISchema | undefined;
13
+ export declare function resolveSchemaRefs({ schema, definition, visitedRefs, maxDepth, currentDepth, }: ResolveSchemaRefsParams): OpenAPISchema | undefined;
14
14
  type ResolveParametersParams = {
15
15
  pathParams: Referenced<OpenAPIParameter>[];
16
16
  opParams: Referenced<OpenAPIParameter>[];
17
17
  definition: OpenAPIDefinition;
18
18
  };
19
- export declare function resolveParameters({ pathParams, opParams, definition }: ResolveParametersParams): OpenAPIParameter[];
19
+ export declare function resolveParameters({ pathParams, opParams, definition, }: ResolveParametersParams): OpenAPIParameter[];
20
20
  export declare function resolveRequestBody(requestBody: Referenced<OpenAPIRequestBody> | undefined, definition: OpenAPIDefinition): OpenAPIRequestBody | undefined;
21
21
  export declare function resolveResponses(responses: Record<string, Referenced<OpenAPIResponse>>, definition: OpenAPIDefinition): Record<string, OpenAPIResponse>;
22
22
  export {};
@@ -1 +1 @@
1
- function v(t,o,n){if(!o)return;const s=o.toLowerCase(),r=Object.values(t).filter(({name:i})=>i.toLowerCase()===s);if(r.length===0)return;const e=n?r.filter(i=>i.version===n):r;if(e.length===0)return;if(e.length===1)return e[0];if(new Set(e.map(({version:i})=>i||"")).size>1){const i=e.map(({version:d})=>d||"(no version)").join(", ");throw new Error(`Multiple versions of "${o}" found: ${i}. Specify a version to disambiguate.`)}const c=e.map(({relativePath:i})=>i||"(unknown path)").join(", "),u=e[0].version?` at version "${e[0].version}"`:"";throw new Error(`Multiple APIs are titled "${o}"${u} (${c}). Give them a distinct info.title or info.version so they can be addressed individually.`)}function $(t,o){return Object.values(t).filter(({name:n})=>n.toLowerCase().includes(o.toLowerCase()))}function a(t,o){if(!o||!t?.startsWith("#/"))return;const n=t.slice(2).split("/");let s=o;for(const r of n)if(typeof s=="object"&&s!==null&&r in s)s=s[r];else return;return s}function l({schema:t,definition:o,visitedRefs:n=new Set,maxDepth:s=50,currentDepth:r=0}){if(!t)return;if(r>=s)return{type:"object",description:`Maximum resolution depth exceeded (${s})`};if("$ref"in t&&t.$ref){if(n.has(t.$ref))return{type:"object",description:`Circular reference detected: ${t.$ref}`,"x-circular-ref":t.$ref};const c=new Set(n);c.add(t.$ref);const u=a(t.$ref,o);return u?l({schema:u,definition:o,visitedRefs:c,maxDepth:s,currentDepth:r+1}):{type:"object",description:`Could not resolve reference: ${t.$ref}`,"x-unresolved-ref":t.$ref}}const e={...t};if(e.properties){const c={};for(const[u,i]of Object.entries(e.properties)){const d=l({schema:i,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1});c[u]=d||i}e.properties=c}if(e.items&&typeof e.items=="object")if(Array.isArray(e.items))e.items=e.items.map(c=>l({schema:c,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1})||c);else{const c=l({schema:e.items,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1});c&&(e.items=c)}return["allOf","anyOf","oneOf"].forEach(c=>{const u=e[c];Array.isArray(u)&&(e[c]=u.reduce((i,d)=>{const p=l({schema:d,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1});return p&&i.push(p),i},[]))}),e}function h({pathParams:t,opParams:o,definition:n}){return[...t,...o].reduce((s,r)=>{if(!r)return s;if("$ref"in r&&r.$ref){const e=a(r.$ref,n);return e&&s.push({...e,schema:"schema"in e&&e.schema?l({schema:e.schema,definition:n}):void 0}),s}return s.push({...r,schema:"schema"in r&&r.schema?l({schema:r.schema,definition:n}):void 0}),s},[])}function m(t,o){const n={...t};if(t.example!==void 0&&(n.example=t.example),!t.examples)return n;const s={};for(const[r,e]of Object.entries(t.examples))if("$ref"in e){const f=a(e.$ref,o);f&&(s[r]=f)}else s[r]=e;return n.examples=s,n}function w(t,o){if(!t)return;const n="$ref"in t&&t.$ref?a(t.$ref,o):t;if(!n)return;const s={...n};if("content"in n&&n.content){const r={};for(const[e,f]of Object.entries(n.content))r[e]={...m(f,o),schema:f.schema?l({schema:f.schema,definition:o}):void 0};s.content=r}return s}function b(t,o){return Object.entries(t).reduce((n,[s,r])=>{const e="$ref"in r&&r.$ref?a(r.$ref,o):r;if(!e)return n;const f={...e};if("content"in e&&e.content){const c={};for(const[u,i]of Object.entries(e.content))c[u]={...m(i,o),schema:i.schema?l({schema:i.schema,definition:o}):void 0};f.content=c}return n[s]=f,n},{})}export{$ as filterApiDescriptionsByName,v as findApiDescriptionByNameAndVersion,h as resolveParameters,a as resolveRef,w as resolveRequestBody,b as resolveResponses,l as resolveSchemaRefs};
1
+ function $(t,o,n){if(!o)return;const s=o.toLowerCase(),r=Object.values(t).filter(({name:i})=>i.toLowerCase()===s);if(r.length===0)return;const e=n?r.filter(i=>i.version===n):r;if(e.length===0)return;if(e.length===1)return e[0];if(new Set(e.map(({version:i})=>i||"")).size>1){const i=e.map(({version:a})=>a||"(no version)").join(", ");throw new Error(`Multiple versions of "${o}" found: ${i}. Specify a version to disambiguate.`)}const f=e.map(({relativePath:i})=>`"${i||"(unknown path)"}"`).join(", "),u=e[0].version?` at version "${e[0].version}"`:"";throw new Error(`Multiple APIs are titled "${o}"${u}. Pass the "filePath" parameter to select one of: ${f}.`)}function v(t,o){return Object.values(t).filter(({name:n})=>n.toLowerCase().includes(o.toLowerCase()))}function d(t,o){if(!o||!t?.startsWith("#/"))return;const n=t.slice(2).split("/");let s=o;for(const r of n)if(typeof s=="object"&&s!==null&&r in s)s=s[r];else return;return s}function l({schema:t,definition:o,visitedRefs:n=new Set,maxDepth:s=50,currentDepth:r=0}){if(!t)return;if(r>=s)return{type:"object",description:`Maximum resolution depth exceeded (${s})`};if("$ref"in t&&t.$ref){if(n.has(t.$ref))return{type:"object",description:`Circular reference detected: ${t.$ref}`,"x-circular-ref":t.$ref};const f=new Set(n);f.add(t.$ref);const u=d(t.$ref,o);return u?l({schema:u,definition:o,visitedRefs:f,maxDepth:s,currentDepth:r+1}):{type:"object",description:`Could not resolve reference: ${t.$ref}`,"x-unresolved-ref":t.$ref}}const e={...t};if(e.properties){const f={};for(const[u,i]of Object.entries(e.properties)){const a=l({schema:i,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1});f[u]=a||i}e.properties=f}if(e.items&&typeof e.items=="object")if(Array.isArray(e.items))e.items=e.items.map(f=>l({schema:f,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1})||f);else{const f=l({schema:e.items,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1});f&&(e.items=f)}return["allOf","anyOf","oneOf"].forEach(f=>{const u=e[f];Array.isArray(u)&&(e[f]=u.reduce((i,a)=>{const p=l({schema:a,definition:o,visitedRefs:new Set(n),maxDepth:s,currentDepth:r+1});return p&&i.push(p),i},[]))}),e}function h({pathParams:t,opParams:o,definition:n}){return[...t,...o].reduce((s,r)=>{if(!r)return s;if("$ref"in r&&r.$ref){const e=d(r.$ref,n);return e&&s.push({...e,schema:"schema"in e&&e.schema?l({schema:e.schema,definition:n}):void 0}),s}return s.push({...r,schema:"schema"in r&&r.schema?l({schema:r.schema,definition:n}):void 0}),s},[])}function m(t,o){const n={...t};if(t.example!==void 0&&(n.example=t.example),!t.examples)return n;const s={};for(const[r,e]of Object.entries(t.examples))if("$ref"in e){const c=d(e.$ref,o);c&&(s[r]=c)}else s[r]=e;return n.examples=s,n}function w(t,o){if(!t)return;const n="$ref"in t&&t.$ref?d(t.$ref,o):t;if(!n)return;const s={...n};if("content"in n&&n.content){const r={};for(const[e,c]of Object.entries(n.content))r[e]={...m(c,o),schema:c.schema?l({schema:c.schema,definition:o}):void 0};s.content=r}return s}function x(t,o){return Object.entries(t).reduce((n,[s,r])=>{const e="$ref"in r&&r.$ref?d(r.$ref,o):r;if(!e)return n;const c={...e};if("content"in e&&e.content){const f={};for(const[u,i]of Object.entries(e.content))f[u]={...m(i,o),schema:i.schema?l({schema:i.schema,definition:o}):void 0};c.content=f}return n[s]=c,n},{})}export{v as filterApiDescriptionsByName,$ as findApiDescriptionByNameAndVersion,h as resolveParameters,d as resolveRef,w as resolveRequestBody,x as resolveResponses,l as resolveSchemaRefs};
@@ -0,0 +1,28 @@
1
+ import type { InputRequiredResult } from '@modelcontextprotocol/server';
2
+ import type { UpstreamAuthRequiredEvent } from './upstream-auth.js';
3
+ import type { UpstreamAuthScheme } from './upstream-auth-scheme.js';
4
+ import type { KvService } from '@redocly/config';
5
+ export declare const CREDENTIALS_INPUT_REQUEST_KEY = "credentials";
6
+ export declare function isCredentialElicitationDeclined(inputResponses: Record<string, unknown> | undefined): boolean;
7
+ /**
8
+ * The 2026-07-28-era credentials prompt: the tool call returns an input-required result the
9
+ * client fulfils and retries, with no push `elicitation/create` and no session behind it.
10
+ * Nothing has to survive the round trip - the secrets are keyed by `subject`, which is
11
+ * recomputed from the caller's identity on every request.
12
+ */
13
+ export declare function buildUpstreamCredentialInputRequired({ subject, baseUrl, events, auth, kv, }: {
14
+ subject: string;
15
+ baseUrl: string;
16
+ events: UpstreamAuthRequiredEvent[];
17
+ auth: UpstreamAuthScheme;
18
+ kv: KvService;
19
+ }): Promise<InputRequiredResult>;
20
+ /** Fallback text for a 2026-07-28-era client without URL-elicitation support. */
21
+ export declare function buildUpstreamCredentialFallback({ subject, baseUrl, events, auth, kv, }: {
22
+ subject: string;
23
+ baseUrl: string;
24
+ events: UpstreamAuthRequiredEvent[];
25
+ auth: UpstreamAuthScheme;
26
+ kv: KvService;
27
+ }): Promise<string>;
28
+ //# sourceMappingURL=elicitation.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{inputRequired as s,inputResponse as p}from"@modelcontextprotocol/server";import{secretStore as h,ELICITATION_TTL_MS as m}from"./secret-store.js";import{ANONYMOUS_SUBJECT_PREFIX as c}from"./subject.js";const l="credentials";function k(e){const t=p(e,l);return t.kind==="elicit"&&(t.action==="decline"||t.action==="cancel")}async function v({subject:e,baseUrl:t,events:n,auth:a,kv:r}){const{url:i}=await u(r,e,t,n,a);return s({inputRequests:{[l]:s.elicitUrl({message:T(n[0].name),url:i})}})}async function A({subject:e,baseUrl:t,events:n,auth:a,kv:r}){const{url:i}=await u(r,e,t,n,a);return E(n,i,f(e))}async function u(e,t,n,a,r){const i=a[0],o=await h.createElicitation(e,{subject:t,api:i.api,name:i.name,auth:r});return{token:o,url:g(n,o)}}function f(e){return e.startsWith(c)?e.slice(c.length):void 0}function T(e){return`The "${e}" API requires credentials. Open the link to provide them securely; they never pass through the chat.`}function g(e,t){if(!e)return`/mcp/credentials?token=${t}`;try{const n=new URL("/mcp/credentials",e);return n.searchParams.set("token",t),n.toString()}catch{return`${e}/mcp/credentials?token=${t}`}}function E(e,t,n){const[a,...r]=e,i=[`The upstream API "${a.name}" returned 401 Unauthorized.`,"",`**Action required: show the user the link below and ask them to open it in a browser to provide the API credentials (valid ${Math.round(m/6e4)} minutes):**`,"",t,"",n?`Then call this tool again with sessionHandle: "${n}" - the credentials are stored against that handle, applied server-side, and never appear in the conversation.`:"Then call this tool again - the credentials are applied server-side and never appear in the conversation."];if(r.length>0){const o=r.map(d=>`"${d.name}"`).join(", ");i.push("",`The remaining APIs (${o}) will prompt for credentials on subsequent calls.`)}return i.join(`
2
+ `)}export{l as CREDENTIALS_INPUT_REQUEST_KEY,A as buildUpstreamCredentialFallback,v as buildUpstreamCredentialInputRequired,k as isCredentialElicitationDeclined};