Skip to content

Commit efed431

Browse files
docs: add {@link} and @see tags to JSDoc comments (#1490)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 64fb21d commit efed431

File tree

10 files changed

+27
-8
lines changed

10 files changed

+27
-8
lines changed

packages/client/src/client/auth.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,8 @@ export function extractResourceMetadataUrl(res: Response): URL | undefined {
654654
}
655655

656656
/**
657-
* Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata.
657+
* Looks up {@link https://datatracker.ietf.org/doc/html/rfc9728 | RFC 9728}
658+
* OAuth 2.0 Protected Resource Metadata.
658659
*
659660
* If the server returns a 404 for the well-known endpoint, this function will
660661
* return `undefined`. Any other errors will be thrown as exceptions.
@@ -872,8 +873,11 @@ export function buildDiscoveryUrls(authorizationServerUrl: string | URL): { url:
872873
}
873874

874875
/**
875-
* Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata
876-
* and OpenID Connect Discovery 1.0 specifications.
876+
* Discovers authorization server metadata with support for
877+
* {@link https://datatracker.ietf.org/doc/html/rfc8414 | RFC 8414} OAuth 2.0
878+
* Authorization Server Metadata and
879+
* {@link https://openid.net/specs/openid-connect-discovery-1_0.html | OpenID Connect Discovery 1.0}
880+
* specifications.
877881
*
878882
* This function implements a fallback strategy for authorization server discovery:
879883
* 1. Attempts RFC 8414 OAuth metadata discovery first
@@ -1269,7 +1273,8 @@ export async function fetchToken(
12691273
}
12701274

12711275
/**
1272-
* Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591.
1276+
* Performs OAuth 2.0 Dynamic Client Registration according to
1277+
* {@link https://datatracker.ietf.org/doc/html/rfc7591 | RFC 7591}.
12731278
*/
12741279
export async function registerClient(
12751280
authorizationServerUrl: string | URL,

packages/client/src/client/authExtensions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ export interface PrivateKeyJwtProviderOptions {
223223
* OAuth provider for client_credentials grant with private_key_jwt authentication.
224224
*
225225
* This provider is designed for machine-to-machine authentication where
226-
* the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2).
226+
* the client authenticates using a signed JWT assertion
227+
* ({@link https://datatracker.ietf.org/doc/html/rfc7523#section-2.2 | RFC 7523 Section 2.2}).
227228
*
228229
* @example
229230
* ```typescript

packages/core/src/auth/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { OAuthErrorResponse } from '../shared/auth.js';
22

33
/**
4-
* OAuth error codes as defined by RFC 6749 and extensions.
4+
* OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}
5+
* and extensions.
56
*/
67
export enum OAuthErrorCode {
78
/**

packages/core/src/experimental/tasks/interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export interface QueuedError extends BaseQueuedMessage {
9797
* All methods are async to support external storage implementations.
9898
* All data in QueuedMessage must be JSON-serializable.
9999
*
100+
* @see {@linkcode InMemoryTaskMessageQueue} for a reference implementation
100101
* @experimental
101102
*/
102103
export interface TaskMessageQueue {
@@ -157,6 +158,7 @@ export interface CreateTaskOptions {
157158
* Similar to Transport, this allows pluggable task storage implementations
158159
* (in-memory, database, distributed cache, etc.).
159160
*
161+
* @see {@linkcode InMemoryTaskStore} for a reference implementation
160162
* @experimental
161163
*/
162164
export interface TaskStore {

packages/core/src/shared/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export const OAuthMetadataSchema = z.looseObject({
7171

7272
/**
7373
* OpenID Connect Discovery 1.0 Provider Metadata
74-
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
74+
*
75+
* @see https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
7576
*/
7677
export const OpenIdProviderMetadataSchema = z.looseObject({
7778
issuer: z.string(),

packages/core/src/shared/authUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
/**
66
* Converts a server URL to a resource URL by removing the fragment.
7-
* RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component".
7+
* {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}
8+
* states that resource URIs "MUST NOT include a fragment component".
89
* Keeps everything else unchanged (scheme, domain, port, path, query).
910
*/
1011
export function resourceUrlFromServerUrl(url: URL | string): URL {

packages/core/src/shared/toolNameValidation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits
77
* (0-9), underscore (_), dash (-), and dot (.).
88
* Tool names SHOULD NOT contain spaces, commas, or other special characters.
9+
*
10+
* @see {@link https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986 | SEP-986: Specify Format for Tool Names}
911
*/
1012

1113
/**

packages/core/src/validation/ajvProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ function createDefaultAjvInstance(): Ajv {
3333
* const ajv = new Ajv({ strict: true, allErrors: true });
3434
* const validator = new AjvJsonSchemaValidator(ajv);
3535
* ```
36+
*
37+
* @see {@linkcode CfWorkerJsonSchemaValidator} for an edge-runtime-compatible alternative
3638
*/
3739
export class AjvJsonSchemaValidator implements jsonSchemaValidator {
3840
private _ajv: Ajv;

packages/core/src/validation/cfWorkerProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* This provider uses @cfworker/json-schema for validation without code generation,
55
* making it compatible with edge runtimes like Cloudflare Workers that restrict
66
* eval and new Function.
7+
*
8+
* @see {@linkcode AjvJsonSchemaValidator} for the Node.js alternative
79
*/
810

911
import { Validator } from '@cfworker/json-schema';

packages/server/src/server/completable.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export type CompletableSchema<T extends AnySchema> = T & {
2020

2121
/**
2222
* Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.
23+
*
24+
* @see {@linkcode server/mcp.McpServer.registerPrompt | McpServer.registerPrompt} for using completable schemas in prompt argument definitions
2325
*/
2426
export function completable<T extends AnySchema>(schema: T, complete: CompleteCallback<T>): CompletableSchema<T> {
2527
Object.defineProperty(schema as object, COMPLETABLE_SYMBOL, {

0 commit comments

Comments
 (0)