sarvam-agents-client 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -29
- package/dist/apis/AgentsApi.d.ts +96 -11
- package/dist/apis/AgentsApi.js +229 -9
- package/dist/apis/ConversationsApi.d.ts +5 -2
- package/dist/apis/ConversationsApi.js +7 -2
- package/dist/client.d.ts +3 -2
- package/dist/client.js +2 -1
- package/dist/compat/core/agents.d.ts +6 -1
- package/dist/compat/core/agents.js +237 -27
- package/dist/compat/core/customApis.d.ts +76 -0
- package/dist/compat/core/customApis.js +424 -0
- package/dist/compat/core/data.js +1 -1
- package/dist/compat/openai/client.d.ts +3 -0
- package/dist/compat/openai/client.js +5 -1
- package/dist/compat/openai/index.d.ts +1 -0
- package/dist/compat/openai/index.js +0 -1
- package/dist/compat/openai/resources/agents.js +8 -1
- package/dist/compat/openai/resources/sarvam.d.ts +26 -0
- package/dist/compat/openai/resources/sarvam.js +56 -0
- package/dist/compose/deploy.d.ts +14 -3
- package/dist/compose/deploy.js +60 -7
- package/dist/compose/errors.d.ts +4 -0
- package/dist/compose/errors.js +6 -1
- package/dist/compose/settingsTransport.d.ts +18 -13
- package/dist/compose/settingsTransport.js +78 -130
- package/dist/compose/transport.d.ts +12 -2
- package/dist/compose/webhook.d.ts +10 -13
- package/dist/compose/webhook.js +48 -45
- package/dist/compose/webhookSecrets.d.ts +79 -49
- package/dist/compose/webhookSecrets.js +244 -195
- package/dist/esm/apis/AgentsApi.d.ts +96 -11
- package/dist/esm/apis/AgentsApi.js +230 -10
- package/dist/esm/apis/ConversationsApi.d.ts +5 -2
- package/dist/esm/apis/ConversationsApi.js +7 -2
- package/dist/esm/client.d.ts +3 -2
- package/dist/esm/client.js +2 -1
- package/dist/esm/compat/core/agents.d.ts +6 -1
- package/dist/esm/compat/core/agents.js +237 -27
- package/dist/esm/compat/core/customApis.d.ts +76 -0
- package/dist/esm/compat/core/customApis.js +419 -0
- package/dist/esm/compat/core/data.js +1 -1
- package/dist/esm/compat/openai/client.d.ts +3 -0
- package/dist/esm/compat/openai/client.js +5 -1
- package/dist/esm/compat/openai/index.d.ts +1 -0
- package/dist/esm/compat/openai/index.js +0 -1
- package/dist/esm/compat/openai/resources/agents.js +8 -1
- package/dist/esm/compat/openai/resources/sarvam.d.ts +26 -0
- package/dist/esm/compat/openai/resources/sarvam.js +51 -0
- package/dist/esm/compose/deploy.d.ts +14 -3
- package/dist/esm/compose/deploy.js +60 -7
- package/dist/esm/compose/errors.d.ts +4 -0
- package/dist/esm/compose/errors.js +4 -0
- package/dist/esm/compose/settingsTransport.d.ts +18 -13
- package/dist/esm/compose/settingsTransport.js +80 -132
- package/dist/esm/compose/transport.d.ts +12 -2
- package/dist/esm/compose/webhook.d.ts +10 -13
- package/dist/esm/compose/webhook.js +45 -42
- package/dist/esm/compose/webhookSecrets.d.ts +79 -49
- package/dist/esm/compose/webhookSecrets.js +241 -193
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/models/AgentConversationDetail.d.ts +12 -0
- package/dist/esm/models/AgentConversationDetail.js +4 -0
- package/dist/esm/models/AgentConversationView.d.ts +12 -0
- package/dist/esm/models/AgentConversationView.js +4 -0
- package/dist/esm/models/AgentResource.d.ts +7 -0
- package/dist/esm/models/AgentResource.js +3 -0
- package/dist/esm/models/AgentVersionSavedResource.d.ts +65 -0
- package/dist/esm/models/AgentVersionSavedResource.js +60 -0
- package/dist/esm/models/AgentWebhookList.d.ts +33 -0
- package/dist/esm/models/AgentWebhookList.js +44 -0
- package/dist/esm/models/AgentWebhookView.d.ts +76 -0
- package/dist/esm/models/AgentWebhookView.js +70 -0
- package/dist/esm/models/ConversationDetail.d.ts +6 -0
- package/dist/esm/models/ConversationDetail.js +2 -0
- package/dist/esm/models/ConversationView.d.ts +6 -0
- package/dist/esm/models/ConversationView.js +2 -0
- package/dist/esm/models/ErrorDetailItem.d.ts +3 -0
- package/dist/esm/models/FileNodeView.d.ts +7 -0
- package/dist/esm/models/FileNodeView.js +3 -0
- package/dist/esm/models/QueueMessageInput.d.ts +6 -0
- package/dist/esm/models/QueueMessageInput.js +2 -0
- package/dist/esm/models/RotatedWebhookSecretView.d.ts +58 -0
- package/dist/esm/models/RotatedWebhookSecretView.js +61 -0
- package/dist/esm/models/SaveWarningView.d.ts +44 -0
- package/dist/esm/models/SaveWarningView.js +51 -0
- package/dist/esm/models/ShareSkippedResource.d.ts +41 -0
- package/dist/esm/models/ShareSkippedResource.js +47 -0
- package/dist/esm/models/WebhookSecretPutBody.d.ts +32 -0
- package/dist/esm/models/WebhookSecretPutBody.js +43 -0
- package/dist/esm/models/WebhookSecretStateView.d.ts +52 -0
- package/dist/esm/models/WebhookSecretStateView.js +56 -0
- package/dist/esm/models/WebhookSecretValueView.d.ts +32 -0
- package/dist/esm/models/WebhookSecretValueView.js +44 -0
- package/dist/esm/models/WebhookWarning.d.ts +44 -0
- package/dist/esm/models/WebhookWarning.js +51 -0
- package/dist/esm/models/index.d.ts +10 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/dist/models/AgentConversationDetail.d.ts +12 -0
- package/dist/models/AgentConversationDetail.js +4 -0
- package/dist/models/AgentConversationView.d.ts +12 -0
- package/dist/models/AgentConversationView.js +4 -0
- package/dist/models/AgentResource.d.ts +7 -0
- package/dist/models/AgentResource.js +3 -0
- package/dist/models/AgentVersionSavedResource.d.ts +65 -0
- package/dist/models/AgentVersionSavedResource.js +67 -0
- package/dist/models/AgentWebhookList.d.ts +33 -0
- package/dist/models/AgentWebhookList.js +51 -0
- package/dist/models/AgentWebhookView.d.ts +76 -0
- package/dist/models/AgentWebhookView.js +78 -0
- package/dist/models/ConversationDetail.d.ts +6 -0
- package/dist/models/ConversationDetail.js +2 -0
- package/dist/models/ConversationView.d.ts +6 -0
- package/dist/models/ConversationView.js +2 -0
- package/dist/models/ErrorDetailItem.d.ts +3 -0
- package/dist/models/FileNodeView.d.ts +7 -0
- package/dist/models/FileNodeView.js +3 -0
- package/dist/models/QueueMessageInput.d.ts +6 -0
- package/dist/models/QueueMessageInput.js +2 -0
- package/dist/models/RotatedWebhookSecretView.d.ts +58 -0
- package/dist/models/RotatedWebhookSecretView.js +69 -0
- package/dist/models/SaveWarningView.d.ts +44 -0
- package/dist/models/SaveWarningView.js +58 -0
- package/dist/models/ShareSkippedResource.d.ts +41 -0
- package/dist/models/ShareSkippedResource.js +54 -0
- package/dist/models/WebhookSecretPutBody.d.ts +32 -0
- package/dist/models/WebhookSecretPutBody.js +50 -0
- package/dist/models/WebhookSecretStateView.d.ts +52 -0
- package/dist/models/WebhookSecretStateView.js +64 -0
- package/dist/models/WebhookSecretValueView.d.ts +32 -0
- package/dist/models/WebhookSecretValueView.js +51 -0
- package/dist/models/WebhookWarning.d.ts +44 -0
- package/dist/models/WebhookWarning.js +58 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +10 -0
- package/package.json +1 -1
- package/src/apis/AgentsApi.ts +366 -11
- package/src/apis/ConversationsApi.ts +9 -2
- package/src/client.ts +3 -2
- package/src/compat/core/agents.ts +265 -36
- package/src/compat/core/customApis.ts +506 -0
- package/src/compat/core/data.ts +1 -1
- package/src/compat/openai/client.ts +7 -1
- package/src/compat/openai/index.ts +9 -0
- package/src/compat/openai/resources/agents.ts +9 -1
- package/src/compat/openai/resources/sarvam.ts +94 -0
- package/src/compose/deploy.ts +71 -10
- package/src/compose/errors.ts +4 -0
- package/src/compose/settingsTransport.ts +78 -131
- package/src/compose/transport.ts +10 -2
- package/src/compose/webhook.ts +49 -45
- package/src/compose/webhookSecrets.ts +227 -179
- package/src/index.ts +2 -1
- package/src/models/AgentConversationDetail.ts +16 -0
- package/src/models/AgentConversationView.ts +16 -0
- package/src/models/AgentResource.ts +15 -0
- package/src/models/AgentVersionSavedResource.ts +119 -0
- package/src/models/AgentWebhookList.ts +74 -0
- package/src/models/AgentWebhookView.ts +129 -0
- package/src/models/ConversationDetail.ts +8 -0
- package/src/models/ConversationView.ts +8 -0
- package/src/models/ErrorDetailItem.ts +3 -0
- package/src/models/FileNodeView.ts +16 -0
- package/src/models/QueueMessageInput.ts +8 -0
- package/src/models/RotatedWebhookSecretView.ts +103 -0
- package/src/models/SaveWarningView.ts +84 -0
- package/src/models/ShareSkippedResource.ts +78 -0
- package/src/models/WebhookSecretPutBody.ts +66 -0
- package/src/models/WebhookSecretStateView.ts +94 -0
- package/src/models/WebhookSecretValueView.ts +66 -0
- package/src/models/WebhookWarning.ts +84 -0
- package/src/models/index.ts +10 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
-
import type { AgentContentsResource, AgentCreate, AgentDeploy, AgentDraftResource, AgentHistoryResource, AgentResource, AgentSearchChannel, AgentSettingsResponse, AgentTemplateResource, AgentUpdate, AgentVersionCreate, AgentVersionDiffResource, AgentVersionPick, AgentVersionResource, EntityCategory, EntityListAgentResource, EntityListAgentTemplateResource, FileNodeView, FileWriteBody, InstructionsBody, InstructionsResponse, PageFileNodeView, PublishRequest, Scope, SkillUpdateResource } from '../models/index.js';
|
|
13
|
+
import type { AgentContentsResource, AgentCreate, AgentDeploy, AgentDraftResource, AgentHistoryResource, AgentResource, AgentSearchChannel, AgentSettingsResponse, AgentTemplateResource, AgentUpdate, AgentVersionCreate, AgentVersionDiffResource, AgentVersionPick, AgentVersionResource, AgentVersionSavedResource, AgentWebhookList, EntityCategory, EntityListAgentResource, EntityListAgentTemplateResource, FileNodeView, FileWriteBody, InstructionsBody, InstructionsResponse, PageFileNodeView, PublishRequest, RotatedWebhookSecretView, Scope, SkillUpdateResource, WebhookSecretPutBody, WebhookSecretStateView, WebhookSecretValueView } from '../models/index.js';
|
|
14
14
|
export interface AcceptSkillUpdateRequest {
|
|
15
15
|
agentId: string;
|
|
16
16
|
skillId: string;
|
|
@@ -34,9 +34,17 @@ export interface CreateAgentRequest {
|
|
|
34
34
|
origin?: CreateAgentOriginEnum;
|
|
35
35
|
xPanjaOrigin?: CreateAgentXPanjaOriginEnum;
|
|
36
36
|
}
|
|
37
|
+
export interface CreateAgentWebhookSecretRequest {
|
|
38
|
+
agentId: string;
|
|
39
|
+
webhookKey: string;
|
|
40
|
+
}
|
|
37
41
|
export interface DeleteAgentRequest {
|
|
38
42
|
agentId: string;
|
|
39
43
|
}
|
|
44
|
+
export interface DeleteAgentWebhookSecretRequest {
|
|
45
|
+
agentId: string;
|
|
46
|
+
webhookKey: string;
|
|
47
|
+
}
|
|
40
48
|
export interface DeleteVersionRequest {
|
|
41
49
|
agentId: string;
|
|
42
50
|
version: number;
|
|
@@ -87,8 +95,12 @@ export interface ListAgentTemplatesRequest {
|
|
|
87
95
|
limit?: number;
|
|
88
96
|
offset?: number;
|
|
89
97
|
}
|
|
98
|
+
export interface ListAgentWebhooksRequest {
|
|
99
|
+
agentId: string;
|
|
100
|
+
}
|
|
90
101
|
export interface ListAgentsRequest {
|
|
91
102
|
channel?: Array<AgentSearchChannel> | null;
|
|
103
|
+
shared?: boolean;
|
|
92
104
|
scope?: Scope | null;
|
|
93
105
|
q?: string | null;
|
|
94
106
|
limit?: number;
|
|
@@ -127,6 +139,11 @@ export interface PutAgentSettingsRequest {
|
|
|
127
139
|
agentId: string;
|
|
128
140
|
body: object;
|
|
129
141
|
}
|
|
142
|
+
export interface PutAgentWebhookSecretRequest {
|
|
143
|
+
agentId: string;
|
|
144
|
+
webhookKey: string;
|
|
145
|
+
webhookSecretPutBody: WebhookSecretPutBody;
|
|
146
|
+
}
|
|
130
147
|
export interface PutInstructionsRequest {
|
|
131
148
|
agentId: string;
|
|
132
149
|
instructionsBody: InstructionsBody;
|
|
@@ -134,6 +151,10 @@ export interface PutInstructionsRequest {
|
|
|
134
151
|
export interface ResumeAgentRequest {
|
|
135
152
|
agentId: string;
|
|
136
153
|
}
|
|
154
|
+
export interface RotateAgentWebhookSecretRequest {
|
|
155
|
+
agentId: string;
|
|
156
|
+
webhookKey: string;
|
|
157
|
+
}
|
|
137
158
|
export interface SaveVersionRequest {
|
|
138
159
|
agentId: string;
|
|
139
160
|
agentVersionCreate: AgentVersionCreate;
|
|
@@ -158,6 +179,10 @@ export interface UpdateAgentRequest {
|
|
|
158
179
|
agentId: string;
|
|
159
180
|
agentUpdate: AgentUpdate;
|
|
160
181
|
}
|
|
182
|
+
export interface ViewAgentWebhookSecretRequest {
|
|
183
|
+
agentId: string;
|
|
184
|
+
webhookKey: string;
|
|
185
|
+
}
|
|
161
186
|
/**
|
|
162
187
|
*
|
|
163
188
|
*/
|
|
@@ -212,6 +237,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
212
237
|
* Create Agent
|
|
213
238
|
*/
|
|
214
239
|
createAgent(requestParameters: CreateAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
240
|
+
/**
|
|
241
|
+
* Create the webhook\'s signing secret, shown in this response only (``no-store``): its first one, or a new one after a delete. 409 ``secret_exists`` when it already has one (rotate-secret replaces it).
|
|
242
|
+
* Create Agent Webhook Secret
|
|
243
|
+
*/
|
|
244
|
+
createAgentWebhookSecretRaw(requestParameters: CreateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookSecretValueView>>;
|
|
245
|
+
/**
|
|
246
|
+
* Create the webhook\'s signing secret, shown in this response only (``no-store``): its first one, or a new one after a delete. 409 ``secret_exists`` when it already has one (rotate-secret replaces it).
|
|
247
|
+
* Create Agent Webhook Secret
|
|
248
|
+
*/
|
|
249
|
+
createAgentWebhookSecret(requestParameters: CreateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretValueView>;
|
|
215
250
|
/**
|
|
216
251
|
* Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it. Once the gateway confirms the delete, the agent\'s inbound triggers are retired (only with ``CLAW_TRIGGERS_ENABLED`` on); that cleanup never fails the delete.
|
|
217
252
|
* Delete Agent
|
|
@@ -222,6 +257,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
222
257
|
* Delete Agent
|
|
223
258
|
*/
|
|
224
259
|
deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
260
|
+
/**
|
|
261
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
262
|
+
* Delete Agent Webhook Secret
|
|
263
|
+
*/
|
|
264
|
+
deleteAgentWebhookSecretRaw(requestParameters: DeleteAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
265
|
+
/**
|
|
266
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
267
|
+
* Delete Agent Webhook Secret
|
|
268
|
+
*/
|
|
269
|
+
deleteAgentWebhookSecret(requestParameters: DeleteAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
225
270
|
/**
|
|
226
271
|
* Delete a never-live version; 409 ``VERSION_WAS_LIVE`` otherwise.
|
|
227
272
|
* Delete Version
|
|
@@ -233,22 +278,22 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
233
278
|
*/
|
|
234
279
|
deleteVersion(requestParameters: DeleteVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
235
280
|
/**
|
|
236
|
-
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one);
|
|
281
|
+
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); nothing the version attaches blocks it (a deleted sub-agent, skill, MCP or knowledge base is dropped from the turn). Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
|
|
237
282
|
* Deploy Agent
|
|
238
283
|
*/
|
|
239
284
|
deployAgentRaw(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
|
|
240
285
|
/**
|
|
241
|
-
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one);
|
|
286
|
+
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); nothing the version attaches blocks it (a deleted sub-agent, skill, MCP or knowledge base is dropped from the turn). Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
|
|
242
287
|
* Deploy Agent
|
|
243
288
|
*/
|
|
244
289
|
deployAgent(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
245
290
|
/**
|
|
246
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
291
|
+
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` returns the caller\'s own agents and the managed agents shared with them (the ``shared=true`` list), so a tester can open one in the Playground. A teammate\'s Cowork agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
|
|
247
292
|
* Get Agent
|
|
248
293
|
*/
|
|
249
294
|
getAgentRaw(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
|
|
250
295
|
/**
|
|
251
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
296
|
+
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` returns the caller\'s own agents and the managed agents shared with them (the ``shared=true`` list), so a tester can open one in the Playground. A teammate\'s Cowork agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
|
|
252
297
|
* Get Agent
|
|
253
298
|
*/
|
|
254
299
|
getAgent(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
@@ -347,12 +392,22 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
347
392
|
*/
|
|
348
393
|
listAgentTemplates(requestParameters?: ListAgentTemplatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EntityListAgentTemplateResource>;
|
|
349
394
|
/**
|
|
350
|
-
*
|
|
395
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
396
|
+
* List Agent Webhooks
|
|
397
|
+
*/
|
|
398
|
+
listAgentWebhooksRaw(requestParameters: ListAgentWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentWebhookList>>;
|
|
399
|
+
/**
|
|
400
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
401
|
+
* List Agent Webhooks
|
|
402
|
+
*/
|
|
403
|
+
listAgentWebhooks(requestParameters: ListAgentWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentWebhookList>;
|
|
404
|
+
/**
|
|
405
|
+
* Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which has no managed filter, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored. ``origin=managed_agents&shared=true`` lists the other side: managed agents visible to the caller that someone else owns (shared with their workspace or organisation), which the caller can test in the Playground. Their session logs stay the owner\'s. ``shared`` without ``origin`` is a 400.
|
|
351
406
|
* List Agents
|
|
352
407
|
*/
|
|
353
408
|
listAgentsRaw(requestParameters: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EntityListAgentResource>>;
|
|
354
409
|
/**
|
|
355
|
-
* Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which has no managed filter, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
|
|
410
|
+
* Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which has no managed filter, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored. ``origin=managed_agents&shared=true`` lists the other side: managed agents visible to the caller that someone else owns (shared with their workspace or organisation), which the caller can test in the Playground. Their session logs stay the owner\'s. ``shared`` without ``origin`` is a 400.
|
|
356
411
|
* List Agents
|
|
357
412
|
*/
|
|
358
413
|
listAgents(requestParameters?: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EntityListAgentResource>;
|
|
@@ -424,6 +479,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
424
479
|
* Put Agent Settings
|
|
425
480
|
*/
|
|
426
481
|
putAgentSettings(requestParameters: PutAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentSettingsResponse>;
|
|
482
|
+
/**
|
|
483
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
484
|
+
* Put Agent Webhook Secret
|
|
485
|
+
*/
|
|
486
|
+
putAgentWebhookSecretRaw(requestParameters: PutAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookSecretStateView>>;
|
|
487
|
+
/**
|
|
488
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
489
|
+
* Put Agent Webhook Secret
|
|
490
|
+
*/
|
|
491
|
+
putAgentWebhookSecret(requestParameters: PutAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretStateView>;
|
|
427
492
|
/**
|
|
428
493
|
* Put Instructions
|
|
429
494
|
*/
|
|
@@ -443,15 +508,25 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
443
508
|
*/
|
|
444
509
|
resumeAgent(requestParameters: ResumeAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
445
510
|
/**
|
|
446
|
-
*
|
|
511
|
+
* Replace the live secret with a new ``whsec_``, shown in this response only. 404 ``secret_missing`` when there is none: create one with ``POST .../secret`` first (rotate never creates one).
|
|
512
|
+
* Rotate Agent Webhook Secret
|
|
513
|
+
*/
|
|
514
|
+
rotateAgentWebhookSecretRaw(requestParameters: RotateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RotatedWebhookSecretView>>;
|
|
515
|
+
/**
|
|
516
|
+
* Replace the live secret with a new ``whsec_``, shown in this response only. 404 ``secret_missing`` when there is none: create one with ``POST .../secret`` first (rotate never creates one).
|
|
517
|
+
* Rotate Agent Webhook Secret
|
|
518
|
+
*/
|
|
519
|
+
rotateAgentWebhookSecret(requestParameters: RotateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RotatedWebhookSecretView>;
|
|
520
|
+
/**
|
|
521
|
+
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed. The gateway then shares the agent with its workspace if it is still private; a refused share does not fail the save and comes back as ``shareSkipped``.
|
|
447
522
|
* Save Version
|
|
448
523
|
*/
|
|
449
|
-
saveVersionRaw(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
524
|
+
saveVersionRaw(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentVersionSavedResource>>;
|
|
450
525
|
/**
|
|
451
|
-
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed.
|
|
526
|
+
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed. The gateway then shares the agent with its workspace if it is still private; a refused share does not fail the save and comes back as ``shareSkipped``.
|
|
452
527
|
* Save Version
|
|
453
528
|
*/
|
|
454
|
-
saveVersion(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
529
|
+
saveVersion(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentVersionSavedResource>;
|
|
455
530
|
/**
|
|
456
531
|
* Pause the live version: every surface stops answering (API sessions get 409 ``AGENT_NOT_DEPLOYED`` on their next turn) and ``/resume`` brings the same version back. The builder and Playground keep working. Idempotent: a no-op when nothing is live.
|
|
457
532
|
* Undeploy Agent
|
|
@@ -502,6 +577,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
502
577
|
* Update Agent
|
|
503
578
|
*/
|
|
504
579
|
updateAgent(requestParameters: UpdateAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
580
|
+
/**
|
|
581
|
+
* The webhook\'s current signing secret, to view again (``no-store``). Owner only. 404 ``secret_missing`` when it has none: create one with ``POST .../secret`` or set your own with ``PUT``; rotate it if it leaked.
|
|
582
|
+
* View Agent Webhook Secret
|
|
583
|
+
*/
|
|
584
|
+
viewAgentWebhookSecretRaw(requestParameters: ViewAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookSecretValueView>>;
|
|
585
|
+
/**
|
|
586
|
+
* The webhook\'s current signing secret, to view again (``no-store``). Owner only. 404 ``secret_missing`` when it has none: create one with ``POST .../secret`` or set your own with ``PUT``; rotate it if it leaked.
|
|
587
|
+
* View Agent Webhook Secret
|
|
588
|
+
*/
|
|
589
|
+
viewAgentWebhookSecret(requestParameters: ViewAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretValueView>;
|
|
505
590
|
}
|
|
506
591
|
/**
|
|
507
592
|
* @export
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import * as runtime from '../runtime.js';
|
|
15
|
-
import { AgentContentsResourceFromJSON, AgentCreateToJSON, AgentDeployToJSON, AgentDraftResourceFromJSON, AgentHistoryResourceFromJSON, AgentResourceFromJSON, AgentSettingsResponseFromJSON, AgentTemplateResourceFromJSON, AgentUpdateToJSON, AgentVersionCreateToJSON, AgentVersionDiffResourceFromJSON, AgentVersionPickToJSON, AgentVersionResourceFromJSON, EntityListAgentResourceFromJSON, EntityListAgentTemplateResourceFromJSON, FileNodeViewFromJSON, FileWriteBodyToJSON, InstructionsBodyToJSON, InstructionsResponseFromJSON, PageFileNodeViewFromJSON, PublishRequestToJSON, SkillUpdateResourceFromJSON, } from '../models/index.js';
|
|
15
|
+
import { AgentContentsResourceFromJSON, AgentCreateToJSON, AgentDeployToJSON, AgentDraftResourceFromJSON, AgentHistoryResourceFromJSON, AgentResourceFromJSON, AgentSettingsResponseFromJSON, AgentTemplateResourceFromJSON, AgentUpdateToJSON, AgentVersionCreateToJSON, AgentVersionDiffResourceFromJSON, AgentVersionPickToJSON, AgentVersionResourceFromJSON, AgentVersionSavedResourceFromJSON, AgentWebhookListFromJSON, EntityListAgentResourceFromJSON, EntityListAgentTemplateResourceFromJSON, FileNodeViewFromJSON, FileWriteBodyToJSON, InstructionsBodyToJSON, InstructionsResponseFromJSON, PageFileNodeViewFromJSON, PublishRequestToJSON, RotatedWebhookSecretViewFromJSON, SkillUpdateResourceFromJSON, WebhookSecretPutBodyToJSON, WebhookSecretStateViewFromJSON, WebhookSecretValueViewFromJSON, } from '../models/index.js';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
@@ -210,6 +210,42 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
210
210
|
const response = await this.createAgentRaw(requestParameters, initOverrides);
|
|
211
211
|
return await response.value();
|
|
212
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Create the webhook\'s signing secret, shown in this response only (``no-store``): its first one, or a new one after a delete. 409 ``secret_exists`` when it already has one (rotate-secret replaces it).
|
|
215
|
+
* Create Agent Webhook Secret
|
|
216
|
+
*/
|
|
217
|
+
async createAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
218
|
+
if (requestParameters['agentId'] == null) {
|
|
219
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling createAgentWebhookSecret().');
|
|
220
|
+
}
|
|
221
|
+
if (requestParameters['webhookKey'] == null) {
|
|
222
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling createAgentWebhookSecret().');
|
|
223
|
+
}
|
|
224
|
+
const queryParameters = {};
|
|
225
|
+
const headerParameters = {};
|
|
226
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
227
|
+
const token = this.configuration.accessToken;
|
|
228
|
+
const tokenString = await token("bearerAuth", []);
|
|
229
|
+
if (tokenString) {
|
|
230
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const response = await this.request({
|
|
234
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
235
|
+
method: 'POST',
|
|
236
|
+
headers: headerParameters,
|
|
237
|
+
query: queryParameters,
|
|
238
|
+
}, initOverrides);
|
|
239
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSecretValueViewFromJSON(jsonValue));
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Create the webhook\'s signing secret, shown in this response only (``no-store``): its first one, or a new one after a delete. 409 ``secret_exists`` when it already has one (rotate-secret replaces it).
|
|
243
|
+
* Create Agent Webhook Secret
|
|
244
|
+
*/
|
|
245
|
+
async createAgentWebhookSecret(requestParameters, initOverrides) {
|
|
246
|
+
const response = await this.createAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
247
|
+
return await response.value();
|
|
248
|
+
}
|
|
213
249
|
/**
|
|
214
250
|
* Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it. Once the gateway confirms the delete, the agent\'s inbound triggers are retired (only with ``CLAW_TRIGGERS_ENABLED`` on); that cleanup never fails the delete.
|
|
215
251
|
* Delete Agent
|
|
@@ -242,6 +278,41 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
242
278
|
async deleteAgent(requestParameters, initOverrides) {
|
|
243
279
|
await this.deleteAgentRaw(requestParameters, initOverrides);
|
|
244
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
283
|
+
* Delete Agent Webhook Secret
|
|
284
|
+
*/
|
|
285
|
+
async deleteAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
286
|
+
if (requestParameters['agentId'] == null) {
|
|
287
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling deleteAgentWebhookSecret().');
|
|
288
|
+
}
|
|
289
|
+
if (requestParameters['webhookKey'] == null) {
|
|
290
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling deleteAgentWebhookSecret().');
|
|
291
|
+
}
|
|
292
|
+
const queryParameters = {};
|
|
293
|
+
const headerParameters = {};
|
|
294
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
295
|
+
const token = this.configuration.accessToken;
|
|
296
|
+
const tokenString = await token("bearerAuth", []);
|
|
297
|
+
if (tokenString) {
|
|
298
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const response = await this.request({
|
|
302
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
303
|
+
method: 'DELETE',
|
|
304
|
+
headers: headerParameters,
|
|
305
|
+
query: queryParameters,
|
|
306
|
+
}, initOverrides);
|
|
307
|
+
return new runtime.VoidApiResponse(response);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
311
|
+
* Delete Agent Webhook Secret
|
|
312
|
+
*/
|
|
313
|
+
async deleteAgentWebhookSecret(requestParameters, initOverrides) {
|
|
314
|
+
await this.deleteAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
315
|
+
}
|
|
245
316
|
/**
|
|
246
317
|
* Delete a never-live version; 409 ``VERSION_WAS_LIVE`` otherwise.
|
|
247
318
|
* Delete Version
|
|
@@ -278,7 +349,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
278
349
|
await this.deleteVersionRaw(requestParameters, initOverrides);
|
|
279
350
|
}
|
|
280
351
|
/**
|
|
281
|
-
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one);
|
|
352
|
+
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); nothing the version attaches blocks it (a deleted sub-agent, skill, MCP or knowledge base is dropped from the turn). Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
|
|
282
353
|
* Deploy Agent
|
|
283
354
|
*/
|
|
284
355
|
async deployAgentRaw(requestParameters, initOverrides) {
|
|
@@ -305,7 +376,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
305
376
|
return new runtime.JSONApiResponse(response, (jsonValue) => AgentResourceFromJSON(jsonValue));
|
|
306
377
|
}
|
|
307
378
|
/**
|
|
308
|
-
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one);
|
|
379
|
+
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); nothing the version attaches blocks it (a deleted sub-agent, skill, MCP or knowledge base is dropped from the turn). Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
|
|
309
380
|
* Deploy Agent
|
|
310
381
|
*/
|
|
311
382
|
async deployAgent(requestParameters, initOverrides) {
|
|
@@ -313,7 +384,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
313
384
|
return await response.value();
|
|
314
385
|
}
|
|
315
386
|
/**
|
|
316
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
387
|
+
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` returns the caller\'s own agents and the managed agents shared with them (the ``shared=true`` list), so a tester can open one in the Playground. A teammate\'s Cowork agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
|
|
317
388
|
* Get Agent
|
|
318
389
|
*/
|
|
319
390
|
async getAgentRaw(requestParameters, initOverrides) {
|
|
@@ -344,7 +415,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
344
415
|
return new runtime.JSONApiResponse(response, (jsonValue) => AgentResourceFromJSON(jsonValue));
|
|
345
416
|
}
|
|
346
417
|
/**
|
|
347
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
418
|
+
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` returns the caller\'s own agents and the managed agents shared with them (the ``shared=true`` list), so a tester can open one in the Playground. A teammate\'s Cowork agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
|
|
348
419
|
* Get Agent
|
|
349
420
|
*/
|
|
350
421
|
async getAgent(requestParameters, initOverrides) {
|
|
@@ -693,7 +764,40 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
693
764
|
return await response.value();
|
|
694
765
|
}
|
|
695
766
|
/**
|
|
696
|
-
*
|
|
767
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
768
|
+
* List Agent Webhooks
|
|
769
|
+
*/
|
|
770
|
+
async listAgentWebhooksRaw(requestParameters, initOverrides) {
|
|
771
|
+
if (requestParameters['agentId'] == null) {
|
|
772
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listAgentWebhooks().');
|
|
773
|
+
}
|
|
774
|
+
const queryParameters = {};
|
|
775
|
+
const headerParameters = {};
|
|
776
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
777
|
+
const token = this.configuration.accessToken;
|
|
778
|
+
const tokenString = await token("bearerAuth", []);
|
|
779
|
+
if (tokenString) {
|
|
780
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
const response = await this.request({
|
|
784
|
+
path: `/v1/agents/{agentId}/webhooks`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
|
|
785
|
+
method: 'GET',
|
|
786
|
+
headers: headerParameters,
|
|
787
|
+
query: queryParameters,
|
|
788
|
+
}, initOverrides);
|
|
789
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentWebhookListFromJSON(jsonValue));
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
793
|
+
* List Agent Webhooks
|
|
794
|
+
*/
|
|
795
|
+
async listAgentWebhooks(requestParameters, initOverrides) {
|
|
796
|
+
const response = await this.listAgentWebhooksRaw(requestParameters, initOverrides);
|
|
797
|
+
return await response.value();
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which has no managed filter, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored. ``origin=managed_agents&shared=true`` lists the other side: managed agents visible to the caller that someone else owns (shared with their workspace or organisation), which the caller can test in the Playground. Their session logs stay the owner\'s. ``shared`` without ``origin`` is a 400.
|
|
697
801
|
* List Agents
|
|
698
802
|
*/
|
|
699
803
|
async listAgentsRaw(requestParameters, initOverrides) {
|
|
@@ -701,6 +805,9 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
701
805
|
if (requestParameters['channel'] != null) {
|
|
702
806
|
queryParameters['channel'] = requestParameters['channel'];
|
|
703
807
|
}
|
|
808
|
+
if (requestParameters['shared'] != null) {
|
|
809
|
+
queryParameters['shared'] = requestParameters['shared'];
|
|
810
|
+
}
|
|
704
811
|
if (requestParameters['scope'] != null) {
|
|
705
812
|
queryParameters['scope'] = requestParameters['scope'];
|
|
706
813
|
}
|
|
@@ -751,7 +858,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
751
858
|
return new runtime.JSONApiResponse(response, (jsonValue) => EntityListAgentResourceFromJSON(jsonValue));
|
|
752
859
|
}
|
|
753
860
|
/**
|
|
754
|
-
* Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which has no managed filter, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
|
|
861
|
+
* Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which has no managed filter, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored. ``origin=managed_agents&shared=true`` lists the other side: managed agents visible to the caller that someone else owns (shared with their workspace or organisation), which the caller can test in the Playground. Their session logs stay the owner\'s. ``shared`` without ``origin`` is a 400.
|
|
755
862
|
* List Agents
|
|
756
863
|
*/
|
|
757
864
|
async listAgents(requestParameters = {}, initOverrides) {
|
|
@@ -1007,6 +1114,47 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1007
1114
|
const response = await this.putAgentSettingsRaw(requestParameters, initOverrides);
|
|
1008
1115
|
return await response.value();
|
|
1009
1116
|
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
1119
|
+
* Put Agent Webhook Secret
|
|
1120
|
+
*/
|
|
1121
|
+
async putAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
1122
|
+
if (requestParameters['agentId'] == null) {
|
|
1123
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling putAgentWebhookSecret().');
|
|
1124
|
+
}
|
|
1125
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1126
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling putAgentWebhookSecret().');
|
|
1127
|
+
}
|
|
1128
|
+
if (requestParameters['webhookSecretPutBody'] == null) {
|
|
1129
|
+
throw new runtime.RequiredError('webhookSecretPutBody', 'Required parameter "webhookSecretPutBody" was null or undefined when calling putAgentWebhookSecret().');
|
|
1130
|
+
}
|
|
1131
|
+
const queryParameters = {};
|
|
1132
|
+
const headerParameters = {};
|
|
1133
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1134
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1135
|
+
const token = this.configuration.accessToken;
|
|
1136
|
+
const tokenString = await token("bearerAuth", []);
|
|
1137
|
+
if (tokenString) {
|
|
1138
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
const response = await this.request({
|
|
1142
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1143
|
+
method: 'PUT',
|
|
1144
|
+
headers: headerParameters,
|
|
1145
|
+
query: queryParameters,
|
|
1146
|
+
body: WebhookSecretPutBodyToJSON(requestParameters['webhookSecretPutBody']),
|
|
1147
|
+
}, initOverrides);
|
|
1148
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSecretStateViewFromJSON(jsonValue));
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
1152
|
+
* Put Agent Webhook Secret
|
|
1153
|
+
*/
|
|
1154
|
+
async putAgentWebhookSecret(requestParameters, initOverrides) {
|
|
1155
|
+
const response = await this.putAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1156
|
+
return await response.value();
|
|
1157
|
+
}
|
|
1010
1158
|
/**
|
|
1011
1159
|
* Put Instructions
|
|
1012
1160
|
*/
|
|
@@ -1077,7 +1225,43 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1077
1225
|
return await response.value();
|
|
1078
1226
|
}
|
|
1079
1227
|
/**
|
|
1080
|
-
*
|
|
1228
|
+
* Replace the live secret with a new ``whsec_``, shown in this response only. 404 ``secret_missing`` when there is none: create one with ``POST .../secret`` first (rotate never creates one).
|
|
1229
|
+
* Rotate Agent Webhook Secret
|
|
1230
|
+
*/
|
|
1231
|
+
async rotateAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
1232
|
+
if (requestParameters['agentId'] == null) {
|
|
1233
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling rotateAgentWebhookSecret().');
|
|
1234
|
+
}
|
|
1235
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1236
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling rotateAgentWebhookSecret().');
|
|
1237
|
+
}
|
|
1238
|
+
const queryParameters = {};
|
|
1239
|
+
const headerParameters = {};
|
|
1240
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1241
|
+
const token = this.configuration.accessToken;
|
|
1242
|
+
const tokenString = await token("bearerAuth", []);
|
|
1243
|
+
if (tokenString) {
|
|
1244
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
const response = await this.request({
|
|
1248
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/rotate-secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1249
|
+
method: 'POST',
|
|
1250
|
+
headers: headerParameters,
|
|
1251
|
+
query: queryParameters,
|
|
1252
|
+
}, initOverrides);
|
|
1253
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RotatedWebhookSecretViewFromJSON(jsonValue));
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Replace the live secret with a new ``whsec_``, shown in this response only. 404 ``secret_missing`` when there is none: create one with ``POST .../secret`` first (rotate never creates one).
|
|
1257
|
+
* Rotate Agent Webhook Secret
|
|
1258
|
+
*/
|
|
1259
|
+
async rotateAgentWebhookSecret(requestParameters, initOverrides) {
|
|
1260
|
+
const response = await this.rotateAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1261
|
+
return await response.value();
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed. The gateway then shares the agent with its workspace if it is still private; a refused share does not fail the save and comes back as ``shareSkipped``.
|
|
1081
1265
|
* Save Version
|
|
1082
1266
|
*/
|
|
1083
1267
|
async saveVersionRaw(requestParameters, initOverrides) {
|
|
@@ -1104,10 +1288,10 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1104
1288
|
query: queryParameters,
|
|
1105
1289
|
body: AgentVersionCreateToJSON(requestParameters['agentVersionCreate']),
|
|
1106
1290
|
}, initOverrides);
|
|
1107
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
1291
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentVersionSavedResourceFromJSON(jsonValue));
|
|
1108
1292
|
}
|
|
1109
1293
|
/**
|
|
1110
|
-
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed.
|
|
1294
|
+
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed. The gateway then shares the agent with its workspace if it is still private; a refused share does not fail the save and comes back as ``shareSkipped``.
|
|
1111
1295
|
* Save Version
|
|
1112
1296
|
*/
|
|
1113
1297
|
async saveVersion(requestParameters, initOverrides) {
|
|
@@ -1295,6 +1479,42 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1295
1479
|
const response = await this.updateAgentRaw(requestParameters, initOverrides);
|
|
1296
1480
|
return await response.value();
|
|
1297
1481
|
}
|
|
1482
|
+
/**
|
|
1483
|
+
* The webhook\'s current signing secret, to view again (``no-store``). Owner only. 404 ``secret_missing`` when it has none: create one with ``POST .../secret`` or set your own with ``PUT``; rotate it if it leaked.
|
|
1484
|
+
* View Agent Webhook Secret
|
|
1485
|
+
*/
|
|
1486
|
+
async viewAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
1487
|
+
if (requestParameters['agentId'] == null) {
|
|
1488
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling viewAgentWebhookSecret().');
|
|
1489
|
+
}
|
|
1490
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1491
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling viewAgentWebhookSecret().');
|
|
1492
|
+
}
|
|
1493
|
+
const queryParameters = {};
|
|
1494
|
+
const headerParameters = {};
|
|
1495
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1496
|
+
const token = this.configuration.accessToken;
|
|
1497
|
+
const tokenString = await token("bearerAuth", []);
|
|
1498
|
+
if (tokenString) {
|
|
1499
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
const response = await this.request({
|
|
1503
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1504
|
+
method: 'GET',
|
|
1505
|
+
headers: headerParameters,
|
|
1506
|
+
query: queryParameters,
|
|
1507
|
+
}, initOverrides);
|
|
1508
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSecretValueViewFromJSON(jsonValue));
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* The webhook\'s current signing secret, to view again (``no-store``). Owner only. 404 ``secret_missing`` when it has none: create one with ``POST .../secret`` or set your own with ``PUT``; rotate it if it leaked.
|
|
1512
|
+
* View Agent Webhook Secret
|
|
1513
|
+
*/
|
|
1514
|
+
async viewAgentWebhookSecret(requestParameters, initOverrides) {
|
|
1515
|
+
const response = await this.viewAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1516
|
+
return await response.value();
|
|
1517
|
+
}
|
|
1298
1518
|
}
|
|
1299
1519
|
/**
|
|
1300
1520
|
* @export
|
|
@@ -35,6 +35,7 @@ export interface ListConversationsRequest {
|
|
|
35
35
|
cursor?: string | null;
|
|
36
36
|
q?: string | null;
|
|
37
37
|
sessionType?: ListConversationsSessionTypeEnum;
|
|
38
|
+
agentId?: string | null;
|
|
38
39
|
}
|
|
39
40
|
export interface PinConversationRequest {
|
|
40
41
|
conversationId: string;
|
|
@@ -56,12 +57,12 @@ export interface UpdateConversationRequest {
|
|
|
56
57
|
*/
|
|
57
58
|
export declare class ConversationsApi extends runtime.BaseAPI {
|
|
58
59
|
/**
|
|
59
|
-
* ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin``
|
|
60
|
+
* ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin``, an ``agentId`` or ``metadata.agent_id`` (how Indus binds a chat) must still name an agent the caller can see (else 404): the binding puts the chat in that agent\'s session log and interaction count. A conversation created with ``X-Panja-Surface: playground`` (an agent\'s Playground) is saved as session type ``playground``: hidden from the default inbox and listed apart from real chats in the agent\'s session log. Never gated, so drafts work (``services.session_types``).
|
|
60
61
|
* Create Conversation Route
|
|
61
62
|
*/
|
|
62
63
|
createConversationRaw(requestParameters: CreateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConversationView>>;
|
|
63
64
|
/**
|
|
64
|
-
* ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin``
|
|
65
|
+
* ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin``, an ``agentId`` or ``metadata.agent_id`` (how Indus binds a chat) must still name an agent the caller can see (else 404): the binding puts the chat in that agent\'s session log and interaction count. A conversation created with ``X-Panja-Surface: playground`` (an agent\'s Playground) is saved as session type ``playground``: hidden from the default inbox and listed apart from real chats in the agent\'s session log. Never gated, so drafts work (``services.session_types``).
|
|
65
66
|
* Create Conversation Route
|
|
66
67
|
*/
|
|
67
68
|
createConversation(requestParameters: CreateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConversationView>;
|
|
@@ -128,10 +129,12 @@ export declare class ConversationsApi extends runtime.BaseAPI {
|
|
|
128
129
|
*/
|
|
129
130
|
unpinConversation(requestParameters: UnpinConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConversationView>;
|
|
130
131
|
/**
|
|
132
|
+
* Rename or replace ``metadata``. A ``metadata.agent_id`` that differs from the stored one must name an agent the caller can see (else 404); an unchanged one is not re-checked, so a chat whose agent was since unshared can still be renamed.
|
|
131
133
|
* Update Conversation Route
|
|
132
134
|
*/
|
|
133
135
|
updateConversationRaw(requestParameters: UpdateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConversationView>>;
|
|
134
136
|
/**
|
|
137
|
+
* Rename or replace ``metadata``. A ``metadata.agent_id`` that differs from the stored one must name an agent the caller can see (else 404); an unchanged one is not re-checked, so a chat whose agent was since unshared can still be renamed.
|
|
135
138
|
* Update Conversation Route
|
|
136
139
|
*/
|
|
137
140
|
updateConversation(requestParameters: UpdateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConversationView>;
|