Skip to content

Commit d53ba3f

Browse files
committed
feat(unstable): Create dedicated elicitation module
And also make sure enums have newtype pattern
1 parent 4aa0895 commit d53ba3f

5 files changed

Lines changed: 743 additions & 592 deletions

File tree

docs/protocol/draft/schema.mdx

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,22 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
26092609
The file path being modified.
26102610
</ResponseField>
26112611

2612+
## <span class="font-mono">ElicitationAcceptAction</span>
2613+
2614+
**UNSTABLE**
2615+
2616+
This capability is not part of the spec yet, and may be removed or changed at any point.
2617+
2618+
The user accepted the elicitation and provided content.
2619+
2620+
**Type:** Object
2621+
2622+
**Properties:**
2623+
2624+
<ResponseField name="content" type={"object"}>
2625+
The user-provided content, if any.
2626+
</ResponseField>
2627+
26122628
## <span class="font-mono">ElicitationAction</span>
26132629

26142630
**UNSTABLE**
@@ -2706,12 +2722,24 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
27062722

27072723
</ResponseField>
27082724

2709-
## <span class="font-mono">ElicitationId</span>
2725+
## <span class="font-mono">ElicitationFormMode</span>
27102726

27112727
**UNSTABLE**
27122728

27132729
This capability is not part of the spec yet, and may be removed or changed at any point.
27142730

2731+
Form-based elicitation mode where the client renders a form from the provided schema.
2732+
2733+
**Type:** Object
2734+
2735+
**Properties:**
2736+
2737+
<ResponseField name="requestedSchema" type={"object"} required>
2738+
A JSON Schema describing the form fields to present to the user.
2739+
</ResponseField>
2740+
2741+
## <span class="font-mono">ElicitationId</span>
2742+
27152743
Unique identifier for an elicitation.
27162744

27172745
**Type:** `string`
@@ -2737,6 +2765,29 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
27372765

27382766
</ResponseField>
27392767

2768+
## <span class="font-mono">ElicitationUrlMode</span>
2769+
2770+
**UNSTABLE**
2771+
2772+
This capability is not part of the spec yet, and may be removed or changed at any point.
2773+
2774+
URL-based elicitation mode where the client directs the user to a URL.
2775+
2776+
**Type:** Object
2777+
2778+
**Properties:**
2779+
2780+
<ResponseField
2781+
name="elicitationId"
2782+
type={<a href="#elicitationid">ElicitationId</a>}
2783+
required
2784+
>
2785+
The unique identifier for this elicitation.
2786+
</ResponseField>
2787+
<ResponseField name="url" type={"string"} required>
2788+
The URL to direct the user to.
2789+
</ResponseField>
2790+
27402791
## <span class="font-mono">EmbeddedResource</span>
27412792

27422793
The contents of a resource, embedded into a prompt or tool call result.

schema/schema.unstable.json

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,21 +1458,32 @@
14581458
"required": ["path", "newText"],
14591459
"type": "object"
14601460
},
1461+
"ElicitationAcceptAction": {
1462+
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe user accepted the elicitation and provided content.",
1463+
"properties": {
1464+
"content": {
1465+
"description": "The user-provided content, if any."
1466+
}
1467+
},
1468+
"type": "object"
1469+
},
14611470
"ElicitationAction": {
14621471
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe user's action in response to an elicitation.",
14631472
"discriminator": {
14641473
"propertyName": "action"
14651474
},
14661475
"oneOf": [
14671476
{
1477+
"allOf": [
1478+
{
1479+
"$ref": "#/$defs/ElicitationAcceptAction"
1480+
}
1481+
],
14681482
"description": "The user accepted and provided content.",
14691483
"properties": {
14701484
"action": {
14711485
"const": "accept",
14721486
"type": "string"
1473-
},
1474-
"content": {
1475-
"description": "The user-provided content, if any."
14761487
}
14771488
},
14781489
"required": ["action"],
@@ -1568,8 +1579,18 @@
15681579
},
15691580
"type": "object"
15701581
},
1582+
"ElicitationFormMode": {
1583+
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForm-based elicitation mode where the client renders a form from the provided schema.",
1584+
"properties": {
1585+
"requestedSchema": {
1586+
"description": "A JSON Schema describing the form fields to present to the user."
1587+
}
1588+
},
1589+
"required": ["requestedSchema"],
1590+
"type": "object"
1591+
},
15711592
"ElicitationId": {
1572-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for an elicitation.",
1593+
"description": "Unique identifier for an elicitation.",
15731594
"type": "string"
15741595
},
15751596
"ElicitationRequest": {
@@ -1579,40 +1600,35 @@
15791600
},
15801601
"oneOf": [
15811602
{
1603+
"allOf": [
1604+
{
1605+
"$ref": "#/$defs/ElicitationFormMode"
1606+
}
1607+
],
15821608
"description": "Form-based elicitation where the client renders a form from the provided schema.",
15831609
"properties": {
15841610
"mode": {
15851611
"const": "form",
15861612
"type": "string"
1587-
},
1588-
"requestedSchema": {
1589-
"description": "A JSON Schema describing the form fields to present to the user."
15901613
}
15911614
},
1592-
"required": ["mode", "requestedSchema"],
1615+
"required": ["mode"],
15931616
"type": "object"
15941617
},
15951618
{
1619+
"allOf": [
1620+
{
1621+
"$ref": "#/$defs/ElicitationUrlMode"
1622+
}
1623+
],
15961624
"description": "URL-based elicitation where the client directs the user to a URL.",
15971625
"properties": {
1598-
"elicitationId": {
1599-
"allOf": [
1600-
{
1601-
"$ref": "#/$defs/ElicitationId"
1602-
}
1603-
],
1604-
"description": "The unique identifier for this elicitation."
1605-
},
16061626
"mode": {
16071627
"const": "url",
16081628
"type": "string"
1609-
},
1610-
"url": {
1611-
"description": "The URL to direct the user to.",
1612-
"type": "string"
16131629
}
16141630
},
1615-
"required": ["mode", "elicitationId", "url"],
1631+
"required": ["mode"],
16161632
"type": "object"
16171633
}
16181634
],
@@ -1673,6 +1689,25 @@
16731689
},
16741690
"type": "object"
16751691
},
1692+
"ElicitationUrlMode": {
1693+
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nURL-based elicitation mode where the client directs the user to a URL.",
1694+
"properties": {
1695+
"elicitationId": {
1696+
"allOf": [
1697+
{
1698+
"$ref": "#/$defs/ElicitationId"
1699+
}
1700+
],
1701+
"description": "The unique identifier for this elicitation."
1702+
},
1703+
"url": {
1704+
"description": "The URL to direct the user to.",
1705+
"type": "string"
1706+
}
1707+
},
1708+
"required": ["elicitationId", "url"],
1709+
"type": "object"
1710+
},
16761711
"EmbeddedResource": {
16771712
"description": "The contents of a resource, embedded into a prompt or tool call result.",
16781713
"properties": {

0 commit comments

Comments
 (0)