@breign/client 1.0.137 → 1.0.139

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.
Files changed (65) hide show
  1. package/dist/apis/LibraryAgentsApi.d.ts +211 -0
  2. package/dist/apis/LibraryAgentsApi.js +537 -0
  3. package/dist/apis/OrganizationsApi.d.ts +58 -1
  4. package/dist/apis/OrganizationsApi.js +134 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/models/AgentBundleDiffUio.d.ts +79 -0
  8. package/dist/models/AgentBundleDiffUio.js +85 -0
  9. package/dist/models/AgentBundleListDiffUio.d.ts +44 -0
  10. package/dist/models/AgentBundleListDiffUio.js +58 -0
  11. package/dist/models/AgentLibraryLinkLatestVersionUio.d.ts +44 -0
  12. package/dist/models/AgentLibraryLinkLatestVersionUio.js +58 -0
  13. package/dist/models/AgentLibraryLinkUio.d.ts +81 -0
  14. package/dist/models/AgentLibraryLinkUio.js +79 -0
  15. package/dist/models/AgentLibraryLinkUpdateRequestUio.d.ts +38 -0
  16. package/dist/models/AgentLibraryLinkUpdateRequestUio.js +52 -0
  17. package/dist/models/AgentLibraryLinkUpdateResponseUio.d.ts +69 -0
  18. package/dist/models/AgentLibraryLinkUpdateResponseUio.js +75 -0
  19. package/dist/models/AgentLibraryLinksResponseUio.d.ts +33 -0
  20. package/dist/models/AgentLibraryLinksResponseUio.js +51 -0
  21. package/dist/models/AgentSandboxNetworkConfigurationUio.d.ts +2 -2
  22. package/dist/models/ChatMessageUio.d.ts +7 -0
  23. package/dist/models/ChatMessageUio.js +3 -0
  24. package/dist/models/ConversationMessageApprovalUio.d.ts +70 -0
  25. package/dist/models/ConversationMessageApprovalUio.js +74 -0
  26. package/dist/models/ConversationMessagesInnerUio.d.ts +7 -0
  27. package/dist/models/ConversationMessagesInnerUio.js +3 -0
  28. package/dist/models/CreateToolApprovalRequestUio.d.ts +53 -0
  29. package/dist/models/CreateToolApprovalRequestUio.js +67 -0
  30. package/dist/models/EditToolApprovalRequestUio.d.ts +47 -0
  31. package/dist/models/EditToolApprovalRequestUio.js +63 -0
  32. package/dist/models/LibraryAgentBundleSummaryUio.d.ts +56 -0
  33. package/dist/models/LibraryAgentBundleSummaryUio.js +66 -0
  34. package/dist/models/LibraryAgentDiffResponseUio.d.ts +46 -0
  35. package/dist/models/LibraryAgentDiffResponseUio.js +60 -0
  36. package/dist/models/LibraryAgentDiffVersionRefUio.d.ts +38 -0
  37. package/dist/models/LibraryAgentDiffVersionRefUio.js +54 -0
  38. package/dist/models/LibraryAgentEntryUio.d.ts +87 -0
  39. package/dist/models/LibraryAgentEntryUio.js +83 -0
  40. package/dist/models/LibraryAgentInstallRequestUio.d.ts +38 -0
  41. package/dist/models/LibraryAgentInstallRequestUio.js +52 -0
  42. package/dist/models/LibraryAgentInstallResponseUio.d.ts +75 -0
  43. package/dist/models/LibraryAgentInstallResponseUio.js +77 -0
  44. package/dist/models/LibraryAgentParseBundleRequestUio.d.ts +46 -0
  45. package/dist/models/LibraryAgentParseBundleRequestUio.js +62 -0
  46. package/dist/models/LibraryAgentPublishRequestUio.d.ts +68 -0
  47. package/dist/models/LibraryAgentPublishRequestUio.js +60 -0
  48. package/dist/models/LibraryAgentPublishVersionRequestUio.d.ts +62 -0
  49. package/dist/models/LibraryAgentPublishVersionRequestUio.js +58 -0
  50. package/dist/models/LibraryAgentVersionUio.d.ts +99 -0
  51. package/dist/models/LibraryAgentVersionUio.js +87 -0
  52. package/dist/models/LibraryAgentsPageUio.d.ts +63 -0
  53. package/dist/models/LibraryAgentsPageUio.js +71 -0
  54. package/dist/models/ToolApprovalUio.d.ts +85 -0
  55. package/dist/models/ToolApprovalUio.js +88 -0
  56. package/dist/models/ToolApprovalsResponseUio.d.ts +33 -0
  57. package/dist/models/ToolApprovalsResponseUio.js +51 -0
  58. package/dist/models/ToolCallResultRequestUio.d.ts +28 -0
  59. package/dist/models/ToolCallResultRequestUio.js +19 -1
  60. package/dist/models/ToolCallUio.d.ts +4 -4
  61. package/dist/models/ToolCallUio.js +2 -4
  62. package/dist/models/index.d.ts +23 -0
  63. package/dist/models/index.js +23 -0
  64. package/dist/openapi.json +6374 -4924
  65. package/package.json +1 -1
@@ -0,0 +1,537 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || (function () {
32
+ var ownKeys = function(o) {
33
+ ownKeys = Object.getOwnPropertyNames || function (o) {
34
+ var ar = [];
35
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
+ return ar;
37
+ };
38
+ return ownKeys(o);
39
+ };
40
+ return function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ })();
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.LibraryAgentsApi = void 0;
50
+ const runtime = __importStar(require("../runtime"));
51
+ const index_1 = require("../models/index");
52
+ /**
53
+ *
54
+ */
55
+ class LibraryAgentsApi extends runtime.BaseAPI {
56
+ /**
57
+ * Delete a library agent and all its versions (super-admin)
58
+ */
59
+ async adminDeleteLibraryAgentRaw(requestParameters, initOverrides) {
60
+ if (requestParameters['slug'] == null) {
61
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling adminDeleteLibraryAgent().');
62
+ }
63
+ const queryParameters = {};
64
+ const headerParameters = {};
65
+ if (this.configuration && this.configuration.apiKey) {
66
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
67
+ }
68
+ const response = await this.request({
69
+ path: `/admin/library-agents/{slug}`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))),
70
+ method: 'DELETE',
71
+ headers: headerParameters,
72
+ query: queryParameters,
73
+ }, initOverrides);
74
+ return new runtime.VoidApiResponse(response);
75
+ }
76
+ /**
77
+ * Delete a library agent and all its versions (super-admin)
78
+ */
79
+ async adminDeleteLibraryAgent(slug, initOverrides) {
80
+ await this.adminDeleteLibraryAgentRaw({ slug: slug }, initOverrides);
81
+ }
82
+ /**
83
+ * Get a library agent entry by slug (super-admin)
84
+ */
85
+ async adminGetLibraryAgentRaw(requestParameters, initOverrides) {
86
+ if (requestParameters['slug'] == null) {
87
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling adminGetLibraryAgent().');
88
+ }
89
+ const queryParameters = {};
90
+ const headerParameters = {};
91
+ if (this.configuration && this.configuration.apiKey) {
92
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
93
+ }
94
+ const response = await this.request({
95
+ path: `/admin/library-agents/{slug}`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))),
96
+ method: 'GET',
97
+ headers: headerParameters,
98
+ query: queryParameters,
99
+ }, initOverrides);
100
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentEntryUioFromJSON)(jsonValue));
101
+ }
102
+ /**
103
+ * Get a library agent entry by slug (super-admin)
104
+ */
105
+ async adminGetLibraryAgent(slug, initOverrides) {
106
+ const response = await this.adminGetLibraryAgentRaw({ slug: slug }, initOverrides);
107
+ return await response.value();
108
+ }
109
+ /**
110
+ * Returns the raw breign-agent export bundle stored for this version. Used to prefill the publish composer.
111
+ * Get the stored bundle of a published version (super-admin)
112
+ */
113
+ async adminGetLibraryAgentVersionBundleRaw(requestParameters, initOverrides) {
114
+ if (requestParameters['slug'] == null) {
115
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling adminGetLibraryAgentVersionBundle().');
116
+ }
117
+ if (requestParameters['versionId'] == null) {
118
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling adminGetLibraryAgentVersionBundle().');
119
+ }
120
+ const queryParameters = {};
121
+ const headerParameters = {};
122
+ if (this.configuration && this.configuration.apiKey) {
123
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
124
+ }
125
+ const response = await this.request({
126
+ path: `/admin/library-agents/{slug}/versions/{versionId}/bundle`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
127
+ method: 'GET',
128
+ headers: headerParameters,
129
+ query: queryParameters,
130
+ }, initOverrides);
131
+ return new runtime.JSONApiResponse(response);
132
+ }
133
+ /**
134
+ * Returns the raw breign-agent export bundle stored for this version. Used to prefill the publish composer.
135
+ * Get the stored bundle of a published version (super-admin)
136
+ */
137
+ async adminGetLibraryAgentVersionBundle(slug, versionId, initOverrides) {
138
+ const response = await this.adminGetLibraryAgentVersionBundleRaw({ slug: slug, versionId: versionId }, initOverrides);
139
+ return await response.value();
140
+ }
141
+ /**
142
+ * List all library agents (super-admin)
143
+ */
144
+ async adminListLibraryAgentsRaw(requestParameters, initOverrides) {
145
+ const queryParameters = {};
146
+ if (requestParameters['page'] != null) {
147
+ queryParameters['page'] = requestParameters['page'];
148
+ }
149
+ if (requestParameters['limit'] != null) {
150
+ queryParameters['limit'] = requestParameters['limit'];
151
+ }
152
+ if (requestParameters['search'] != null) {
153
+ queryParameters['search'] = requestParameters['search'];
154
+ }
155
+ if (requestParameters['category'] != null) {
156
+ queryParameters['category'] = requestParameters['category'];
157
+ }
158
+ const headerParameters = {};
159
+ if (this.configuration && this.configuration.apiKey) {
160
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
161
+ }
162
+ const response = await this.request({
163
+ path: `/admin/library-agents`,
164
+ method: 'GET',
165
+ headers: headerParameters,
166
+ query: queryParameters,
167
+ }, initOverrides);
168
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentsPageUioFromJSON)(jsonValue));
169
+ }
170
+ /**
171
+ * List all library agents (super-admin)
172
+ */
173
+ async adminListLibraryAgents(page, limit, search, category, initOverrides) {
174
+ const response = await this.adminListLibraryAgentsRaw({ page: page, limit: limit, search: search, category: category }, initOverrides);
175
+ return await response.value();
176
+ }
177
+ /**
178
+ * Parses a serialized YAML/JSON breign-agent bundle with the same validation rules as publication, and returns the normalized bundle. Used by the composer to prefill from a file.
179
+ * Parse and validate a raw agent bundle (superadmin)
180
+ */
181
+ async adminParseLibraryAgentBundleRaw(requestParameters, initOverrides) {
182
+ if (requestParameters['libraryAgentParseBundleRequestUio'] == null) {
183
+ throw new runtime.RequiredError('libraryAgentParseBundleRequestUio', 'Required parameter "libraryAgentParseBundleRequestUio" was null or undefined when calling adminParseLibraryAgentBundle().');
184
+ }
185
+ const queryParameters = {};
186
+ const headerParameters = {};
187
+ headerParameters['Content-Type'] = 'application/json';
188
+ if (this.configuration && this.configuration.apiKey) {
189
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
190
+ }
191
+ const response = await this.request({
192
+ path: `/admin/library-agents/parse-bundle`,
193
+ method: 'POST',
194
+ headers: headerParameters,
195
+ query: queryParameters,
196
+ body: (0, index_1.LibraryAgentParseBundleRequestUioToJSON)(requestParameters['libraryAgentParseBundleRequestUio']),
197
+ }, initOverrides);
198
+ return new runtime.JSONApiResponse(response);
199
+ }
200
+ /**
201
+ * Parses a serialized YAML/JSON breign-agent bundle with the same validation rules as publication, and returns the normalized bundle. Used by the composer to prefill from a file.
202
+ * Parse and validate a raw agent bundle (superadmin)
203
+ */
204
+ async adminParseLibraryAgentBundle(libraryAgentParseBundleRequestUio, initOverrides) {
205
+ const response = await this.adminParseLibraryAgentBundleRaw({ libraryAgentParseBundleRequestUio: libraryAgentParseBundleRequestUio }, initOverrides);
206
+ return await response.value();
207
+ }
208
+ /**
209
+ * Exports the given agent as a portable bundle (secrets stripped) and publishes it as the initial version of a new library entry.
210
+ * Publish an agent to the library (super-admin)
211
+ */
212
+ async adminPublishLibraryAgentRaw(requestParameters, initOverrides) {
213
+ if (requestParameters['libraryAgentPublishRequestUio'] == null) {
214
+ throw new runtime.RequiredError('libraryAgentPublishRequestUio', 'Required parameter "libraryAgentPublishRequestUio" was null or undefined when calling adminPublishLibraryAgent().');
215
+ }
216
+ const queryParameters = {};
217
+ const headerParameters = {};
218
+ headerParameters['Content-Type'] = 'application/json';
219
+ if (this.configuration && this.configuration.apiKey) {
220
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
221
+ }
222
+ const response = await this.request({
223
+ path: `/admin/library-agents`,
224
+ method: 'POST',
225
+ headers: headerParameters,
226
+ query: queryParameters,
227
+ body: (0, index_1.LibraryAgentPublishRequestUioToJSON)(requestParameters['libraryAgentPublishRequestUio']),
228
+ }, initOverrides);
229
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentEntryUioFromJSON)(jsonValue));
230
+ }
231
+ /**
232
+ * Exports the given agent as a portable bundle (secrets stripped) and publishes it as the initial version of a new library entry.
233
+ * Publish an agent to the library (super-admin)
234
+ */
235
+ async adminPublishLibraryAgent(libraryAgentPublishRequestUio, initOverrides) {
236
+ const response = await this.adminPublishLibraryAgentRaw({ libraryAgentPublishRequestUio: libraryAgentPublishRequestUio }, initOverrides);
237
+ return await response.value();
238
+ }
239
+ /**
240
+ * Exports the given agent as a portable bundle and publishes it as the new latest version of an existing library entry. Name, description and category default to the previous latest version.
241
+ * Publish a new version of a library agent (super-admin)
242
+ */
243
+ async adminPublishLibraryAgentVersionRaw(requestParameters, initOverrides) {
244
+ if (requestParameters['slug'] == null) {
245
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling adminPublishLibraryAgentVersion().');
246
+ }
247
+ if (requestParameters['libraryAgentPublishVersionRequestUio'] == null) {
248
+ throw new runtime.RequiredError('libraryAgentPublishVersionRequestUio', 'Required parameter "libraryAgentPublishVersionRequestUio" was null or undefined when calling adminPublishLibraryAgentVersion().');
249
+ }
250
+ const queryParameters = {};
251
+ const headerParameters = {};
252
+ headerParameters['Content-Type'] = 'application/json';
253
+ if (this.configuration && this.configuration.apiKey) {
254
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
255
+ }
256
+ const response = await this.request({
257
+ path: `/admin/library-agents/{slug}/versions`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))),
258
+ method: 'POST',
259
+ headers: headerParameters,
260
+ query: queryParameters,
261
+ body: (0, index_1.LibraryAgentPublishVersionRequestUioToJSON)(requestParameters['libraryAgentPublishVersionRequestUio']),
262
+ }, initOverrides);
263
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentVersionUioFromJSON)(jsonValue));
264
+ }
265
+ /**
266
+ * Exports the given agent as a portable bundle and publishes it as the new latest version of an existing library entry. Name, description and category default to the previous latest version.
267
+ * Publish a new version of a library agent (super-admin)
268
+ */
269
+ async adminPublishLibraryAgentVersion(slug, libraryAgentPublishVersionRequestUio, initOverrides) {
270
+ const response = await this.adminPublishLibraryAgentVersionRaw({ slug: slug, libraryAgentPublishVersionRequestUio: libraryAgentPublishVersionRequestUio }, initOverrides);
271
+ return await response.value();
272
+ }
273
+ /**
274
+ * Removes the provenance link. The agent no longer follows catalog versions and becomes freely editable again; its current configuration is left untouched. Requires organization admin rights.
275
+ * Detach a managed agent from the marketplace
276
+ */
277
+ async detachAgentLibraryLinkRaw(requestParameters, initOverrides) {
278
+ if (requestParameters['agentId'] == null) {
279
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling detachAgentLibraryLink().');
280
+ }
281
+ if (requestParameters['organizationId'] == null) {
282
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling detachAgentLibraryLink().');
283
+ }
284
+ const queryParameters = {};
285
+ if (requestParameters['organizationId'] != null) {
286
+ queryParameters['organizationId'] = requestParameters['organizationId'];
287
+ }
288
+ const headerParameters = {};
289
+ if (this.configuration && this.configuration.apiKey) {
290
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
291
+ }
292
+ const response = await this.request({
293
+ path: `/agent-library-links/{agentId}`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
294
+ method: 'DELETE',
295
+ headers: headerParameters,
296
+ query: queryParameters,
297
+ }, initOverrides);
298
+ return new runtime.VoidApiResponse(response);
299
+ }
300
+ /**
301
+ * Removes the provenance link. The agent no longer follows catalog versions and becomes freely editable again; its current configuration is left untouched. Requires organization admin rights.
302
+ * Detach a managed agent from the marketplace
303
+ */
304
+ async detachAgentLibraryLink(agentId, organizationId, initOverrides) {
305
+ await this.detachAgentLibraryLinkRaw({ agentId: agentId, organizationId: organizationId }, initOverrides);
306
+ }
307
+ /**
308
+ * Structural diff between two published bundle versions of the same catalog entry — feeds the \"what changes\" modal shown before updating a managed agent. Requires organization membership.
309
+ * Diff two published versions of a library agent
310
+ */
311
+ async diffLibraryAgentVersionsRaw(requestParameters, initOverrides) {
312
+ if (requestParameters['slug'] == null) {
313
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling diffLibraryAgentVersions().');
314
+ }
315
+ if (requestParameters['organizationId'] == null) {
316
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling diffLibraryAgentVersions().');
317
+ }
318
+ if (requestParameters['fromVersionId'] == null) {
319
+ throw new runtime.RequiredError('fromVersionId', 'Required parameter "fromVersionId" was null or undefined when calling diffLibraryAgentVersions().');
320
+ }
321
+ if (requestParameters['toVersionId'] == null) {
322
+ throw new runtime.RequiredError('toVersionId', 'Required parameter "toVersionId" was null or undefined when calling diffLibraryAgentVersions().');
323
+ }
324
+ const queryParameters = {};
325
+ if (requestParameters['organizationId'] != null) {
326
+ queryParameters['organizationId'] = requestParameters['organizationId'];
327
+ }
328
+ if (requestParameters['fromVersionId'] != null) {
329
+ queryParameters['fromVersionId'] = requestParameters['fromVersionId'];
330
+ }
331
+ if (requestParameters['toVersionId'] != null) {
332
+ queryParameters['toVersionId'] = requestParameters['toVersionId'];
333
+ }
334
+ const headerParameters = {};
335
+ if (this.configuration && this.configuration.apiKey) {
336
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
337
+ }
338
+ const response = await this.request({
339
+ path: `/library-agents/{slug}/diff`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))),
340
+ method: 'GET',
341
+ headers: headerParameters,
342
+ query: queryParameters,
343
+ }, initOverrides);
344
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentDiffResponseUioFromJSON)(jsonValue));
345
+ }
346
+ /**
347
+ * Structural diff between two published bundle versions of the same catalog entry — feeds the \"what changes\" modal shown before updating a managed agent. Requires organization membership.
348
+ * Diff two published versions of a library agent
349
+ */
350
+ async diffLibraryAgentVersions(slug, organizationId, fromVersionId, toVersionId, initOverrides) {
351
+ const response = await this.diffLibraryAgentVersionsRaw({ slug: slug, organizationId: organizationId, fromVersionId: fromVersionId, toVersionId: toVersionId }, initOverrides);
352
+ return await response.value();
353
+ }
354
+ /**
355
+ * Returns a published agent with its full version history.
356
+ * Get a library agent entry by slug
357
+ */
358
+ async getLibraryAgentRaw(requestParameters, initOverrides) {
359
+ if (requestParameters['slug'] == null) {
360
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getLibraryAgent().');
361
+ }
362
+ if (requestParameters['organizationId'] == null) {
363
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getLibraryAgent().');
364
+ }
365
+ const queryParameters = {};
366
+ if (requestParameters['organizationId'] != null) {
367
+ queryParameters['organizationId'] = requestParameters['organizationId'];
368
+ }
369
+ const headerParameters = {};
370
+ if (this.configuration && this.configuration.apiKey) {
371
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
372
+ }
373
+ const response = await this.request({
374
+ path: `/library-agents/{slug}`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))),
375
+ method: 'GET',
376
+ headers: headerParameters,
377
+ query: queryParameters,
378
+ }, initOverrides);
379
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentEntryUioFromJSON)(jsonValue));
380
+ }
381
+ /**
382
+ * Returns a published agent with its full version history.
383
+ * Get a library agent entry by slug
384
+ */
385
+ async getLibraryAgent(slug, organizationId, initOverrides) {
386
+ const response = await this.getLibraryAgentRaw({ slug: slug, organizationId: organizationId }, initOverrides);
387
+ return await response.value();
388
+ }
389
+ /**
390
+ * Materializes the published agent bundle (agent, skills, knowledge bases, flow, apps) in the organization. MCP tools are only linked when a matching tool already exists in the organization, otherwise they are reported as skipped. Requires organization admin rights.
391
+ * Install a library agent into an organization
392
+ */
393
+ async installLibraryAgentRaw(requestParameters, initOverrides) {
394
+ if (requestParameters['slug'] == null) {
395
+ throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling installLibraryAgent().');
396
+ }
397
+ if (requestParameters['libraryAgentInstallRequestUio'] == null) {
398
+ throw new runtime.RequiredError('libraryAgentInstallRequestUio', 'Required parameter "libraryAgentInstallRequestUio" was null or undefined when calling installLibraryAgent().');
399
+ }
400
+ const queryParameters = {};
401
+ const headerParameters = {};
402
+ headerParameters['Content-Type'] = 'application/json';
403
+ if (this.configuration && this.configuration.apiKey) {
404
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
405
+ }
406
+ const response = await this.request({
407
+ path: `/library-agents/{slug}/install`.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))),
408
+ method: 'POST',
409
+ headers: headerParameters,
410
+ query: queryParameters,
411
+ body: (0, index_1.LibraryAgentInstallRequestUioToJSON)(requestParameters['libraryAgentInstallRequestUio']),
412
+ }, initOverrides);
413
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentInstallResponseUioFromJSON)(jsonValue));
414
+ }
415
+ /**
416
+ * Materializes the published agent bundle (agent, skills, knowledge bases, flow, apps) in the organization. MCP tools are only linked when a matching tool already exists in the organization, otherwise they are reported as skipped. Requires organization admin rights.
417
+ * Install a library agent into an organization
418
+ */
419
+ async installLibraryAgent(slug, libraryAgentInstallRequestUio, initOverrides) {
420
+ const response = await this.installLibraryAgentRaw({ slug: slug, libraryAgentInstallRequestUio: libraryAgentInstallRequestUio }, initOverrides);
421
+ return await response.value();
422
+ }
423
+ /**
424
+ * Returns the provenance links of the organization\'s managed agents, each enriched with the latest published version of its catalog entry and an updateAvailable flag. Requires organization membership.
425
+ * List marketplace links of an organization\'s agents
426
+ */
427
+ async listAgentLibraryLinksRaw(requestParameters, initOverrides) {
428
+ if (requestParameters['organizationId'] == null) {
429
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listAgentLibraryLinks().');
430
+ }
431
+ const queryParameters = {};
432
+ if (requestParameters['organizationId'] != null) {
433
+ queryParameters['organizationId'] = requestParameters['organizationId'];
434
+ }
435
+ if (requestParameters['agentId'] != null) {
436
+ queryParameters['agentId'] = requestParameters['agentId'];
437
+ }
438
+ const headerParameters = {};
439
+ if (this.configuration && this.configuration.apiKey) {
440
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
441
+ }
442
+ const response = await this.request({
443
+ path: `/agent-library-links`,
444
+ method: 'GET',
445
+ headers: headerParameters,
446
+ query: queryParameters,
447
+ }, initOverrides);
448
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AgentLibraryLinksResponseUioFromJSON)(jsonValue));
449
+ }
450
+ /**
451
+ * Returns the provenance links of the organization\'s managed agents, each enriched with the latest published version of its catalog entry and an updateAvailable flag. Requires organization membership.
452
+ * List marketplace links of an organization\'s agents
453
+ */
454
+ async listAgentLibraryLinks(organizationId, agentId, initOverrides) {
455
+ const response = await this.listAgentLibraryLinksRaw({ organizationId: organizationId, agentId: agentId }, initOverrides);
456
+ return await response.value();
457
+ }
458
+ /**
459
+ * Returns a paginated, searchable, filterable list of published agents with their versions.
460
+ * List all library agents (agent marketplace)
461
+ */
462
+ async listLibraryAgentsRaw(requestParameters, initOverrides) {
463
+ if (requestParameters['organizationId'] == null) {
464
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listLibraryAgents().');
465
+ }
466
+ const queryParameters = {};
467
+ if (requestParameters['organizationId'] != null) {
468
+ queryParameters['organizationId'] = requestParameters['organizationId'];
469
+ }
470
+ if (requestParameters['page'] != null) {
471
+ queryParameters['page'] = requestParameters['page'];
472
+ }
473
+ if (requestParameters['limit'] != null) {
474
+ queryParameters['limit'] = requestParameters['limit'];
475
+ }
476
+ if (requestParameters['search'] != null) {
477
+ queryParameters['search'] = requestParameters['search'];
478
+ }
479
+ if (requestParameters['category'] != null) {
480
+ queryParameters['category'] = requestParameters['category'];
481
+ }
482
+ const headerParameters = {};
483
+ if (this.configuration && this.configuration.apiKey) {
484
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
485
+ }
486
+ const response = await this.request({
487
+ path: `/library-agents`,
488
+ method: 'GET',
489
+ headers: headerParameters,
490
+ query: queryParameters,
491
+ }, initOverrides);
492
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LibraryAgentsPageUioFromJSON)(jsonValue));
493
+ }
494
+ /**
495
+ * Returns a paginated, searchable, filterable list of published agents with their versions.
496
+ * List all library agents (agent marketplace)
497
+ */
498
+ async listLibraryAgents(organizationId, page, limit, search, category, initOverrides) {
499
+ const response = await this.listLibraryAgentsRaw({ organizationId: organizationId, page: page, limit: limit, search: search, category: category }, initOverrides);
500
+ return await response.value();
501
+ }
502
+ /**
503
+ * Re-applies the published bundle onto the installed agent in place (fields replaced, skill/tool/knowledge-base assignments synchronized, flow replaced). Organization skills and knowledge bases are never deleted, only unassigned; existing apps with the same name are kept. Defaults to the latest published version. Requires organization admin rights.
504
+ * Update a managed agent to a catalog version
505
+ */
506
+ async updateManagedAgentRaw(requestParameters, initOverrides) {
507
+ if (requestParameters['agentId'] == null) {
508
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling updateManagedAgent().');
509
+ }
510
+ if (requestParameters['agentLibraryLinkUpdateRequestUio'] == null) {
511
+ throw new runtime.RequiredError('agentLibraryLinkUpdateRequestUio', 'Required parameter "agentLibraryLinkUpdateRequestUio" was null or undefined when calling updateManagedAgent().');
512
+ }
513
+ const queryParameters = {};
514
+ const headerParameters = {};
515
+ headerParameters['Content-Type'] = 'application/json';
516
+ if (this.configuration && this.configuration.apiKey) {
517
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
518
+ }
519
+ const response = await this.request({
520
+ path: `/agent-library-links/{agentId}/update`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
521
+ method: 'POST',
522
+ headers: headerParameters,
523
+ query: queryParameters,
524
+ body: (0, index_1.AgentLibraryLinkUpdateRequestUioToJSON)(requestParameters['agentLibraryLinkUpdateRequestUio']),
525
+ }, initOverrides);
526
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AgentLibraryLinkUpdateResponseUioFromJSON)(jsonValue));
527
+ }
528
+ /**
529
+ * Re-applies the published bundle onto the installed agent in place (fields replaced, skill/tool/knowledge-base assignments synchronized, flow replaced). Organization skills and knowledge bases are never deleted, only unassigned; existing apps with the same name are kept. Defaults to the latest published version. Requires organization admin rights.
530
+ * Update a managed agent to a catalog version
531
+ */
532
+ async updateManagedAgent(agentId, agentLibraryLinkUpdateRequestUio, initOverrides) {
533
+ const response = await this.updateManagedAgentRaw({ agentId: agentId, agentLibraryLinkUpdateRequestUio: agentLibraryLinkUpdateRequestUio }, initOverrides);
534
+ return await response.value();
535
+ }
536
+ }
537
+ exports.LibraryAgentsApi = LibraryAgentsApi;
@@ -10,11 +10,15 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DeleteOrganizationUser200ResponseUio, OrganizationEngineUio, OrganizationMemberUio, OrganizationUio, OrganizationUserInviteRequestUio, OrganizationUserInviteResponseUio, RoleCreateRequestUio, RoleUio } from '../models/index';
13
+ import type { CreateToolApprovalRequestUio, DeleteOrganizationUser200ResponseUio, EditToolApprovalRequestUio, OrganizationEngineUio, OrganizationMemberUio, OrganizationUio, OrganizationUserInviteRequestUio, OrganizationUserInviteResponseUio, RoleCreateRequestUio, RoleUio, ToolApprovalUio, ToolApprovalsResponseUio } from '../models/index';
14
14
  export interface CreateOrganizationRoleRequest {
15
15
  organizationId: string;
16
16
  roleCreateRequestUio: RoleCreateRequestUio;
17
17
  }
18
+ export interface CreateToolApprovalRequest {
19
+ organizationId: string;
20
+ createToolApprovalRequestUio: CreateToolApprovalRequestUio;
21
+ }
18
22
  export interface DeleteOrganizationRequest {
19
23
  organizationId: string;
20
24
  }
@@ -26,6 +30,11 @@ export interface DeleteOrganizationUserRequest {
26
30
  organizationId: string;
27
31
  userId: string;
28
32
  }
33
+ export interface EditToolApprovalRequest {
34
+ organizationId: string;
35
+ approvalId: string;
36
+ editToolApprovalRequestUio: EditToolApprovalRequestUio;
37
+ }
29
38
  export interface GetOrganizationByIdRequest {
30
39
  organizationId: string;
31
40
  }
@@ -45,6 +54,14 @@ export interface ListOrganizationRolesRequest {
45
54
  export interface ListOrganizationUsersRequest {
46
55
  organizationId: string;
47
56
  }
57
+ export interface ListToolApprovalsRequest {
58
+ organizationId: string;
59
+ agentId?: string;
60
+ }
61
+ export interface RevokeToolApprovalRequest {
62
+ organizationId: string;
63
+ approvalId: string;
64
+ }
48
65
  export interface UpdateOrganizationRoleRequest {
49
66
  organizationId: string;
50
67
  roleId: string;
@@ -64,6 +81,16 @@ export declare class OrganizationsApi extends runtime.BaseAPI {
64
81
  * Create a role in an organization
65
82
  */
66
83
  createOrganizationRole(organizationId: string, roleCreateRequestUio: RoleCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RoleUio>;
84
+ /**
85
+ * Creates an approval without waiting for the agent to ask for one — preparing an agent rather than answering its questions. It widens no boundary: the value goes through the same validation as an in-conversation approval, the scope is the only one open (this agent, for the caller), and the author is the caller. Granting a value that is already granted returns the existing approval rather than a duplicate.
86
+ * Grant an approval by hand
87
+ */
88
+ createToolApprovalRaw(requestParameters: CreateToolApprovalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolApprovalUio>>;
89
+ /**
90
+ * Creates an approval without waiting for the agent to ask for one — preparing an agent rather than answering its questions. It widens no boundary: the value goes through the same validation as an in-conversation approval, the scope is the only one open (this agent, for the caller), and the author is the caller. Granting a value that is already granted returns the existing approval rather than a duplicate.
91
+ * Grant an approval by hand
92
+ */
93
+ createToolApproval(organizationId: string, createToolApprovalRequestUio: CreateToolApprovalRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolApprovalUio>;
67
94
  /**
68
95
  * Permanently deletes an organization, then purges the agent memories attached to it. Restricted to super administrators and only available when the server runs with the `features.testMode` flag enabled.
69
96
  * Delete an organization
@@ -92,6 +119,16 @@ export declare class OrganizationsApi extends runtime.BaseAPI {
92
119
  * Remove a user from an organization
93
120
  */
94
121
  deleteOrganizationUser(organizationId: string, userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteOrganizationUser200ResponseUio>;
122
+ /**
123
+ * Rewrites what one approval covers — widening an address into a pattern, or correcting a command. Only an approval the caller granted himself, and only its resource: the scope, the agent and the author never change. An approval cannot be created this way; a right only ever starts with a question the agent actually asked.
124
+ * Edit an approval the caller granted
125
+ */
126
+ editToolApprovalRaw(requestParameters: EditToolApprovalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolApprovalUio>>;
127
+ /**
128
+ * Rewrites what one approval covers — widening an address into a pattern, or correcting a command. Only an approval the caller granted himself, and only its resource: the scope, the agent and the author never change. An approval cannot be created this way; a right only ever starts with a question the agent actually asked.
129
+ * Edit an approval the caller granted
130
+ */
131
+ editToolApproval(organizationId: string, approvalId: string, editToolApprovalRequestUio: EditToolApprovalRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolApprovalUio>;
95
132
  /**
96
133
  * Retrieves an organization by its ID
97
134
  * Get an organization by ID
@@ -158,6 +195,26 @@ export declare class OrganizationsApi extends runtime.BaseAPI {
158
195
  * List organizations
159
196
  */
160
197
  listOrganizations(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OrganizationUio>>;
198
+ /**
199
+ * Returns the approvals the CALLER granted in this organisation, newest first. Revoking one deletes it, so every approval returned is a right in force — there is no expiry and no revoked state to filter out. Never another user\'s: an approval is a personal consent.
200
+ * List the operations the caller has authorised
201
+ */
202
+ listToolApprovalsRaw(requestParameters: ListToolApprovalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolApprovalsResponseUio>>;
203
+ /**
204
+ * Returns the approvals the CALLER granted in this organisation, newest first. Revoking one deletes it, so every approval returned is a right in force — there is no expiry and no revoked state to filter out. Never another user\'s: an approval is a personal consent.
205
+ * List the operations the caller has authorised
206
+ */
207
+ listToolApprovals(organizationId: string, agentId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolApprovalsResponseUio>;
208
+ /**
209
+ * Takes back one approval the caller granted. The approval is deleted, and the agent asks again the next time it needs that operation. It takes effect on the agent\'s next turn.
210
+ * Revoke an approval
211
+ */
212
+ revokeToolApprovalRaw(requestParameters: RevokeToolApprovalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
213
+ /**
214
+ * Takes back one approval the caller granted. The approval is deleted, and the agent asks again the next time it needs that operation. It takes effect on the agent\'s next turn.
215
+ * Revoke an approval
216
+ */
217
+ revokeToolApproval(organizationId: string, approvalId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
161
218
  /**
162
219
  * Updates an existing agent role in the specified organization
163
220
  * Update a role in an organization