Skip to content

Commit 5a5bd84

Browse files
Fix indentation in Mermaid sequence diagrams
Corrects the indentation of nested block structures (alt, opt, par, loop) in all four Mermaid sequence diagrams. Content inside nested blocks is now properly indented relative to the block keywords, making the hierarchical structure clearer and more readable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 7db51ff commit 5a5bd84

File tree

1 file changed

+75
-75
lines changed

1 file changed

+75
-75
lines changed

specification/draft/apps.mdx

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -636,49 +636,49 @@ The typical lifecycle for rendering a UI resource:
636636

637637
```mermaid
638638
sequenceDiagram
639-
participant H as Host
640-
participant S as MCP Server
639+
participant H as Host
640+
participant S as MCP Server
641641
642-
autonumber
643-
S -->> H: resources/list (includes ui:// resources)
644-
S -->> H: tools/list (includes tools with ui/resourceUri metadata)
642+
autonumber
643+
S -->> H: resources/list (includes ui:// resources)
644+
S -->> H: tools/list (includes tools with ui/resourceUri metadata)
645645
```
646646

647647
#### 2. UI Initialization (Desktop/Native Hosts)
648648

649649
```mermaid
650650
sequenceDiagram
651-
participant H as Host
652-
participant UI as Guest UI (iframe)
653-
participant P as Sandbox Proxy
654-
participant S as MCP Server
655-
656-
autonumber
657-
par UI Tool call
658-
H ->> S: tools/call to Tool with ui/resourceUri metadata
659-
and UI initialization
660-
alt Desktop/Native hosts
661-
H ->> H: Render Guest UI in an iframe (HTML from the ui:// resource)
662-
else Web hosts
663-
H ->> H: Render Sandbox Proxy in an iframe (different origin)
664-
P ->> H: ui/notifications/sandbox-ready
665-
H -->> P: ui/notifications/sandbox-resource-ready (HTML content)
666-
P -> P: Render inner iframe with HTML
667-
668-
end
669-
UI ->> H: ui/initialize
670-
H -->> UI: McpUiInitializeResult (e.g., host-context, capabilities, etc.)
671-
UI ->> H: ui/notifications/initialized
672-
opt Stream Tool input to UI
673-
H -->> UI: ui/notifications/tool-input-partial (0..n)
674-
end
675-
H -->> UI: ui/notifications/tool-input (complete)
676-
end
677-
alt Tool complete
678-
H -->> UI: ui/notifications/tool-result
679-
else Tool cancelled
680-
H -->> UI: ui/notifications/tool-cancelled
681-
end
651+
participant H as Host
652+
participant UI as Guest UI (iframe)
653+
participant P as Sandbox Proxy
654+
participant S as MCP Server
655+
656+
autonumber
657+
par UI Tool call
658+
H ->> S: tools/call to Tool with ui/resourceUri metadata
659+
and UI initialization
660+
alt Desktop/Native hosts
661+
H ->> H: Render Guest UI in an iframe (HTML from the ui:// resource)
662+
else Web hosts
663+
H ->> H: Render Sandbox Proxy in an iframe (different origin)
664+
P ->> H: ui/notifications/sandbox-ready
665+
H -->> P: ui/notifications/sandbox-resource-ready (HTML content)
666+
P -> P: Render inner iframe with HTML
667+
668+
end
669+
UI ->> H: ui/initialize
670+
H -->> UI: McpUiInitializeResult (e.g., host-context, capabilities, etc.)
671+
UI ->> H: ui/notifications/initialized
672+
opt Stream Tool input to UI
673+
H -->> UI: ui/notifications/tool-input-partial (0..n)
674+
end
675+
H -->> UI: ui/notifications/tool-input (complete)
676+
end
677+
alt Tool complete
678+
H -->> UI: ui/notifications/tool-result
679+
else Tool cancelled
680+
H -->> UI: ui/notifications/tool-cancelled
681+
end
682682
```
683683

684684
Note: when the Guest UI is rendered inside a sandbox, the sandbox transparently passes messages between the Guest UI and the Host, except for messages named `ui/notifications/sandbox-*`.
@@ -687,51 +687,51 @@ Note: when the Guest UI is rendered inside a sandbox, the sandbox transparently
687687

688688
```mermaid
689689
sequenceDiagram
690-
actor U as User / Agent
691-
participant H as Host
692-
participant UI as Guest UI (iframe)
693-
participant S as MCP Server
694-
loop Interactive phase
695-
U ->> UI: interaction (e.g., click)
696-
alt Tool call
697-
UI ->> H: tools/call
698-
H ->> S: tools/call
699-
opt Stream Tool input to UI
700-
H -->> UI: ui/notifications/tool-input-partial (0..n)
701-
end
702-
H -->> UI: ui/notifications/tool-input (complete)
703-
H-->>UI: ui/notifications/tool-result
704-
else Message
705-
UI ->> H: ui/message
706-
H -->> H: Process message and follow up
707-
else Notify
708-
UI ->> H: notifications/message
709-
H ->> H: Process notification and store in context
710-
else Resource read
711-
UI ->> H: resources/read
712-
H ->> S: resources/read
713-
S --> H: resources/read response
714-
H --> UI: resources/read response
715-
end
716-
opt UI notifications
717-
UI ->> H: notifications (e.g., ui/notifications/size-change)
718-
end
719-
opt Host notifications
720-
H ->> UI: notifications (e.g., ui/notifications/host-context-change)
721-
end
722-
end
690+
actor U as User / Agent
691+
participant H as Host
692+
participant UI as Guest UI (iframe)
693+
participant S as MCP Server
694+
loop Interactive phase
695+
U ->> UI: interaction (e.g., click)
696+
alt Tool call
697+
UI ->> H: tools/call
698+
H ->> S: tools/call
699+
opt Stream Tool input to UI
700+
H -->> UI: ui/notifications/tool-input-partial (0..n)
701+
end
702+
H -->> UI: ui/notifications/tool-input (complete)
703+
H-->>UI: ui/notifications/tool-result
704+
else Message
705+
UI ->> H: ui/message
706+
H -->> H: Process message and follow up
707+
else Notify
708+
UI ->> H: notifications/message
709+
H ->> H: Process notification and store in context
710+
else Resource read
711+
UI ->> H: resources/read
712+
H ->> S: resources/read
713+
S --> H: resources/read response
714+
H --> UI: resources/read response
715+
end
716+
opt UI notifications
717+
UI ->> H: notifications (e.g., ui/notifications/size-change)
718+
end
719+
opt Host notifications
720+
H ->> UI: notifications (e.g., ui/notifications/host-context-change)
721+
end
722+
end
723723
```
724724

725725
#### 6. Cleanup
726726

727727
```mermaid
728728
sequenceDiagram
729-
participant H as Host
730-
participant UI as Guest UI (iframe)
731-
H ->> UI: ui/resource-teardown
732-
UI --> UI: Graceful termination
733-
UI -->> H: ui/resource-teardown response
734-
H -x H: Tear down iframe and listeners
729+
participant H as Host
730+
participant UI as Guest UI (iframe)
731+
H ->> UI: ui/resource-teardown
732+
UI --> UI: Graceful termination
733+
UI -->> H: ui/resource-teardown response
734+
H -x H: Tear down iframe and listeners
735735
```
736736

737737
Note: Cleanup may be triggered at any point in the lifecycle following UI initialization.

0 commit comments

Comments
 (0)