Skip to content

Commit f589304

Browse files
ochafikclaude
andcommitted
docs: improve TypeDoc formatting and use as const for notification methods
- Use proper TypeDoc syntax with `@param callback.params` and `@param callback.extra` - Add {@link ResultType} references for return types - Replace `as Notification` with `as const` on method literals where possible (sendResourceListChanged, sendPromptListChanged) - Simplify sendHostContextChange cast syntax 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 915e836 commit f589304

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

src/app-bridge.ts

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,10 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
534534
* handler allows the host to intercept and process these requests, typically
535535
* by forwarding them to the MCP server.
536536
*
537-
* @param callback - Handler that receives tool call params and returns a result
538-
* - params.name - Name of the tool to call
539-
* - params.arguments - Tool arguments
540-
* - extra - Request metadata (abort signal, session info)
541-
* - Returns: Promise<CallToolResult> with tool execution result
537+
* @param callback - Handler that receives tool call params and returns a
538+
* {@link CallToolResult}
539+
* @param callback.params - Tool call parameters (name and arguments)
540+
* @param callback.extra - Request metadata (abort signal, session info)
542541
*
543542
* @example
544543
* ```typescript
@@ -598,10 +597,10 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
598597
* resources. This handler allows the host to intercept and process these
599598
* requests, typically by forwarding them to the MCP server.
600599
*
601-
* @param callback - Handler that receives list params and returns resources
602-
* - params - Request params (may include cursor for pagination)
603-
* - extra - Request metadata (abort signal, session info)
604-
* - Returns: Promise<ListResourcesResult> with available resources
600+
* @param callback - Handler that receives list params and returns a
601+
* {@link ListResourcesResult}
602+
* @param callback.params - Request params (may include cursor for pagination)
603+
* @param callback.extra - Request metadata (abort signal, session info)
605604
*
606605
* @example
607606
* ```typescript
@@ -638,10 +637,10 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
638637
* MCP resource templates. This handler allows the host to intercept and process
639638
* these requests, typically by forwarding them to the MCP server.
640639
*
641-
* @param callback - Handler that receives list params and returns templates
642-
* - params - Request params (may include cursor for pagination)
643-
* - extra - Request metadata (abort signal, session info)
644-
* - Returns: Promise<ListResourceTemplatesResult> with available templates
640+
* @param callback - Handler that receives list params and returns a
641+
* {@link ListResourceTemplatesResult}
642+
* @param callback.params - Request params (may include cursor for pagination)
643+
* @param callback.extra - Request metadata (abort signal, session info)
645644
*
646645
* @example
647646
* ```typescript
@@ -678,10 +677,10 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
678677
* MCP resource. This handler allows the host to intercept and process these
679678
* requests, typically by forwarding them to the MCP server.
680679
*
681-
* @param callback - Handler that receives read params and returns resource content
682-
* - params.uri - URI of the resource to read
683-
* - extra - Request metadata (abort signal, session info)
684-
* - Returns: Promise<ReadResourceResult> with resource contents
680+
* @param callback - Handler that receives read params and returns a
681+
* {@link ReadResourceResult}
682+
* @param callback.params - Read parameters including the resource URI
683+
* @param callback.extra - Request metadata (abort signal, session info)
685684
*
686685
* @example
687686
* ```typescript
@@ -734,9 +733,9 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
734733
params: ResourceListChangedNotification["params"] = {},
735734
) {
736735
return this.notification({
737-
method: "notifications/resources/list_changed",
736+
method: "notifications/resources/list_changed" as const,
738737
params,
739-
} as Notification);
738+
});
740739
}
741740

742741
/**
@@ -746,10 +745,10 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
746745
* prompts. This handler allows the host to intercept and process these
747746
* requests, typically by forwarding them to the MCP server.
748747
*
749-
* @param callback - Handler that receives list params and returns prompts
750-
* - params - Request params (may include cursor for pagination)
751-
* - extra - Request metadata (abort signal, session info)
752-
* - Returns: Promise<ListPromptsResult> with available prompts
748+
* @param callback - Handler that receives list params and returns a
749+
* {@link ListPromptsResult}
750+
* @param callback.params - Request params (may include cursor for pagination)
751+
* @param callback.extra - Request metadata (abort signal, session info)
753752
*
754753
* @example
755754
* ```typescript
@@ -797,9 +796,9 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
797796
*/
798797
sendPromptListChanged(params: PromptListChangedNotification["params"] = {}) {
799798
return this.notification({
800-
method: "notifications/prompts/list_changed",
799+
method: "notifications/prompts/list_changed" as const,
801800
params,
802-
} as Notification);
801+
});
803802
}
804803

805804
/**
@@ -937,10 +936,10 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
937936
sendHostContextChange(
938937
params: McpUiHostContextChangedNotification["params"],
939938
): Promise<void> | void {
940-
return this.notification((<McpUiHostContextChangedNotification>{
941-
method: "ui/notifications/host-context-changed",
939+
return this.notification({
940+
method: "ui/notifications/host-context-changed" as const,
942941
params,
943-
}) as Notification);
942+
} as Notification);
944943
}
945944

946945
/**

0 commit comments

Comments
 (0)