Skip to content

Commit 4e08951

Browse files
Move HostContext field descriptions to JSDoc comments
Converted the HostContext interface documentation from a separate "Field Descriptions" section to JSDoc-style comments above each field. This improves consistency with other interfaces in the specification and keeps documentation closer to the code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 78de0bf commit 4e08951

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

specification/draft/apps.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -317,27 +317,40 @@ When the Guest UI sends an `ui/initialize` request to the Host, the Host SHOULD
317317

318318
```typescript
319319
interface HostContext {
320-
toolInfo?: { // Metadata of the tool call that instantiated the App
321-
id?: RequestId, // JSON-RPC id of the tools/call request
322-
tool: Tool, // contains name, inputSchema, etc…
320+
/** Metadata of the tool call that instantiated the App */
321+
toolInfo?: {
322+
/** JSON-RPC id of the tools/call request */
323+
id?: RequestId,
324+
/** Contains name, inputSchema, etc… */
325+
tool: Tool,
323326
};
327+
/** Current color theme preference */
324328
theme?: "light" | "dark" | "system";
329+
/** How the UI is currently displayed */
325330
displayMode?: "inline" | "fullscreen" | "pip" | "carousel";
331+
/** Display modes the host supports */
326332
availableDisplayModes?: string[];
333+
/** Current and maximum dimensions available to the UI */
327334
viewport?: {
328335
width: number;
329336
height: number;
330337
maxHeight?: number;
331338
maxWidth?: number;
332339
};
333-
locale?: string; // BCP 47, e.g., "en-US"
334-
timeZone?: string; // IANA, e.g., "America/New_York"
340+
/** User's language/region preference (BCP 47, e.g., "en-US") */
341+
locale?: string;
342+
/** User's timezone (IANA, e.g., "America/New_York") */
343+
timeZone?: string;
344+
/** Host application identifier */
335345
userAgent?: string;
346+
/** Platform type for responsive design */
336347
platform?: "web" | "desktop" | "mobile";
348+
/** Device capabilities such as touch */
337349
deviceCapabilities?: {
338350
touch?: boolean;
339351
hover?: boolean;
340352
}
353+
/** Mobile safe area boundaries in pixels */
341354
safeAreaInsets?: {
342355
top: number;
343356
right: number;
@@ -347,19 +360,6 @@ interface HostContext {
347360
}
348361
```
349362

350-
**Field Descriptions:**
351-
352-
- `theme`: Current color theme preference
353-
- `displayMode`: How the UI is currently displayed
354-
- `availableDisplayModes`: Display modes the host supports
355-
- `viewport`: Current and maximum dimensions available to the UI
356-
- `locale`: User's language/region preference
357-
- `timeZone`: User's timezone
358-
- `userAgent`: Host application identifier
359-
- `platform`: Platform type for responsive design
360-
- `deviceCapabilities`: Device capabilities such as touch
361-
- `safeAreaInsets`: Mobile safe area boundaries in pixels
362-
363363
All fields are optional. Hosts SHOULD provide relevant context. Guest UIs SHOULD handle missing fields gracefully.
364364

365365
Example:

0 commit comments

Comments
 (0)