spec: ui/notifications/tool-input (no final 's')
This commit is contained in:
parent
9875d276be
commit
69c814dae2
1 changed files with 11 additions and 11 deletions
|
|
@ -460,12 +460,12 @@ Host SHOULD add the message to the conversation thread, preserving the specified
|
||||||
|
|
||||||
#### Notifications (Host → UI)
|
#### Notifications (Host → UI)
|
||||||
|
|
||||||
`ui/notifications/tool-inputs` - Host MUST send this notification with the complete tool arguments after the Guest UI's initialize request completes.
|
`ui/notifications/tool-input` - Host MUST send this notification with the complete tool arguments after the Guest UI's initialize request completes.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "ui/notifications/tool-inputs",
|
"method": "ui/notifications/tool-input",
|
||||||
"params": {
|
"params": {
|
||||||
"arguments": "Record<string, unknown>" // Tool input arguments
|
"arguments": "Record<string, unknown>" // Tool input arguments
|
||||||
}
|
}
|
||||||
|
|
@ -474,12 +474,12 @@ Host SHOULD add the message to the conversation thread, preserving the specified
|
||||||
|
|
||||||
Host sends this notification after the Guest UI's initialize request completes, when tool arguments become available. This notification is sent at most once and is required before sending `ui/tool-result`.
|
Host sends this notification after the Guest UI's initialize request completes, when tool arguments become available. This notification is sent at most once and is required before sending `ui/tool-result`.
|
||||||
|
|
||||||
`ui/tool-inputs-partial` - Host MAY send this notification zero or more times while the agent is streaming tool arguments, before `ui/tool-inputs` is sent.
|
`ui/notifications/tool-input-partial` - Host MAY send this notification zero or more times while the agent is streaming tool arguments, before `ui/notifications/tool-input` is sent.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "ui/tool-inputs-partial",
|
"method": "ui/notifications/tool-input-partial",
|
||||||
"params": {
|
"params": {
|
||||||
"arguments": "Record<string, unknown>" // Tool input arguments
|
"arguments": "Record<string, unknown>" // Tool input arguments
|
||||||
}
|
}
|
||||||
|
|
@ -490,7 +490,7 @@ The arguments object represents best-effort recovery of incomplete JSON, with un
|
||||||
|
|
||||||
- MAY parse the agent's partial JSON output by closing unclosed brackets/braces
|
- MAY parse the agent's partial JSON output by closing unclosed brackets/braces
|
||||||
- MAY send recovered arguments as they become available during streaming
|
- MAY send recovered arguments as they become available during streaming
|
||||||
- MUST stop sending once `ui/tool-inputs` is sent with complete arguments
|
- MUST stop sending once `ui/notifications/tool-input` is sent with complete arguments
|
||||||
|
|
||||||
Guest UI behavior (optional):
|
Guest UI behavior (optional):
|
||||||
|
|
||||||
|
|
@ -656,9 +656,9 @@ sequenceDiagram
|
||||||
H -->> UI: InitializeResult (e.g., host-context, capabilities, etc.)
|
H -->> UI: InitializeResult (e.g., host-context, capabilities, etc.)
|
||||||
UI ->> H: notifications/initialized
|
UI ->> H: notifications/initialized
|
||||||
opt Stream Tool input to UI
|
opt Stream Tool input to UI
|
||||||
H -->> UI: ui/notifications/tool-inputs-partial (0..n)
|
H -->> UI: ui/notifications/tool-input-partial (0..n)
|
||||||
end
|
end
|
||||||
H -->> UI: ui/notifications/tool-inputs (complete)
|
H -->> UI: ui/notifications/tool-input (complete)
|
||||||
end
|
end
|
||||||
alt Tool complete
|
alt Tool complete
|
||||||
H -->> UI: ui/notifications/tool-result
|
H -->> UI: ui/notifications/tool-result
|
||||||
|
|
@ -683,9 +683,9 @@ sequenceDiagram
|
||||||
UI ->> H: tools/call
|
UI ->> H: tools/call
|
||||||
H ->> S: tools/call
|
H ->> S: tools/call
|
||||||
opt Stream Tool input to UI
|
opt Stream Tool input to UI
|
||||||
H -->> UI: ui/notifications/tool-inputs-partial (0..n)
|
H -->> UI: ui/notifications/tool-input-partial (0..n)
|
||||||
end
|
end
|
||||||
H -->> UI: ui/notifications/tool-inputs (complete)
|
H -->> UI: ui/notifications/tool-input (complete)
|
||||||
H-->>UI: ui/notifications/tool-result
|
H-->>UI: ui/notifications/tool-result
|
||||||
else Message
|
else Message
|
||||||
UI ->> H: ui/message
|
UI ->> H: ui/message
|
||||||
|
|
@ -732,7 +732,7 @@ Note: Cleanup may be triggered at any point in the lifecycle following UI initia
|
||||||
|
|
||||||
Tool execution results are passed to the UI through two mechanisms:
|
Tool execution results are passed to the UI through two mechanisms:
|
||||||
|
|
||||||
#### 1. Tool Input (via ui/notifications/tool-inputs notification)
|
#### 1. Tool Input (via ui/notifications/tool-input notification)
|
||||||
|
|
||||||
The original tool call arguments:
|
The original tool call arguments:
|
||||||
|
|
||||||
|
|
@ -741,7 +741,7 @@ The original tool call arguments:
|
||||||
tools/call("get_weather", { location: "San Francisco" })
|
tools/call("get_weather", { location: "San Francisco" })
|
||||||
|
|
||||||
// UI receives:
|
// UI receives:
|
||||||
notification: ui/tool-inputs
|
notification: ui/notifications/tool-input
|
||||||
params: {
|
params: {
|
||||||
arguments: { location: "San Francisco" }
|
arguments: { location: "San Francisco" }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue