@redocly/redoc-reef 0.136.0-next.4 → 0.136.0-next.6

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 (127) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/client/ErrorBoundary.js +1 -1
  3. package/dist/client/app/Sidebar/helpers/hide-empty-separators.d.ts +13 -0
  4. package/dist/client/app/Sidebar/helpers/hide-empty-separators.js +1 -0
  5. package/dist/client/app/Sidebar/utils.js +1 -1
  6. package/dist/client/app/l10n/hooks/useTranslate.js +1 -1
  7. package/dist/client/app/l10n/initL10n.js +1 -1
  8. package/dist/client/app/utils/same-resolved-route.d.ts +5 -0
  9. package/dist/client/app/utils/same-resolved-route.js +1 -0
  10. package/dist/client/providers/post-message/PostMessageProvider.js +1 -1
  11. package/dist/client/templates/openapi-docs/helpers.d.ts +1 -1
  12. package/dist/client/templates/openapi-docs/helpers.js +2 -2
  13. package/dist/constants/common.d.ts +13 -1
  14. package/dist/constants/common.js +1 -1
  15. package/dist/server/config/env-config.d.ts +2 -4
  16. package/dist/server/config/env-schema.d.ts +5 -10
  17. package/dist/server/config/env-schemas/feature-flags.d.ts +4 -8
  18. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  19. package/dist/server/constants/common.d.ts +2 -0
  20. package/dist/server/constants/common.js +1 -1
  21. package/dist/server/constants/entitlements.js +1 -1
  22. package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
  23. package/dist/server/plugins/markdown/search/create-render-tag-fn.d.ts +2 -1
  24. package/dist/server/plugins/markdown/search/create-render-tag-fn.js +1 -1
  25. package/dist/server/plugins/markdown/search/get-ai-search-documents.js +9 -9
  26. package/dist/server/plugins/mcp/auth/auth-handlers.d.ts +1 -0
  27. package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
  28. package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
  29. package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +27 -0
  30. package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +2 -0
  31. package/dist/server/plugins/mcp/gateway-mcp/eligibility.d.ts +4 -15
  32. package/dist/server/plugins/mcp/gateway-mcp/eligibility.js +1 -1
  33. package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.d.ts +8 -8
  34. package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.js +1 -1
  35. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.d.ts +17 -1
  36. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
  37. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-errors.d.ts +11 -0
  38. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-errors.js +1 -0
  39. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-telemetry.d.ts +13 -0
  40. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-telemetry.js +1 -0
  41. package/dist/server/plugins/mcp/gateway-mcp/fetch/redact.d.ts +4 -0
  42. package/dist/server/plugins/mcp/gateway-mcp/fetch/redact.js +1 -0
  43. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-blocklist.d.ts +22 -0
  44. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-blocklist.js +1 -0
  45. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.d.ts +1 -1
  46. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.js +1 -1
  47. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-safe-lookup.d.ts +13 -0
  48. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-safe-lookup.js +1 -0
  49. package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.d.ts +8 -1
  50. package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.js +1 -1
  51. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/apply-edge-rate-limit.d.ts +3 -0
  52. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/apply-edge-rate-limit.js +1 -0
  53. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/edge-limiter.d.ts +16 -0
  54. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/edge-limiter.js +1 -0
  55. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/ip-key.d.ts +2 -0
  56. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/ip-key.js +1 -0
  57. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/limits.d.ts +7 -0
  58. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/limits.js +1 -0
  59. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/window-counter.d.ts +15 -0
  60. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/window-counter.js +1 -0
  61. package/dist/server/plugins/mcp/gateway-mcp/secret-store.d.ts +24 -0
  62. package/dist/server/plugins/mcp/gateway-mcp/secret-store.js +1 -0
  63. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.d.ts +18 -0
  64. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.js +1 -0
  65. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.d.ts +10 -0
  66. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.js +1 -0
  67. package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
  68. package/dist/server/plugins/mcp/handlers/errors.d.ts +3 -3
  69. package/dist/server/plugins/mcp/handlers/errors.js +1 -1
  70. package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
  71. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.d.ts +5 -0
  72. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +101 -0
  73. package/dist/server/plugins/mcp/index.d.ts +1 -0
  74. package/dist/server/plugins/mcp/index.js +1 -1
  75. package/dist/server/plugins/mcp/servers/docs-server.d.ts +5 -2
  76. package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
  77. package/dist/server/plugins/mcp/servers/mcp-server.d.ts +13 -2
  78. package/dist/server/plugins/mcp/servers/mcp-server.js +1 -1
  79. package/dist/server/plugins/mcp/servers/session-manager.d.ts +15 -0
  80. package/dist/server/plugins/mcp/servers/session-manager.js +1 -0
  81. package/dist/server/plugins/mcp/types.d.ts +9 -12
  82. package/dist/server/plugins/mcp/utils/jwt.d.ts +0 -9
  83. package/dist/server/plugins/mcp/utils/jwt.js +1 -1
  84. package/dist/server/plugins/mcp/utils/mode.d.ts +12 -2
  85. package/dist/server/plugins/mcp/utils/mode.js +1 -1
  86. package/dist/server/plugins/mcp/utils/telemetry-attributes.d.ts +8 -0
  87. package/dist/server/plugins/mcp/utils/telemetry-attributes.js +1 -0
  88. package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
  89. package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.js +1 -1
  90. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +16 -16
  91. package/dist/server/plugins/openapi-docs/utils.js +1 -1
  92. package/dist/server/plugins/sso/index.js +1 -1
  93. package/dist/server/sandbox/types.d.ts +3 -2
  94. package/dist/server/sandbox/utils/execution-budget.d.ts +4 -3
  95. package/dist/server/sandbox/utils/execution-budget.js +1 -1
  96. package/dist/server/types/plugins/markdown.d.ts +2 -2
  97. package/dist/server/utils/crypto/constants.d.ts +5 -0
  98. package/dist/server/utils/crypto/constants.js +1 -0
  99. package/dist/server/utils/crypto/decrypt-aes-gcm.d.ts +6 -0
  100. package/dist/server/utils/crypto/decrypt-aes-gcm.js +1 -0
  101. package/dist/server/utils/crypto/decrypt-claim-value.d.ts +6 -0
  102. package/dist/server/utils/crypto/decrypt-claim-value.js +1 -0
  103. package/dist/server/utils/crypto/derive-key.d.ts +5 -0
  104. package/dist/server/utils/crypto/derive-key.js +1 -0
  105. package/dist/server/utils/crypto/encrypt-aes-gcm.d.ts +6 -0
  106. package/dist/server/utils/crypto/encrypt-aes-gcm.js +1 -0
  107. package/dist/server/utils/crypto/encrypt-claim-value.d.ts +6 -0
  108. package/dist/server/utils/crypto/encrypt-claim-value.js +1 -0
  109. package/dist/server/utils/l10n/get-build-translate-context.d.ts +7 -0
  110. package/dist/server/utils/l10n/get-build-translate-context.js +1 -0
  111. package/dist/server/utils/rbac.d.ts +4 -0
  112. package/dist/server/utils/rbac.js +1 -1
  113. package/dist/server/web-server/auth.d.ts +33 -3
  114. package/dist/server/web-server/auth.js +3 -3
  115. package/dist/server/web-server/handle-api-route-request.js +1 -1
  116. package/dist/server/web-server/routes/api-routes/api-routes.js +1 -1
  117. package/dist/server/web-server/routes/auth.js +1 -1
  118. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.d.ts +5 -2
  119. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
  120. package/dist/server/web-server/routes/mcp-routes/mcp-routes.js +1 -1
  121. package/dist/server/workers/worker-pool.js +1 -1
  122. package/dist/types/entitlements.d.ts +6 -1
  123. package/dist/utils/l10n/build-i18n-config.d.ts +24 -0
  124. package/dist/utils/l10n/build-i18n-config.js +1 -0
  125. package/dist/utils/l10n/create-translate.d.ts +19 -0
  126. package/dist/utils/l10n/create-translate.js +1 -0
  127. package/package.json +11 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @redocly/redoc-reef
2
2
 
3
+ ## 0.136.0-next.6
4
+
5
+ ### Minor Changes
6
+
7
+ - 8c1feb665fa: Added team-based access control for the MCP server using the `rbac.features.mcp` configuration to restrict access per team, similar to how `rbac.features.aiSearch` controls AI search access.
8
+
9
+ ### Patch Changes
10
+
11
+ - ee1f316d325: Fixed an issue where mock server requests in hosted projects failed with a 500 error due to restricted API access.
12
+ - 5b0ce5ffa64: Fixed editor-to-Webview navigation for API operations rendered as anchors on a single page
13
+ - 696e6673957: Fixed an issue on iOS devices where the on-screen keyboard caused the search and AI Assistant's inputs to overflow the screen making the send button inaccessible.
14
+ - 1ba0268431e: Fixed an issue where callbacks and other collapsible panels in API docs could not be expanded.
15
+ - 8e9a1f74be4: Fixed an issue where multiple adjacent separators in the sidebar rendered only the last one.
16
+ - Updated dependencies [696e6673957]
17
+ - Updated dependencies [1ba0268431e]
18
+ - Updated dependencies [8e9a1f74be4]
19
+ - @redocly/theme@0.68.0-next.4
20
+ - @redocly/openapi-docs@3.24.0-next.6
21
+ - @redocly/asyncapi-docs@1.13.0-next.6
22
+ - @redocly/graphql-docs@1.13.0-next.6
23
+ - @redocly/portal-plugin-mock-server@0.21.0-next.6
24
+
25
+ ## 0.136.0-next.5
26
+
27
+ ### Minor Changes
28
+
29
+ - f7bb0ce633c: Added support for automatic access token refresh for the MCP server.
30
+ MCP clients keep long-running sessions alive without repeated browser logins.
31
+
32
+ ### Patch Changes
33
+
34
+ - 12eed09e5b6: Fixed an issue in API docs where documented array items were not displayed in a nested indexed row.
35
+ - a8f19de21ab: Fixed security vulnerabilities `CVE-2026-59896`, `CVE-2026-59895`, and `CVE-2026-59897` by upgrading `hono` to version `4.12.27`.
36
+ - 50ec00284cd: Updated `@redocly/openapi-core` to version `2.40.0`.
37
+ - a8f19de21ab: Fixed security vulnerability `GHSA-c2j3-45gr-mqc4` by upgrading `dompurify` to version `3.4.12`.
38
+ - a8f19de21ab: Fixed security vulnerability `CVE-2026-59869` by upgrading `js-yaml` to version `4.3.0`.
39
+ - Updated dependencies [12eed09e5b6]
40
+ - Updated dependencies [50ec00284cd]
41
+ - Updated dependencies [a8f19de21ab]
42
+ - Updated dependencies [339a4748440]
43
+ - Updated dependencies [a8f19de21ab]
44
+ - @redocly/openapi-docs@3.24.0-next.5
45
+ - @redocly/theme@0.68.0-next.3
46
+ - @redocly/asyncapi-docs@1.13.0-next.5
47
+ - @redocly/graphql-docs@1.13.0-next.5
48
+ - @redocly/portal-plugin-mock-server@0.21.0-next.5
49
+
3
50
  ## 0.136.0-next.4
4
51
 
5
52
  ### Minor 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};
@@ -0,0 +1,13 @@
1
+ import type { ItemState } from '@redocly/theme/core/types';
2
+ /**
3
+ * Removes separators marked with `hideWhenEmpty` (set by OpenAPI sidebar
4
+ * generation) whose section is empty — i.e. the separator has no non-separator
5
+ * sibling before the next separator or the end of the array. RBAC filtering and
6
+ * empty-group pruning already ran server-side, so an empty section here means
7
+ * the item immediately after the separator is another separator or absent.
8
+ *
9
+ * Authored separators carry no `hideWhenEmpty` flag and are always kept,
10
+ * including deliberate consecutive separators.
11
+ */
12
+ export declare function hideEmptyFlaggedSeparators(items: ItemState[]): ItemState[];
13
+ //# sourceMappingURL=hide-empty-separators.d.ts.map
@@ -0,0 +1 @@
1
+ const n=e=>e.type==="separator";function o(e){return e.filter((r,a)=>{if(!n(r)||!r.hideWhenEmpty)return!0;const t=e[a+1];return t!==void 0&&!n(t)})}export{o as hideEmptyFlaggedSeparators};
@@ -1 +1 @@
1
- import{withPathPrefix as p}from"@redocly/theme/core/utils";import{removeTrailingSlash as a}from"../../../utils/url/remove-trailing-slash";import{isAbsoluteUrl as c}from"../../../utils/url/is-absolute-url";function P(t,n,r=""){return t.map(e=>{const s=m(e,r,n),o=u(e,r,n);return{...e,items:P(e.items||[],n,r),active:s&&!o,hasActiveSubItem:o}}).filter(Boolean)}function m(t,n="",r){if(!t.link||c(t.link))return!1;const[e,s]=t.link.split("#"),o=r.pathname,i=k(o,e),h=decodeURIComponent(a(p(i))),l=decodeURIComponent(a(o));if(n)return h===a(n)||s===n;if(s){const f=r.hash?r.hash.substring(1):"";return s===f}else return h===l}function u(t,n="",r){return(t.items||[]).some(s=>m(s,n,r)||u(s,n,r))}function k(t,n){const r=new URL(t,"http://localhost");return new URL(n,r.href).pathname}export{P as mapItemsPropsToState};
1
+ import{withPathPrefix as f}from"@redocly/theme/core/utils";import{removeTrailingSlash as m}from"../../../utils/url/remove-trailing-slash";import{isAbsoluteUrl as c}from"../../../utils/url/is-absolute-url";import{hideEmptyFlaggedSeparators as P}from"./helpers/hide-empty-separators";function k(n,r,t=""){const s=n.map(e=>{const o=i(e,t,r),a=l(e,t,r);return{...e,items:k(e.items||[],r,t),active:o&&!a,hasActiveSubItem:a}}).filter(Boolean);return P(s)}function i(n,r="",t){if(!n.link||c(n.link))return!1;const[s,e]=n.link.split("#"),o=t.pathname,a=U(o,s),h=decodeURIComponent(m(f(a))),u=decodeURIComponent(m(o));if(r)return h===m(r)||e===r;if(e){const p=t.hash?t.hash.substring(1):"";return e===p}else return h===u}function l(n,r="",t){return(n.items||[]).some(e=>i(e,r,t)||l(e,r,t))}function U(n,r){const t=new URL(n,"http://localhost");return new URL(r,t.href).pathname}export{k as mapItemsPropsToState};
@@ -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};
@@ -0,0 +1,5 @@
1
+ export declare function isSameResolvedRoute(resolvedRoute: string, location: {
2
+ pathname: string;
3
+ hash: string;
4
+ }, isExplicitUrl: boolean): boolean;
5
+ //# sourceMappingURL=same-resolved-route.d.ts.map
@@ -0,0 +1 @@
1
+ import{normalizeRouteSlug as n}from"../../../utils/path/normalize-route-slug";function r(m,e,o){const[h,s]=m.split("#"),t=n(h)===n(e.pathname),a=(s??"")===e.hash.substring(1);return o?t&&a:t&&(!s||a)}export{r as isSameResolvedRoute};
@@ -1 +1 @@
1
- import s,{createContext as E,useEffect as U}from"react";import{useLocation as L,useNavigate as x}from"react-router-dom";import{useColorSwitcher as O}from"@redocly/theme/core/hooks";import{withPathPrefix as T}from"@redocly/theme/core/utils";import{ServerRoutes as z}from"../../../constants/api";import{removeTrailingSlash as D}from"../../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as P}from"../../../utils/path/normalize-route-slug";import{loadAndNavigate as I}from"../../app/utils/loadAndNavigate";import{resolveRouteBySlug as N}from"../../app/utils/resolveRouteBySlug";import{syncScrollWithEditor as A}from"../../app/utils/syncScrollWithEditor";import{PostMessageConnection as H}from"./PostMessageConnection";import{isHostnameOnDomain as i}from"../../app/utils/isHostnameOnDomain";import{usePageData as _}from"../../app/hooks/usePageData";const B=E({sendMessage:()=>{}});function ae({children:l,enabled:t}){const R=x(),n=L(),c=s.useRef(null),{switchColorMode:h}=O(),p=_()?.templateId,u=s.useCallback(e=>{c.current?.send(e)},[]),f=s.useCallback(async e=>{console.info("[PM] connection initialized."),c.current=new H(e.source,e.origin);const a=await N(n.pathname+n.hash,p).catch(o=>{console.error("Initial route resolve failed with error: ",o.message)});u({type:"initialized",initialRoute:a})},[u,n.pathname,n.hash,p]),g=s.useCallback(async e=>{const{path:a="/",line:o=1,url:m}=e;let r=m;if(!m)try{const d=await fetch(T(z.RESOLVE_ROUTE_BY_PATH),{method:"POST",body:JSON.stringify(a+(o?`:${o}`:""))}),{route:S}=await d.json();r=S?.slug??S?.url??void 0}catch(d){console.error(d)}if(!r)return;r=r==="/"?"/":D(r);const[v,C]=r.split("#"),y=P(v)===P(n.pathname),M=(C??"")===n.hash.substring(1);(m?y&&M:y)||(console.info("[PM] Update route to: ",r),await I({navigate:R,to:r,origin:"pm"}))},[n]),w=s.useCallback(async e=>{const{action:a}=e;switch(a){case"back":window.history.back();break;case"forward":window.history.forward();break;case"reload":window.location.reload();break}},[]),b=s.useCallback(e=>{window.scrollTo({top:e.position.absolute,behavior:"instant"})},[]),k=s.useCallback(e=>{h(e.colorSchema)},[h]);return U(()=>{if(!t)return;const e=async a=>{if(!j(a.origin))return;const o=a.data;switch(o.type){case"initialize":f(a);break;case"route-update":if(!c.current)return;g(o);break;case"location-update":if(!c.current)return;w(o);break;case"scroll-update":if(!c.current)return;b(o);break;case"editor-scroll-update":if(!c.current)return;A(o.percentScrolled,o.sequenceNumber);break;case"color-schema-update":if(!c.current)return;k(o);break}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t,f,g,w,b,k]),s.createElement(B.Provider,{value:{sendMessage:u}},l)}function j(l){const t=new URL(l);return i(t.hostname,"localhost")||i(t.hostname,"127.0.0.1")||i(t.hostname,"blueharvest.cloud")||i(t.hostname,"bhstage.cloud")||i(t.hostname,"cloud.redocly.com")||i(t.hostname,"cloud.eu.redocly.com")||i(t.hostname,"cba.au.redocly.com")}export{B as PostMessageContext,ae as PostMessageProvider};
1
+ import n,{createContext as v,useEffect as P}from"react";import{useLocation as S,useNavigate as C}from"react-router-dom";import{useColorSwitcher as M}from"@redocly/theme/core/hooks";import{withPathPrefix as E}from"@redocly/theme/core/utils";import{ServerRoutes as U}from"../../../constants/api";import{removeTrailingSlash as L}from"../../../utils/url/remove-trailing-slash";import{loadAndNavigate as x}from"../../app/utils/loadAndNavigate";import{resolveRouteBySlug as O}from"../../app/utils/resolveRouteBySlug";import{isSameResolvedRoute as T}from"../../app/utils/same-resolved-route";import{syncScrollWithEditor as D}from"../../app/utils/syncScrollWithEditor";import{PostMessageConnection as I}from"./PostMessageConnection";import{isHostnameOnDomain as c}from"../../app/utils/isHostnameOnDomain";import{usePageData as N}from"../../app/hooks/usePageData";const z=v({sendMessage:()=>{}});function Z({children:l,enabled:t}){const R=C(),i=S(),s=n.useRef(null),{switchColorMode:h}=M(),p=N()?.templateId,u=n.useCallback(e=>{s.current?.send(e)},[]),f=n.useCallback(async e=>{console.info("[PM] connection initialized."),s.current=new I(e.source,e.origin);const a=await O(i.pathname+i.hash,p).catch(o=>{console.error("Initial route resolve failed with error: ",o.message)});u({type:"initialized",initialRoute:a})},[u,i.pathname,i.hash,p]),w=n.useCallback(async e=>{const{path:a="/",line:o=1,url:d}=e;let r=d;if(!d)try{const m=await fetch(E(U.RESOLVE_ROUTE_BY_PATH),{method:"POST",body:JSON.stringify(a+(o?`:${o}`:""))}),{route:y}=await m.json();r=y?.slug??y?.url??void 0}catch(m){console.error(m)}if(!r)return;r=r==="/"?"/":L(r),T(r,i,!!d)||(console.info("[PM] Update route to: ",r),await x({navigate:R,to:r,origin:"pm"}))},[i]),g=n.useCallback(async e=>{const{action:a}=e;switch(a){case"back":window.history.back();break;case"forward":window.history.forward();break;case"reload":window.location.reload();break}},[]),b=n.useCallback(e=>{window.scrollTo({top:e.position.absolute,behavior:"instant"})},[]),k=n.useCallback(e=>{h(e.colorSchema)},[h]);return P(()=>{if(!t)return;const e=async a=>{if(!A(a.origin))return;const o=a.data;switch(o.type){case"initialize":f(a);break;case"route-update":if(!s.current)return;w(o);break;case"location-update":if(!s.current)return;g(o);break;case"scroll-update":if(!s.current)return;b(o);break;case"editor-scroll-update":if(!s.current)return;D(o.percentScrolled,o.sequenceNumber);break;case"color-schema-update":if(!s.current)return;k(o);break}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t,f,w,g,b,k]),n.createElement(z.Provider,{value:{sendMessage:u}},l)}function A(l){const t=new URL(l);return c(t.hostname,"localhost")||c(t.hostname,"127.0.0.1")||c(t.hostname,"blueharvest.cloud")||c(t.hostname,"bhstage.cloud")||c(t.hostname,"cloud.redocly.com")||c(t.hostname,"cloud.eu.redocly.com")||c(t.hostname,"cba.au.redocly.com")}export{z as PostMessageContext,Z as PostMessageProvider};
@@ -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
  };
@@ -50,7 +51,8 @@ export declare enum FEEDBACK_TYPES {
50
51
  SCALE = "scale"
51
52
  }
52
53
  export declare enum RbacFeatures {
53
- AI_SEARCH = "aiSearch"
54
+ AI_SEARCH = "aiSearch",
55
+ MCP = "mcp"
54
56
  }
55
57
  export declare const DEV_LOGIN_SLUG = "/login";
56
58
  export declare const INVITE_SLUG = "/invite";
@@ -103,6 +105,16 @@ export declare const FEATURE: {
103
105
  readonly aiSearchLimit: 'aiSearchLimit';
104
106
  readonly kvStorageLimit: 'kvStorageLimit';
105
107
  readonly mcp: 'mcp';
108
+ readonly mcpGateway: 'mcpGateway';
109
+ readonly mcpMode: 'mcpMode';
110
+ readonly gatewayFetchRatePerMin: 'gatewayFetchRatePerMin';
111
+ readonly gatewayFetchQuotaPerDay: 'gatewayFetchQuotaPerDay';
112
+ readonly gatewayFetchBudgetPerExec: 'gatewayFetchBudgetPerExec';
106
113
  readonly banner: 'banner';
107
114
  };
115
+ export declare const GATEWAY_FETCH_LIMIT_DEFAULTS: {
116
+ readonly ratePerMin: 60;
117
+ readonly quotaPerDay: 2000;
118
+ readonly budgetPerExec: 25;
119
+ };
108
120
  //# 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 s={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="*",d={[c]:"read"},L=["openid","email"],O=1440*60,T=720*60*60,I="anonymous",R="authenticated",l="**",x="Reunite",C="translations.yaml",P="redocly.yaml",D="@redocly/theme",N="@theme",g="@skills",m="SKILL.md",u="/.well-known/agent-skills",M="/.well-known/agent-card.json",U="/a2a",F="/.well-known/mcp/server-card.json",h="/app-data.json",y="/eject-component";var t;(function(e){e.BUILD="build",e.DEVELOP="develop",e.PREPARE="prepare"})(t||(t={}));var o;(function(e){e.RATING="rating",e.SENTIMENT="sentiment",e.COMMENT="comment",e.MOOD="mood",e.PROBLEM="problem",e.SCALE="scale"})(o||(o={}));var r;(function(e){e.AI_SEARCH="aiSearch",e.MCP="mcp"})(r||(r={}));const k="/login",b="/invite",G={AUTH0_PASS:"/auth/auth0-pass"},v={NotExist:"ENOENT"},H="default_locale",w="sidebar-",K="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"],a="redocly_category",j="redocly_product",q="redocly_version",Q="redocly_teams",X=a,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",gatewayFetchRatePerMin:"gatewayFetchRatePerMin",gatewayFetchQuotaPerDay:"gatewayFetchQuotaPerDay",gatewayFetchBudgetPerExec:"gatewayFetchBudgetPerExec",banner:"banner"},z={ratePerMin:60,quotaPerDay:2e3,budgetPerExec:25};export{U as A2A_SLUG,M as AGENT_CARD_SLUG,u as AGENT_SKILLS_BASE,E as ASYNC_API_DOCS_TEMPLATE_ID,s as AuthCookieNames,B as BRANCH_ENV_PREFIX,P as CONFIG_FILE_NAME,A as CUSTOM_MARKDOC_OPTIONS_PATH,S as CUSTOM_MARKDOC_TAGS_PATH,I as DEFAULT_ANONYMOUS_VISITOR_TEAM,R as DEFAULT_AUTHENTICATED_TEAM,O as DEFAULT_COOKIE_EXPIRATION,H as DEFAULT_LOCALE_PLACEHOLDER,l as DEFAULT_RBAC_SCOPE,x as DEFAULT_SSO_IDP_TITLE,D as DEFAULT_THEME_NAME,k as DEV_LOGIN_SLUG,y as EJECT_COMPONENT_URL,G as ExternalRoutes,W as FEATURE,o as FEEDBACK_TYPES,v as FsErrors,z as GATEWAY_FETCH_LIMIT_DEFAULTS,h as GLOBAL_DATA_URL,i as GRAPHQL_SPEC_SLUG,p as GRAPHQL_TEMPLATE_ID,b as INVITE_SLUG,f as MARKDOC_ERROR_TYPES,F as MCP_SERVER_CARD_SLUG,_ as OPENAPI_DOCS_TEMPLATE_ID,T as POST_LOGOUT_COOKIE_EXPIRATION,n as POST_LOGOUT_COOKIE_NAME,K as PUBLIC_ENV_PREFIX,d as PUBLIC_RBAC_SCOPE_ITEM,c as RBAC_ALL_OTHER_TEAMS,L as REQUIRED_OIDC_SCOPES,r as RbacFeatures,a as SEARCH_CATEGORY_FIELD,X as SEARCH_GROUP_FACET_FIELD,j as SEARCH_PRODUCT_FIELD,Q as SEARCH_RBAC_FIELD,q as SEARCH_VERSION_FIELD,w as SIDEBAR_PREFIX,C as TRANSLATIONS_FILE_NAME,V as UI_ACCESSIBLE_CONFIG_PROPS,g as USER_SKILLS_ALIAS,m 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
+ /** Prompt for upstream API credentials via URL-mode elicitation. Enabled by default wherever the gateway capability is enabled; set to `false` to disable. */
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
+ import{GATEWAY_FETCH_LIMIT_DEFAULTS as e}from"../../constants/common.js";const a={pro:{rbac:!1,sso:!1,analytics:!0,removeAttribution:!1,advancedSearch:!1,ssoDirect:!1,aiSearchLimit:0,kvStorageLimit:.5,mcp:!1,mcpGateway:!1,mcpMode:"tools",gatewayFetchRatePerMin:e.ratePerMin,gatewayFetchQuotaPerDay:e.quotaPerDay,gatewayFetchBudgetPerExec:e.budgetPerExec},enterprise:{rbac:!0,sso:!0,analytics:!0,removeAttribution:!0,advancedSearch:!0,ssoDirect:!1,aiSearchLimit:750,kvStorageLimit:5,mcp:!0,mcpGateway:!0,mcpMode:"code",gatewayFetchRatePerMin:e.ratePerMin,gatewayFetchQuotaPerDay:e.quotaPerDay,gatewayFetchBudgetPerExec:e.budgetPerExec}},r=["@redocly/portal-plugin-async-api/plugin.js","@redocly/portal-plugin-mock-server/plugin.js","@redocly/portal-plugin-soap-api/plugin.js"],o={"code-walkthrough":"codeWalkthrough",step:"codeWalkthrough",toggle:"codeWalkthrough",input:"codeWalkthrough"};export{o as GATED_MARKDOC_TAGS,r as GATED_PLUGINS,a 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};
@@ -9,5 +9,6 @@ export declare function handleMcpAuth(request: Request, context: ApiFunctionsCon
9
9
  accessToken?: string;
10
10
  }>;
11
11
  export declare function constructUnauthorizedResponse(baseUrl: string): Response;
12
+ export declare function constructForbiddenResponse(): Response;
12
13
  export declare function constructInvalidTokenResponse(): Response;
13
14
  //# sourceMappingURL=auth-handlers.d.ts.map
@@ -1 +1 @@
1
- import{extractTokenFromAuthHeader as u}from"../../../plugins/mcp/utils/jwt.js";import{getUserParamsFromCookies as d}from"../../../web-server/auth.js";import{ServerRoutes as l}from"../../../../constants/api.js";import{DEFAULT_ANONYMOUS_VISITOR_TEAM as i,RBAC_ALL_OTHER_TEAMS as a}from"../../../../constants/common.js";import{withPathPrefix as h}from"@redocly/theme/core/utils";function c(e){return!e||typeof e!="object"||Object.keys(e).length===0?!1:!(e[i]&&e[i]!=="none"||e[a]&&e[a]!=="none")}function f(e,t){if(!t||Object.keys(t).length===0)return e;const r=t.content;if(r&&Object.keys(r).length>0&&Object.values(r).some(c))return!0;const o=t.teamFoldersBaseRoles;return c(o)?!0:e}function O(e){const t=e.getConfig().access;return f(!!t?.requiresLogin,t?.rbac||{})}async function _(e,t){const r=e.headers.get("Authorization");if(!r)return{isAuthenticated:!1};const o=u(r),s=t?.config?.ssoDirect||{},n=o?await d(s,{authorization:o}):{};return o&&n&&n.isAuthenticated?{isAuthenticated:!0,isTokenValid:!0,currentUser:{teams:n.teams||[],email:n.email||"",claims:n,isAuthenticated:!0,idpAccessToken:n.idpAccessToken||void 0,idpId:n.idpId||void 0},accessToken:o}:{isAuthenticated:!1,isTokenValid:!1}}function g(e){return e=e.replace(/^http:\/\//,"https://"),new Response(JSON.stringify({error:"unauthorized",message:"Authentication required"}),{status:401,headers:{"Content-Type":"application/json","WWW-Authenticate":`Bearer resource_metadata="${e}${l.MCP_OAUTH_PROTECTED_RESOURCE}${h("/mcp")}"`,"Access-Control-Allow-Origin":"*"}})}function x(){return new Response(JSON.stringify({error:"invalid_token",message:"Invalid or expired token"}),{status:401,headers:{"Content-Type":"application/json","WWW-Authenticate":'Bearer error="invalid_token", error_description="Invalid or expired token"',"Access-Control-Allow-Origin":"*"}})}export{x as constructInvalidTokenResponse,g as constructUnauthorizedResponse,_ as handleMcpAuth,O as isMcpContentProtected,f as shouldHandleMcpAuth};
1
+ import{extractTokenFromAuthHeader as u}from"../../../plugins/mcp/utils/jwt.js";import{getUserParamsFromCookies as d}from"../../../web-server/auth.js";import{ServerRoutes as l}from"../../../../constants/api.js";import{DEFAULT_ANONYMOUS_VISITOR_TEAM as a,RBAC_ALL_OTHER_TEAMS as c,RbacFeatures as f}from"../../../../constants/common.js";import{withPathPrefix as p}from"@redocly/theme/core/utils";function i(e){return!e||typeof e!="object"||Object.keys(e).length===0?!1:!(e[a]&&e[a]!=="none"||e[c]&&e[c]!=="none")}function h(e,t){if(!t||Object.keys(t).length===0)return e;const r=t.content;if(r&&Object.keys(r).length>0&&Object.values(r).some(i))return!0;const s=t.teamFoldersBaseRoles;if(i(s))return!0;const o=t.features;return i(o?.[f.MCP])?!0:e}function g(e){const t=e.getConfig().access;return h(!!t?.requiresLogin,t?.rbac||{})}async function C(e,t){const r=e.headers.get("Authorization");if(!r)return{isAuthenticated:!1};const s=u(r),o=t?.config?.ssoDirect||{},n=s?await d(o,{authorization:s}):{};return s&&n&&n.isAuthenticated?{isAuthenticated:!0,isTokenValid:!0,currentUser:{teams:n.teams||[],email:n.email||"",claims:n,isAuthenticated:!0,idpAccessToken:n.idpAccessToken||void 0,idpId:n.idpId||void 0},accessToken:s}:{isAuthenticated:!1,isTokenValid:!1}}function _(e){return e=e.replace(/^http:\/\//,"https://"),new Response(JSON.stringify({error:"unauthorized",message:"Authentication required"}),{status:401,headers:{"Content-Type":"application/json","WWW-Authenticate":`Bearer resource_metadata="${e}${l.MCP_OAUTH_PROTECTED_RESOURCE}${p("/mcp")}"`,"Access-Control-Allow-Origin":"*"}})}function y(){return new Response(JSON.stringify({error:"forbidden",message:"You do not have access to this MCP server"}),{status:403,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}function x(){return new Response(JSON.stringify({error:"invalid_token",message:"Invalid or expired token"}),{status:401,headers:{"Content-Type":"application/json","WWW-Authenticate":'Bearer error="invalid_token", error_description="Invalid or expired token"',"Access-Control-Allow-Origin":"*"}})}export{y as constructForbiddenResponse,x as constructInvalidTokenResponse,_ as constructUnauthorizedResponse,C as handleMcpAuth,g as isMcpContentProtected,h as shouldHandleMcpAuth};
@@ -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,27 @@
1
+ import type { UpstreamAuthRequiredEvent } from './upstream-auth.js';
2
+ import type { UpstreamAuthScheme } from './upstream-auth-scheme.js';
3
+ import type { KvService } from '@redocly/config';
4
+ export declare const ELICITATION_TIMEOUT_MS = 300000;
5
+ export type SendElicitRequest = (request: object, resultSchema: unknown, options: {
6
+ timeout: number;
7
+ }) => Promise<{
8
+ action: string;
9
+ }>;
10
+ export type ElicitationOutcome = {
11
+ status: 'accepted';
12
+ } | {
13
+ status: 'fallback';
14
+ text: string;
15
+ } | {
16
+ status: 'skipped';
17
+ };
18
+ export declare function runUpstreamCredentialElicitation({ sendRequest, clientSupportsElicitation, sessionId, baseUrl, events, auth, kv, }: {
19
+ sendRequest: SendElicitRequest;
20
+ clientSupportsElicitation: boolean;
21
+ sessionId: string;
22
+ baseUrl: string;
23
+ events: UpstreamAuthRequiredEvent[];
24
+ auth: UpstreamAuthScheme;
25
+ kv: KvService;
26
+ }): Promise<ElicitationOutcome>;
27
+ //# sourceMappingURL=elicitation.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{ElicitResultSchema as d}from"@redocly/mcp-typescript-sdk/types.js";import{logger as p}from"../../../tools/notifiers/logger.js";import{secretStore as h,ELICITATION_TTL_MS as f}from"./secret-store.js";const g=3e5;async function $({sendRequest:e,clientSupportsElicitation:t,sessionId:r,baseUrl:a,events:n,auth:o,kv:s}){const c=n[0],u=await h.createElicitation(s,{sessionId:r,api:c.api,name:c.name,auth:o}),l=T(a,u);if(!t)return{status:"fallback",text:m(n,l)};try{return(await e({method:"elicitation/create",params:{mode:"url",message:`The "${c.name}" API requires credentials. Open the link to provide them securely; they never pass through the chat.`,url:l,elicitationId:u}},d,{timeout:g})).action==="accept"?{status:"accepted"}:{status:"skipped"}}catch(i){return p.warn(`URL-mode elicitation failed, falling back to markdown link: ${i instanceof Error?i.message:String(i)}`),{status:"fallback",text:m(n,l)}}}function T(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 m(e,t){const[r,...a]=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(f/6e4)} minutes):**`,"",t,"","Then call this tool again - the credentials are applied server-side and never appear in the conversation."];if(a.length>0){const o=a.map(s=>`"${s.name}"`).join(", ");n.push("",`The remaining APIs (${o}) will prompt for credentials on subsequent calls.`)}return n.join(`
2
+ `)}export{g 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