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
package/src/apis/AgentsApi.ts
CHANGED
|
@@ -29,6 +29,8 @@ import type {
|
|
|
29
29
|
AgentVersionDiffResource,
|
|
30
30
|
AgentVersionPick,
|
|
31
31
|
AgentVersionResource,
|
|
32
|
+
AgentVersionSavedResource,
|
|
33
|
+
AgentWebhookList,
|
|
32
34
|
ChatError,
|
|
33
35
|
EntityCategory,
|
|
34
36
|
EntityListAgentResource,
|
|
@@ -41,8 +43,12 @@ import type {
|
|
|
41
43
|
ListModels403Response,
|
|
42
44
|
PageFileNodeView,
|
|
43
45
|
PublishRequest,
|
|
46
|
+
RotatedWebhookSecretView,
|
|
44
47
|
Scope,
|
|
45
48
|
SkillUpdateResource,
|
|
49
|
+
WebhookSecretPutBody,
|
|
50
|
+
WebhookSecretStateView,
|
|
51
|
+
WebhookSecretValueView,
|
|
46
52
|
} from '../models/index.js';
|
|
47
53
|
import {
|
|
48
54
|
AgentContentsResourceFromJSON,
|
|
@@ -73,6 +79,10 @@ import {
|
|
|
73
79
|
AgentVersionPickToJSON,
|
|
74
80
|
AgentVersionResourceFromJSON,
|
|
75
81
|
AgentVersionResourceToJSON,
|
|
82
|
+
AgentVersionSavedResourceFromJSON,
|
|
83
|
+
AgentVersionSavedResourceToJSON,
|
|
84
|
+
AgentWebhookListFromJSON,
|
|
85
|
+
AgentWebhookListToJSON,
|
|
76
86
|
ChatErrorFromJSON,
|
|
77
87
|
ChatErrorToJSON,
|
|
78
88
|
EntityCategoryFromJSON,
|
|
@@ -97,10 +107,18 @@ import {
|
|
|
97
107
|
PageFileNodeViewToJSON,
|
|
98
108
|
PublishRequestFromJSON,
|
|
99
109
|
PublishRequestToJSON,
|
|
110
|
+
RotatedWebhookSecretViewFromJSON,
|
|
111
|
+
RotatedWebhookSecretViewToJSON,
|
|
100
112
|
ScopeFromJSON,
|
|
101
113
|
ScopeToJSON,
|
|
102
114
|
SkillUpdateResourceFromJSON,
|
|
103
115
|
SkillUpdateResourceToJSON,
|
|
116
|
+
WebhookSecretPutBodyFromJSON,
|
|
117
|
+
WebhookSecretPutBodyToJSON,
|
|
118
|
+
WebhookSecretStateViewFromJSON,
|
|
119
|
+
WebhookSecretStateViewToJSON,
|
|
120
|
+
WebhookSecretValueViewFromJSON,
|
|
121
|
+
WebhookSecretValueViewToJSON,
|
|
104
122
|
} from '../models/index.js';
|
|
105
123
|
|
|
106
124
|
export interface AcceptSkillUpdateRequest {
|
|
@@ -131,10 +149,20 @@ export interface CreateAgentRequest {
|
|
|
131
149
|
xPanjaOrigin?: CreateAgentXPanjaOriginEnum;
|
|
132
150
|
}
|
|
133
151
|
|
|
152
|
+
export interface CreateAgentWebhookSecretRequest {
|
|
153
|
+
agentId: string;
|
|
154
|
+
webhookKey: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
134
157
|
export interface DeleteAgentRequest {
|
|
135
158
|
agentId: string;
|
|
136
159
|
}
|
|
137
160
|
|
|
161
|
+
export interface DeleteAgentWebhookSecretRequest {
|
|
162
|
+
agentId: string;
|
|
163
|
+
webhookKey: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
138
166
|
export interface DeleteVersionRequest {
|
|
139
167
|
agentId: string;
|
|
140
168
|
version: number;
|
|
@@ -198,8 +226,13 @@ export interface ListAgentTemplatesRequest {
|
|
|
198
226
|
offset?: number;
|
|
199
227
|
}
|
|
200
228
|
|
|
229
|
+
export interface ListAgentWebhooksRequest {
|
|
230
|
+
agentId: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
201
233
|
export interface ListAgentsRequest {
|
|
202
234
|
channel?: Array<AgentSearchChannel> | null;
|
|
235
|
+
shared?: boolean;
|
|
203
236
|
scope?: Scope | null;
|
|
204
237
|
q?: string | null;
|
|
205
238
|
limit?: number;
|
|
@@ -246,6 +279,12 @@ export interface PutAgentSettingsRequest {
|
|
|
246
279
|
body: object;
|
|
247
280
|
}
|
|
248
281
|
|
|
282
|
+
export interface PutAgentWebhookSecretRequest {
|
|
283
|
+
agentId: string;
|
|
284
|
+
webhookKey: string;
|
|
285
|
+
webhookSecretPutBody: WebhookSecretPutBody;
|
|
286
|
+
}
|
|
287
|
+
|
|
249
288
|
export interface PutInstructionsRequest {
|
|
250
289
|
agentId: string;
|
|
251
290
|
instructionsBody: InstructionsBody;
|
|
@@ -255,6 +294,11 @@ export interface ResumeAgentRequest {
|
|
|
255
294
|
agentId: string;
|
|
256
295
|
}
|
|
257
296
|
|
|
297
|
+
export interface RotateAgentWebhookSecretRequest {
|
|
298
|
+
agentId: string;
|
|
299
|
+
webhookKey: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
258
302
|
export interface SaveVersionRequest {
|
|
259
303
|
agentId: string;
|
|
260
304
|
agentVersionCreate: AgentVersionCreate;
|
|
@@ -285,6 +329,11 @@ export interface UpdateAgentRequest {
|
|
|
285
329
|
agentUpdate: AgentUpdate;
|
|
286
330
|
}
|
|
287
331
|
|
|
332
|
+
export interface ViewAgentWebhookSecretRequest {
|
|
333
|
+
agentId: string;
|
|
334
|
+
webhookKey: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
288
337
|
/**
|
|
289
338
|
*
|
|
290
339
|
*/
|
|
@@ -549,6 +598,56 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
549
598
|
return await response.value();
|
|
550
599
|
}
|
|
551
600
|
|
|
601
|
+
/**
|
|
602
|
+
* 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).
|
|
603
|
+
* Create Agent Webhook Secret
|
|
604
|
+
*/
|
|
605
|
+
async createAgentWebhookSecretRaw(requestParameters: CreateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookSecretValueView>> {
|
|
606
|
+
if (requestParameters['agentId'] == null) {
|
|
607
|
+
throw new runtime.RequiredError(
|
|
608
|
+
'agentId',
|
|
609
|
+
'Required parameter "agentId" was null or undefined when calling createAgentWebhookSecret().'
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (requestParameters['webhookKey'] == null) {
|
|
614
|
+
throw new runtime.RequiredError(
|
|
615
|
+
'webhookKey',
|
|
616
|
+
'Required parameter "webhookKey" was null or undefined when calling createAgentWebhookSecret().'
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
const queryParameters: any = {};
|
|
621
|
+
|
|
622
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
623
|
+
|
|
624
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
625
|
+
const token = this.configuration.accessToken;
|
|
626
|
+
const tokenString = await token("bearerAuth", []);
|
|
627
|
+
|
|
628
|
+
if (tokenString) {
|
|
629
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
const response = await this.request({
|
|
633
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
634
|
+
method: 'POST',
|
|
635
|
+
headers: headerParameters,
|
|
636
|
+
query: queryParameters,
|
|
637
|
+
}, initOverrides);
|
|
638
|
+
|
|
639
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSecretValueViewFromJSON(jsonValue));
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* 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).
|
|
644
|
+
* Create Agent Webhook Secret
|
|
645
|
+
*/
|
|
646
|
+
async createAgentWebhookSecret(requestParameters: CreateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretValueView> {
|
|
647
|
+
const response = await this.createAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
648
|
+
return await response.value();
|
|
649
|
+
}
|
|
650
|
+
|
|
552
651
|
/**
|
|
553
652
|
* 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.
|
|
554
653
|
* Delete Agent
|
|
@@ -591,6 +690,55 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
591
690
|
await this.deleteAgentRaw(requestParameters, initOverrides);
|
|
592
691
|
}
|
|
593
692
|
|
|
693
|
+
/**
|
|
694
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
695
|
+
* Delete Agent Webhook Secret
|
|
696
|
+
*/
|
|
697
|
+
async deleteAgentWebhookSecretRaw(requestParameters: DeleteAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
698
|
+
if (requestParameters['agentId'] == null) {
|
|
699
|
+
throw new runtime.RequiredError(
|
|
700
|
+
'agentId',
|
|
701
|
+
'Required parameter "agentId" was null or undefined when calling deleteAgentWebhookSecret().'
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
if (requestParameters['webhookKey'] == null) {
|
|
706
|
+
throw new runtime.RequiredError(
|
|
707
|
+
'webhookKey',
|
|
708
|
+
'Required parameter "webhookKey" was null or undefined when calling deleteAgentWebhookSecret().'
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const queryParameters: any = {};
|
|
713
|
+
|
|
714
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
715
|
+
|
|
716
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
717
|
+
const token = this.configuration.accessToken;
|
|
718
|
+
const tokenString = await token("bearerAuth", []);
|
|
719
|
+
|
|
720
|
+
if (tokenString) {
|
|
721
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
const response = await this.request({
|
|
725
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
726
|
+
method: 'DELETE',
|
|
727
|
+
headers: headerParameters,
|
|
728
|
+
query: queryParameters,
|
|
729
|
+
}, initOverrides);
|
|
730
|
+
|
|
731
|
+
return new runtime.VoidApiResponse(response);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
736
|
+
* Delete Agent Webhook Secret
|
|
737
|
+
*/
|
|
738
|
+
async deleteAgentWebhookSecret(requestParameters: DeleteAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
739
|
+
await this.deleteAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
740
|
+
}
|
|
741
|
+
|
|
594
742
|
/**
|
|
595
743
|
* Delete a never-live version; 409 ``VERSION_WAS_LIVE`` otherwise.
|
|
596
744
|
* Delete Version
|
|
@@ -641,7 +789,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
641
789
|
}
|
|
642
790
|
|
|
643
791
|
/**
|
|
644
|
-
* 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);
|
|
792
|
+
* 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.
|
|
645
793
|
* Deploy Agent
|
|
646
794
|
*/
|
|
647
795
|
async deployAgentRaw(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>> {
|
|
@@ -678,7 +826,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
678
826
|
}
|
|
679
827
|
|
|
680
828
|
/**
|
|
681
|
-
* 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);
|
|
829
|
+
* 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.
|
|
682
830
|
* Deploy Agent
|
|
683
831
|
*/
|
|
684
832
|
async deployAgent(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource> {
|
|
@@ -687,7 +835,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
687
835
|
}
|
|
688
836
|
|
|
689
837
|
/**
|
|
690
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
838
|
+
* 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).
|
|
691
839
|
* Get Agent
|
|
692
840
|
*/
|
|
693
841
|
async getAgentRaw(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>> {
|
|
@@ -729,7 +877,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
729
877
|
}
|
|
730
878
|
|
|
731
879
|
/**
|
|
732
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
880
|
+
* 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).
|
|
733
881
|
* Get Agent
|
|
734
882
|
*/
|
|
735
883
|
async getAgent(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource> {
|
|
@@ -1192,7 +1340,50 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1192
1340
|
}
|
|
1193
1341
|
|
|
1194
1342
|
/**
|
|
1195
|
-
*
|
|
1343
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
1344
|
+
* List Agent Webhooks
|
|
1345
|
+
*/
|
|
1346
|
+
async listAgentWebhooksRaw(requestParameters: ListAgentWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentWebhookList>> {
|
|
1347
|
+
if (requestParameters['agentId'] == null) {
|
|
1348
|
+
throw new runtime.RequiredError(
|
|
1349
|
+
'agentId',
|
|
1350
|
+
'Required parameter "agentId" was null or undefined when calling listAgentWebhooks().'
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
const queryParameters: any = {};
|
|
1355
|
+
|
|
1356
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1357
|
+
|
|
1358
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1359
|
+
const token = this.configuration.accessToken;
|
|
1360
|
+
const tokenString = await token("bearerAuth", []);
|
|
1361
|
+
|
|
1362
|
+
if (tokenString) {
|
|
1363
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
const response = await this.request({
|
|
1367
|
+
path: `/v1/agents/{agentId}/webhooks`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
|
|
1368
|
+
method: 'GET',
|
|
1369
|
+
headers: headerParameters,
|
|
1370
|
+
query: queryParameters,
|
|
1371
|
+
}, initOverrides);
|
|
1372
|
+
|
|
1373
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentWebhookListFromJSON(jsonValue));
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
1378
|
+
* List Agent Webhooks
|
|
1379
|
+
*/
|
|
1380
|
+
async listAgentWebhooks(requestParameters: ListAgentWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentWebhookList> {
|
|
1381
|
+
const response = await this.listAgentWebhooksRaw(requestParameters, initOverrides);
|
|
1382
|
+
return await response.value();
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* 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.
|
|
1196
1387
|
* List Agents
|
|
1197
1388
|
*/
|
|
1198
1389
|
async listAgentsRaw(requestParameters: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EntityListAgentResource>> {
|
|
@@ -1202,6 +1393,10 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1202
1393
|
queryParameters['channel'] = requestParameters['channel'];
|
|
1203
1394
|
}
|
|
1204
1395
|
|
|
1396
|
+
if (requestParameters['shared'] != null) {
|
|
1397
|
+
queryParameters['shared'] = requestParameters['shared'];
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1205
1400
|
if (requestParameters['scope'] != null) {
|
|
1206
1401
|
queryParameters['scope'] = requestParameters['scope'];
|
|
1207
1402
|
}
|
|
@@ -1267,7 +1462,7 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1267
1462
|
}
|
|
1268
1463
|
|
|
1269
1464
|
/**
|
|
1270
|
-
* 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.
|
|
1465
|
+
* 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.
|
|
1271
1466
|
* List Agents
|
|
1272
1467
|
*/
|
|
1273
1468
|
async listAgents(requestParameters: ListAgentsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EntityListAgentResource> {
|
|
@@ -1614,6 +1809,66 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1614
1809
|
return await response.value();
|
|
1615
1810
|
}
|
|
1616
1811
|
|
|
1812
|
+
/**
|
|
1813
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
1814
|
+
* Put Agent Webhook Secret
|
|
1815
|
+
*/
|
|
1816
|
+
async putAgentWebhookSecretRaw(requestParameters: PutAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookSecretStateView>> {
|
|
1817
|
+
if (requestParameters['agentId'] == null) {
|
|
1818
|
+
throw new runtime.RequiredError(
|
|
1819
|
+
'agentId',
|
|
1820
|
+
'Required parameter "agentId" was null or undefined when calling putAgentWebhookSecret().'
|
|
1821
|
+
);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1825
|
+
throw new runtime.RequiredError(
|
|
1826
|
+
'webhookKey',
|
|
1827
|
+
'Required parameter "webhookKey" was null or undefined when calling putAgentWebhookSecret().'
|
|
1828
|
+
);
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
if (requestParameters['webhookSecretPutBody'] == null) {
|
|
1832
|
+
throw new runtime.RequiredError(
|
|
1833
|
+
'webhookSecretPutBody',
|
|
1834
|
+
'Required parameter "webhookSecretPutBody" was null or undefined when calling putAgentWebhookSecret().'
|
|
1835
|
+
);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
const queryParameters: any = {};
|
|
1839
|
+
|
|
1840
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1841
|
+
|
|
1842
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1843
|
+
|
|
1844
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1845
|
+
const token = this.configuration.accessToken;
|
|
1846
|
+
const tokenString = await token("bearerAuth", []);
|
|
1847
|
+
|
|
1848
|
+
if (tokenString) {
|
|
1849
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
const response = await this.request({
|
|
1853
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1854
|
+
method: 'PUT',
|
|
1855
|
+
headers: headerParameters,
|
|
1856
|
+
query: queryParameters,
|
|
1857
|
+
body: WebhookSecretPutBodyToJSON(requestParameters['webhookSecretPutBody']),
|
|
1858
|
+
}, initOverrides);
|
|
1859
|
+
|
|
1860
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSecretStateViewFromJSON(jsonValue));
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
1865
|
+
* Put Agent Webhook Secret
|
|
1866
|
+
*/
|
|
1867
|
+
async putAgentWebhookSecret(requestParameters: PutAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretStateView> {
|
|
1868
|
+
const response = await this.putAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1869
|
+
return await response.value();
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1617
1872
|
/**
|
|
1618
1873
|
* Put Instructions
|
|
1619
1874
|
*/
|
|
@@ -1709,10 +1964,60 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1709
1964
|
}
|
|
1710
1965
|
|
|
1711
1966
|
/**
|
|
1712
|
-
*
|
|
1967
|
+
* 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).
|
|
1968
|
+
* Rotate Agent Webhook Secret
|
|
1969
|
+
*/
|
|
1970
|
+
async rotateAgentWebhookSecretRaw(requestParameters: RotateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RotatedWebhookSecretView>> {
|
|
1971
|
+
if (requestParameters['agentId'] == null) {
|
|
1972
|
+
throw new runtime.RequiredError(
|
|
1973
|
+
'agentId',
|
|
1974
|
+
'Required parameter "agentId" was null or undefined when calling rotateAgentWebhookSecret().'
|
|
1975
|
+
);
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1979
|
+
throw new runtime.RequiredError(
|
|
1980
|
+
'webhookKey',
|
|
1981
|
+
'Required parameter "webhookKey" was null or undefined when calling rotateAgentWebhookSecret().'
|
|
1982
|
+
);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
const queryParameters: any = {};
|
|
1986
|
+
|
|
1987
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1988
|
+
|
|
1989
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1990
|
+
const token = this.configuration.accessToken;
|
|
1991
|
+
const tokenString = await token("bearerAuth", []);
|
|
1992
|
+
|
|
1993
|
+
if (tokenString) {
|
|
1994
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
const response = await this.request({
|
|
1998
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/rotate-secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1999
|
+
method: 'POST',
|
|
2000
|
+
headers: headerParameters,
|
|
2001
|
+
query: queryParameters,
|
|
2002
|
+
}, initOverrides);
|
|
2003
|
+
|
|
2004
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RotatedWebhookSecretViewFromJSON(jsonValue));
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
/**
|
|
2008
|
+
* 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).
|
|
2009
|
+
* Rotate Agent Webhook Secret
|
|
2010
|
+
*/
|
|
2011
|
+
async rotateAgentWebhookSecret(requestParameters: RotateAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RotatedWebhookSecretView> {
|
|
2012
|
+
const response = await this.rotateAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
2013
|
+
return await response.value();
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* 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``.
|
|
1713
2018
|
* Save Version
|
|
1714
2019
|
*/
|
|
1715
|
-
async saveVersionRaw(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
2020
|
+
async saveVersionRaw(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentVersionSavedResource>> {
|
|
1716
2021
|
if (requestParameters['agentId'] == null) {
|
|
1717
2022
|
throw new runtime.RequiredError(
|
|
1718
2023
|
'agentId',
|
|
@@ -1749,14 +2054,14 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
1749
2054
|
body: AgentVersionCreateToJSON(requestParameters['agentVersionCreate']),
|
|
1750
2055
|
}, initOverrides);
|
|
1751
2056
|
|
|
1752
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
2057
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentVersionSavedResourceFromJSON(jsonValue));
|
|
1753
2058
|
}
|
|
1754
2059
|
|
|
1755
2060
|
/**
|
|
1756
|
-
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed.
|
|
2061
|
+
* 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``.
|
|
1757
2062
|
* Save Version
|
|
1758
2063
|
*/
|
|
1759
|
-
async saveVersion(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
2064
|
+
async saveVersion(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentVersionSavedResource> {
|
|
1760
2065
|
const response = await this.saveVersionRaw(requestParameters, initOverrides);
|
|
1761
2066
|
return await response.value();
|
|
1762
2067
|
}
|
|
@@ -2010,6 +2315,56 @@ export class AgentsApi extends runtime.BaseAPI {
|
|
|
2010
2315
|
return await response.value();
|
|
2011
2316
|
}
|
|
2012
2317
|
|
|
2318
|
+
/**
|
|
2319
|
+
* 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.
|
|
2320
|
+
* View Agent Webhook Secret
|
|
2321
|
+
*/
|
|
2322
|
+
async viewAgentWebhookSecretRaw(requestParameters: ViewAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookSecretValueView>> {
|
|
2323
|
+
if (requestParameters['agentId'] == null) {
|
|
2324
|
+
throw new runtime.RequiredError(
|
|
2325
|
+
'agentId',
|
|
2326
|
+
'Required parameter "agentId" was null or undefined when calling viewAgentWebhookSecret().'
|
|
2327
|
+
);
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
if (requestParameters['webhookKey'] == null) {
|
|
2331
|
+
throw new runtime.RequiredError(
|
|
2332
|
+
'webhookKey',
|
|
2333
|
+
'Required parameter "webhookKey" was null or undefined when calling viewAgentWebhookSecret().'
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
const queryParameters: any = {};
|
|
2338
|
+
|
|
2339
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
2340
|
+
|
|
2341
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2342
|
+
const token = this.configuration.accessToken;
|
|
2343
|
+
const tokenString = await token("bearerAuth", []);
|
|
2344
|
+
|
|
2345
|
+
if (tokenString) {
|
|
2346
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
const response = await this.request({
|
|
2350
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
2351
|
+
method: 'GET',
|
|
2352
|
+
headers: headerParameters,
|
|
2353
|
+
query: queryParameters,
|
|
2354
|
+
}, initOverrides);
|
|
2355
|
+
|
|
2356
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSecretValueViewFromJSON(jsonValue));
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* 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.
|
|
2361
|
+
* View Agent Webhook Secret
|
|
2362
|
+
*/
|
|
2363
|
+
async viewAgentWebhookSecret(requestParameters: ViewAgentWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretValueView> {
|
|
2364
|
+
const response = await this.viewAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
2365
|
+
return await response.value();
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2013
2368
|
}
|
|
2014
2369
|
|
|
2015
2370
|
/**
|
|
@@ -80,6 +80,7 @@ export interface ListConversationsRequest {
|
|
|
80
80
|
cursor?: string | null;
|
|
81
81
|
q?: string | null;
|
|
82
82
|
sessionType?: ListConversationsSessionTypeEnum;
|
|
83
|
+
agentId?: string | null;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
export interface PinConversationRequest {
|
|
@@ -107,7 +108,7 @@ export interface UpdateConversationRequest {
|
|
|
107
108
|
export class ConversationsApi extends runtime.BaseAPI {
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
|
-
* ``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``
|
|
111
|
+
* ``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``).
|
|
111
112
|
* Create Conversation Route
|
|
112
113
|
*/
|
|
113
114
|
async createConversationRaw(requestParameters: CreateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConversationView>> {
|
|
@@ -152,7 +153,7 @@ export class ConversationsApi extends runtime.BaseAPI {
|
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
/**
|
|
155
|
-
* ``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``
|
|
156
|
+
* ``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``).
|
|
156
157
|
* Create Conversation Route
|
|
157
158
|
*/
|
|
158
159
|
async createConversation(requestParameters: CreateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConversationView> {
|
|
@@ -329,6 +330,10 @@ export class ConversationsApi extends runtime.BaseAPI {
|
|
|
329
330
|
queryParameters['sessionType'] = requestParameters['sessionType'];
|
|
330
331
|
}
|
|
331
332
|
|
|
333
|
+
if (requestParameters['agentId'] != null) {
|
|
334
|
+
queryParameters['agentId'] = requestParameters['agentId'];
|
|
335
|
+
}
|
|
336
|
+
|
|
332
337
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
333
338
|
|
|
334
339
|
if (this.configuration && this.configuration.accessToken) {
|
|
@@ -502,6 +507,7 @@ export class ConversationsApi extends runtime.BaseAPI {
|
|
|
502
507
|
}
|
|
503
508
|
|
|
504
509
|
/**
|
|
510
|
+
* 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.
|
|
505
511
|
* Update Conversation Route
|
|
506
512
|
*/
|
|
507
513
|
async updateConversationRaw(requestParameters: UpdateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConversationView>> {
|
|
@@ -545,6 +551,7 @@ export class ConversationsApi extends runtime.BaseAPI {
|
|
|
545
551
|
}
|
|
546
552
|
|
|
547
553
|
/**
|
|
554
|
+
* 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.
|
|
548
555
|
* Update Conversation Route
|
|
549
556
|
*/
|
|
550
557
|
async updateConversation(requestParameters: UpdateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConversationView> {
|
package/src/client.ts
CHANGED
|
@@ -8,12 +8,13 @@ import { WebhookSecrets } from "./compose/webhookSecrets.js";
|
|
|
8
8
|
*
|
|
9
9
|
* ```ts
|
|
10
10
|
* const client = new Client(config);
|
|
11
|
-
* const
|
|
11
|
+
* const hooks = await client.webhooks.list(agentId); // each webhook and its secretStatus
|
|
12
|
+
* const secret = await client.webhooks.getSecret(agentId, "https://hooks.acme.com/panja");
|
|
12
13
|
* const github = await client.triggers.setSecret(agentId, "github_issues"); // a provider trigger's signing secret
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
16
|
export class Client {
|
|
16
|
-
/**
|
|
17
|
+
/** List an agent's webhooks; create, view, rotate, set and delete each one's signing secret. */
|
|
17
18
|
readonly webhooks: WebhookSecrets;
|
|
18
19
|
/** An agent's inbound triggers: set, rotate, check and delete a trigger's signing secret (or rotate a bearer
|
|
19
20
|
* trigger's token), and page through its events. */
|