sarvam-agents-client 0.5.2 → 0.5.3
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/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/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/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/dist/apis/AgentsApi.js
CHANGED
|
@@ -213,6 +213,42 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
213
213
|
const response = await this.createAgentRaw(requestParameters, initOverrides);
|
|
214
214
|
return await response.value();
|
|
215
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* 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).
|
|
218
|
+
* Create Agent Webhook Secret
|
|
219
|
+
*/
|
|
220
|
+
async createAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
221
|
+
if (requestParameters['agentId'] == null) {
|
|
222
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling createAgentWebhookSecret().');
|
|
223
|
+
}
|
|
224
|
+
if (requestParameters['webhookKey'] == null) {
|
|
225
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling createAgentWebhookSecret().');
|
|
226
|
+
}
|
|
227
|
+
const queryParameters = {};
|
|
228
|
+
const headerParameters = {};
|
|
229
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
230
|
+
const token = this.configuration.accessToken;
|
|
231
|
+
const tokenString = await token("bearerAuth", []);
|
|
232
|
+
if (tokenString) {
|
|
233
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const response = await this.request({
|
|
237
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
238
|
+
method: 'POST',
|
|
239
|
+
headers: headerParameters,
|
|
240
|
+
query: queryParameters,
|
|
241
|
+
}, initOverrides);
|
|
242
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.WebhookSecretValueViewFromJSON)(jsonValue));
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* 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).
|
|
246
|
+
* Create Agent Webhook Secret
|
|
247
|
+
*/
|
|
248
|
+
async createAgentWebhookSecret(requestParameters, initOverrides) {
|
|
249
|
+
const response = await this.createAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
250
|
+
return await response.value();
|
|
251
|
+
}
|
|
216
252
|
/**
|
|
217
253
|
* 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.
|
|
218
254
|
* Delete Agent
|
|
@@ -245,6 +281,41 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
245
281
|
async deleteAgent(requestParameters, initOverrides) {
|
|
246
282
|
await this.deleteAgentRaw(requestParameters, initOverrides);
|
|
247
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
286
|
+
* Delete Agent Webhook Secret
|
|
287
|
+
*/
|
|
288
|
+
async deleteAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
289
|
+
if (requestParameters['agentId'] == null) {
|
|
290
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling deleteAgentWebhookSecret().');
|
|
291
|
+
}
|
|
292
|
+
if (requestParameters['webhookKey'] == null) {
|
|
293
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling deleteAgentWebhookSecret().');
|
|
294
|
+
}
|
|
295
|
+
const queryParameters = {};
|
|
296
|
+
const headerParameters = {};
|
|
297
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
298
|
+
const token = this.configuration.accessToken;
|
|
299
|
+
const tokenString = await token("bearerAuth", []);
|
|
300
|
+
if (tokenString) {
|
|
301
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
const response = await this.request({
|
|
305
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
306
|
+
method: 'DELETE',
|
|
307
|
+
headers: headerParameters,
|
|
308
|
+
query: queryParameters,
|
|
309
|
+
}, initOverrides);
|
|
310
|
+
return new runtime.VoidApiResponse(response);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Remove the webhook\'s signing secret. Idempotent; the webhook need not be in ``agent.json`` (an orphan\'s secret).
|
|
314
|
+
* Delete Agent Webhook Secret
|
|
315
|
+
*/
|
|
316
|
+
async deleteAgentWebhookSecret(requestParameters, initOverrides) {
|
|
317
|
+
await this.deleteAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
318
|
+
}
|
|
248
319
|
/**
|
|
249
320
|
* Delete a never-live version; 409 ``VERSION_WAS_LIVE`` otherwise.
|
|
250
321
|
* Delete Version
|
|
@@ -281,7 +352,7 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
281
352
|
await this.deleteVersionRaw(requestParameters, initOverrides);
|
|
282
353
|
}
|
|
283
354
|
/**
|
|
284
|
-
* 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);
|
|
355
|
+
* 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.
|
|
285
356
|
* Deploy Agent
|
|
286
357
|
*/
|
|
287
358
|
async deployAgentRaw(requestParameters, initOverrides) {
|
|
@@ -308,7 +379,7 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
308
379
|
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentResourceFromJSON)(jsonValue));
|
|
309
380
|
}
|
|
310
381
|
/**
|
|
311
|
-
* 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);
|
|
382
|
+
* 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.
|
|
312
383
|
* Deploy Agent
|
|
313
384
|
*/
|
|
314
385
|
async deployAgent(requestParameters, initOverrides) {
|
|
@@ -316,7 +387,7 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
316
387
|
return await response.value();
|
|
317
388
|
}
|
|
318
389
|
/**
|
|
319
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
390
|
+
* 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).
|
|
320
391
|
* Get Agent
|
|
321
392
|
*/
|
|
322
393
|
async getAgentRaw(requestParameters, initOverrides) {
|
|
@@ -347,7 +418,7 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
347
418
|
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentResourceFromJSON)(jsonValue));
|
|
348
419
|
}
|
|
349
420
|
/**
|
|
350
|
-
* One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents``
|
|
421
|
+
* 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).
|
|
351
422
|
* Get Agent
|
|
352
423
|
*/
|
|
353
424
|
async getAgent(requestParameters, initOverrides) {
|
|
@@ -696,7 +767,40 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
696
767
|
return await response.value();
|
|
697
768
|
}
|
|
698
769
|
/**
|
|
699
|
-
*
|
|
770
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
771
|
+
* List Agent Webhooks
|
|
772
|
+
*/
|
|
773
|
+
async listAgentWebhooksRaw(requestParameters, initOverrides) {
|
|
774
|
+
if (requestParameters['agentId'] == null) {
|
|
775
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listAgentWebhooks().');
|
|
776
|
+
}
|
|
777
|
+
const queryParameters = {};
|
|
778
|
+
const headerParameters = {};
|
|
779
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
780
|
+
const token = this.configuration.accessToken;
|
|
781
|
+
const tokenString = await token("bearerAuth", []);
|
|
782
|
+
if (tokenString) {
|
|
783
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
const response = await this.request({
|
|
787
|
+
path: `/v1/agents/{agentId}/webhooks`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
|
|
788
|
+
method: 'GET',
|
|
789
|
+
headers: headerParameters,
|
|
790
|
+
query: queryParameters,
|
|
791
|
+
}, initOverrides);
|
|
792
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentWebhookListFromJSON)(jsonValue));
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* The agent\'s webhooks with whether each has a signing secret, then any orphaned secret (``inAgentJson`` false, ``url`` null).
|
|
796
|
+
* List Agent Webhooks
|
|
797
|
+
*/
|
|
798
|
+
async listAgentWebhooks(requestParameters, initOverrides) {
|
|
799
|
+
const response = await this.listAgentWebhooksRaw(requestParameters, initOverrides);
|
|
800
|
+
return await response.value();
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* 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.
|
|
700
804
|
* List Agents
|
|
701
805
|
*/
|
|
702
806
|
async listAgentsRaw(requestParameters, initOverrides) {
|
|
@@ -704,6 +808,9 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
704
808
|
if (requestParameters['channel'] != null) {
|
|
705
809
|
queryParameters['channel'] = requestParameters['channel'];
|
|
706
810
|
}
|
|
811
|
+
if (requestParameters['shared'] != null) {
|
|
812
|
+
queryParameters['shared'] = requestParameters['shared'];
|
|
813
|
+
}
|
|
707
814
|
if (requestParameters['scope'] != null) {
|
|
708
815
|
queryParameters['scope'] = requestParameters['scope'];
|
|
709
816
|
}
|
|
@@ -754,7 +861,7 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
754
861
|
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.EntityListAgentResourceFromJSON)(jsonValue));
|
|
755
862
|
}
|
|
756
863
|
/**
|
|
757
|
-
* 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.
|
|
864
|
+
* 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.
|
|
758
865
|
* List Agents
|
|
759
866
|
*/
|
|
760
867
|
async listAgents(requestParameters = {}, initOverrides) {
|
|
@@ -1010,6 +1117,47 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
1010
1117
|
const response = await this.putAgentSettingsRaw(requestParameters, initOverrides);
|
|
1011
1118
|
return await response.value();
|
|
1012
1119
|
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
1122
|
+
* Put Agent Webhook Secret
|
|
1123
|
+
*/
|
|
1124
|
+
async putAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
1125
|
+
if (requestParameters['agentId'] == null) {
|
|
1126
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling putAgentWebhookSecret().');
|
|
1127
|
+
}
|
|
1128
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1129
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling putAgentWebhookSecret().');
|
|
1130
|
+
}
|
|
1131
|
+
if (requestParameters['webhookSecretPutBody'] == null) {
|
|
1132
|
+
throw new runtime.RequiredError('webhookSecretPutBody', 'Required parameter "webhookSecretPutBody" was null or undefined when calling putAgentWebhookSecret().');
|
|
1133
|
+
}
|
|
1134
|
+
const queryParameters = {};
|
|
1135
|
+
const headerParameters = {};
|
|
1136
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1137
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1138
|
+
const token = this.configuration.accessToken;
|
|
1139
|
+
const tokenString = await token("bearerAuth", []);
|
|
1140
|
+
if (tokenString) {
|
|
1141
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
const response = await this.request({
|
|
1145
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1146
|
+
method: 'PUT',
|
|
1147
|
+
headers: headerParameters,
|
|
1148
|
+
query: queryParameters,
|
|
1149
|
+
body: (0, index_js_1.WebhookSecretPutBodyToJSON)(requestParameters['webhookSecretPutBody']),
|
|
1150
|
+
}, initOverrides);
|
|
1151
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.WebhookSecretStateViewFromJSON)(jsonValue));
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* Set the webhook\'s signing secret to one you made. A malformed one is 422 ``invalid_secret``; an unknown ``webhookKey`` is 404.
|
|
1155
|
+
* Put Agent Webhook Secret
|
|
1156
|
+
*/
|
|
1157
|
+
async putAgentWebhookSecret(requestParameters, initOverrides) {
|
|
1158
|
+
const response = await this.putAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1159
|
+
return await response.value();
|
|
1160
|
+
}
|
|
1013
1161
|
/**
|
|
1014
1162
|
* Put Instructions
|
|
1015
1163
|
*/
|
|
@@ -1080,7 +1228,43 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
1080
1228
|
return await response.value();
|
|
1081
1229
|
}
|
|
1082
1230
|
/**
|
|
1083
|
-
*
|
|
1231
|
+
* 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).
|
|
1232
|
+
* Rotate Agent Webhook Secret
|
|
1233
|
+
*/
|
|
1234
|
+
async rotateAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
1235
|
+
if (requestParameters['agentId'] == null) {
|
|
1236
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling rotateAgentWebhookSecret().');
|
|
1237
|
+
}
|
|
1238
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1239
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling rotateAgentWebhookSecret().');
|
|
1240
|
+
}
|
|
1241
|
+
const queryParameters = {};
|
|
1242
|
+
const headerParameters = {};
|
|
1243
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1244
|
+
const token = this.configuration.accessToken;
|
|
1245
|
+
const tokenString = await token("bearerAuth", []);
|
|
1246
|
+
if (tokenString) {
|
|
1247
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
const response = await this.request({
|
|
1251
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/rotate-secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1252
|
+
method: 'POST',
|
|
1253
|
+
headers: headerParameters,
|
|
1254
|
+
query: queryParameters,
|
|
1255
|
+
}, initOverrides);
|
|
1256
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.RotatedWebhookSecretViewFromJSON)(jsonValue));
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* 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).
|
|
1260
|
+
* Rotate Agent Webhook Secret
|
|
1261
|
+
*/
|
|
1262
|
+
async rotateAgentWebhookSecret(requestParameters, initOverrides) {
|
|
1263
|
+
const response = await this.rotateAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1264
|
+
return await response.value();
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* 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``.
|
|
1084
1268
|
* Save Version
|
|
1085
1269
|
*/
|
|
1086
1270
|
async saveVersionRaw(requestParameters, initOverrides) {
|
|
@@ -1107,10 +1291,10 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
1107
1291
|
query: queryParameters,
|
|
1108
1292
|
body: (0, index_js_1.AgentVersionCreateToJSON)(requestParameters['agentVersionCreate']),
|
|
1109
1293
|
}, initOverrides);
|
|
1110
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.
|
|
1294
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentVersionSavedResourceFromJSON)(jsonValue));
|
|
1111
1295
|
}
|
|
1112
1296
|
/**
|
|
1113
|
-
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed.
|
|
1297
|
+
* 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``.
|
|
1114
1298
|
* Save Version
|
|
1115
1299
|
*/
|
|
1116
1300
|
async saveVersion(requestParameters, initOverrides) {
|
|
@@ -1298,6 +1482,42 @@ class AgentsApi extends runtime.BaseAPI {
|
|
|
1298
1482
|
const response = await this.updateAgentRaw(requestParameters, initOverrides);
|
|
1299
1483
|
return await response.value();
|
|
1300
1484
|
}
|
|
1485
|
+
/**
|
|
1486
|
+
* 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.
|
|
1487
|
+
* View Agent Webhook Secret
|
|
1488
|
+
*/
|
|
1489
|
+
async viewAgentWebhookSecretRaw(requestParameters, initOverrides) {
|
|
1490
|
+
if (requestParameters['agentId'] == null) {
|
|
1491
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling viewAgentWebhookSecret().');
|
|
1492
|
+
}
|
|
1493
|
+
if (requestParameters['webhookKey'] == null) {
|
|
1494
|
+
throw new runtime.RequiredError('webhookKey', 'Required parameter "webhookKey" was null or undefined when calling viewAgentWebhookSecret().');
|
|
1495
|
+
}
|
|
1496
|
+
const queryParameters = {};
|
|
1497
|
+
const headerParameters = {};
|
|
1498
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1499
|
+
const token = this.configuration.accessToken;
|
|
1500
|
+
const tokenString = await token("bearerAuth", []);
|
|
1501
|
+
if (tokenString) {
|
|
1502
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
const response = await this.request({
|
|
1506
|
+
path: `/v1/agents/{agentId}/webhooks/{webhookKey}/secret`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"webhookKey"}}`, runtime.encodePathParam('webhookKey', requestParameters['webhookKey'])),
|
|
1507
|
+
method: 'GET',
|
|
1508
|
+
headers: headerParameters,
|
|
1509
|
+
query: queryParameters,
|
|
1510
|
+
}, initOverrides);
|
|
1511
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.WebhookSecretValueViewFromJSON)(jsonValue));
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* 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.
|
|
1515
|
+
* View Agent Webhook Secret
|
|
1516
|
+
*/
|
|
1517
|
+
async viewAgentWebhookSecret(requestParameters, initOverrides) {
|
|
1518
|
+
const response = await this.viewAgentWebhookSecretRaw(requestParameters, initOverrides);
|
|
1519
|
+
return await response.value();
|
|
1520
|
+
}
|
|
1301
1521
|
}
|
|
1302
1522
|
exports.AgentsApi = AgentsApi;
|
|
1303
1523
|
/**
|
|
@@ -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>;
|
|
@@ -21,7 +21,7 @@ const index_js_1 = require("../models/index.js");
|
|
|
21
21
|
*/
|
|
22
22
|
class ConversationsApi extends runtime.BaseAPI {
|
|
23
23
|
/**
|
|
24
|
-
* ``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``
|
|
24
|
+
* ``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``).
|
|
25
25
|
* Create Conversation Route
|
|
26
26
|
*/
|
|
27
27
|
async createConversationRaw(requestParameters, initOverrides) {
|
|
@@ -54,7 +54,7 @@ class ConversationsApi extends runtime.BaseAPI {
|
|
|
54
54
|
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.ConversationViewFromJSON)(jsonValue));
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* ``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``
|
|
57
|
+
* ``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``).
|
|
58
58
|
* Create Conversation Route
|
|
59
59
|
*/
|
|
60
60
|
async createConversation(requestParameters, initOverrides) {
|
|
@@ -187,6 +187,9 @@ class ConversationsApi extends runtime.BaseAPI {
|
|
|
187
187
|
if (requestParameters['sessionType'] != null) {
|
|
188
188
|
queryParameters['sessionType'] = requestParameters['sessionType'];
|
|
189
189
|
}
|
|
190
|
+
if (requestParameters['agentId'] != null) {
|
|
191
|
+
queryParameters['agentId'] = requestParameters['agentId'];
|
|
192
|
+
}
|
|
190
193
|
const headerParameters = {};
|
|
191
194
|
if (this.configuration && this.configuration.accessToken) {
|
|
192
195
|
const token = this.configuration.accessToken;
|
|
@@ -316,6 +319,7 @@ class ConversationsApi extends runtime.BaseAPI {
|
|
|
316
319
|
return await response.value();
|
|
317
320
|
}
|
|
318
321
|
/**
|
|
322
|
+
* 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.
|
|
319
323
|
* Update Conversation Route
|
|
320
324
|
*/
|
|
321
325
|
async updateConversationRaw(requestParameters, initOverrides) {
|
|
@@ -345,6 +349,7 @@ class ConversationsApi extends runtime.BaseAPI {
|
|
|
345
349
|
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.ConversationViewFromJSON)(jsonValue));
|
|
346
350
|
}
|
|
347
351
|
/**
|
|
352
|
+
* 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.
|
|
348
353
|
* Update Conversation Route
|
|
349
354
|
*/
|
|
350
355
|
async updateConversation(requestParameters, initOverrides) {
|
package/dist/client.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ import { WebhookSecrets } from "./compose/webhookSecrets.js";
|
|
|
6
6
|
*
|
|
7
7
|
* ```ts
|
|
8
8
|
* const client = new Client(config);
|
|
9
|
-
* const
|
|
9
|
+
* const hooks = await client.webhooks.list(agentId); // each webhook and its secretStatus
|
|
10
|
+
* const secret = await client.webhooks.getSecret(agentId, "https://hooks.acme.com/panja");
|
|
10
11
|
* const github = await client.triggers.setSecret(agentId, "github_issues"); // a provider trigger's signing secret
|
|
11
12
|
* ```
|
|
12
13
|
*/
|
|
13
14
|
export declare class Client {
|
|
14
15
|
readonly config: Configuration;
|
|
15
|
-
/**
|
|
16
|
+
/** List an agent's webhooks; create, view, rotate, set and delete each one's signing secret. */
|
|
16
17
|
readonly webhooks: WebhookSecrets;
|
|
17
18
|
/** An agent's inbound triggers: set, rotate, check and delete a trigger's signing secret (or rotate a bearer
|
|
18
19
|
* trigger's token), and page through its events. */
|
package/dist/client.js
CHANGED
|
@@ -8,7 +8,8 @@ const webhookSecrets_js_1 = require("./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
|
*/
|
package/dist/compose/deploy.d.ts
CHANGED
|
@@ -10,13 +10,19 @@ export interface Deployment {
|
|
|
10
10
|
/** The live version, or while the agent is paused, the paused version (what `resumeAgent` brings back); undefined
|
|
11
11
|
* from a server without versions, or when no version was ever live. */
|
|
12
12
|
version?: number;
|
|
13
|
-
/** URLs of the webhooks that
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
/** URLs of the agent's webhooks that have no signing secret after this deploy: one it added whose secret it could
|
|
14
|
+
* not create (it warned why), or one deployed before whose secret is missing (deleted, perhaps on purpose; deploy
|
|
15
|
+
* never recreates it). Nothing is delivered to them: `client.webhooks.createSecret(agentId, url)` gives one. Left
|
|
16
|
+
* out when there are none. */
|
|
16
17
|
webhooksMissingSecret?: string[];
|
|
17
18
|
/** The token (and fire URL) of each bearer trigger this deploy created. The server shows a token only once: keep
|
|
18
19
|
* it now. Left out when nothing was minted; `client.triggers.list(agentId)` lists every trigger's URL. */
|
|
19
20
|
triggerTokens?: MintedTriggerToken[];
|
|
21
|
+
/** The signing secret this deploy created for each webhook it added (every webhook on a first deploy), by URL. Give each to its receiver
|
|
22
|
+
* now (`client.webhooks.getSecret` shows it again). A webhook that already had a secret keeps it and is not listed.
|
|
23
|
+
* The property is non-enumerable, so logging or serialising the deployment leaves it out. Left out when deploy
|
|
24
|
+
* created none. */
|
|
25
|
+
readonly webhookSecrets?: Readonly<Record<string, string>>;
|
|
20
26
|
}
|
|
21
27
|
/** Set (or clear, with null) the client used when deploy/remove/run get no client. */
|
|
22
28
|
export declare function setDefaultClient(config: Configuration | null): void;
|
|
@@ -30,6 +36,11 @@ export declare function resolveTransport(client?: Configuration, transport?: Tra
|
|
|
30
36
|
* saves any edits the owner left in the draft, so check the draft first. `strict: true` throws `DriftError` instead of
|
|
31
37
|
* overwriting fields edited outside the SDK. `adopt: agentId` takes over an agent made elsewhere. `version` is the live
|
|
32
38
|
* version (the paused one while paused).
|
|
39
|
+
*
|
|
40
|
+
* The deploy then creates the signing secret of each webhook it added (a URL not in the agent.json last deployed;
|
|
41
|
+
* every webhook on a first deploy) and returns it once in `webhookSecrets` (by URL). An existing secret is never
|
|
42
|
+
* rotated or overwritten, and a missing one on a webhook deployed before is never recreated: it is listed in
|
|
43
|
+
* `webhooksMissingSecret`.
|
|
33
44
|
*/
|
|
34
45
|
export declare function deploy(agent: Agent<OutputType | undefined>, opts?: {
|
|
35
46
|
client?: Configuration;
|