Skip to content

Commit 9e5f8d7

Browse files
xtmqbenbrandt
andauthored
feat(unstable): Initial implementation of providers (#899)
* feat(rfd): implement providers RFD (providers/list, providers/set, providers/disable) * docs: add CLAUDE.md referencing AGENTS.md for AI context * chore: add .idea to .gitignore * Make more generic nullable helper * Cleanup * Fix merge issues * Add tests * Cleanup * Align with category documentaton * CHange claude.md to a symlink * Clean up RFD * Module clean up * Clearer name for nullable type --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
1 parent 3080a39 commit 9e5f8d7

File tree

13 files changed

+1787
-113
lines changed

13 files changed

+1787
-113
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
dist
44
*.tsbuildinfo
55
.DS_Store
6+
.idea
67

78
# TypeScript generated files
89
typescript/*.js

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ unstable = [
1818
"unstable_auth_methods",
1919
"unstable_cancel_request",
2020
"unstable_elicitation",
21+
"unstable_llm_providers",
2122
"unstable_logout",
2223
"unstable_nes",
2324
"unstable_session_additional_directories",
@@ -32,6 +33,7 @@ unstable = [
3233
unstable_auth_methods = []
3334
unstable_cancel_request = []
3435
unstable_elicitation = []
36+
unstable_llm_providers = []
3537
unstable_logout = []
3638
unstable_nes = []
3739
unstable_session_additional_directories = []

docs/protocol/draft/schema.mdx

Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,180 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
624624
The list of suggestions.
625625
</ResponseField>
626626

627+
<a id="providers-disable"></a>
628+
### <span class="font-mono">providers/disable</span>
629+
630+
**UNSTABLE**
631+
632+
This capability is not part of the spec yet, and may be removed or changed at any point.
633+
634+
Disables a provider.
635+
636+
#### <span class="font-mono">DisableProvidersRequest</span>
637+
638+
**UNSTABLE**
639+
640+
This capability is not part of the spec yet, and may be removed or changed at any point.
641+
642+
Request parameters for `providers/disable`.
643+
644+
**Type:** Object
645+
646+
**Properties:**
647+
648+
<ResponseField name="_meta" type={"object | null"} >
649+
The _meta property is reserved by ACP to allow clients and agents to attach additional
650+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
651+
these keys.
652+
653+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
654+
655+
</ResponseField>
656+
<ResponseField name="id" type={"string"} required>
657+
Provider id to disable.
658+
</ResponseField>
659+
660+
#### <span class="font-mono">DisableProvidersResponse</span>
661+
662+
**UNSTABLE**
663+
664+
This capability is not part of the spec yet, and may be removed or changed at any point.
665+
666+
Response to `providers/disable`.
667+
668+
**Type:** Object
669+
670+
**Properties:**
671+
672+
<ResponseField name="_meta" type={"object | null"} >
673+
The _meta property is reserved by ACP to allow clients and agents to attach additional
674+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
675+
these keys.
676+
677+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
678+
679+
</ResponseField>
680+
681+
<a id="providers-list"></a>
682+
### <span class="font-mono">providers/list</span>
683+
684+
**UNSTABLE**
685+
686+
This capability is not part of the spec yet, and may be removed or changed at any point.
687+
688+
Lists providers that can be configured by the client.
689+
690+
#### <span class="font-mono">ListProvidersRequest</span>
691+
692+
**UNSTABLE**
693+
694+
This capability is not part of the spec yet, and may be removed or changed at any point.
695+
696+
Request parameters for `providers/list`.
697+
698+
**Type:** Object
699+
700+
**Properties:**
701+
702+
<ResponseField name="_meta" type={"object | null"} >
703+
The _meta property is reserved by ACP to allow clients and agents to attach additional
704+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
705+
these keys.
706+
707+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
708+
709+
</ResponseField>
710+
711+
#### <span class="font-mono">ListProvidersResponse</span>
712+
713+
**UNSTABLE**
714+
715+
This capability is not part of the spec yet, and may be removed or changed at any point.
716+
717+
Response to `providers/list`.
718+
719+
**Type:** Object
720+
721+
**Properties:**
722+
723+
<ResponseField name="_meta" type={"object | null"} >
724+
The _meta property is reserved by ACP to allow clients and agents to attach additional
725+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
726+
these keys.
727+
728+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
729+
730+
</ResponseField>
731+
<ResponseField name="providers" type={<a href="#providerinfo">ProviderInfo[]</a>} required>
732+
Configurable providers with current routing info suitable for UI display.
733+
</ResponseField>
734+
735+
<a id="providers-set"></a>
736+
### <span class="font-mono">providers/set</span>
737+
738+
**UNSTABLE**
739+
740+
This capability is not part of the spec yet, and may be removed or changed at any point.
741+
742+
Replaces the configuration for a provider.
743+
744+
#### <span class="font-mono">SetProvidersRequest</span>
745+
746+
**UNSTABLE**
747+
748+
This capability is not part of the spec yet, and may be removed or changed at any point.
749+
750+
Request parameters for `providers/set`.
751+
752+
Replaces the full configuration for one provider id.
753+
754+
**Type:** Object
755+
756+
**Properties:**
757+
758+
<ResponseField name="_meta" type={"object | null"} >
759+
The _meta property is reserved by ACP to allow clients and agents to attach additional
760+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
761+
these keys.
762+
763+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
764+
765+
</ResponseField>
766+
<ResponseField name="apiType" type={<a href="#llmprotocol">LlmProtocol</a>} required>
767+
Protocol type for this provider.
768+
</ResponseField>
769+
<ResponseField name="baseUrl" type={"string"} required>
770+
Base URL for requests sent through this provider.
771+
</ResponseField>
772+
<ResponseField name="headers" type={"object"} >
773+
Full headers map for this provider.
774+
May include authorization, routing, or other integration-specific headers.
775+
</ResponseField>
776+
<ResponseField name="id" type={"string"} required>
777+
Provider id to configure.
778+
</ResponseField>
779+
780+
#### <span class="font-mono">SetProvidersResponse</span>
781+
782+
**UNSTABLE**
783+
784+
This capability is not part of the spec yet, and may be removed or changed at any point.
785+
786+
Response to `providers/set`.
787+
788+
**Type:** Object
789+
790+
**Properties:**
791+
792+
<ResponseField name="_meta" type={"object | null"} >
793+
The _meta property is reserved by ACP to allow clients and agents to attach additional
794+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
795+
these keys.
796+
797+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
798+
799+
</ResponseField>
800+
627801
<a id="session-cancel"></a>
628802
### <span class="font-mono">session/cancel</span>
629803

@@ -2365,6 +2539,16 @@ The position encoding selected by the agent from the client's supported encoding
23652539

23662540
- Default: `{"audio":false,"embeddedContext":false,"image":false}`
23672541

2542+
</ResponseField>
2543+
<ResponseField name="providers" type={<><span><a href="#providerscapabilities">ProvidersCapabilities</a></span><span> | null</span></>} >
2544+
**UNSTABLE**
2545+
2546+
This capability is not part of the spec yet, and may be removed or changed at any point.
2547+
2548+
Provider configuration capabilities supported by the agent.
2549+
2550+
By supplying `\{\}` it means that the agent supports provider configuration methods.
2551+
23682552
</ResponseField>
23692553
<ResponseField name="sessionCapabilities" type={<a href="#sessioncapabilities">SessionCapabilities</a>} >
23702554

@@ -4130,6 +4314,45 @@ Schema for integer properties in an elicitation form.
41304314
Optional title for the property.
41314315
</ResponseField>
41324316

4317+
## <span class="font-mono">LlmProtocol</span>
4318+
4319+
**UNSTABLE**
4320+
4321+
This capability is not part of the spec yet, and may be removed or changed at any point.
4322+
4323+
Well-known API protocol identifiers for LLM providers.
4324+
4325+
Agents and clients MUST handle unknown protocol identifiers gracefully.
4326+
4327+
Protocol names beginning with `_` are free for custom use, like other ACP extension methods.
4328+
Protocol names that do not begin with `_` are reserved for the ACP spec.
4329+
4330+
**Type:** Union
4331+
4332+
<ResponseField name="anthropic" type="string">
4333+
Anthropic API protocol.
4334+
</ResponseField>
4335+
4336+
<ResponseField name="openai" type="string">
4337+
OpenAI API protocol.
4338+
</ResponseField>
4339+
4340+
<ResponseField name="azure" type="string">
4341+
Azure OpenAI API protocol.
4342+
</ResponseField>
4343+
4344+
<ResponseField name="vertex" type="string">
4345+
Google Vertex AI API protocol.
4346+
</ResponseField>
4347+
4348+
<ResponseField name="bedrock" type="string">
4349+
AWS Bedrock API protocol.
4350+
</ResponseField>
4351+
4352+
<ResponseField name="other" type="string">
4353+
Unknown or custom protocol.
4354+
</ResponseField>
4355+
41334356
## <span class="font-mono">LogoutCapabilities</span>
41344357

41354358
**UNSTABLE**
@@ -5642,6 +5865,87 @@ Non-breaking changes should be introduced via capabilities.
56425865
| Minimum | `0` |
56435866
| Maximum | `65535` |
56445867

5868+
## <span class="font-mono">ProviderCurrentConfig</span>
5869+
5870+
**UNSTABLE**
5871+
5872+
This capability is not part of the spec yet, and may be removed or changed at any point.
5873+
5874+
Current effective non-secret routing configuration for a provider.
5875+
5876+
**Type:** Object
5877+
5878+
**Properties:**
5879+
5880+
<ResponseField
5881+
name="apiType"
5882+
type={<a href="#llmprotocol">LlmProtocol</a>}
5883+
required
5884+
>
5885+
Protocol currently used by this provider.
5886+
</ResponseField>
5887+
<ResponseField name="baseUrl" type={"string"} required>
5888+
Base URL currently used by this provider.
5889+
</ResponseField>
5890+
5891+
## <span class="font-mono">ProviderInfo</span>
5892+
5893+
**UNSTABLE**
5894+
5895+
This capability is not part of the spec yet, and may be removed or changed at any point.
5896+
5897+
Information about a configurable LLM provider.
5898+
5899+
**Type:** Object
5900+
5901+
**Properties:**
5902+
5903+
<ResponseField name="_meta" type={"object | null"} >
5904+
The _meta property is reserved by ACP to allow clients and agents to attach additional
5905+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
5906+
these keys.
5907+
5908+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
5909+
5910+
</ResponseField>
5911+
<ResponseField name="current" type={<><span><a href="#providercurrentconfig">ProviderCurrentConfig</a></span><span> | null</span></>} required>
5912+
Current effective non-secret routing config.
5913+
Null means provider is disabled.
5914+
</ResponseField>
5915+
<ResponseField name="id" type={"string"} required>
5916+
Provider identifier, for example "main" or "openai".
5917+
</ResponseField>
5918+
<ResponseField name="required" type={"boolean"} required>
5919+
Whether this provider is mandatory and cannot be disabled via `providers/disable`.
5920+
If true, clients must not call `providers/disable` for this id.
5921+
</ResponseField>
5922+
<ResponseField name="supported" type={<a href="#llmprotocol">LlmProtocol[]</a>} required>
5923+
Supported protocol types for this provider.
5924+
</ResponseField>
5925+
5926+
## <span class="font-mono">ProvidersCapabilities</span>
5927+
5928+
**UNSTABLE**
5929+
5930+
This capability is not part of the spec yet, and may be removed or changed at any point.
5931+
5932+
Provider configuration capabilities supported by the agent.
5933+
5934+
By supplying `\{\}` it means that the agent supports provider configuration methods.
5935+
5936+
**Type:** Object
5937+
5938+
**Properties:**
5939+
5940+
<ResponseField name="_meta" type={"object | null"} >
5941+
The _meta property is reserved by ACP to allow clients and agents to attach additional
5942+
metadata to their interactions. Implementations MUST NOT make assumptions about values at
5943+
these keys.
5944+
5945+
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
5946+
5947+
</ResponseField>
5948+
56455949
## <span class="font-mono">Range</span>
56465950

56475951
A range in a text document, expressed as start and end positions.

0 commit comments

Comments
 (0)