@redocly/realm 0.136.0-next.3 → 0.136.0-next.5

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 (102) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/client/ErrorBoundary.js +1 -1
  3. package/dist/client/app/l10n/hooks/useTranslate.js +1 -1
  4. package/dist/client/app/l10n/initL10n.js +1 -1
  5. package/dist/client/app/usePreloadHistory.d.ts +2 -2
  6. package/dist/client/app/usePreloadHistory.js +1 -1
  7. package/dist/client/app/utils/loadAndNavigate.js +1 -1
  8. package/dist/client/browser-entry.js +2 -2
  9. package/dist/client/templates/openapi-docs/helpers.d.ts +1 -1
  10. package/dist/client/templates/openapi-docs/helpers.js +2 -2
  11. package/dist/constants/common.d.ts +3 -0
  12. package/dist/constants/common.js +1 -1
  13. package/dist/server/config/env-config.d.ts +2 -4
  14. package/dist/server/config/env-schema.d.ts +5 -10
  15. package/dist/server/config/env-schemas/feature-flags.d.ts +4 -8
  16. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  17. package/dist/server/constants/common.d.ts +2 -0
  18. package/dist/server/constants/common.js +1 -1
  19. package/dist/server/constants/entitlements.js +1 -1
  20. package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
  21. package/dist/server/plugins/markdown/search/create-render-tag-fn.d.ts +2 -1
  22. package/dist/server/plugins/markdown/search/create-render-tag-fn.js +1 -1
  23. package/dist/server/plugins/markdown/search/get-ai-search-documents.js +9 -9
  24. package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
  25. package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +25 -0
  26. package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +2 -0
  27. package/dist/server/plugins/mcp/gateway-mcp/eligibility.d.ts +4 -15
  28. package/dist/server/plugins/mcp/gateway-mcp/eligibility.js +1 -1
  29. package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.d.ts +8 -8
  30. package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.js +1 -1
  31. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.d.ts +15 -1
  32. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
  33. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-blocklist.d.ts +10 -0
  34. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-blocklist.js +1 -0
  35. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.d.ts +1 -1
  36. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.js +1 -1
  37. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-safe-lookup.d.ts +11 -0
  38. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-safe-lookup.js +1 -0
  39. package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.d.ts +8 -1
  40. package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.js +1 -1
  41. package/dist/server/plugins/mcp/gateway-mcp/secret-store.d.ts +24 -0
  42. package/dist/server/plugins/mcp/gateway-mcp/secret-store.js +1 -0
  43. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.d.ts +18 -0
  44. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.js +1 -0
  45. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.d.ts +10 -0
  46. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.js +1 -0
  47. package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
  48. package/dist/server/plugins/mcp/handlers/errors.d.ts +3 -3
  49. package/dist/server/plugins/mcp/handlers/errors.js +1 -1
  50. package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
  51. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.d.ts +5 -0
  52. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +101 -0
  53. package/dist/server/plugins/mcp/index.d.ts +1 -0
  54. package/dist/server/plugins/mcp/index.js +1 -1
  55. package/dist/server/plugins/mcp/servers/docs-server.d.ts +3 -2
  56. package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
  57. package/dist/server/plugins/mcp/servers/mcp-server.d.ts +11 -2
  58. package/dist/server/plugins/mcp/servers/mcp-server.js +1 -1
  59. package/dist/server/plugins/mcp/servers/session-manager.d.ts +15 -0
  60. package/dist/server/plugins/mcp/servers/session-manager.js +1 -0
  61. package/dist/server/plugins/mcp/types.d.ts +6 -12
  62. package/dist/server/plugins/mcp/utils/jwt.d.ts +0 -9
  63. package/dist/server/plugins/mcp/utils/jwt.js +1 -1
  64. package/dist/server/plugins/mcp/utils/mode.d.ts +12 -2
  65. package/dist/server/plugins/mcp/utils/mode.js +1 -1
  66. package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
  67. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +16 -16
  68. package/dist/server/plugins/sso/index.js +1 -1
  69. package/dist/server/sandbox/types.d.ts +3 -2
  70. package/dist/server/sandbox/utils/execution-budget.d.ts +4 -3
  71. package/dist/server/sandbox/utils/execution-budget.js +1 -1
  72. package/dist/server/ssr/render.js +1 -1
  73. package/dist/server/types/plugins/markdown.d.ts +2 -2
  74. package/dist/server/utils/crypto/constants.d.ts +5 -0
  75. package/dist/server/utils/crypto/constants.js +1 -0
  76. package/dist/server/utils/crypto/decrypt-aes-gcm.d.ts +6 -0
  77. package/dist/server/utils/crypto/decrypt-aes-gcm.js +1 -0
  78. package/dist/server/utils/crypto/decrypt-claim-value.d.ts +6 -0
  79. package/dist/server/utils/crypto/decrypt-claim-value.js +1 -0
  80. package/dist/server/utils/crypto/derive-key.d.ts +5 -0
  81. package/dist/server/utils/crypto/derive-key.js +1 -0
  82. package/dist/server/utils/crypto/encrypt-aes-gcm.d.ts +6 -0
  83. package/dist/server/utils/crypto/encrypt-aes-gcm.js +1 -0
  84. package/dist/server/utils/crypto/encrypt-claim-value.d.ts +6 -0
  85. package/dist/server/utils/crypto/encrypt-claim-value.js +1 -0
  86. package/dist/server/utils/l10n/get-build-translate-context.d.ts +7 -0
  87. package/dist/server/utils/l10n/get-build-translate-context.js +1 -0
  88. package/dist/server/utils/rbac.js +1 -1
  89. package/dist/server/web-server/auth.d.ts +33 -3
  90. package/dist/server/web-server/auth.js +3 -3
  91. package/dist/server/web-server/handle-api-route-request.js +1 -1
  92. package/dist/server/web-server/routes/api-routes/api-routes.js +1 -1
  93. package/dist/server/web-server/routes/auth.js +1 -1
  94. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.d.ts +5 -2
  95. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
  96. package/dist/server/web-server/routes/mcp-routes/mcp-routes.js +1 -1
  97. package/dist/types/entitlements.d.ts +3 -1
  98. package/dist/utils/l10n/build-i18n-config.d.ts +24 -0
  99. package/dist/utils/l10n/build-i18n-config.js +1 -0
  100. package/dist/utils/l10n/create-translate.d.ts +19 -0
  101. package/dist/utils/l10n/create-translate.js +1 -0
  102. package/package.json +11 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.136.0-next.5
4
+
5
+ ### Minor Changes
6
+
7
+ - f7bb0ce633c: Added support for automatic access token refresh for the MCP server.
8
+ MCP clients keep long-running sessions alive without repeated browser logins.
9
+ - 339a4748440: Added `locale` and `translate` options to the `renderForLlms` tag render context, allowing custom Markdoc tags to localize their content in `llms.txt` and AI search output at build time.
10
+
11
+ ### Patch Changes
12
+
13
+ - 12eed09e5b6: Fixed an issue in API docs where documented array items were not displayed in a nested indexed row.
14
+ - a8f19de21ab: Fixed security vulnerabilities `CVE-2026-59896`, `CVE-2026-59895`, and `CVE-2026-59897` by upgrading `hono` to version `4.12.27`.
15
+ - 50ec00284cd: Updated `@redocly/openapi-core` to version `2.40.0`.
16
+ - a8f19de21ab: Fixed security vulnerability `GHSA-c2j3-45gr-mqc4` by upgrading `dompurify` to version `3.4.12`.
17
+ - a8f19de21ab: Fixed security vulnerability `CVE-2026-59869` by upgrading `js-yaml` to version `4.3.0`.
18
+ - Updated dependencies [12eed09e5b6]
19
+ - Updated dependencies [50ec00284cd]
20
+ - Updated dependencies [a8f19de21ab]
21
+ - Updated dependencies [339a4748440]
22
+ - Updated dependencies [a8f19de21ab]
23
+ - @redocly/openapi-docs@3.24.0-next.5
24
+ - @redocly/theme@0.68.0-next.3
25
+ - @redocly/asyncapi-docs@1.13.0-next.5
26
+ - @redocly/graphql-docs@1.13.0-next.5
27
+ - @redocly/portal-plugin-mock-server@0.21.0-next.5
28
+
29
+ ## 0.136.0-next.4
30
+
31
+ ### Minor Changes
32
+
33
+ - d0133f4af19: Updated the `react-router-dom` peer dependency from `^6.30.3` to `^7.18.1`.
34
+ `@redocly/theme` v6 is no longer supported.
35
+ Consumers that render `@redocly/theme` components directly must provide a `react-router-dom` v7 instance.
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [d0133f4af19]
40
+ - @redocly/theme@0.68.0-next.2
41
+ - @redocly/asyncapi-docs@1.13.0-next.4
42
+ - @redocly/graphql-docs@1.13.0-next.4
43
+ - @redocly/openapi-docs@3.24.0-next.4
44
+ - @redocly/portal-plugin-mock-server@0.21.0-next.4
45
+
3
46
  ## 0.136.0-next.3
4
47
 
5
48
  ### Patch Changes
@@ -1 +1 @@
1
- import*as s from"react";import{ErrorDetails as a}from"./app/Error/ErrorDetails";import{telemetry as n}from"./app/telemetry/index.js";class p extends s.Component{constructor(r){super(r),this.state={error:void 0}}componentDidCatch(r,c){const{name:e,message:t}=r,o={name:e,message:t,stack:c.componentStack??void 0};this.setState({error:o}),n.sendClientErrorMessage([{object:"client",message:`${e}: ${t}`,url:location.href}]),n.sendError(o,"ReactErrorBoundary"),process.env.NODE_ENV!=="production"&&console.log(r)}render(){return this.state.error&&process.env.NODE_ENV!=="production"?s.createElement(a,{error:this.state.error}):this.props.children}}export{p as ErrorBoundary};
1
+ import*as s from"react";import{getBaseDataAttributes as c}from"@redocly/theme/core/utils";import{ErrorDetails as i}from"./app/Error/ErrorDetails";import{telemetry as n}from"./app/telemetry/index.js";class l extends s.Component{constructor(r){super(r),this.state={error:void 0}}componentDidCatch(r,a){const{name:e,message:t}=r,o={name:e,message:t,stack:a.componentStack??void 0};this.setState({error:o}),n.sendClientErrorMessage([{...c("reactErrorBoundary","client"),message:`${e}: ${t}`,url:location.href}]),n.sendError(o,"ReactErrorBoundary"),process.env.NODE_ENV!=="production"&&console.log(r)}render(){return this.state.error&&process.env.NODE_ENV!=="production"?s.createElement(i,{error:this.state.error}):this.props.children}}export{l as ErrorBoundary};
@@ -1 +1 @@
1
- import a from"i18next";import{useMemo as u}from"react";import{useL10n as o}from"./useL10n";const d=()=>{const{lang:r}=o();return{translate:u(()=>(n,t)=>{let e=t&&typeof t=="string"?t:void 0,s=e?void 0:t;return n?a.t(n,{defaultValue:e,...s})||e||n||"":e??""},[r])}};export{d as useTranslate};
1
+ import r from"i18next";import{useMemo as e}from"react";import{createTranslate as o}from"../../../../utils/l10n/create-translate.js";import{useL10n as n}from"./useL10n";const p=()=>{const{lang:t}=n();return{translate:e(()=>o(r.t),[t])}};export{p as useTranslate};
@@ -1 +1 @@
1
- import c from"i18next";import{DEFAULT_LOCALE_PLACEHOLDER as f}from"../../../constants/common.js";import{defaultTranslationImports as u}from"../../../constants/l10n/default-translations.js";async function p(a,s){const n=a?.defaultLocale||f,i=a?.translations??{},e=a?.locales?[...new Set(a.locales.flatMap(t=>[t.code,t.code.split("-")[0]]))]:[n],l={};for(const t of e){const o=await u[t]?.()||{};l[t]={translation:{...o,...i[t]?.translation}}}return{load:"currentOnly",lng:s,nonExplicitSupportedLngs:!0,fallbackLng:t=>{if(!t)return[n];const o=t.split("-")[0];if(t===n)return o!==t?[o,n]:[n];const r=[t];return o!==t&&r.push(o),r.push(n),r},interpolation:{escapeValue:!1},debug:!1,resources:{...l}}}async function d(a,s){const n=await p(a,s);await c.init(n)}export{d as initL10n};
1
+ import o from"i18next";import{buildI18nConfig as a}from"../../../utils/l10n/build-i18n-config.js";async function c(i,n){const t=await a(i,n);await o.init(t)}export{c as initL10n};
@@ -1,6 +1,6 @@
1
- import type { To, NavigateFunction, Location } from 'react-router-dom';
1
+ import type { To, Location } from 'react-router-dom';
2
2
  export declare function usePreloadHistory(): {
3
- push: (location: To) => Promise<ReturnType<NavigateFunction>>;
3
+ push: (location: To) => Promise<void>;
4
4
  location: Location;
5
5
  };
6
6
  //# sourceMappingURL=usePreloadHistory.d.ts.map
@@ -1 +1 @@
1
- import{useMemo as r,useCallback as n}from"react";import{useLocation as s,useNavigate as i}from"react-router-dom";function m(){const o=i(),t=n(async e=>(await window.__LOADER.load(e),o(e)),[o]),a=s();return r(()=>({push:t,location:a}),[a,t])}export{m as usePreloadHistory};
1
+ import{useMemo as s,useCallback as n}from"react";import{useLocation as r,useNavigate as i}from"react-router-dom";function m(){const o=i(),a=n(async e=>{await window.__LOADER.load(e),await o(e)},[o]),t=r();return s(()=>({push:a,location:t}),[t,a])}export{m as usePreloadHistory};
@@ -1 +1 @@
1
- import{isLocalLink as f}from"../../../utils/path/is-local-link.js";import{isAuthRoutePath as m}from"../../../utils/auth/is-auth-route-path.js";import{withLoadProgress as u}from"./withLoadProgress";import{scrollToAnchor as p}from"./scroll-to-anchor";let s;async function A({navigate:i,to:o,origin:a="browser",options:c}){o===""&&(o="/"),s=o;const{pathname:n,hash:d,search:t}=new URL(o,window.location.origin+window.location.pathname),r=decodeURIComponent(d),l=decodeURIComponent(window.location.hash);if(m(n)){window.location.href=o;return}const w=window.__LOADER,e=await u(w.tryLoad(n,void 0,t));if(e?.redirectTo){if(!f(e.redirectTo)){window.location.href=e.redirectTo;return}return A({navigate:i,to:e.redirectTo,origin:a,options:c})}if(e&&s===o){if((n!==window.location.pathname||t!==window.location.search||r!==l)&&i({pathname:n,search:t,hash:r},{...c,state:{origin:a},unstable_flushSync:!0}),e.props?.disableAutoScroll)return;requestAnimationFrame(()=>{if(r){const h=r.slice(1);p(h)}else window.scrollTo(0,0)})}}export{A as loadAndNavigate};
1
+ import{isLocalLink as f}from"../../../utils/path/is-local-link.js";import{isAuthRoutePath as m}from"../../../utils/auth/is-auth-route-path.js";import{withLoadProgress as u}from"./withLoadProgress";import{scrollToAnchor as p}from"./scroll-to-anchor";let s;async function A({navigate:t,to:o,origin:a="browser",options:c}){o===""&&(o="/"),s=o;const{pathname:e,hash:d,search:i}=new URL(o,window.location.origin+window.location.pathname),n=decodeURIComponent(d),l=decodeURIComponent(window.location.hash);if(m(e)){window.location.href=o;return}const w=window.__LOADER,r=await u(w.tryLoad(e,void 0,i));if(r?.redirectTo){if(!f(r.redirectTo)){window.location.href=r.redirectTo;return}return A({navigate:t,to:r.redirectTo,origin:a,options:c})}if(r&&s===o){if((e!==window.location.pathname||i!==window.location.search||n!==l)&&t({pathname:e,search:i,hash:n},{...c,state:{origin:a},flushSync:!0}),r.props?.disableAutoScroll)return;requestAnimationFrame(()=>{if(n){const h=n.slice(1);p(h)}else window.scrollTo(0,0)})}}export{A as loadAndNavigate};
@@ -1,7 +1,7 @@
1
- import{telemetry as s}from"./app/telemetry/index.js";s.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as p}from"react-dom/client";import{RouterProvider as m,createBrowserRouter as d}from"react-router-dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{StyleSheetManager as u}from"styled-components";import{getLocaleFromPathname as E,withoutPathPrefix as R,withPathPrefix as e}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../constants/api";import{DEFAULT_LOCALE_PLACEHOLDER as O}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as _}from"./constants/common.js";import{shouldForwardProp as D}from"../utils/should-forward-prop.js";import"./polyfills";import{PACKAGE_NAME as P,PRODUCT_NAME as h}from"../config/product-gates";import{App as g,routes as A}from"./App";import{Loader as v,useRefresh as x,globalData as t}from"./runtime/loader";import{initL10n as N}from"./app/l10n/initL10n";function T(){return x(),o.createElement(f,{context:{}},o.createElement(u,{shouldForwardProp:D},o.createElement(g,null)))}function b(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
1
+ import{telemetry as p}from"./app/telemetry/index.js";p.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as s}from"react-dom/client";import{RouterProvider as m,createBrowserRouter as d}from"react-router-dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{StyleSheetManager as E}from"styled-components";import{getLocaleFromPathname as u,withoutPathPrefix as R,withPathPrefix as e}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../constants/api";import{DEFAULT_LOCALE_PLACEHOLDER as O}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as _}from"./constants/common.js";import{shouldForwardProp as D}from"../utils/should-forward-prop.js";import"./polyfills";import{PACKAGE_NAME as P,PRODUCT_NAME as h}from"../config/product-gates";import{App as g,routes as A}from"./App";import{Loader as x,useRefresh as N,globalData as t}from"./runtime/loader";import{initL10n as b}from"./app/l10n/initL10n";function v(){return N(),o.createElement(f,{context:{}},o.createElement(E,{shouldForwardProp:D},o.createElement(g,null)))}function T(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
2
2
  %c Version: ${process.env.REDOCLY_PORTAL_VERSION} %c
3
3
  `,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):process.env.REDOCLY_PORTAL_VERSION&&console.log(`
4
4
  %c Redocly ${h} %c ${process.env.REDOCLY_PORTAL_VERSION} %c
5
5
 
6
6
  %chttps://redocly.com
7
- `,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await v.load(window.location.pathname,void 0,window.location.search),b();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=E(R(location.pathname),i,n);await N(r,a);const c=d([{Component:T,path:e("/*"),children:A}]);p(document.getElementById("app_root"),o.createElement(m,{future:{v7_startTransition:!1},router:c}))}C();
7
+ `,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await x.load(window.location.pathname,void 0,window.location.search),T();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=u(R(location.pathname),i,n);await b(r,a);const c=d([{Component:v,path:e("/*"),children:A}]);s(document.getElementById("app_root"),o.createElement(m,{router:c}))}C();
@@ -13,6 +13,6 @@ export declare function joinWithSeparator(base?: string, path?: string, sep?: st
13
13
  export declare function parsePartials(partials?: Record<string, any>): Record<string, Node[] | Node> | undefined;
14
14
  export declare function usePatchedStore(storeJs: OpenAPIDocsStore, { markdown, baseSlug }: PageProps): OpenAPIDocsStore;
15
15
  export declare function safeParseFunction(fnInput: EventFunctionInput): ((event: EventType) => void) | null;
16
- export declare function mergeEvents(userFunction: ((event: EventType) => void) | null, telemetryEvent?: AsyncApiRealmUI.GetEventData<'openapi_docs'>[number]['eventType']): (event: EventType) => void;
16
+ export declare function mergeEvents(userFunction: ((event: EventType) => void) | null, telemetryEvent?: AsyncApiRealmUI.GetEventData<'com.redocly.openapiDocs.interacted'>[0]['eventType']): (event: EventType) => void;
17
17
  export {};
18
18
  //# sourceMappingURL=helpers.d.ts.map
@@ -1,5 +1,5 @@
1
- import{useMemo as f}from"react";import{components as d}from"@redocly-markdoc/components";import{schema as c}from"@redocly-markdoc/schema";import{Ast as g}from"@markdoc/markdoc";import{PageNavigation as h}from"@redocly/theme/components/PageNavigation/PageNavigation";import{tags as _,components as y}from"@redocly/theme/markdoc/default";import{Breadcrumbs as P}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{withPathPrefix as m}from"@redocly/theme/core/utils";import{ServerRoutes as u}from"../../../constants/api.js";import{OPENAPI_DOCS_TEMPLATE_ID as w}from"../../../constants/common.js";import{isBrowser as S}from"../../../utils/env/is-browser.js";import*as O from"../../../markdoc/nodes/index.js";import v from"../../../markdoc/tags/index.js";import{normalizeCustomTags as C}from"../../../markdoc/helpers/normalize-custom-tags.js";import*as T from"../../app/markdoc/custom-components/index.js";import{usePageData as x,useSidebarSiblingsData as A}from"../../providers/page-data/hooks";import{telemetry as E}from"../../app/telemetry/index.js";import{getMockServerDocsConfig as R}from"./mock-server-config.js";function X(o="",r="",t="/"){return o.endsWith(t)&&(o=o.slice(0,-t.length)),r.startsWith(t)&&(r=r.slice(t.length)),!o||!r?o+r:o+t+r}function b(o){if(o)return Object.entries(o).reduce((r,[t,n])=>(r[t]=g.fromJSON(JSON.stringify(n)),r),{})}function Z(o,{markdown:r,baseSlug:t}){return f(()=>{const i=S();if(o.options.oAuth2RedirectURI=i?`${window.location.origin}${m(u.REPLAY_OAUTH2_CALLBACK)}`:void 0,o.options.routingBasePath=m(t),o.options.mockServer=R(o.options.mockServer,t),o.options.corsProxyUrl===void 0){const e=m(`${u.CORS_PROXY}/`);o.options.corsProxyUrl=i?new URL(e,window.location.origin).toString():e}o.options.scrollYOffset=i?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--navbar-height"),10):0,o.options.markdocOptions={tags:{...v,..._,...C(c?.tags??{})},nodes:{...O,...c?.nodes??{}},functions:{...c?.functions??{}},components:{...T,...y,...d,...globalThis.__LOADER.markdocComponents},...r,partials:b(r?.partials)},o.options.unstable_hooks={...o.options.unstable_hooks,MiddlePanelFooter:()=>{const{templateId:e}=x()||{},{nextPage:s,prevPage:a}=A()||{};return e===w?null:h({nextPage:s,prevPage:a})},MiddlePanelHeader:()=>P({})};const l={codeSamplesLanguageSwitch:"samples_language_switch",codeSamplesCopy:"code_samples_copy",panelToggle:"panel_toggle",targetServerSwitch:"target_server_switch",tryItOpen:"try_it_toggle",tryItSent:"try_it_sent"},p={};for(const[e,s]of Object.entries(l)){const a=U(o.options.events?.[e]);p[e]=F(a,s)}return o.options.events=p,o},[o,r,t])}function U(o){if(typeof window>"u")return null;if(typeof o=="function")return o;if(typeof o!="string")return null;try{const r=o.trim();if(!r.match(/^(\([^)]*\)\s*=>\s*.+|[a-zA-Z_$][\w$]*\s*=>\s*.+)$/))throw new Error("Invalid function format. Only arrow functions allowed.");if(["eval","Function","constructor","prototype","__proto__","import","require","process","global","window","document"].some(i=>r.includes(i)))throw new Error("Function contains prohibited keywords");return new Function("event",`
1
+ import{useMemo as f}from"react";import{components as g}from"@redocly-markdoc/components";import{schema as c}from"@redocly-markdoc/schema";import{Ast as d}from"@markdoc/markdoc";import{PageNavigation as h}from"@redocly/theme/components/PageNavigation/PageNavigation";import{tags as _,components as y}from"@redocly/theme/markdoc/default";import{Breadcrumbs as P}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{withPathPrefix as m,getBaseDataAttributes as w}from"@redocly/theme/core/utils";import{ServerRoutes as u}from"../../../constants/api.js";import{OPENAPI_DOCS_TEMPLATE_ID as S}from"../../../constants/common.js";import{isBrowser as O}from"../../../utils/env/is-browser.js";import*as v from"../../../markdoc/nodes/index.js";import C from"../../../markdoc/tags/index.js";import{normalizeCustomTags as T}from"../../../markdoc/helpers/normalize-custom-tags.js";import*as A from"../../app/markdoc/custom-components/index.js";import{usePageData as x,useSidebarSiblingsData as D}from"../../providers/page-data/hooks";import{telemetry as E}from"../../app/telemetry/index.js";import{getMockServerDocsConfig as R}from"./mock-server-config.js";function Z(o="",r="",t="/"){return o.endsWith(t)&&(o=o.slice(0,-t.length)),r.startsWith(t)&&(r=r.slice(t.length)),!o||!r?o+r:o+t+r}function b(o){if(o)return Object.entries(o).reduce((r,[t,n])=>(r[t]=d.fromJSON(JSON.stringify(n)),r),{})}function G(o,{markdown:r,baseSlug:t}){return f(()=>{const i=O();if(o.options.oAuth2RedirectURI=i?`${window.location.origin}${m(u.REPLAY_OAUTH2_CALLBACK)}`:void 0,o.options.routingBasePath=m(t),o.options.mockServer=R(o.options.mockServer,t),o.options.corsProxyUrl===void 0){const e=m(`${u.CORS_PROXY}/`);o.options.corsProxyUrl=i?new URL(e,window.location.origin).toString():e}o.options.scrollYOffset=i?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--navbar-height"),10):0,o.options.markdocOptions={tags:{...C,..._,...T(c?.tags??{})},nodes:{...v,...c?.nodes??{}},functions:{...c?.functions??{}},components:{...A,...y,...g,...globalThis.__LOADER.markdocComponents},...r,partials:b(r?.partials)},o.options.unstable_hooks={...o.options.unstable_hooks,MiddlePanelFooter:()=>{const{templateId:e}=x()||{},{nextPage:s,prevPage:a}=D()||{};return e===S?null:h({nextPage:s,prevPage:a})},MiddlePanelHeader:()=>P({})};const l={codeSamplesLanguageSwitch:"samples_language_switch",codeSamplesCopy:"code_samples_copy",panelToggle:"panel_toggle",targetServerSwitch:"target_server_switch",tryItOpen:"try_it_toggle",tryItSent:"try_it_sent"},p={};for(const[e,s]of Object.entries(l)){const a=I(o.options.events?.[e]);p[e]=U(a,s)}return o.options.events=p,o},[o,r,t])}function I(o){if(typeof window>"u")return null;if(typeof o=="function")return o;if(typeof o!="string")return null;try{const r=o.trim();if(!r.match(/^(\([^)]*\)\s*=>\s*.+|[a-zA-Z_$][\w$]*\s*=>\s*.+)$/))throw new Error("Invalid function format. Only arrow functions allowed.");if(["eval","Function","constructor","prototype","__proto__","import","require","process","global","window","document"].some(i=>r.includes(i)))throw new Error("Function contains prohibited keywords");return new Function("event",`
2
2
  'use strict';
3
3
  const userFn = ${r};
4
4
  return userFn(event);
5
- `)}catch(r){return console.error("Function parsing error:",r),null}}function F(o,r){return t=>{if(o)try{o(t)}catch(n){console.error("User event handler error:",n)}if(r)try{E.sendOpenapiDocsMessage([{object:"openapi_docs",eventType:r,operationHttpVerb:t.operationHttpVerb,operationPath:t.operationPath,lang:"lang"in t?t.lang:void 0,action:t.action,state:"state"in t?t.state:void 0,serverUrl:"serverUrl"in t?t.serverUrl:void 0}])}catch{}}}export{X as joinWithSeparator,F as mergeEvents,b as parsePartials,U as safeParseFunction,Z as usePatchedStore};
5
+ `)}catch(r){return console.error("Function parsing error:",r),null}}function U(o,r){return t=>{if(o)try{o(t)}catch(n){console.error("User event handler error:",n)}if(r)try{E.sendOpenapiDocsMessage([{...w("openapiDocsInteraction","openapiDocs"),eventType:r,operationHttpVerb:t.operationHttpVerb,operationPath:t.operationPath,lang:"lang"in t?t.lang:void 0,action:t.action,state:"state"in t?t.state:void 0,serverUrl:"serverUrl"in t?t.serverUrl:void 0}])}catch{}}}export{Z as joinWithSeparator,U as mergeEvents,b as parsePartials,I as safeParseFunction,G as usePatchedStore};
@@ -3,6 +3,7 @@ export declare const AuthCookieNames: {
3
3
  readonly AUTHORIZATION: 'authorization';
4
4
  readonly IDP_ID_TOKEN: 'idp_id_token';
5
5
  readonly IDP_ACCESS_TOKEN: 'idp_access_token';
6
+ readonly IDP_REFRESH_TOKEN: 'idp_refresh_token';
6
7
  readonly FEDERATED_ACCESS_TOKEN: 'federated_access_token';
7
8
  readonly FEDERATED_ID_TOKEN: 'federated_id_token';
8
9
  };
@@ -103,6 +104,8 @@ export declare const FEATURE: {
103
104
  readonly aiSearchLimit: 'aiSearchLimit';
104
105
  readonly kvStorageLimit: 'kvStorageLimit';
105
106
  readonly mcp: 'mcp';
107
+ readonly mcpGateway: 'mcpGateway';
108
+ readonly mcpMode: 'mcpMode';
106
109
  readonly banner: 'banner';
107
110
  };
108
111
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- const a={AUTHORIZATION:"authorization",IDP_ID_TOKEN:"idp_id_token",IDP_ACCESS_TOKEN:"idp_access_token",FEDERATED_ACCESS_TOKEN:"federated_access_token",FEDERATED_ID_TOKEN:"federated_id_token"},n="post_logout",_="openapi_docs",E="asyncapi_docs",p="graphql_docs",A="/_spec-gql",i="markdoc",S="tags",c="*",L={[c]:"read"},O=["openid","email"],d=1440*60,I=720*60*60,T="anonymous",R="authenticated",l="**",C="Reunite",x="translations.yaml",P="redocly.yaml",D="@redocly/theme",N="@theme",m="@skills",U="SKILL.md",u="/.well-known/agent-skills",g="/.well-known/agent-card.json",M="/a2a",h="/.well-known/mcp/server-card.json",F="/app-data.json",b="/eject-component";var t;(function(o){o.BUILD="build",o.DEVELOP="develop",o.PREPARE="prepare"})(t||(t={}));var e;(function(o){o.RATING="rating",o.SENTIMENT="sentiment",o.COMMENT="comment",o.MOOD="mood",o.PROBLEM="problem",o.SCALE="scale"})(e||(e={}));var r;(function(o){o.AI_SEARCH="aiSearch"})(r||(r={}));const k="/login",v="/invite",G={AUTH0_PASS:"/auth/auth0-pass"},H={NotExist:"ENOENT"},y="default_locale",K="sidebar-",B="PUBLIC_",w="branch.",V=["BROKEN_LINK","MARKDOC","RESOLVE"],f=["logo","navbar","products","footer","sidebar","scripts","links","feedback","search","aiAssistant","colorMode","palette","navigation","codeSnippet","markdown","openapi","graphql","analytics","userMenu","versionPicker","breadcrumbs","catalog","entitiesCatalog","scorecard","scorecards","scorecardClassic","mcp","banner"],s="redocly_category",j="redocly_product",q="redocly_version",X="redocly_teams",Q=s,W={asyncapi:"asyncapi",apiFunctions:"apiFunctions",reactPages:"reactPages",catalog:"catalog",catalogClassic:"catalogClassic",lint:"lint",scorecard:"scorecard",scorecards:"scorecards",l10n:"l10n",openapi:"openapi",graphql:"graphql",markdown:"markdown",devOnboarding:"devOnboarding",seo:"seo",redirects:"redirects",customPlugins:"customPlugins",themeEjecting:"themeEjecting",products:"products",breadcrumbs:"breadcrumbs",mockServer:"mockServer",sso:"sso",rbac:"rbac",analytics:"analytics",removeAttribution:"removeAttribution",advancedSearch:"advancedSearch",soap:"soap",ssoDirect:"ssoDirect",codeWalkthrough:"codeWalkthrough",aiSearchLimit:"aiSearchLimit",kvStorageLimit:"kvStorageLimit",mcp:"mcp",banner:"banner"};export{M as A2A_SLUG,g as AGENT_CARD_SLUG,u as AGENT_SKILLS_BASE,E as ASYNC_API_DOCS_TEMPLATE_ID,a as AuthCookieNames,w as BRANCH_ENV_PREFIX,P as CONFIG_FILE_NAME,i as CUSTOM_MARKDOC_OPTIONS_PATH,S as CUSTOM_MARKDOC_TAGS_PATH,T as DEFAULT_ANONYMOUS_VISITOR_TEAM,R as DEFAULT_AUTHENTICATED_TEAM,d as DEFAULT_COOKIE_EXPIRATION,y as DEFAULT_LOCALE_PLACEHOLDER,l as DEFAULT_RBAC_SCOPE,C as DEFAULT_SSO_IDP_TITLE,D as DEFAULT_THEME_NAME,k as DEV_LOGIN_SLUG,b as EJECT_COMPONENT_URL,G as ExternalRoutes,W as FEATURE,e as FEEDBACK_TYPES,H as FsErrors,F as GLOBAL_DATA_URL,A as GRAPHQL_SPEC_SLUG,p as GRAPHQL_TEMPLATE_ID,v as INVITE_SLUG,V as MARKDOC_ERROR_TYPES,h as MCP_SERVER_CARD_SLUG,_ as OPENAPI_DOCS_TEMPLATE_ID,I as POST_LOGOUT_COOKIE_EXPIRATION,n as POST_LOGOUT_COOKIE_NAME,B as PUBLIC_ENV_PREFIX,L as PUBLIC_RBAC_SCOPE_ITEM,c as RBAC_ALL_OTHER_TEAMS,O as REQUIRED_OIDC_SCOPES,r as RbacFeatures,s as SEARCH_CATEGORY_FIELD,Q as SEARCH_GROUP_FACET_FIELD,j as SEARCH_PRODUCT_FIELD,X as SEARCH_RBAC_FIELD,q as SEARCH_VERSION_FIELD,K as SIDEBAR_PREFIX,x as TRANSLATIONS_FILE_NAME,f as UI_ACCESSIBLE_CONFIG_PROPS,m as USER_SKILLS_ALIAS,U as USER_SKILL_FILENAME,N as USER_THEME_ALIAS,t as cliCommandNames};
1
+ const a={AUTHORIZATION:"authorization",IDP_ID_TOKEN:"idp_id_token",IDP_ACCESS_TOKEN:"idp_access_token",IDP_REFRESH_TOKEN:"idp_refresh_token",FEDERATED_ACCESS_TOKEN:"federated_access_token",FEDERATED_ID_TOKEN:"federated_id_token"},n="post_logout",_="openapi_docs",E="asyncapi_docs",p="graphql_docs",i="/_spec-gql",A="markdoc",S="tags",c="*",O={[c]:"read"},d=["openid","email"],L=1440*60,I=720*60*60,T="anonymous",R="authenticated",l="**",C="Reunite",x="translations.yaml",P="redocly.yaml",D="@redocly/theme",N="@theme",m="@skills",U="SKILL.md",u="/.well-known/agent-skills",g="/.well-known/agent-card.json",M="/a2a",h="/.well-known/mcp/server-card.json",F="/app-data.json",k="/eject-component";var t;(function(o){o.BUILD="build",o.DEVELOP="develop",o.PREPARE="prepare"})(t||(t={}));var e;(function(o){o.RATING="rating",o.SENTIMENT="sentiment",o.COMMENT="comment",o.MOOD="mood",o.PROBLEM="problem",o.SCALE="scale"})(e||(e={}));var r;(function(o){o.AI_SEARCH="aiSearch"})(r||(r={}));const b="/login",G="/invite",v={AUTH0_PASS:"/auth/auth0-pass"},H={NotExist:"ENOENT"},y="default_locale",K="sidebar-",w="PUBLIC_",B="branch.",f=["BROKEN_LINK","MARKDOC","RESOLVE"],V=["logo","navbar","products","footer","sidebar","scripts","links","feedback","search","aiAssistant","colorMode","palette","navigation","codeSnippet","markdown","openapi","graphql","analytics","userMenu","versionPicker","breadcrumbs","catalog","entitiesCatalog","scorecard","scorecards","scorecardClassic","mcp","banner"],s="redocly_category",j="redocly_product",q="redocly_version",X="redocly_teams",Q=s,W={asyncapi:"asyncapi",apiFunctions:"apiFunctions",reactPages:"reactPages",catalog:"catalog",catalogClassic:"catalogClassic",lint:"lint",scorecard:"scorecard",scorecards:"scorecards",l10n:"l10n",openapi:"openapi",graphql:"graphql",markdown:"markdown",devOnboarding:"devOnboarding",seo:"seo",redirects:"redirects",customPlugins:"customPlugins",themeEjecting:"themeEjecting",products:"products",breadcrumbs:"breadcrumbs",mockServer:"mockServer",sso:"sso",rbac:"rbac",analytics:"analytics",removeAttribution:"removeAttribution",advancedSearch:"advancedSearch",soap:"soap",ssoDirect:"ssoDirect",codeWalkthrough:"codeWalkthrough",aiSearchLimit:"aiSearchLimit",kvStorageLimit:"kvStorageLimit",mcp:"mcp",mcpGateway:"mcpGateway",mcpMode:"mcpMode",banner:"banner"};export{M as A2A_SLUG,g as AGENT_CARD_SLUG,u as AGENT_SKILLS_BASE,E as ASYNC_API_DOCS_TEMPLATE_ID,a as AuthCookieNames,B as BRANCH_ENV_PREFIX,P as CONFIG_FILE_NAME,A as CUSTOM_MARKDOC_OPTIONS_PATH,S as CUSTOM_MARKDOC_TAGS_PATH,T as DEFAULT_ANONYMOUS_VISITOR_TEAM,R as DEFAULT_AUTHENTICATED_TEAM,L as DEFAULT_COOKIE_EXPIRATION,y as DEFAULT_LOCALE_PLACEHOLDER,l as DEFAULT_RBAC_SCOPE,C as DEFAULT_SSO_IDP_TITLE,D as DEFAULT_THEME_NAME,b as DEV_LOGIN_SLUG,k as EJECT_COMPONENT_URL,v as ExternalRoutes,W as FEATURE,e as FEEDBACK_TYPES,H as FsErrors,F as GLOBAL_DATA_URL,i as GRAPHQL_SPEC_SLUG,p as GRAPHQL_TEMPLATE_ID,G as INVITE_SLUG,f as MARKDOC_ERROR_TYPES,h as MCP_SERVER_CARD_SLUG,_ as OPENAPI_DOCS_TEMPLATE_ID,I as POST_LOGOUT_COOKIE_EXPIRATION,n as POST_LOGOUT_COOKIE_NAME,w as PUBLIC_ENV_PREFIX,O as PUBLIC_RBAC_SCOPE_ITEM,c as RBAC_ALL_OTHER_TEAMS,d as REQUIRED_OIDC_SCOPES,r as RbacFeatures,s as SEARCH_CATEGORY_FIELD,Q as SEARCH_GROUP_FACET_FIELD,j as SEARCH_PRODUCT_FIELD,X as SEARCH_RBAC_FIELD,q as SEARCH_VERSION_FIELD,K as SIDEBAR_PREFIX,x as TRANSLATIONS_FILE_NAME,V as UI_ACCESSIBLE_CONFIG_PROPS,m as USER_SKILLS_ALIAS,U as USER_SKILL_FILENAME,N as USER_THEME_ALIAS,t as cliCommandNames};
@@ -52,9 +52,8 @@ declare function loadEnvConfig(): {
52
52
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
53
53
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
54
54
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
55
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
56
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
57
55
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
56
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: boolean | undefined;
58
57
  SEARCH_DEV_REINIT?: string | undefined;
59
58
  SEARCH_DEV_DEBUG: boolean;
60
59
  TYPESENSE_API_URL?: string | undefined;
@@ -134,9 +133,8 @@ export declare const envConfig: {
134
133
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
135
134
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
136
135
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
137
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
138
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
139
136
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
137
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: boolean | undefined;
140
138
  SEARCH_DEV_REINIT?: string | undefined;
141
139
  SEARCH_DEV_DEBUG: boolean;
142
140
  TYPESENSE_API_URL?: string | undefined;
@@ -56,9 +56,8 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
56
56
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
57
57
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL: z.ZodOptional<z.ZodString>;
58
58
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
59
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
60
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
61
59
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
60
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
62
61
  } & {
63
62
  SEARCH_DEV_REINIT: z.ZodOptional<z.ZodString>;
64
63
  SEARCH_DEV_DEBUG: z.ZodEffects<z.ZodDefault<z.ZodEnum<["true", "false"]>>, boolean, "false" | "true" | undefined>;
@@ -135,9 +134,8 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
135
134
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
136
135
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
137
136
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
138
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
139
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
140
137
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
138
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: boolean | undefined;
141
139
  SEARCH_DEV_REINIT?: string | undefined;
142
140
  SEARCH_DEV_DEBUG: boolean;
143
141
  TYPESENSE_API_URL?: string | undefined;
@@ -207,9 +205,8 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
207
205
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "false" | "true" | undefined;
208
206
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
209
207
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
210
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: "false" | "true" | undefined;
211
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: "false" | "true" | undefined;
212
208
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
209
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: "false" | "true" | undefined;
213
210
  SEARCH_DEV_REINIT?: string | undefined;
214
211
  SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
215
212
  TYPESENSE_API_URL?: string | undefined;
@@ -279,9 +276,8 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
279
276
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
280
277
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
281
278
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
282
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
283
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
284
279
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
280
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: boolean | undefined;
285
281
  SEARCH_DEV_REINIT?: string | undefined;
286
282
  SEARCH_DEV_DEBUG: boolean;
287
283
  TYPESENSE_API_URL?: string | undefined;
@@ -351,9 +347,8 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
351
347
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "false" | "true" | undefined;
352
348
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
353
349
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
354
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: "false" | "true" | undefined;
355
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: "false" | "true" | undefined;
356
350
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
351
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: "false" | "true" | undefined;
357
352
  SEARCH_DEV_REINIT?: string | undefined;
358
353
  SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
359
354
  TYPESENSE_API_URL?: string | undefined;
@@ -15,12 +15,10 @@ export declare const featureFlagsSchema: z.ZodObject<{
15
15
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL: z.ZodOptional<z.ZodString>;
16
16
  /** (Optional) API endpoint for the agent feedback endpoint;**/
17
17
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
18
- /** Experimental: serve the Docs MCP server in codemode (a single `execute` tool). */
19
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
20
- /** Experimental: give the docs MCP `execute` sandbox a guarded `fetch` that can call gateway-eligible APIs. */
21
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
22
18
  /** Escape hatch: disables the Node Permission Model sandbox on API function and MCP tool worker processes (hosted Reunite environments only). */
23
19
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
20
+ /** Experimental: prompt for upstream API credentials via URL-mode elicitation. Requires the gateway capability. */
21
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
24
22
  }, "strip", z.ZodTypeAny, {
25
23
  NEW_CATALOG_ENABLED?: boolean | undefined;
26
24
  NEW_SCORECARDS_ENABLED?: boolean | undefined;
@@ -31,9 +29,8 @@ export declare const featureFlagsSchema: z.ZodObject<{
31
29
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
32
30
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
33
31
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
34
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
35
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
36
32
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
33
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: boolean | undefined;
37
34
  }, {
38
35
  NEW_CATALOG_ENABLED?: "false" | "true" | undefined;
39
36
  NEW_SCORECARDS_ENABLED?: "false" | "true" | undefined;
@@ -44,8 +41,7 @@ export declare const featureFlagsSchema: z.ZodObject<{
44
41
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "false" | "true" | undefined;
45
42
  REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
46
43
  REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
47
- REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: "false" | "true" | undefined;
48
- REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: "false" | "true" | undefined;
49
44
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
45
+ REDOCLY_EXP_MCP_ELICITATION_ENABLED?: "false" | "true" | undefined;
50
46
  }>;
51
47
  //# sourceMappingURL=feature-flags.d.ts.map
@@ -1 +1 @@
1
- import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const D=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_EXP_MCP_CODE_MODE_ENABLED:E(),REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED:E(),REDOCLY_DISABLE_API_FUNCTION_SANDBOX:E()});export{D as featureFlagsSchema};
1
+ import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const N=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_DISABLE_API_FUNCTION_SANDBOX:E(),REDOCLY_EXP_MCP_ELICITATION_ENABLED:E()});export{N as featureFlagsSchema};
@@ -11,6 +11,8 @@ export declare const DEFAULT_THEME_PLUGIN_PATH = "@redocly/theme/plugin.js";
11
11
  export declare const STYLES_FILE = "styles.css";
12
12
  export declare const DEFAULT_PROJECT_PLUGIN_PATHS: string[];
13
13
  export declare const JWT_SECRET_KEY: string;
14
+ export declare const MCP_ACCESS_TOKEN_TTL_SEC: number;
15
+ export declare const MCP_REFRESH_SESSION_LIFETIME_SEC: number;
14
16
  export declare const I18N_DIR_NAME = "@i18n";
15
17
  export declare const L10N_DIR_NAME = "@l10n";
16
18
  export declare const RESERVED_DIR_NAMES: string[];
@@ -1 +1 @@
1
- import{ServerRoutes as A}from"../../constants/api.js";import{USER_THEME_ALIAS as I}from"../../constants/common.js";import{envConfig as _}from"../config/env-config.js";const N="runtime",x="/assets",U="/_spec",l="/_bundle",M="static",a="redocly:::linkOriginal",P="@",i="default",m=new RegExp("((?!@i18n\\/|@l10n\\/)\\/?@.*?(?=\\/))","g"),F="@redocly/theme/plugin.js",H="styles.css",u=["@theme/plugin.js","@theme/plugin.cjs","@theme/plugin.mjs"],d=_.JWT_SECRET_KEY||"test_secret_key",c="@i18n",p="@l10n",G=[I,c,p],Y="https://redocly.com/auth/aud",K="catalog.json",B="scorecard.json",g="page-count.json",h="sitemap.xml",J="llms.txt",o=_.PROJECT_ID,R=_.PROJECT_SLUG,e=_.ORGANIZATION_ID,n=_.ORG_SLUG,E=_.BH_API_URL,s=E&&n&&R?`${E}/orgs/${n}/projects/${R}`:void 0,t=E&&e&&o?`${E}/orgs/${e}/projects/${o}`:void 0,S=E?`${E}/entitlements/.well-known/jwks`:"https://app.cloud.redocly.com/api/entitlements/.well-known/jwks",W=_.ENTITLEMENTS_JWKS_CDN_URL||S,f=s?`${s}/feedback`:"",j=t?`${t}/ai-agentic-conversations`:"",k=t?`${t}/semantic-search`:"",w="no-store",V=365*24*60*60,X="X-Redocly-Cache-Control",$="no-cache",v="public, s-maxage=86400, max-age=10, must-revalidate",y=_.AUTH_URL,b="Developer Documentation",T=_.REDOCLY_SSR_RENDER_MODE==="worker"?"worker":"main",Z=T==="main"?0:_.REDOCLY_SSR_WORKERS_MIN!=null?Number(_.REDOCLY_SSR_WORKERS_MIN):2,q=T==="main"?1:_.REDOCLY_SSR_WORKERS_MAX!=null?Number(_.REDOCLY_SSR_WORKERS_MAX):5,z="-----BEGIN CERTIFICATE-----",Q="-----END CERTIFICATE-----",__=!_.isDevelopMode&&_.REDOCLY_TELEMETRY!=="off"||_.REDOCLY_TELEMETRY==="on",E_="http://localhost:4318/v1/traces",t_=[A.HEALTH],r=_.SERVER_EDITOR_APP_URL||"http://127.0.0.1:3000",o_=_.REDOCLY_CORS_ORIGINS?_.REDOCLY_CORS_ORIGINS.split(",").map(L=>L.trim()).filter(Boolean).concat(r):[r],R_="markdown/partials",e_="markdown/partials-deps";export{o_ as ALLOWED_CORS_ORIGINS,Y as ALTERNATIVE_AUD_CLAIM_NAME,j as ASK_AI_API_URL,y as AUTH_URL,z as BEGIN_CERTIFICATE_DELIMITER,s as BH_API_PROJECTS_URL,t as BH_API_PROJECTS_URL_V2,w as CACHE_CONTROL_NO_STORE_HEADER_VALUE,$ as CACHE_CONTROL_PUBLIC_HTML,K as CATALOG_OUTPUT_FILE_NAME,V as DEFAULT_IMMUTABLE_CACHE_MAX_AGE,u as DEFAULT_PROJECT_PLUGIN_PATHS,F as DEFAULT_THEME_PLUGIN_PATH,b as DEFAULT_TITLE,i as DEFAULT_VERSION_NAME,U as DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER,Q as END_CERTIFICATE_DELIMITER,W as ENTITLEMENTS_JWKS_URL,f as FEEDBACK_API_URL,c as I18N_DIR_NAME,d as JWT_SECRET_KEY,p as L10N_DIR_NAME,a as LINK_ORIGINAL_ATTR_NAME,J as LLMS_TXT_FILE_NAME,R_ as MARKDOC_PARTIALS_DATA_KEY,e_ as MARKDOC_PARTIALS_DEPS_KEY,e as ORG_ID,n as ORG_SLUG,t_ as OTEL_EXCLUDED_ROUTES,E_ as OTEL_TRACES_DEV_URL,g as PAGE_COUNT_OUTPUT_FILE_NAME,o as PROJECT_ID,R as PROJECT_SLUG,l as PUBLIC_API_DEFINITIONS_FOLDER,x as PUBLIC_ASSETS_FOLDER,M as PUBLIC_STATIC_FOLDER,G as RESERVED_DIR_NAMES,N as RUNTIME_RESOURCES_DIR,B as SCORECARD_OUTPUT_FILE_NAME,k as SEMANTIC_SEARCH_API_URL,r as SERVER_EDITOR_APP_URL,h as SITEMAP_FILE_NAME,T as SSR_RENDER_MODE,q as SSR_WORKERS_MAX,Z as SSR_WORKERS_MIN,H as STYLES_FILE,__ as TELEMETRY_ENABLED,m as VERSIONED_FOLDER_REGEXP_MATCH,P as VERSION_SEPARATOR,X as X_REDOCLY_CACHE_CONTROL_HEADER,v as X_REDOCLY_CACHE_CONTROL_PUBLIC_HTML};
1
+ import{ServerRoutes as I}from"../../constants/api.js";import{USER_THEME_ALIAS as A}from"../../constants/common.js";import{envConfig as _}from"../config/env-config.js";const N="runtime",x="/assets",U="/_spec",M="/_bundle",P="static",l="redocly:::linkOriginal",a="@",i="default",m=new RegExp("((?!@i18n\\/|@l10n\\/)\\/?@.*?(?=\\/))","g"),F="@redocly/theme/plugin.js",H="styles.css",u=["@theme/plugin.js","@theme/plugin.cjs","@theme/plugin.mjs"],d=_.JWT_SECRET_KEY||"test_secret_key",G=3600,K=1440*60,c="@i18n",S="@l10n",Y=[A,c,S],B="https://redocly.com/auth/aud",g="catalog.json",h="scorecard.json",J="page-count.json",W="sitemap.xml",f="llms.txt",o=_.PROJECT_ID,R=_.PROJECT_SLUG,e=_.ORGANIZATION_ID,n=_.ORG_SLUG,E=_.BH_API_URL,s=E&&n&&R?`${E}/orgs/${n}/projects/${R}`:void 0,t=E&&e&&o?`${E}/orgs/${e}/projects/${o}`:void 0,p=E?`${E}/entitlements/.well-known/jwks`:"https://app.cloud.redocly.com/api/entitlements/.well-known/jwks",j=_.ENTITLEMENTS_JWKS_CDN_URL||p,k=s?`${s}/feedback`:"",w=t?`${t}/ai-agentic-conversations`:"",V=t?`${t}/semantic-search`:"",X="no-store",$=365*24*60*60,v="X-Redocly-Cache-Control",y="no-cache",b="public, s-maxage=86400, max-age=10, must-revalidate",Z=_.AUTH_URL,q="Developer Documentation",T=_.REDOCLY_SSR_RENDER_MODE==="worker"?"worker":"main",z=T==="main"?0:_.REDOCLY_SSR_WORKERS_MIN!=null?Number(_.REDOCLY_SSR_WORKERS_MIN):2,Q=T==="main"?1:_.REDOCLY_SSR_WORKERS_MAX!=null?Number(_.REDOCLY_SSR_WORKERS_MAX):5,__="-----BEGIN CERTIFICATE-----",E_="-----END CERTIFICATE-----",t_=!_.isDevelopMode&&_.REDOCLY_TELEMETRY!=="off"||_.REDOCLY_TELEMETRY==="on",o_="http://localhost:4318/v1/traces",R_=[I.HEALTH],r=_.SERVER_EDITOR_APP_URL||"http://127.0.0.1:3000",e_=_.REDOCLY_CORS_ORIGINS?_.REDOCLY_CORS_ORIGINS.split(",").map(L=>L.trim()).filter(Boolean).concat(r):[r],n_="markdown/partials",s_="markdown/partials-deps";export{e_ as ALLOWED_CORS_ORIGINS,B as ALTERNATIVE_AUD_CLAIM_NAME,w as ASK_AI_API_URL,Z as AUTH_URL,__ as BEGIN_CERTIFICATE_DELIMITER,s as BH_API_PROJECTS_URL,t as BH_API_PROJECTS_URL_V2,X as CACHE_CONTROL_NO_STORE_HEADER_VALUE,y as CACHE_CONTROL_PUBLIC_HTML,g as CATALOG_OUTPUT_FILE_NAME,$ as DEFAULT_IMMUTABLE_CACHE_MAX_AGE,u as DEFAULT_PROJECT_PLUGIN_PATHS,F as DEFAULT_THEME_PLUGIN_PATH,q as DEFAULT_TITLE,i as DEFAULT_VERSION_NAME,U as DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER,E_ as END_CERTIFICATE_DELIMITER,j as ENTITLEMENTS_JWKS_URL,k as FEEDBACK_API_URL,c as I18N_DIR_NAME,d as JWT_SECRET_KEY,S as L10N_DIR_NAME,l as LINK_ORIGINAL_ATTR_NAME,f as LLMS_TXT_FILE_NAME,n_ as MARKDOC_PARTIALS_DATA_KEY,s_ as MARKDOC_PARTIALS_DEPS_KEY,G as MCP_ACCESS_TOKEN_TTL_SEC,K as MCP_REFRESH_SESSION_LIFETIME_SEC,e as ORG_ID,n as ORG_SLUG,R_ as OTEL_EXCLUDED_ROUTES,o_ as OTEL_TRACES_DEV_URL,J as PAGE_COUNT_OUTPUT_FILE_NAME,o as PROJECT_ID,R as PROJECT_SLUG,M as PUBLIC_API_DEFINITIONS_FOLDER,x as PUBLIC_ASSETS_FOLDER,P as PUBLIC_STATIC_FOLDER,Y as RESERVED_DIR_NAMES,N as RUNTIME_RESOURCES_DIR,h as SCORECARD_OUTPUT_FILE_NAME,V as SEMANTIC_SEARCH_API_URL,r as SERVER_EDITOR_APP_URL,W as SITEMAP_FILE_NAME,T as SSR_RENDER_MODE,Q as SSR_WORKERS_MAX,z as SSR_WORKERS_MIN,H as STYLES_FILE,t_ as TELEMETRY_ENABLED,m as VERSIONED_FOLDER_REGEXP_MATCH,a as VERSION_SEPARATOR,v as X_REDOCLY_CACHE_CONTROL_HEADER,b as X_REDOCLY_CACHE_CONTROL_PUBLIC_HTML};
@@ -1 +1 @@
1
- const e={pro:{rbac:!1,sso:!1,analytics:!0,removeAttribution:!1,advancedSearch:!1,ssoDirect:!1,aiSearchLimit:0,kvStorageLimit:.5,mcp:!1},enterprise:{rbac:!0,sso:!0,analytics:!0,removeAttribution:!0,advancedSearch:!0,ssoDirect:!1,aiSearchLimit:750,kvStorageLimit:5,mcp:!0}},t=["@redocly/portal-plugin-async-api/plugin.js","@redocly/portal-plugin-mock-server/plugin.js","@redocly/portal-plugin-soap-api/plugin.js"],r={"code-walkthrough":"codeWalkthrough",step:"codeWalkthrough",toggle:"codeWalkthrough",input:"codeWalkthrough"};export{r as GATED_MARKDOC_TAGS,t as GATED_PLUGINS,e as PLAN_GATES_DEFAULTS};
1
+ const e={pro:{rbac:!1,sso:!1,analytics:!0,removeAttribution:!1,advancedSearch:!1,ssoDirect:!1,aiSearchLimit:0,kvStorageLimit:.5,mcp:!1,mcpGateway:!1,mcpMode:"tools"},enterprise:{rbac:!0,sso:!0,analytics:!0,removeAttribution:!0,advancedSearch:!0,ssoDirect:!1,aiSearchLimit:750,kvStorageLimit:5,mcp:!0,mcpGateway:!0,mcpMode:"code"}},t=["@redocly/portal-plugin-async-api/plugin.js","@redocly/portal-plugin-mock-server/plugin.js","@redocly/portal-plugin-soap-api/plugin.js"],a={"code-walkthrough":"codeWalkthrough",step:"codeWalkthrough",toggle:"codeWalkthrough",input:"codeWalkthrough"};export{a as GATED_MARKDOC_TAGS,t as GATED_PLUGINS,e as PLAN_GATES_DEFAULTS};
@@ -1 +1 @@
1
- import w from"path";import{lintConfig as A,loadConfig as T,createConfigTypes as U}from"@redocly/openapi-core";import{deepMerge as $}from"../../../../../utils/object/deep-merge.js";import{logger as d}from"../../../../tools/notifiers/logger.js";import{BRANCH_ENV_PREFIX as L}from"../../../../../constants/common.js";import{sanitizeBranchName as x}from"../../../../utils/envs/sanitize-branch-name.js";import{envConfig as C}from"../../../../config/env-config.js";import{safeParsePartial as E}from"../../safe-parse.js";import{formatConfigProblem as B}from"../../format-error.js";import{ExternalResolver as j}from"../../../../fs/utils/external-ref-resolver.js";import{resolveMutuallyExclusiveProps as q}from"../../resolve-mutual-exclusion.js";function g(e,t,s,o){t in e&&e[t]&&typeof e[t]=="string"&&(/^https?:\/\/.*/.test(e[t])||o(new Error(`Invalid ${s} URL: "${e[t]}". ${s} must start with "http://" or "https://".`)))}function N(e,t){if("access"in e&&e.access&&typeof e.access=="object"){const s=e.access;g(s,"logoutReturnUrl","access.logoutReturnUrl",t),g(s,"residency","access.residency",t);const o=["requiresLogin","logoutReturnUrl","residency","sso","rbac"];for(const a of o)a in s&&s[a]!==void 0&&a in e&&e[a]!==void 0&&t(new Error(`Property '${a}' is defined both at root level and in 'access' object. Please use 'access.${a}' to define this configuration.`))}}async function G(e,t,s,o){const u=t.getFileInfo(e)?.realRelativePath||e;async function c(){const l=new j(t),p=w.join(t.cwd,u),i=await T({configPath:p,externalRefResolver:l}),f=await o(i.resolvedConfig);if(f===void 0)return i.resolvedConfig;const P=[...i.document?.source?await A({config:i,externalConfigTypes:U(f,i)}):[],...i.document?.source?q(i.resolvedConfig,i.document?.source):[]];if(P.length>0)for(const b of P)s(new Error(B(b,t.cwd)));return i.resolvedConfig}const r=await t.exists(e)?await c():{},R=k(r),y=await o(r);g(r,"residency","Residency",s),g(r,"logoutReturnUrl","Logout return URL",s),N(r,s);let m=y?E(y,r):r;const{env:h}=m;if(h){const l=C.REDOCLY_ENV,p=h[l]||{},i=C.PUBLIC_REDOCLY_BRANCH_NAME||"",f=i?x(i):"",v=f&&h[`${L}${f}`]||{};m=$(m,v,p)}const n=I(m,R);if(n.imports&&n.imports.length>0){d.warn("The 'imports' property is deprecated. Please use 'plugins' property instead.");const l=new Set([...n.plugins||[],...n.imports.map(p=>w.posix.join(p,"plugin.js"))]);n.plugins=Array.from(l),delete n.imports}if(n.catalog&&(d.warn("The 'catalog' property is deprecated. Please use 'catalogClassic' property instead."),n.catalogClassic={...n.catalog},delete n.catalog),n.scorecard&&(d.warn("The 'scorecard' property is deprecated. Please use 'scorecardClassic' property instead."),n.scorecardClassic=n.scorecard,delete n.scorecard),n.search?.ai){d.warn("The 'search.ai' property is deprecated. Please use 'aiAssistant' property instead.");const l={...n.search?.ai,...n.aiAssistant,suggestions:n.aiAssistant?.suggestions?.length?n.aiAssistant.suggestions:n.search?.ai.suggestions||[]};n.aiAssistant=l,delete n.search.ai}return _(n)}function _(e){const t={...e},o={..."access"in e&&e.access&&typeof e.access=="object"?e.access:{}},a=["requiresLogin","logoutReturnUrl","residency","sso","idps","rbac"],u=[];for(const c of a){const r=t[c];r!==void 0&&(u.push(c),c==="requiresLogin"&&o.requiresLogin===void 0&&(o.requiresLogin=r),c==="logoutReturnUrl"&&o.logoutReturnUrl===void 0&&(o.logoutReturnUrl=r),c==="residency"&&o.residency===void 0&&(o.residency=r),c==="sso"&&o.sso===void 0&&(o.sso=r),c==="idps"&&o.idps===void 0&&(o.idps=r),c==="rbac"&&o.rbac===void 0&&(o.rbac=r),delete t[c])}return u.length>0&&d.warn(`The following properties at root level are deprecated: ${u.join(", ")}. Please move them to the 'access' object.`),Object.keys(o).length>0&&(t.access=o),t}function k(e){if(!e.theme)return[];d.warn("The 'theme' property in redocly.yaml is deprecated. Please move all of the properties from 'theme' to the root of the config.");const t=[];for(const s of Object.keys(e.theme))e[s]==null?t.push(s):d.warn(`Detected both '${s}' and 'theme.${s}' properties in redocly.yaml. The 'theme.${s}' property will be ignored and needs to be removed or merged into the '${s}'.`);return t}function I(e,t){if(!e.theme||t.length===0)return e;const s={...e};for(const o of t)s[o]=e.theme[o];return delete s.theme,s}export{_ as ensureAccessBackwardsCompatibility,G as readAndValidateConfig};
1
+ import w from"path";import{lintConfig as A,loadConfig as T,createConfigTypes as U}from"@redocly/openapi-core";import{deepMerge as $}from"../../../../../utils/object/deep-merge.js";import{logger as d}from"../../../../tools/notifiers/logger.js";import{BRANCH_ENV_PREFIX as L}from"../../../../../constants/common.js";import{sanitizeBranchName as x}from"../../../../utils/envs/sanitize-branch-name.js";import{envConfig as C}from"../../../../config/env-config.js";import{safeParsePartial as E}from"../../safe-parse.js";import{formatConfigProblem as B}from"../../format-error.js";import{ExternalResolver as j}from"../../../../fs/utils/external-ref-resolver.js";import{resolveMutuallyExclusiveProps as q}from"../../resolve-mutual-exclusion.js";function h(e,t,s,o){t in e&&e[t]&&typeof e[t]=="string"&&(/^https?:\/\/.*/.test(e[t])||o(new Error(`Invalid ${s} URL: "${e[t]}". ${s} must start with "http://" or "https://".`)))}function N(e,t){if("access"in e&&e.access&&typeof e.access=="object"){const s=e.access;h(s,"logoutReturnUrl","access.logoutReturnUrl",t),h(s,"residency","access.residency",t);const o=["requiresLogin","logoutReturnUrl","residency","sso","rbac"];for(const a of o)a in s&&s[a]!==void 0&&a in e&&e[a]!==void 0&&t(new Error(`Property '${a}' is defined both at root level and in 'access' object. Please use 'access.${a}' to define this configuration.`))}}async function J(e,t,s,o){const p=t.getFileInfo(e)?.realRelativePath||e;async function i(){const l=new j(t),u=w.join(t.cwd,p),c=await T({configPath:u,externalRefResolver:l}),f=await o(c.resolvedConfig);if(f===void 0)return c.resolvedConfig;const m=c.document?.source,P=[...m?await A({config:c,externalConfigTypes:U(f,c)}):[],...m?q(c.resolvedConfig,m):[]];if(P.length>0)for(const b of P)s(new Error(B(b,t.cwd)));return c.resolvedConfig}const r=await t.exists(e)?await i():{},R=k(r),v=await o(r);h(r,"residency","Residency",s),h(r,"logoutReturnUrl","Logout return URL",s),N(r,s);let g=v?E(v,r):r;const{env:y}=g;if(y){const l=C.REDOCLY_ENV,u=y[l]||{},c=C.PUBLIC_REDOCLY_BRANCH_NAME||"",f=c?x(c):"",m=f&&y[`${L}${f}`]||{};g=$(g,m,u)}const n=I(g,R);if(n.imports&&n.imports.length>0){d.warn("The 'imports' property is deprecated. Please use 'plugins' property instead.");const l=new Set([...n.plugins||[],...n.imports.map(u=>w.posix.join(u,"plugin.js"))]);n.plugins=Array.from(l),delete n.imports}if(n.catalog&&(d.warn("The 'catalog' property is deprecated. Please use 'catalogClassic' property instead."),n.catalogClassic={...n.catalog},delete n.catalog),n.scorecard&&(d.warn("The 'scorecard' property is deprecated. Please use 'scorecardClassic' property instead."),n.scorecardClassic=n.scorecard,delete n.scorecard),n.search?.ai){d.warn("The 'search.ai' property is deprecated. Please use 'aiAssistant' property instead.");const l={...n.search?.ai,...n.aiAssistant,suggestions:n.aiAssistant?.suggestions?.length?n.aiAssistant.suggestions:n.search?.ai.suggestions||[]};n.aiAssistant=l,delete n.search.ai}return _(n)}function _(e){const t={...e},o={..."access"in e&&e.access&&typeof e.access=="object"?e.access:{}},a=["requiresLogin","logoutReturnUrl","residency","sso","idps","rbac"],p=[];for(const i of a){const r=t[i];r!==void 0&&(p.push(i),i==="requiresLogin"&&o.requiresLogin===void 0&&(o.requiresLogin=r),i==="logoutReturnUrl"&&o.logoutReturnUrl===void 0&&(o.logoutReturnUrl=r),i==="residency"&&o.residency===void 0&&(o.residency=r),i==="sso"&&o.sso===void 0&&(o.sso=r),i==="idps"&&o.idps===void 0&&(o.idps=r),i==="rbac"&&o.rbac===void 0&&(o.rbac=r),delete t[i])}return p.length>0&&d.warn(`The following properties at root level are deprecated: ${p.join(", ")}. Please move them to the 'access' object.`),Object.keys(o).length>0&&(t.access=o),t}function k(e){if(!e.theme)return[];d.warn("The 'theme' property in redocly.yaml is deprecated. Please move all of the properties from 'theme' to the root of the config.");const t=[];for(const s of Object.keys(e.theme))e[s]==null?t.push(s):d.warn(`Detected both '${s}' and 'theme.${s}' properties in redocly.yaml. The 'theme.${s}' property will be ignored and needs to be removed or merged into the '${s}'.`);return t}function I(e,t){if(!e.theme||t.length===0)return e;const s={...e};for(const o of t)s[o]=e.theme[o];return delete s.theme,s}export{_ as ensureAccessBackwardsCompatibility,J as readAndValidateConfig};
@@ -1,4 +1,5 @@
1
1
  import type { MarkdocTagSchema } from '@redocly/theme/markdoc/tags/types';
2
+ import type { TFunction } from '@redocly/theme/core/types';
2
3
  import type { RenderTagFn } from '../../../types/plugins/markdown';
3
- export declare function createRenderTagFn(markdocTags: Record<string, MarkdocTagSchema> | undefined): RenderTagFn;
4
+ export declare function createRenderTagFn(markdocTags: Record<string, MarkdocTagSchema> | undefined, locale: string, translate: TFunction): RenderTagFn;
4
5
  //# sourceMappingURL=create-render-tag-fn.d.ts.map
@@ -1 +1 @@
1
- function t(e){return(r,n)=>{if(r.tag)return e?.[r.tag]?.renderForLlms?.(r,n)}}export{t as createRenderTagFn};
1
+ function a(e,n,t){return(r,u)=>{if(r.tag)return e?.[r.tag]?.renderForLlms?.(r,{...u,locale:n,translate:t})}}export{a as createRenderTagFn};
@@ -1,9 +1,9 @@
1
- import _ from"@markdoc/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as E,AI_SEARCH_DOCUMENT_CHUNK_SIZE as M}from"../../../constants/plugins/search.js";import{slugger as P}from"../../../../utils/slugger.js";import{joinSectionContent as U}from"./join-section-content.js";import{toMarkdown as b}from"./to-markdown.js";import{AstToSearchNodeTransformer as I}from"./walk-sections.js";import{createRenderTagFn as x}from"./create-render-tag-fn.js";import{getLocaleFromRelativePath as y}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as L}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as H}from"./search-facets.js";import{formatDocumentMetadata as K}from"../../search/utils.js";import{TagNode as N}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as R}from"../../../constants/common.js";const j=Symbol(),et=(n,r)=>async(e,c,i,s)=>{if(r?.excludeFromSearch)return;P.reset();const a=await e.getNavText?.()||D.basename(e.fsPath),u=_.Ast.fromJSON(c.ast),f=new I({partials:s.getGlobalConfig(R)||{},renderTag:x(s.markdocOptions.tags),getInnerContent:b,ast:u,skipConditionals:!0}),d=Array.from(f.transform());return{async getLLMsTxts(){const o=r?.seo,g=o&&typeof o=="object"&&"description"in o?String(o.description):void 0,C=U(d);return[{title:a,description:g,slug:e.slug,fsPath:e.fsPath,content:C,includeInLLMsTxt:!0}]},async getSearchDocuments(){return F(e,d,n,a)}}};function F(n,r,e,c){const i=n.slug,s=new Map,a=n.metadata||{},u=H(a,e),f=K(a),d=f?`Metadata:
2
- ${f}
3
- `:"";let o=[];for(const t of r)if(t instanceof L){o.splice(t.attributes.level-1,6);const l=t.attributes.level>2,m=o[o.length-1]?.title,S=o[o.length-1]?.url,T=l&&m?m:O(c,t),A=l&&S?S:t.getUrl(i),h={title:T,content:"",url:A,level:t.attributes.level,toc:o.map(v=>p(v.section)).join(`
4
- `)};(t.attributes.level>1||p(t)!==c)&&(h.content+=h.content?`
5
- `:"",h.content+=t.content.trimEnd()),s.set(t.id,h),o.push({section:t,title:T,url:A})}else if(t instanceof N)s.set(t.id,{title:t.content,content:t.content,url:t.getUrl(i),level:t.attributes.level+1,toc:o.map(l=>p(l.section)).concat(t.content).join(`
6
- `)});else{const l=t.parentNode?.id??j,m=s.get(l)??{title:c,content:"",url:i,level:1/0,toc:""};m.content+=m.content?`
7
- `:"",m.content+=t.content.trimEnd(),s.set(l,m)}const g=w(Array.from(s.values())),C=y(n.fsPath);return g.filter(t=>t.content).map(t=>({title:t.title,url:t.url,content:[d,t.toc||`# ${c}`,t.content].filter(Boolean).join(`
8
- `),fsPath:n.fsPath,locale:C,product:n.product?.name,facets:u}))}function k(n){return n.length/4}function w(n){if(n.length===0)return[];const r=[];let e=n[0];for(let c=1;c<n.length;c++){const i=n[c],s=k(e.content),a=k(i.content),u=c===n.length-1;a<E&&(s<M||u)&&i.level>e.level?e.content+=`
9
- `+i.content:(r.push(e),e=i)}return r.push(e),r}function O(n,r){return r.content===n?n:`${n} \u2192 ${p(r)}`}function p(n){return n.content.replace(/^#+/,"").trim()}export{et as getAiDocumentsStore};
1
+ import _ from"@markdoc/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as b,AI_SEARCH_DOCUMENT_CHUNK_SIZE as E}from"../../../constants/plugins/search.js";import{slugger as M}from"../../../../utils/slugger.js";import{joinSectionContent as P}from"./join-section-content.js";import{toMarkdown as U}from"./to-markdown.js";import{AstToSearchNodeTransformer as x}from"./walk-sections.js";import{createRenderTagFn as I}from"./create-render-tag-fn.js";import{getBuildTranslateContext as y}from"../../../utils/l10n/get-build-translate-context.js";import{getLocaleFromRelativePath as L}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as H}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as K}from"./search-facets.js";import{formatDocumentMetadata as N}from"../../search/utils.js";import{TagNode as R}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as j}from"../../../constants/common.js";const w=Symbol(),rt=(n,o)=>async(e,r,i,c)=>{if(o?.excludeFromSearch)return;M.reset();const l=await e.getNavText?.()||D.basename(e.fsPath),f=_.Ast.fromJSON(r.ast),{locale:d,translate:C}=await y(e.slug,c.getGlobalData?.().l10n),s=new x({partials:c.getGlobalConfig(j)||{},renderTag:I(c.markdocOptions.tags,d,C),getInnerContent:U,ast:f,skipConditionals:!0}),g=Array.from(s.transform());return{async getLLMsTxts(){const u=o?.seo,t=u&&typeof u=="object"&&"description"in u?String(u.description):void 0,a=P(g);return[{title:l,description:t,slug:e.slug,fsPath:e.fsPath,content:a,includeInLLMsTxt:!0}]},async getSearchDocuments(){return F(e,g,n,l)}}};function F(n,o,e,r){const i=n.slug,c=new Map,l=n.metadata||{},f=K(l,e),d=N(l),C=d?`Metadata:
2
+ ${d}
3
+ `:"";let s=[];for(const t of o)if(t instanceof H){s.splice(t.attributes.level-1,6);const a=t.attributes.level>2,m=s[s.length-1]?.title,S=s[s.length-1]?.url,T=a&&m?m:$(r,t),A=a&&S?S:t.getUrl(i),h={title:T,content:"",url:A,level:t.attributes.level,toc:s.map(v=>p(v.section)).join(`
4
+ `)};(t.attributes.level>1||p(t)!==r)&&(h.content+=h.content?`
5
+ `:"",h.content+=t.content.trimEnd()),c.set(t.id,h),s.push({section:t,title:T,url:A})}else if(t instanceof R)c.set(t.id,{title:t.content,content:t.content,url:t.getUrl(i),level:t.attributes.level+1,toc:s.map(a=>p(a.section)).concat(t.content).join(`
6
+ `)});else{const a=t.parentNode?.id??w,m=c.get(a)??{title:r,content:"",url:i,level:1/0,toc:""};m.content+=m.content?`
7
+ `:"",m.content+=t.content.trimEnd(),c.set(a,m)}const g=O(Array.from(c.values())),u=L(n.fsPath);return g.filter(t=>t.content).map(t=>({title:t.title,url:t.url,content:[C,t.toc||`# ${r}`,t.content].filter(Boolean).join(`
8
+ `),fsPath:n.fsPath,locale:u,product:n.product?.name,facets:f}))}function k(n){return n.length/4}function O(n){if(n.length===0)return[];const o=[];let e=n[0];for(let r=1;r<n.length;r++){const i=n[r],c=k(e.content),l=k(i.content),f=r===n.length-1;l<b&&(c<E||f)&&i.level>e.level?e.content+=`
9
+ `+i.content:(o.push(e),e=i)}return o.push(e),o}function $(n,o){return o.content===n?n:`${n} \u2192 ${p(o)}`}function p(n){return n.content.replace(/^#+/,"").trim()}export{rt as getAiDocumentsStore};
@@ -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 m}from"../../../../sandbox/sandbox.js";import{isMcpToolAvailable as u}from"../../workers/execute-mcp-tool.js";import{buildExecuteHostFetch as f,isFetchCapable as p}from"../../gateway-mcp/fetch-capability.js";import{withAuthRequiredMeta as d}from"../../gateway-mcp/upstream-auth.js";import{CODE_MODE_TOOL_NAMES as b,EXECUTE_TOOL_NAME as h}from"../constants.js";import{sanitizeToolName as E}from"../build-tool-type-declarations.js";import{invokeTool as T}from"../invoke-tool.js";import{createSandboxSetup as O}from"../sandbox/create-sandbox-setup.js";const A=async(e,t,i)=>{const o=await v(t,i),r=[],n=p(t)?f(t,c=>r.push(c)):void 0,{result:a,error:s}=await m(e.code,{setupContext:O(o,n)});return d({content:[{type:"text",text:JSON.stringify({result:a,error:s})}],isError:s!==void 0},r)};async function v(e,t){const i={};for(const o of Object.keys(l))b.has(o)||!await u({toolName:o,context:e}).catch(()=>!1)||(i[E(o)]=n=>T(o,n,e,t));return i}var F={[h]:A};export{F as default};
@@ -0,0 +1,25 @@
1
+ import type { UpstreamAuthRequiredEvent } from './upstream-auth.js';
2
+ import type { UpstreamAuthScheme } from './upstream-auth-scheme.js';
3
+ export declare const ELICITATION_TIMEOUT_MS = 300000;
4
+ export type SendElicitRequest = (request: object, resultSchema: unknown, options: {
5
+ timeout: number;
6
+ }) => Promise<{
7
+ action: string;
8
+ }>;
9
+ export type ElicitationOutcome = {
10
+ status: 'accepted';
11
+ } | {
12
+ status: 'fallback';
13
+ text: string;
14
+ } | {
15
+ status: 'skipped';
16
+ };
17
+ export declare function runUpstreamCredentialElicitation({ sendRequest, clientSupportsElicitation, sessionId, baseUrl, events, auth, }: {
18
+ sendRequest: SendElicitRequest;
19
+ clientSupportsElicitation: boolean;
20
+ sessionId: string;
21
+ baseUrl: string;
22
+ events: UpstreamAuthRequiredEvent[];
23
+ auth: UpstreamAuthScheme;
24
+ }): Promise<ElicitationOutcome>;
25
+ //# sourceMappingURL=elicitation.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{ElicitResultSchema as m}from"@redocly/mcp-typescript-sdk/types.js";import{logger as d}from"../../../tools/notifiers/logger.js";import{secretStore as p,ELICITATION_TTL_MS as h}from"./secret-store.js";const f=3e5;async function $({sendRequest:e,clientSupportsElicitation:t,sessionId:r,baseUrl:i,events:n,auth:s}){const a=n[0],l=p.createElicitation({sessionId:r,api:a.api,name:a.name,auth:s}),c=g(i,l);if(!t)return{status:"fallback",text:u(n,c)};try{return(await e({method:"elicitation/create",params:{mode:"url",message:`The "${a.name}" API requires credentials. Open the link to provide them securely; they never pass through the chat.`,url:c,elicitationId:l}},m,{timeout:f})).action==="accept"?{status:"accepted"}:{status:"skipped"}}catch(o){return d.warn(`URL-mode elicitation failed, falling back to markdown link: ${o instanceof Error?o.message:String(o)}`),{status:"fallback",text:u(n,c)}}}function g(e,t){if(!e)return`/mcp/credentials?token=${t}`;try{const r=new URL("/mcp/credentials",e);return r.searchParams.set("token",t),r.toString()}catch{return`${e}/mcp/credentials?token=${t}`}}function u(e,t){const[r,...i]=e,n=[`The upstream API "${r.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(h/6e4)} minutes):**`,"",t,"","Then call this tool again - the credentials are applied server-side and never appear in the conversation."];if(i.length>0){const s=i.map(a=>`"${a.name}"`).join(", ");n.push("",`The remaining APIs (${s}) will prompt for credentials on subsequent calls.`)}return n.join(`
2
+ `)}export{f as ELICITATION_TIMEOUT_MS,$ as runUpstreamCredentialElicitation};
@@ -1,18 +1,8 @@
1
1
  import type { OpenAPIDefinition } from '@redocly/openapi-docs';
2
2
  import type { OpenAPIMcp } from '@redocly/openapi-docs/lib/types/open-api.js';
3
- import type { RbacConfig } from '@redocly/config';
4
- type GatewayVisibility = {
5
- hide?: boolean;
6
- docs?: {
7
- hide?: boolean;
8
- ignore?: readonly string[];
9
- };
10
- gateway?: {
11
- hide?: boolean;
12
- };
13
- };
14
- /** Whether the gateway fetch capability is on: the feature flag plus none of mcp/docs/gateway hidden. */
15
- export declare function isGatewayCapabilityEnabled(mcp: GatewayVisibility | undefined): boolean;
3
+ import type { RbacConfig, RedoclyConfig } from '@redocly/config';
4
+ /** Whether the gateway fetch capability is on: the feature flag plus none of mcp/docs hidden. */
5
+ export declare function isGatewayCapabilityEnabled(mcp?: RedoclyConfig['mcp']): boolean;
16
6
  /** Whether an API is eligible for the gateway (fetch-capable `execute` + `/mcp` advertisement). */
17
7
  export declare function isGatewayEligible(info: OpenAPIDefinition['info'] | undefined, relativePath: string, rbacConfig: RbacConfig): boolean;
18
8
  /**
@@ -24,7 +14,6 @@ export declare function shouldAdvertiseGatewayXMcp(definition: (OpenAPIDefinitio
24
14
  'x-mcp'?: {
25
15
  servers?: unknown[];
26
16
  };
27
- }) | undefined, relativePath: string, rbacConfig: RbacConfig, mcpConfig: GatewayVisibility | undefined): boolean;
17
+ }) | undefined, relativePath: string, rbacConfig: RbacConfig, mcpConfig?: RedoclyConfig['mcp']): boolean;
28
18
  export declare function buildGatewayXMcp(url: string): OpenAPIMcp;
29
- export {};
30
19
  //# sourceMappingURL=eligibility.d.ts.map
@@ -1 +1 @@
1
- import{join as r}from"node:path";import{PUBLIC_API_DEFINITIONS_FOLDER as s}from"../../../constants/common.js";import{DEFAULT_ANONYMOUS_VISITOR_TEAM as a}from"../../../../constants/common.js";import{canDownloadApiDefinition as n}from"../../../utils/rbac.js";import{MCP_PROTOCOL_VERSION as p}from"../constants.js";import{isApiIncludedInDocsMcp as l}from"../utils.js";import{isMcpGatewayEnabled as c}from"../utils/mode.js";import{isDefinitionHidden as f,hasGatewayConfig as m}from"../utils/xmcp-utils.js";function u(o){return c()&&!o?.hide&&!o?.docs?.hide&&!o?.gateway?.hide}function d(o,e,i){return f(o,"gateway")?!1:n(r(s,e),i,!1,{isAuthenticated:!1,teams:[a]})||m(o)}function D(o,e,i,t){return u(t)&&!o?.["x-mcp"]?.servers?.length&&d(o?.info,e,i)&&l(e,o,t)}function M(o){return{protocolVersion:p,capabilities:{tools:{}},servers:[{url:o}],tools:[],resources:[],prompts:[]}}export{M as buildGatewayXMcp,u as isGatewayCapabilityEnabled,d as isGatewayEligible,D as shouldAdvertiseGatewayXMcp};
1
+ import{join as e}from"node:path";import{PUBLIC_API_DEFINITIONS_FOLDER as s}from"../../../constants/common.js";import{DEFAULT_ANONYMOUS_VISITOR_TEAM as a}from"../../../../constants/common.js";import{canDownloadApiDefinition as n}from"../../../utils/rbac.js";import{MCP_PROTOCOL_VERSION as p}from"../constants.js";import{isApiIncludedInDocsMcp as c}from"../utils.js";import{isMcpGatewayEnabled as l}from"../utils/mode.js";import{isDefinitionHidden as m,hasGatewayConfig as f}from"../utils/xmcp-utils.js";function u(o){return l()&&!o?.hide&&!o?.docs?.hide}function d(o,i,r){return m(o,"gateway")?!1:n(e(s,i),r,!1,{isAuthenticated:!1,teams:[a]})||f(o)}function D(o,i,r,t){return u(t)&&!o?.["x-mcp"]?.servers?.length&&d(o?.info,i,r)&&c(i,o,t)}function M(o){return{protocolVersion:p,capabilities:{tools:{}},servers:[{url:o}],tools:[],resources:[],prompts:[]}}export{M as buildGatewayXMcp,u as isGatewayCapabilityEnabled,d as isGatewayEligible,D as shouldAdvertiseGatewayXMcp};
@@ -1,13 +1,13 @@
1
1
  import type { OpenAPIServer } from '@redocly/openapi-docs/lib/types/open-api.js';
2
2
  /**
3
- * Build case-insensitive host matchers from an API's server URL templates (plus any
4
- * configured extra hosts). A server URL host may contain server-variable placeholders
5
- * (e.g. a tenant `{subdomain}`); each placeholder expands to its `enum` values, or - when
6
- * free-form - to one DNS label plus any fixed parent domain carried by the variable's
7
- * `default`. So `{subdomain}.dealpos.com` matches `acme.dealpos.com`, and a whole-host
8
- * `{subdomain}` defaulting to `acme.dealpos.net` matches `<tenant>.dealpos.net`, but neither
9
- * matches `a.b.dealpos.com`, the bare parent domain, or an unrelated host.
3
+ * Build case-insensitive host matchers from an API's server URL templates. A server URL host
4
+ * may contain server-variable placeholders (e.g. a tenant `{subdomain}`); each placeholder
5
+ * expands to its `enum` values, or - when free-form - to one DNS label plus any fixed parent
6
+ * domain carried by the variable's `default`. So `{subdomain}.dealpos.com` matches
7
+ * `acme.dealpos.com`, and a whole-host `{subdomain}` defaulting to `acme.dealpos.net` matches
8
+ * `<tenant>.dealpos.net`, but neither matches `a.b.dealpos.com`, the bare parent domain, or an
9
+ * unrelated host.
10
10
  */
11
- export declare function buildAllowedHostMatchers(servers?: readonly OpenAPIServer[], extraHosts?: readonly string[]): RegExp[];
11
+ export declare function buildAllowedHostMatchers(servers?: readonly OpenAPIServer[]): RegExp[];
12
12
  export declare function isHostAllowed(host: string, matchers: readonly RegExp[]): boolean;
13
13
  //# sourceMappingURL=allowed-hosts.d.ts.map
@@ -1 +1 @@
1
- const i=/\{([^}]+)\}/g;function m(n=[],e=[]){const t=[];for(const r of n){const o=u(r);o&&t.push(o)}for(const r of e){const o=h(r);o&&t.push(o)}return t}function p(n,e){return e.some(t=>t.test(n))}function u(n){const e=f(n.url);if(!e)return null;let t="",r=0;for(const o of e.matchAll(i)){const[c,l]=o;t+=s(e.slice(r,o.index)),t+=a(n.variables?.[l]),r=o.index+c.length}return t+=s(e.slice(r)),t.includes("\\.")?new RegExp(`^${t}$`,"i"):null}function a(n){const e=n?.enum?.filter(Boolean);if(e&&e.length>0)return`(?:${e.map(s).join("|")})`;const t=n?.default?.split(".").slice(1).join(".");return t?`[^.]+\\.${s(t)}`:"[^.]+"}function h(n){const e=n.trim().toLowerCase();return e?e.startsWith("*.")?new RegExp(`^[^.]+\\.${s(e.slice(2))}$`,"i"):new RegExp(`^${s(e)}$`,"i"):null}function f(n){if(!n)return null;const t=n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0];return t&&(t.includes("@")?t.slice(t.lastIndexOf("@")+1):t).replace(/:(?:\d+|\{[^}]+\})$/,"")||null}function s(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{m as buildAllowedHostMatchers,p as isHostAllowed};
1
+ const h=/\{([^}]+)\}/g;function g(n=[]){const e=[];for(const t of n){const r=p(t);r&&e.push(r)}return e}function x(n,e){return e.some(t=>t.test(n))}function p(n){const e=m(n.url);if(!e)return null;let t="",r=0,o=!1;for(const l of e.matchAll(h)){const[i,f]=l,c=e.slice(r,l.index);c.includes(".")&&(o=!0),t+=s(c);const u=d(n.variables?.[f]);u.guaranteesDot&&(o=!0),t+=u.pattern,r=l.index+i.length}const a=e.slice(r);return a.includes(".")&&(o=!0),t+=s(a),o?new RegExp(`^${t}$`,"i"):null}function d(n){const e=n?.enum?.filter(Boolean);if(e&&e.length>0)return{pattern:`(?:${e.map(s).join("|")})`,guaranteesDot:e.every(r=>r.includes("."))};const t=n?.default?.split(".").slice(1).join(".");return t?{pattern:`[^.]+\\.${s(t)}`,guaranteesDot:!0}:{pattern:"[^.]+",guaranteesDot:!1}}function m(n){if(!n)return null;const t=n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0];return t&&(t.includes("@")?t.slice(t.lastIndexOf("@")+1):t).replace(/:(?:\d+|\{[^}]+\})$/,"")||null}function s(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{g as buildAllowedHostMatchers,x as isHostAllowed};
@@ -1,12 +1,26 @@
1
+ import { Agent, type Dispatcher } from 'undici';
1
2
  import type { SandboxFetch } from '../../codemode/types.js';
3
+ import type { UpstreamAuthRequiredEvent } from '../upstream-auth.js';
4
+ import type { StoredSecret } from '../secret-store.js';
5
+ export declare const ssrfSafeAgent: Agent;
6
+ export type FetchBridgeApi = {
7
+ slug: string;
8
+ name: string;
9
+ matchers: readonly RegExp[];
10
+ secret?: StoredSecret;
11
+ };
2
12
  type FetchBridgeOptions = {
3
13
  allowedHosts: readonly RegExp[];
14
+ apis?: readonly FetchBridgeApi[];
4
15
  authorization?: string;
16
+ onAuthRequired?: (event: UpstreamAuthRequiredEvent) => void;
5
17
  fetchImpl?: typeof fetch;
18
+ dispatcher?: Dispatcher;
6
19
  timeoutMs?: number;
7
20
  maxResponseBytes?: number;
8
21
  };
9
22
  /** Build the host-side `fetch` the gateway sandbox calls. */
10
- export declare function buildFetchBridge({ allowedHosts, authorization, fetchImpl, timeoutMs, maxResponseBytes, }: FetchBridgeOptions): SandboxFetch;
23
+ export declare function buildFetchBridge({ allowedHosts, apis, authorization, onAuthRequired, fetchImpl, dispatcher, timeoutMs, maxResponseBytes, }: FetchBridgeOptions): SandboxFetch;
24
+ export declare function readCappedBody(response: Response, maxBytes: number): Promise<string>;
11
25
  export {};
12
26
  //# sourceMappingURL=fetch-bridge.d.ts.map