22
33from __future__ import annotations
44
5+ from typing import Iterable , Optional
6+
57import httpx
68
7- from ..._types import Body , Omit , Query , Headers , NoneType , NotGiven , omit , not_given
9+ from ..._types import Body , Omit , Query , Headers , NoneType , NotGiven , SequenceNotStr , omit , not_given
810from ..._utils import path_template , maybe_transform , async_maybe_transform
911from ..._compat import cached_property
1012from ..._resource import SyncAPIResource , AsyncAPIResource
@@ -48,6 +50,9 @@ def create(
4850 self ,
4951 * ,
5052 name : str ,
53+ description : Optional [str ] | Omit = omit ,
54+ secrets : Iterable [agent_create_params .Secret ] | Omit = omit ,
55+ skills : SequenceNotStr [str ] | Omit = omit ,
5156 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5257 # The extra values given here take precedence over values defined on the client or passed to this method.
5358 extra_headers : Headers | None = None ,
@@ -63,6 +68,18 @@ def create(
6368 Args:
6469 name: A name for the agent
6570
71+ description: Optional description of the agent
72+
73+ secrets: Optional list of secrets associated with the agent. Duplicate names within a
74+ single request are rejected.
75+
76+ skills:
77+ Optional list of skill specs to associate with the agent. Format:
78+ "{owner}/{repo}:{skill_path}" (e.g.,
79+ "warpdotdev/warp-server:.claude/skills/deploy/SKILL.md"). Each spec is validated
80+ and normalized at attach time using the team's GitHub credentials; inaccessible
81+ or malformed specs are rejected.
82+
6683 extra_headers: Send extra headers
6784
6885 extra_query: Add additional query parameters to the request
@@ -73,7 +90,15 @@ def create(
7390 """
7491 return self ._post (
7592 "/agent/identities" ,
76- body = maybe_transform ({"name" : name }, agent_create_params .AgentCreateParams ),
93+ body = maybe_transform (
94+ {
95+ "name" : name ,
96+ "description" : description ,
97+ "secrets" : secrets ,
98+ "skills" : skills ,
99+ },
100+ agent_create_params .AgentCreateParams ,
101+ ),
77102 options = make_request_options (
78103 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
79104 ),
@@ -84,20 +109,33 @@ def update(
84109 self ,
85110 uid : str ,
86111 * ,
112+ description : Optional [str ] | Omit = omit ,
87113 name : str | Omit = omit ,
114+ secrets : Optional [Iterable [agent_update_params .Secret ]] | Omit = omit ,
115+ skills : Optional [SequenceNotStr [str ]] | Omit = omit ,
88116 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
89117 # The extra values given here take precedence over values defined on the client or passed to this method.
90118 extra_headers : Headers | None = None ,
91119 extra_query : Query | None = None ,
92120 extra_body : Body | None = None ,
93121 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
94122 ) -> AgentResponse :
95- """
96- Update an existing agent.
123+ """Update an existing agent.
97124
98125 Args:
126+ description: Replacement description.
127+
128+ Omit or pass `null` to leave unchanged, or use an empty
129+ value to clear.
130+
99131 name: The new name for the agent
100132
133+ secrets: Replacement list of secrets. Omit to leave unchanged, pass an empty array to
134+ clear, or pass a non-empty array to replace. Duplicate names are rejected.
135+
136+ skills: Replacement list of skill specs. Omit to leave unchanged, pass an empty array to
137+ clear, or pass a non-empty array to replace.
138+
101139 extra_headers: Send extra headers
102140
103141 extra_query: Add additional query parameters to the request
@@ -110,7 +148,15 @@ def update(
110148 raise ValueError (f"Expected a non-empty value for `uid` but received { uid !r} " )
111149 return self ._put (
112150 path_template ("/agent/identities/{uid}" , uid = uid ),
113- body = maybe_transform ({"name" : name }, agent_update_params .AgentUpdateParams ),
151+ body = maybe_transform (
152+ {
153+ "description" : description ,
154+ "name" : name ,
155+ "secrets" : secrets ,
156+ "skills" : skills ,
157+ },
158+ agent_update_params .AgentUpdateParams ,
159+ ),
114160 options = make_request_options (
115161 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
116162 ),
@@ -202,6 +248,9 @@ async def create(
202248 self ,
203249 * ,
204250 name : str ,
251+ description : Optional [str ] | Omit = omit ,
252+ secrets : Iterable [agent_create_params .Secret ] | Omit = omit ,
253+ skills : SequenceNotStr [str ] | Omit = omit ,
205254 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
206255 # The extra values given here take precedence over values defined on the client or passed to this method.
207256 extra_headers : Headers | None = None ,
@@ -217,6 +266,18 @@ async def create(
217266 Args:
218267 name: A name for the agent
219268
269+ description: Optional description of the agent
270+
271+ secrets: Optional list of secrets associated with the agent. Duplicate names within a
272+ single request are rejected.
273+
274+ skills:
275+ Optional list of skill specs to associate with the agent. Format:
276+ "{owner}/{repo}:{skill_path}" (e.g.,
277+ "warpdotdev/warp-server:.claude/skills/deploy/SKILL.md"). Each spec is validated
278+ and normalized at attach time using the team's GitHub credentials; inaccessible
279+ or malformed specs are rejected.
280+
220281 extra_headers: Send extra headers
221282
222283 extra_query: Add additional query parameters to the request
@@ -227,7 +288,15 @@ async def create(
227288 """
228289 return await self ._post (
229290 "/agent/identities" ,
230- body = await async_maybe_transform ({"name" : name }, agent_create_params .AgentCreateParams ),
291+ body = await async_maybe_transform (
292+ {
293+ "name" : name ,
294+ "description" : description ,
295+ "secrets" : secrets ,
296+ "skills" : skills ,
297+ },
298+ agent_create_params .AgentCreateParams ,
299+ ),
231300 options = make_request_options (
232301 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
233302 ),
@@ -238,20 +307,33 @@ async def update(
238307 self ,
239308 uid : str ,
240309 * ,
310+ description : Optional [str ] | Omit = omit ,
241311 name : str | Omit = omit ,
312+ secrets : Optional [Iterable [agent_update_params .Secret ]] | Omit = omit ,
313+ skills : Optional [SequenceNotStr [str ]] | Omit = omit ,
242314 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243315 # The extra values given here take precedence over values defined on the client or passed to this method.
244316 extra_headers : Headers | None = None ,
245317 extra_query : Query | None = None ,
246318 extra_body : Body | None = None ,
247319 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
248320 ) -> AgentResponse :
249- """
250- Update an existing agent.
321+ """Update an existing agent.
251322
252323 Args:
324+ description: Replacement description.
325+
326+ Omit or pass `null` to leave unchanged, or use an empty
327+ value to clear.
328+
253329 name: The new name for the agent
254330
331+ secrets: Replacement list of secrets. Omit to leave unchanged, pass an empty array to
332+ clear, or pass a non-empty array to replace. Duplicate names are rejected.
333+
334+ skills: Replacement list of skill specs. Omit to leave unchanged, pass an empty array to
335+ clear, or pass a non-empty array to replace.
336+
255337 extra_headers: Send extra headers
256338
257339 extra_query: Add additional query parameters to the request
@@ -264,7 +346,15 @@ async def update(
264346 raise ValueError (f"Expected a non-empty value for `uid` but received { uid !r} " )
265347 return await self ._put (
266348 path_template ("/agent/identities/{uid}" , uid = uid ),
267- body = await async_maybe_transform ({"name" : name }, agent_update_params .AgentUpdateParams ),
349+ body = await async_maybe_transform (
350+ {
351+ "description" : description ,
352+ "name" : name ,
353+ "secrets" : secrets ,
354+ "skills" : skills ,
355+ },
356+ agent_update_params .AgentUpdateParams ,
357+ ),
268358 options = make_request_options (
269359 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
270360 ),
0 commit comments