@agents24/node 0.5.18 → 0.5.20

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/dist/index.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  var crypto = require('crypto');
4
4
  var protocol = require('@agents24/client/protocol');
5
+ var client = require('@agents24/client');
5
6
 
6
7
  // src/http.ts
7
8
 
@@ -150,6 +151,7 @@ var Agents24HttpClient = class {
150
151
  ...config.body === void 0 ? {} : { body: JSON.stringify(config.body) }
151
152
  }, "Failed to connect to the Agents24 API.");
152
153
  await assertOk(response);
154
+ if (response.status === 204) return void 0;
153
155
  return await response.json();
154
156
  }
155
157
  async fetchOrThrow(url, init, message) {
@@ -511,8 +513,6 @@ var ClientSessionsNamespace = class {
511
513
  );
512
514
  }
513
515
  };
514
-
515
- // src/embed.ts
516
516
  var EmbedNamespace = class {
517
517
  constructor(http) {
518
518
  this.http = http;
@@ -848,7 +848,7 @@ var EmbedNamespace = class {
848
848
  if (options.threadId) form.set("thread_id", options.threadId);
849
849
  if (options.runtimeTarget) form.set("runtime_target", options.runtimeTarget);
850
850
  if (options.integrationId) form.set("integration_id", options.integrationId);
851
- for (const file of options.files) form.append("files", file, file.name);
851
+ for (const file of options.files) form.append("files", file.slice(0, file.size, client.normalizeAttachmentMimeType(file.type, file.name)), file.name);
852
852
  const response = await this.http.fetchOrThrow(this.http.url(`/public/embed/agents/${agentId}/attachments/upload`), {
853
853
  method: "POST",
854
854
  headers: this.http.multipartHeaders(void 0, { idempotencyKey: options.idempotencyKey }, true),
@@ -1301,8 +1301,155 @@ var CustomerProfilesNamespace = class {
1301
1301
  }
1302
1302
  };
1303
1303
 
1304
+ // src/generated/pipelines.ts
1305
+ var PipelinesNamespace = class {
1306
+ constructor(http) {
1307
+ this.http = http;
1308
+ }
1309
+ http;
1310
+ list(options = {}) {
1311
+ return this.http.requestJson("/admin/pipelines/visual-pipelines", {
1312
+ query: {
1313
+ skip: options.skip ?? 0,
1314
+ limit: options.limit ?? 20
1315
+ }
1316
+ });
1317
+ }
1318
+ get(pipelineId) {
1319
+ return this.http.requestJson(`/admin/pipelines/visual-pipelines/${encodeURIComponent(pipelineId)}`);
1320
+ }
1321
+ getPublishedExecutable(pipelineId) {
1322
+ return this.http.requestJson(`/admin/pipelines/visual-pipelines/${encodeURIComponent(pipelineId)}/current-executable`);
1323
+ }
1324
+ getInputSchema(executableId) {
1325
+ return this.http.requestJson(`/admin/pipelines/executable-pipelines/${encodeURIComponent(executableId)}/input-schema`);
1326
+ }
1327
+ };
1328
+
1329
+ // src/generated/ingestionJobs.ts
1330
+ var IngestionJobsNamespace = class {
1331
+ constructor(http) {
1332
+ this.http = http;
1333
+ }
1334
+ http;
1335
+ async uploadInput(file, filename) {
1336
+ const formData = new FormData();
1337
+ formData.append("file", file, filename);
1338
+ const response = await this.http.fetchOrThrow(
1339
+ this.http.url("/admin/pipelines/pipeline-inputs/upload"),
1340
+ { method: "POST", headers: this.http.multipartHeaders(), body: formData },
1341
+ "Failed to upload pipeline input."
1342
+ );
1343
+ await assertOk(response);
1344
+ return await response.json();
1345
+ }
1346
+ start(request, options) {
1347
+ return this.http.requestJson("/admin/pipelines/jobs", {
1348
+ method: "POST",
1349
+ body: request,
1350
+ options,
1351
+ mutation: true
1352
+ });
1353
+ }
1354
+ list(options = {}) {
1355
+ return this.http.requestJson("/admin/pipelines/jobs", {
1356
+ query: {
1357
+ skip: options.skip ?? 0,
1358
+ limit: options.limit ?? 20,
1359
+ executable_pipeline_id: options.executablePipelineId,
1360
+ visual_pipeline_id: options.visualPipelineId,
1361
+ status: options.status,
1362
+ pipeline_type: options.pipelineType,
1363
+ q: options.q
1364
+ }
1365
+ });
1366
+ }
1367
+ get(jobId, options = {}) {
1368
+ return this.http.requestJson(`/admin/pipelines/jobs/${encodeURIComponent(jobId)}`, {
1369
+ query: {
1370
+ lite: options.lite ?? false,
1371
+ include_batches: options.includeBatches ?? true
1372
+ }
1373
+ });
1374
+ }
1375
+ listBatches(jobId, options = {}) {
1376
+ return this.http.requestJson(`/admin/pipelines/jobs/${encodeURIComponent(jobId)}/batches`, {
1377
+ query: {
1378
+ skip: options.skip ?? 0,
1379
+ limit: options.limit ?? 100
1380
+ }
1381
+ });
1382
+ }
1383
+ resume(jobId, options) {
1384
+ return this.http.requestJson(`/admin/pipelines/jobs/${encodeURIComponent(jobId)}/resume`, {
1385
+ method: "POST",
1386
+ options,
1387
+ mutation: true
1388
+ });
1389
+ }
1390
+ cancel(jobId, options) {
1391
+ return this.http.requestJson(`/admin/pipelines/jobs/${encodeURIComponent(jobId)}/cancel`, {
1392
+ method: "POST",
1393
+ options,
1394
+ mutation: true
1395
+ });
1396
+ }
1397
+ };
1398
+
1399
+ // src/generated/knowledgeStores.ts
1400
+ var KnowledgeStoresNamespace = class {
1401
+ constructor(http) {
1402
+ this.http = http;
1403
+ }
1404
+ http;
1405
+ list(options = {}) {
1406
+ return this.http.requestJson("/admin/knowledge-stores", {
1407
+ query: {
1408
+ skip: options.skip ?? 0,
1409
+ limit: options.limit ?? 20,
1410
+ view: options.view ?? "summary"
1411
+ }
1412
+ });
1413
+ }
1414
+ create(request) {
1415
+ return this.http.requestJson("/admin/knowledge-stores", {
1416
+ method: "POST",
1417
+ body: request
1418
+ });
1419
+ }
1420
+ get(storeId) {
1421
+ return this.http.requestJson(`/admin/knowledge-stores/${encodeURIComponent(storeId)}`);
1422
+ }
1423
+ update(storeId, request) {
1424
+ return this.http.requestJson(`/admin/knowledge-stores/${encodeURIComponent(storeId)}`, {
1425
+ method: "PATCH",
1426
+ body: request
1427
+ });
1428
+ }
1429
+ stats(storeId) {
1430
+ return this.http.requestJson(`/admin/knowledge-stores/${encodeURIComponent(storeId)}/stats`);
1431
+ }
1432
+ archive(storeId) {
1433
+ return this.http.requestJson(`/admin/knowledge-stores/${encodeURIComponent(storeId)}`, {
1434
+ method: "DELETE"
1435
+ });
1436
+ }
1437
+ };
1438
+
1439
+ // src/generated/integration-namespaces.ts
1440
+ var GeneratedIntegrationNamespaces = class {
1441
+ pipelines;
1442
+ ingestionJobs;
1443
+ knowledgeStores;
1444
+ constructor(http) {
1445
+ this.pipelines = new PipelinesNamespace(http);
1446
+ this.ingestionJobs = new IngestionJobsNamespace(http);
1447
+ this.knowledgeStores = new KnowledgeStoresNamespace(http);
1448
+ }
1449
+ };
1450
+
1304
1451
  // src/client.ts
1305
- var Agents24 = class {
1452
+ var Agents24 = class extends GeneratedIntegrationNamespaces {
1306
1453
  agents;
1307
1454
  embed;
1308
1455
  runs;
@@ -1317,6 +1464,7 @@ var Agents24 = class {
1317
1464
  customerProfiles;
1318
1465
  constructor(options) {
1319
1466
  const http = new Agents24HttpClient(options);
1467
+ super(http);
1320
1468
  this.agents = new AgentsNamespace(http);
1321
1469
  this.embed = new EmbedNamespace(http);
1322
1470
  this.runs = new RunsNamespace(http);
@@ -1441,7 +1589,24 @@ var SDK_OPERATION_IDS = [
1441
1589
  "embed.thread_messages.resume_queue",
1442
1590
  "embed.thread_messages.submit",
1443
1591
  "embed.upload_agent_attachments",
1592
+ "ingestionJobs.cancel",
1593
+ "ingestionJobs.get",
1594
+ "ingestionJobs.list",
1595
+ "ingestionJobs.list_batches",
1596
+ "ingestionJobs.resume",
1597
+ "ingestionJobs.start",
1598
+ "ingestionJobs.upload_input",
1444
1599
  "instructions.publish",
1600
+ "knowledgeStores.archive",
1601
+ "knowledgeStores.create",
1602
+ "knowledgeStores.get",
1603
+ "knowledgeStores.list",
1604
+ "knowledgeStores.stats",
1605
+ "knowledgeStores.update",
1606
+ "pipelines.get",
1607
+ "pipelines.get_input_schema",
1608
+ "pipelines.get_published_executable",
1609
+ "pipelines.list",
1445
1610
  "resource_installations.accept_pull",
1446
1611
  "resource_installations.apply",
1447
1612
  "resource_installations.bind_deployment",