Skip to content

Commit 77dec4f

Browse files
Convert UiResourceMeta documentation to TypeDoc comments
Move metadata field documentation from separate prose section into TypeDoc comments on the UiResourceMeta interface properties. This consolidates the documentation and eliminates duplication while making it more maintainable and IDE-friendly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2c89056 commit 77dec4f

File tree

1 file changed

+45
-31
lines changed

1 file changed

+45
-31
lines changed

specification/draft/apps.mdx

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,56 @@ interface UIResource {
6161
}
6262

6363
interface UiResourceMeta {
64+
/**
65+
* Content Security Policy configuration
66+
*
67+
* Servers declare which external origins their UI needs to access.
68+
* Hosts use this to enforce appropriate CSP headers.
69+
*/
6470
csp?: {
71+
/**
72+
* Origins for network requests
73+
*
74+
* - Empty or omitted = no external connections (secure default)
75+
* - Maps to CSP `connect-src` directive
76+
*
77+
* @example
78+
* ["https://api.weather.com", "wss://realtime.service.com"]
79+
*/
6580
connectDomains?: string[],
81+
/**
82+
* Origins for static resources (images, scripts, stylesheets, fonts)
83+
*
84+
* - Empty or omitted = no external resources (secure default)
85+
* - Wildcard subdomains supported: `https://*.example.com`
86+
* - Maps to CSP `img-src`, `script-src`, `style-src`, `font-src` directives
87+
*
88+
* @example
89+
* ["https://cdn.jsdelivr.net", "https://*.cloudflare.com"]
90+
*/
6691
resourceDomains?: string[],
6792
},
93+
/**
94+
* Dedicated origin for widget
95+
*
96+
* Optional domain for the widget's sandbox origin. Useful when widgets need
97+
* dedicated origins for API key allowlists or cross-origin isolation.
98+
*
99+
* If omitted, Host uses default sandbox origin.
100+
*
101+
* @example
102+
* "https://weather-widget.example.com"
103+
*/
68104
domain?: string,
105+
/**
106+
* Visual boundary preference
107+
*
108+
* Boolean indicating the UI prefers a visible border. Useful for widgets
109+
* that might blend with host background.
110+
*
111+
* - `true`: Request visible border (host decides styling)
112+
* - `false` or omitted: No preference
113+
*/
69114
prefersBorder?: boolean,
70115
}
71116
```
@@ -101,37 +146,6 @@ The resource content is returned via `resources/read`:
101146
- Content MUST be provided via either `text` (string) or `blob` (base64-encoded)
102147
- Content MUST be valid HTML5 document
103148

104-
#### Metadata Fields:
105-
106-
**`ui.csp` - Content Security Policy configuration**
107-
108-
Servers declare which external origins their UI needs to access. Hosts use this to enforce appropriate CSP headers.
109-
110-
- `connect_domains`: Origins for network requests
111-
- Example: `["https://api.weather.com", "wss://realtime.service.com"]`
112-
- Empty or omitted = no external connections (secure default)
113-
- Maps to CSP `connect-src` directive
114-
115-
- `resource_domains`: Origins for static resources (images, scripts, stylesheets, fonts)
116-
- Example: `["https://cdn.jsdelivr.net", "https://*.cloudflare.com"]`
117-
- Empty or omitted = no external resources (secure default)
118-
- Wildcard subdomains supported: `https://*.example.com`
119-
- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src` directives
120-
121-
**`ui.domain` - Dedicated origin for widget**
122-
123-
Optional domain for the widget's sandbox origin. Useful when widgets need dedicated origins for API key allowlists or cross-origin isolation.
124-
125-
- Example: `"https://weather-widget.example.com"`
126-
- If omitted, Host uses default sandbox origin
127-
128-
**`ui.prefersBorder` - Visual boundary preference**
129-
130-
Boolean indicating the UI prefers a visible border. Useful for widgets that might blend with host background.
131-
132-
- `true`: Request visible border (host decides styling)
133-
- `false` or omitted: No preference
134-
135149
#### Host Behavior:
136150

137151
- **CSP Enforcement:** Host MUST construct CSP headers based on declared domains

0 commit comments

Comments
 (0)