@redocly/redoc-reef 0.141.0-next.11 → 0.141.0-next.12
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.
- package/CHANGELOG.md +20 -0
- package/dist/server/plugins/mcp/codemode/tools/execute-schema.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/manage-credentials.js +2 -2
- package/dist/server/plugins/mcp/constants.d.ts +2 -2
- package/dist/server/plugins/mcp/constants.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/create-anonymous-session.d.ts +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/index.d.ts +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/subject.d.ts +2 -2
- package/dist/server/plugins/mcp/gateway-mcp/subject.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @redocly/redoc-reef
|
|
2
2
|
|
|
3
|
+
## 0.141.0-next.12
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f6a39b0a772: Renamed the MCP server credential tools to `create-anonymous-session`, `manage-api-credentials`, and `remove-api-credentials`.
|
|
8
|
+
- bdc8b09beb8: Removed the unused `SearchAiResponse` component from `@redocly/theme`. A custom theme that imports it no longer builds; import `SearchAiMessageContent` instead, which renders the AI search answer with its tool calls, citations and resources.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- c725911e90f: Fixed an issue where OpenAPI docs pages displayed an empty space above the first heading when the project's styles displayed hidden SVG elements.
|
|
13
|
+
For example: `svg[aria-hidden="true"] { display: inline; }`.
|
|
14
|
+
- 51f0b0ecff0: Fixed catalog entity links that could open the wrong catalog or show a "Not found" page when an entity type's catalog was hidden.
|
|
15
|
+
Links in catalog cards, tables, relation graphs, and domain and owner properties open entities in the correct catalog.
|
|
16
|
+
- Updated dependencies [c725911e90f]
|
|
17
|
+
- Updated dependencies [51f0b0ecff0]
|
|
18
|
+
- Updated dependencies [3892e2b2e75]
|
|
19
|
+
- Updated dependencies [bdc8b09beb8]
|
|
20
|
+
- @redocly/theme@0.73.0-next.8
|
|
21
|
+
- @redocly/api-docs@0.6.0-next.12
|
|
22
|
+
|
|
3
23
|
## 0.141.0-next.11
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EXECUTE_TOOL_NAME as o}from"../constants.js";import{buildExecuteDescription as i}from"../prompts.js";const e="Execute code";function s(t){return t.readOnlyHint?"Query the docs with code":e}const a={name:o,title:e,description:i(!1),schema:{type:"object",required:["code","description"],additionalProperties:!1,properties:{code:{type:"string",description:"JavaScript to run in the sandbox. Return a value to receive it as the result.",minLength:1},description:{type:"string",description:"A short, human-readable summary of what this code does.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by
|
|
1
|
+
import{EXECUTE_TOOL_NAME as o}from"../constants.js";import{buildExecuteDescription as i}from"../prompts.js";const e="Execute code";function s(t){return t.readOnlyHint?"Query the docs with code":e}const a={name:o,title:e,description:i(!1),schema:{type:"object",required:["code","description"],additionalProperties:!1,properties:{code:{type:"string",description:"JavaScript to run in the sandbox. Return a value to receive it as the result.",minLength:1},description:{type:"string",description:"A short, human-readable summary of what this code does.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by `create-anonymous-session`. Required when an API needs credentials. This parameter is only offered when `create-anonymous-session` is available, so pass it whenever you have called that tool.",minLength:1}}},outputSchema:{type:"object",properties:{result:{description:"The value the code returned, as JSON"},error:{type:"string",description:"Why the code failed. Set only on a failed call"}}}};export{a as EXECUTE_TOOL_SCHEMA,s as executeToolTitle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{MANAGE_API_CREDENTIALS_TOOL_NAME as P}from"../../constants.js";import{acceptedCredentialsLink as k,buildCredentialsAcceptedHint as w,buildUpstreamCredentialFallback as
|
|
2
|
-
`),annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},schema:{type:"object",required:["api"],additionalProperties:!1,properties:{api:{type:"string",description:`The API to manage credentials for: its \`filePath\` or the \`name\` from \`listApis\`.${t.length>0?` The file paths are: ${t.join(", ")}.`:""}`,minLength:1,...i.length>0?{enum:i}:{}},scheme:{type:"string",description:"Name of the security scheme to manage the credential for, as named in the API description (a tool result that reports a rejected credential names it). Omit it to let the link cover every scheme the API accepts.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by
|
|
1
|
+
import{MANAGE_API_CREDENTIALS_TOOL_NAME as P}from"../../constants.js";import{acceptedCredentialsLink as k,buildCredentialsAcceptedHint as w,buildUpstreamCredentialFallback as I,buildUpstreamCredentialInputRequired as S,credentialElicitationAnswer as E,dedupeElicitation as C,isStatelessRequest as j,schemeLabelOf as q,supportsUrlElicitation as T}from"../../gateway-mcp/elicitation.js";import{getCallableApis as u,isFetchCapable as H}from"../../gateway-mcp/callable-apis.js";import{secretStore as R}from"../../gateway-mcp/secret-store.js";import{MISSING_SESSION_HANDLE_MESSAGE as U,resolveSecretSubject as $}from"../../gateway-mcp/subject.js";import{upstreamAuthKey as L}from"../../gateway-mcp/upstream-auth.js";import{resolveUpstreamApiAuth as N}from"../../gateway-mcp/upstream-auth-scheme.js";import{apiTitleKey as O,countApiTitles as _}from"../../docs-mcp/utils/api-titles.js";function Q(e){return!!e.elicitationEnabled&&H(e)}function V(e){const s=u(e),t=s.map(r=>r.relativePath),i=[...t,...M(s)];return{name:P,title:"Manage API credentials",description:["Get a secure link where the user sets, replaces, or removes the credentials this server sends to a documented API.","Call it when the user wants to change or clear an API key, or when a tool result tells you the stored credentials were rejected.","The link covers every credential the API accepts, so scheme is optional - pass it only when a tool result names the scheme that was rejected.","It returns a link for the user to open - never ask for the secret in the conversation and never pass it as an argument."].join(`
|
|
2
|
+
`),annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},schema:{type:"object",required:["api"],additionalProperties:!1,properties:{api:{type:"string",description:`The API to manage credentials for: its \`filePath\` or the \`name\` from \`listApis\`.${t.length>0?` The file paths are: ${t.join(", ")}.`:""}`,minLength:1,...i.length>0?{enum:i}:{}},scheme:{type:"string",description:"Name of the security scheme to manage the credential for, as named in the API description (a tool result that reports a rejected credential names it). Omit it to let the link cover every scheme the API accepts.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by `create-anonymous-session`. Required while the caller is anonymous, so the credentials are stored against the same subject the API calls use.",minLength:1}}}}}function M(e){const s=_(e);return e.map(t=>t.name).filter(t=>s.get(O(t))===1)}function X(e,s){return async(t,i)=>{const r=$(e.user,typeof t.sessionHandle=="string"?t.sessionHandle:void 0);if(r.kind==="invalid")return m(r.message);if(r.kind==="anonymous")return m(U);const{subject:c}=r,p=typeof t.api=="string"?t.api:"",n=u(e).find(l=>l.relativePath===p||l.name===p);if(!n){const l=u(e).map(b=>b.relativePath).join(", ");return m(`Unknown api "${p}". Credentials can only be managed for the APIs this server can call: ${l||"none"}.`)}const d=E(i.mcpReq.inputResponses);if(d==="accepted"){const l=await k(i.mcpReq.requestState(),{kv:await s.getKv(),subject:c,baseUrl:e.baseUrl??"",apis:[n.relativePath]});return{content:[{type:"text",text:w(n.name,l?.url)}],isError:!1}}if(d==="declined")return{content:[{type:"text",text:`The user declined the credentials prompt for the "${n.name}" API, so this call minted no link.`}],isError:!1};const a=await N(e,n.relativePath),o=typeof t.scheme=="string"?t.scheme:void 0,y=Object.keys(a.schemes);if(o&&!a.schemes[o])return m(`Unknown scheme "${o}" for api "${n.relativePath}". The security schemes this server can store credentials for are: ${y.join(", ")}.`);const h=o??a.defaultScheme,f=o?q(a.schemes,o):void 0,A=await s.getKv(),v={subject:c,baseUrl:e.baseUrl??"",target:{api:n.relativePath,name:n.name,scheme:h,...f?{schemeLabel:f}:{}},auth:a.schemes[h],apiAuth:a,kv:A,hasExistingSecret:await R.hasSecret(A,c,n.relativePath,h),reason:{kind:"requested"}};if(j(i.mcpReq)&&T(s.getClientCapabilities()))return await S(v);const g=L({api:n.relativePath,scheme:h});return{content:[{type:"text",text:await C(`${c}:${g}`,()=>I(v))}],isError:!1}}}function m(e){return{content:[{type:"text",text:e}],isError:!0}}export{Q as isManageApiCredentialsToolAvailable,X as manageApiCredentials,V as manageApiCredentialsSchema};
|
|
@@ -13,9 +13,9 @@ export declare const MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
|
13
13
|
export declare const SSE_KEEPALIVE_INTERVAL_MS = 15000;
|
|
14
14
|
export declare const DEFAULT_DOCS_MCP_SERVER_NAME = "Docs MCP server";
|
|
15
15
|
export declare const SUPPORTED_MCP_SCOPES: readonly ['openid', 'profile', 'email', 'offline_access'];
|
|
16
|
-
export declare const CREATE_ANONYMOUS_SESSION_TOOL_NAME = "
|
|
16
|
+
export declare const CREATE_ANONYMOUS_SESSION_TOOL_NAME = "create-anonymous-session";
|
|
17
17
|
export declare const SUBMIT_FEEDBACK_TOOL_NAME = "submit-feedback";
|
|
18
|
-
export declare const MANAGE_API_CREDENTIALS_TOOL_NAME = "
|
|
18
|
+
export declare const MANAGE_API_CREDENTIALS_TOOL_NAME = "manage-api-credentials";
|
|
19
19
|
export declare const READ_ONLY_ANNOTATIONS: ToolAnnotations;
|
|
20
20
|
export declare const CUSTOM_MCP_TOOLS_META_DIR = "custom-mcp-tools-meta";
|
|
21
21
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const t={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},
|
|
1
|
+
import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const t={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},s=o,_=15e3,E="Docs MCP server",n=["openid","profile","email","offline_access"],O="create-anonymous-session",c="submit-feedback",S="manage-api-credentials",p={readOnlyHint:!0,destructiveHint:!1,openWorldHint:!1},A="custom-mcp-tools-meta";export{O as CREATE_ANONYMOUS_SESSION_TOOL_NAME,A as CUSTOM_MCP_TOOLS_META_DIR,E as DEFAULT_DOCS_MCP_SERVER_NAME,S as MANAGE_API_CREDENTIALS_TOOL_NAME,s as MCP_PROTOCOL_VERSION,r as McpErrorCodes,t as McpServerType,p as READ_ONLY_ANNOTATIONS,_ as SSE_KEEPALIVE_INTERVAL_MS,c as SUBMIT_FEEDBACK_TOOL_NAME,n as SUPPORTED_MCP_SCOPES};
|
|
@@ -2,7 +2,7 @@ import type { McpToolContext, McpToolHandler } from '../../../types.js';
|
|
|
2
2
|
export type CreateAnonymousSessionArgs = Record<string, never>;
|
|
3
3
|
export declare function isAnonymousSessionToolAvailable(context: McpToolContext): boolean;
|
|
4
4
|
declare const _default: {
|
|
5
|
-
|
|
5
|
+
"create-anonymous-session": {
|
|
6
6
|
execute: McpToolHandler<CreateAnonymousSessionArgs>;
|
|
7
7
|
isAvailable: typeof isAnonymousSessionToolAvailable;
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
|
|
2
|
+
"create-anonymous-session": {
|
|
3
3
|
execute: import("../../types.js").McpToolHandler<import("./core/create-anonymous-session.js").CreateAnonymousSessionArgs>;
|
|
4
4
|
isAvailable: typeof import("./core/create-anonymous-session.js").isAnonymousSessionToolAvailable;
|
|
5
5
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ApiFunctionsUser } from '@redocly/config';
|
|
2
2
|
export declare const ANONYMOUS_SUBJECT_PREFIX = "anon:";
|
|
3
3
|
export declare const USER_SUBJECT_PREFIX = "user:";
|
|
4
|
-
export declare const MISSING_SESSION_HANDLE_MESSAGE = "This API requires credentials and the caller is anonymous; call
|
|
5
|
-
export declare const MALFORMED_SESSION_HANDLE_MESSAGE = "The sessionHandle is not a valid handle; call
|
|
4
|
+
export declare const MISSING_SESSION_HANDLE_MESSAGE = "This API requires credentials and the caller is anonymous; call `create-anonymous-session` first, then retry with sessionHandle";
|
|
5
|
+
export declare const MALFORMED_SESSION_HANDLE_MESSAGE = "The sessionHandle is not a valid handle; call `create-anonymous-session` to obtain one";
|
|
6
6
|
export type SubjectResolution = {
|
|
7
7
|
kind: 'resolved';
|
|
8
8
|
subject: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomBytes as r}from"node:crypto";const i=32,S=/^[A-Za-z0-9_-]{43}$/,c=1440*60,u=10080*60,
|
|
1
|
+
import{randomBytes as r}from"node:crypto";const i=32,S=/^[A-Za-z0-9_-]{43}$/,c=1440*60,u=10080*60,o="anon:",a="user:",f="This API requires credentials and the caller is anonymous; call `create-anonymous-session` first, then retry with sessionHandle",d="The sessionHandle is not a valid handle; call `create-anonymous-session` to obtain one";function N(){return r(i).toString("base64url")}function E(e){return S.test(e)}function l(e){if(!e?.isAuthenticated)return;const n=e.claims,s=(typeof n?.sub=="string"&&n.sub?n.sub:void 0)??(e.email||void 0);if(s)return`${a}${e.idpId??"local"}:${s}`}function T(e,n){const t=l(e);return t?{kind:"resolved",subject:t}:n===void 0?{kind:"anonymous"}:E(n)?{kind:"resolved",subject:`${o}${n}`}:{kind:"invalid",message:d}}function A(e){return e.startsWith(o)?c:u}export{o as ANONYMOUS_SUBJECT_PREFIX,d as MALFORMED_SESSION_HANDLE_MESSAGE,f as MISSING_SESSION_HANDLE_MESSAGE,a as USER_SUBJECT_PREFIX,N as createSessionHandle,E as isValidSessionHandle,T as resolveSecretSubject,A as secretTtlSeconds,l as userSubject};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/redoc-reef",
|
|
3
|
-
"version": "0.141.0-next.
|
|
3
|
+
"version": "0.141.0-next.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"@opentelemetry/sdk-trace-web": "2.8.0",
|
|
34
34
|
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
35
35
|
"@redocly/ajv": "8.18.0",
|
|
36
|
-
"@redocly/api-docs": "0.6.0-next.
|
|
37
|
-
"@redocly/config": "0.
|
|
36
|
+
"@redocly/api-docs": "0.6.0-next.12",
|
|
37
|
+
"@redocly/config": "0.75.0",
|
|
38
38
|
"@redocly/markdoc": "0.7.1",
|
|
39
39
|
"@redocly/openapi-core": "2.78.0",
|
|
40
40
|
"@redocly/portal-legacy-ui": "0.19.0",
|
|
41
41
|
"@redocly/portal-plugin-mock-server": "0.26.0-next.4",
|
|
42
42
|
"@redocly/realm-asyncapi-sdk": "0.18.0-next.1",
|
|
43
|
-
"@redocly/theme": "0.73.0-next.
|
|
43
|
+
"@redocly/theme": "0.73.0-next.8",
|
|
44
44
|
"@shikijs/transformers": "3.21.0",
|
|
45
45
|
"@tanstack/react-query": "5.62.3",
|
|
46
46
|
"@tanstack/react-table": "8.21.3",
|