@agents24/node 0.4.0 → 0.5.1

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 (41) hide show
  1. package/README.md +26 -2
  2. package/compatibility.json +6 -6
  3. package/dist/bff.cjs +468 -51
  4. package/dist/bff.cjs.map +1 -1
  5. package/dist/bff.d.cts +23 -4
  6. package/dist/bff.d.ts +23 -4
  7. package/dist/bff.js +468 -51
  8. package/dist/bff.js.map +1 -1
  9. package/dist/{client-C5ui84wi.d.cts → client-xWr_OGEe.d.cts} +285 -86
  10. package/dist/{client-C5ui84wi.d.ts → client-xWr_OGEe.d.ts} +285 -86
  11. package/dist/index.cjs +177 -65
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.js +177 -65
  16. package/dist/index.js.map +1 -1
  17. package/dist/types/bff-agent-resolution.d.ts +41 -0
  18. package/dist/types/bff-agent-resolution.d.ts.map +1 -0
  19. package/dist/types/bff-errors.d.ts +3 -0
  20. package/dist/types/bff-errors.d.ts.map +1 -0
  21. package/dist/types/bff.d.ts +6 -20
  22. package/dist/types/bff.d.ts.map +1 -1
  23. package/dist/types/client.d.ts +2 -2
  24. package/dist/types/client.d.ts.map +1 -1
  25. package/dist/types/embed.d.ts +7 -1
  26. package/dist/types/embed.d.ts.map +1 -1
  27. package/dist/types/generated/customerProfiles.d.ts +11 -0
  28. package/dist/types/generated/customerProfiles.d.ts.map +1 -0
  29. package/dist/types/generated/manifest.d.ts +1 -1
  30. package/dist/types/generated/manifest.d.ts.map +1 -1
  31. package/dist/types/generated/resourceInstallations.d.ts +6 -2
  32. package/dist/types/generated/resourceInstallations.d.ts.map +1 -1
  33. package/dist/types/generated/resourcePackages.d.ts +7 -3
  34. package/dist/types/generated/resourcePackages.d.ts.map +1 -1
  35. package/dist/types/generated/resourcePolicies.d.ts +3 -3
  36. package/dist/types/generated/resourcePolicies.d.ts.map +1 -1
  37. package/dist/types/types.d.ts +255 -69
  38. package/dist/types/types.d.ts.map +1 -1
  39. package/package.json +2 -2
  40. package/dist/types/generated/resourceBundles.d.ts +0 -12
  41. package/dist/types/generated/resourceBundles.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -497,6 +497,18 @@ var EmbedNamespace = class {
497
497
  query: { agent_version_id: agentVersionId, runtime_target: runtimeTarget }
498
498
  });
499
499
  }
500
+ resolveAgentAlias(agentAlias) {
501
+ return this.http.requestJson("/public/embed/resolve-agent-alias", {
502
+ method: "POST",
503
+ body: { agent_alias: agentAlias }
504
+ });
505
+ }
506
+ resolveCustomerPrincipal(request) {
507
+ return this.http.requestJson("/public/embed/customer-principals/resolve", {
508
+ method: "POST",
509
+ body: request
510
+ });
511
+ }
500
512
  getResourcePolicy(agentId, request) {
501
513
  return this.http.requestJson(`/public/embed/agents/${agentId}/resource-policy`, {
502
514
  method: "POST",
@@ -509,7 +521,8 @@ var EmbedNamespace = class {
509
521
  external_session_id: options.externalSessionId,
510
522
  skip: options.skip ?? 0,
511
523
  limit: options.limit ?? 20,
512
- runtime_target: options.runtimeTarget
524
+ runtime_target: options.runtimeTarget,
525
+ integration_id: options.integrationId
513
526
  } });
514
527
  }
515
528
  listAgentThreadsMulti(options) {
@@ -520,7 +533,8 @@ var EmbedNamespace = class {
520
533
  external_user_id: options.externalUserId,
521
534
  external_session_id: options.externalSessionId,
522
535
  cursor: options.cursor,
523
- runtime_target: options.runtimeTarget
536
+ runtime_target: options.runtimeTarget,
537
+ integration_id: options.integrationId
524
538
  }), { method: "GET", headers: this.http.streamHeaders(), signal: options.signal }, "Failed to connect to the embedded-agent thread event endpoint.");
525
539
  await assertOk(response);
526
540
  await consumeThreadSummaryEventStream(response, onEvent, options.signal);
@@ -530,11 +544,39 @@ var EmbedNamespace = class {
530
544
  agent_ids: options.agentIds,
531
545
  external_user_id: options.externalUserId,
532
546
  external_session_id: options.externalSessionId,
533
- cursor: options.cursor
547
+ cursor: options.cursor,
548
+ runtime_target: options.runtimeTarget,
549
+ integration_id: options.integrationId
534
550
  }), { method: "GET", headers: this.http.streamHeaders(), signal: options.signal }, "Failed to connect to the embedded-agent thread event endpoint.");
535
551
  await assertOk(response);
536
552
  await consumeThreadSummaryEventStream(response, onEvent, options.signal);
537
553
  }
554
+ getConversationThread(threadId, options) {
555
+ return this.http.requestJson(`/public/embed/threads/${threadId}`, { query: {
556
+ agent_ids: options.agentIds,
557
+ external_user_id: options.externalUserId,
558
+ external_session_id: options.externalSessionId,
559
+ integration_id: options.integrationId,
560
+ before_turn_index: options.beforeTurnIndex,
561
+ limit: options.limit,
562
+ runtime_target: options.runtimeTarget
563
+ } });
564
+ }
565
+ setConversationRuntimeSelection(threadId, request) {
566
+ return this.http.requestJson(`/public/embed/threads/${threadId}/runtime-selection`, { method: "PATCH", body: request, mutation: true });
567
+ }
568
+ resolveConversationRun(runId, request) {
569
+ return this.http.requestJson(`/public/embed/runs/${runId}/resolve`, { method: "POST", body: request });
570
+ }
571
+ deleteConversationThread(threadId, options, requestOptions) {
572
+ return this.http.requestJson(`/public/embed/threads/${threadId}`, { method: "DELETE", query: {
573
+ agent_ids: options.agentIds,
574
+ external_user_id: options.externalUserId,
575
+ external_session_id: options.externalSessionId,
576
+ integration_id: options.integrationId,
577
+ runtime_target: options.runtimeTarget
578
+ }, options: requestOptions, mutation: true });
579
+ }
538
580
  getAgentThread(agentId, threadId, options) {
539
581
  return this.http.requestJson(`/public/embed/agents/${agentId}/threads/${threadId}`, { query: {
540
582
  external_user_id: options.externalUserId,
@@ -545,28 +587,32 @@ var EmbedNamespace = class {
545
587
  subthread_depth: options.subthreadDepth,
546
588
  subthread_turn_limit: options.subthreadTurnLimit,
547
589
  subthread_child_limit: options.subthreadChildLimit,
548
- runtime_target: options.runtimeTarget
590
+ runtime_target: options.runtimeTarget,
591
+ integration_id: options.integrationId
549
592
  } });
550
593
  }
551
594
  deleteAgentThread(agentId, threadId, options, requestOptions) {
552
595
  return this.http.requestJson(`/public/embed/agents/${agentId}/threads/${threadId}`, { method: "DELETE", query: {
553
596
  external_user_id: options.externalUserId,
554
597
  external_session_id: options.externalSessionId,
555
- runtime_target: options.runtimeTarget
598
+ runtime_target: options.runtimeTarget,
599
+ integration_id: options.integrationId
556
600
  }, options: requestOptions, mutation: true });
557
601
  }
558
602
  getAgentRunContext(agentId, runId, options) {
559
603
  return this.http.requestJson(`/public/embed/agents/${agentId}/runs/${runId}/context`, { query: {
560
604
  external_user_id: options.externalUserId,
561
605
  external_session_id: options.externalSessionId,
562
- runtime_target: options.runtimeTarget
606
+ runtime_target: options.runtimeTarget,
607
+ integration_id: options.integrationId
563
608
  } });
564
609
  }
565
610
  cancelAgentRun(agentId, runId, options, requestOptions) {
566
611
  return this.http.requestJson(`/public/embed/agents/${agentId}/runs/${runId}/cancel`, { method: "POST", query: {
567
612
  external_user_id: options.externalUserId,
568
613
  external_session_id: options.externalSessionId,
569
- runtime_target: options.runtimeTarget
614
+ runtime_target: options.runtimeTarget,
615
+ integration_id: options.integrationId
570
616
  }, body: {}, options: requestOptions, mutation: true });
571
617
  }
572
618
  setAgentRunFeedback(agentId, runId, payload) {
@@ -581,6 +627,7 @@ var EmbedNamespace = class {
581
627
  if (options.externalSessionId) form.set("external_session_id", options.externalSessionId);
582
628
  if (options.threadId) form.set("thread_id", options.threadId);
583
629
  if (options.runtimeTarget) form.set("runtime_target", options.runtimeTarget);
630
+ if (options.integrationId) form.set("integration_id", options.integrationId);
584
631
  for (const file of options.files) form.append("files", file, file.name);
585
632
  const response = await this.http.fetchOrThrow(this.http.url(`/public/embed/agents/${agentId}/attachments/upload`), {
586
633
  method: "POST",
@@ -598,57 +645,21 @@ var EmbedNamespace = class {
598
645
  }
599
646
  };
600
647
 
601
- // src/generated/resourceBundles.ts
602
- var ResourceBundlesNamespace = class {
648
+ // src/generated/resourcePackages.ts
649
+ var ResourcePackagesNamespace = class {
603
650
  constructor(http) {
604
651
  this.http = http;
605
652
  }
606
653
  http;
607
- exportPlan(request) {
608
- return this.http.requestJson("/resource-bundles/export/plan", {
609
- method: "POST",
610
- body: request
611
- });
612
- }
613
- exportBundle(request) {
614
- return this.http.requestJson("/resource-bundles/export", {
615
- method: "POST",
616
- body: request
617
- });
618
- }
619
- candidates(options) {
620
- return this.http.requestJson("/resource-bundles/candidates", {
621
- query: {
622
- kind: options.kind,
623
- q: options.query,
624
- limit: options.limit,
625
- offset: options.offset,
626
- required_capability: options.requiredCapability
627
- }
628
- });
654
+ getExportability() {
655
+ return this.http.requestJson("/resource-packages/exportability");
629
656
  }
630
- importPreview(request) {
631
- return this.http.requestJson("/resource-bundles/import/preview", {
657
+ exportPlan(request) {
658
+ return this.http.requestJson("/resource-packages/export/plan", {
632
659
  method: "POST",
633
660
  body: request
634
661
  });
635
662
  }
636
- importBundle(request, options) {
637
- return this.http.requestJson("/resource-bundles/import", {
638
- method: "POST",
639
- body: request,
640
- options,
641
- mutation: true
642
- });
643
- }
644
- };
645
-
646
- // src/generated/resourcePackages.ts
647
- var ResourcePackagesNamespace = class {
648
- constructor(http) {
649
- this.http = http;
650
- }
651
- http;
652
663
  async exportPackage(request) {
653
664
  const response = await this.http.fetchOrThrow(
654
665
  this.http.url("/resource-packages/export"),
@@ -669,26 +680,53 @@ var ResourcePackagesNamespace = class {
669
680
  formData.append("file", new Blob([archiveBytes]), filename);
670
681
  const response = await this.http.fetchOrThrow(
671
682
  this.http.url("/resource-packages/validate", void 0),
672
- { method: "POST", headers: this.http.multipartHeaders(), body: formData },
683
+ { method: "POST", headers: this.http.multipartHeaders(void 0, void 0, false), body: formData },
684
+ "Failed to upload the Agents24 resource package."
685
+ );
686
+ await assertOk(response);
687
+ return await response.json();
688
+ }
689
+ async importPreview(upload) {
690
+ const formData = new FormData();
691
+ const archiveBytes = upload.data.slice().buffer;
692
+ const candidate = upload.filename || "";
693
+ const filename = /^[A-Za-z0-9][A-Za-z0-9._-]{0,200}\.zip$/.test(candidate) ? candidate : "resource.agents24.zip";
694
+ formData.append("file", new Blob([archiveBytes]), filename);
695
+ formData.set("mappings", JSON.stringify(upload.mappings || {}));
696
+ const response = await this.http.fetchOrThrow(
697
+ this.http.url("/resource-packages/import/preview", void 0),
698
+ { method: "POST", headers: this.http.multipartHeaders(void 0, void 0, false), body: formData },
673
699
  "Failed to upload the Agents24 resource package."
674
700
  );
675
701
  await assertOk(response);
676
702
  return await response.json();
677
703
  }
678
- async compilePackage(upload) {
704
+ async importPackage(upload, options = {}) {
679
705
  const formData = new FormData();
680
706
  const archiveBytes = upload.data.slice().buffer;
681
707
  const candidate = upload.filename || "";
682
708
  const filename = /^[A-Za-z0-9][A-Za-z0-9._-]{0,200}\.zip$/.test(candidate) ? candidate : "resource.agents24.zip";
683
709
  formData.append("file", new Blob([archiveBytes]), filename);
710
+ formData.set("mappings", JSON.stringify(upload.mappings || {}));
684
711
  const response = await this.http.fetchOrThrow(
685
- this.http.url("/resource-packages/compile", void 0),
686
- { method: "POST", headers: this.http.multipartHeaders(), body: formData },
712
+ this.http.url("/resource-packages/import", void 0),
713
+ { method: "POST", headers: this.http.multipartHeaders(void 0, options, true), body: formData },
687
714
  "Failed to upload the Agents24 resource package."
688
715
  );
689
716
  await assertOk(response);
690
717
  return await response.json();
691
718
  }
719
+ candidates(options) {
720
+ return this.http.requestJson("/resource-packages/import/candidates", {
721
+ query: {
722
+ kind: options.kind,
723
+ q: options.query,
724
+ limit: options.limit,
725
+ offset: options.offset,
726
+ required_capability: options.requiredCapability
727
+ }
728
+ });
729
+ }
692
730
  };
693
731
 
694
732
  // src/generated/resourceInstallations.ts
@@ -711,6 +749,9 @@ var ResourceInstallationsNamespace = class {
711
749
  get(installationId) {
712
750
  return this.http.requestJson(`/resource-installations/${installationId}`);
713
751
  }
752
+ getByPackageId(packageId) {
753
+ return this.http.requestJson(`/resource-installations/by-package/${packageId}`);
754
+ }
714
755
  async plan(upload) {
715
756
  const formData = new FormData();
716
757
  const archiveBytes = upload.data.slice().buffer;
@@ -719,16 +760,39 @@ var ResourceInstallationsNamespace = class {
719
760
  formData.append("file", new Blob([archiveBytes]), filename);
720
761
  const response = await this.http.fetchOrThrow(
721
762
  this.http.url("/resource-installations/plan", {
722
- installation_id: upload.installationId,
723
- prune: upload.prune,
724
- development: upload.development
763
+ prune: upload.prune
725
764
  }),
726
- { method: "POST", headers: this.http.multipartHeaders(), body: formData },
765
+ { method: "POST", headers: this.http.multipartHeaders(void 0, void 0, false), body: formData },
766
+ "Failed to upload the Agents24 resource package."
767
+ );
768
+ await assertOk(response);
769
+ return await response.json();
770
+ }
771
+ async planPull(installationId, upload) {
772
+ const formData = new FormData();
773
+ const archiveBytes = upload.data.slice().buffer;
774
+ const candidate = upload.filename || "";
775
+ const filename = /^[A-Za-z0-9][A-Za-z0-9._-]{0,200}\.zip$/.test(candidate) ? candidate : "resource.agents24.zip";
776
+ formData.append("file", new Blob([archiveBytes]), filename);
777
+ const response = await this.http.fetchOrThrow(
778
+ this.http.url(`/resource-installations/${installationId}/pull/plan`, void 0),
779
+ { method: "POST", headers: this.http.multipartHeaders(void 0, void 0, false), body: formData },
727
780
  "Failed to upload the Agents24 resource package."
728
781
  );
729
782
  await assertOk(response);
730
783
  return await response.json();
731
784
  }
785
+ downloadPull(installationId, pullId) {
786
+ return this.http.requestJson(`/resource-installations/${installationId}/pull/${pullId}/download`);
787
+ }
788
+ acceptPull(installationId, pullId, request, options) {
789
+ return this.http.requestJson(`/resource-installations/${installationId}/pull/${pullId}/accept`, {
790
+ method: "POST",
791
+ body: request,
792
+ options,
793
+ mutation: true
794
+ });
795
+ }
732
796
  link(installationId, request, options) {
733
797
  return this.http.requestJson(`/resource-installations/${installationId}/link`, {
734
798
  method: "POST",
@@ -897,30 +961,65 @@ var ResourcePoliciesNamespace = class {
897
961
  }
898
962
  };
899
963
 
964
+ // src/generated/customerProfiles.ts
965
+ var CustomerProfilesNamespace = class {
966
+ constructor(http) {
967
+ this.http = http;
968
+ }
969
+ http;
970
+ upsert(request, options) {
971
+ return this.http.requestJson("/public/embed/customer-principals/resolve", {
972
+ method: "POST",
973
+ body: request,
974
+ options,
975
+ mutation: true
976
+ });
977
+ }
978
+ get(customerPrincipalRef) {
979
+ return this.http.requestJson(`/public/embed/customer-principals/${customerPrincipalRef}/profile`);
980
+ }
981
+ clear(customerPrincipalRef, options) {
982
+ return this.http.requestJson(`/public/embed/customer-principals/${customerPrincipalRef}/profile`, {
983
+ method: "DELETE",
984
+ options,
985
+ mutation: true
986
+ });
987
+ }
988
+ search(options) {
989
+ return this.http.requestJson("/public/embed/customer-principals", {
990
+ query: {
991
+ q: options.query,
992
+ integration_id: options.integrationId,
993
+ limit: options.limit ?? 25
994
+ }
995
+ });
996
+ }
997
+ };
998
+
900
999
  // src/client.ts
901
1000
  var Agents24 = class {
902
1001
  agents;
903
1002
  embed;
904
1003
  runs;
905
- resourceBundles;
906
1004
  resourcePackages;
907
1005
  resourceInstallations;
908
1006
  clientDeployments;
909
1007
  clientSessions;
910
1008
  instructions;
911
1009
  resourcePolicies;
1010
+ customerProfiles;
912
1011
  constructor(options) {
913
1012
  const http = new Agents24HttpClient(options);
914
1013
  this.agents = new AgentsNamespace(http);
915
1014
  this.embed = new EmbedNamespace(http);
916
1015
  this.runs = new RunsNamespace(http);
917
- this.resourceBundles = new ResourceBundlesNamespace(http);
918
1016
  this.resourcePackages = new ResourcePackagesNamespace(http);
919
1017
  this.resourceInstallations = new ResourceInstallationsNamespace(http);
920
1018
  this.clientDeployments = new ClientDeploymentsNamespace(http);
921
1019
  this.clientSessions = new ClientSessionsNamespace(http);
922
1020
  this.instructions = new InstructionsNamespace(http);
923
1021
  this.resourcePolicies = new ResourcePoliciesNamespace(http);
1022
+ this.customerProfiles = new CustomerProfilesNamespace(http);
924
1023
  }
925
1024
  agent(options) {
926
1025
  return new AgentDefinitionBuilder(this.agents, options);
@@ -973,45 +1072,58 @@ var SDK_OPERATION_IDS = [
973
1072
  "client.threads.events",
974
1073
  "client.threads.get",
975
1074
  "client.threads.list",
1075
+ "customer_profiles.clear",
1076
+ "customer_profiles.get",
1077
+ "customer_profiles.search",
1078
+ "customer_profiles.upsert",
976
1079
  "embed.attach_agent_run",
977
1080
  "embed.cancel_agent_run",
978
1081
  "embed.create_attachment_content_access",
979
1082
  "embed.delete_agent_thread",
1083
+ "embed.delete_conversation_thread",
980
1084
  "embed.get_agent_run_context",
981
1085
  "embed.get_agent_thread",
1086
+ "embed.get_conversation_thread",
982
1087
  "embed.get_resource_policy",
983
1088
  "embed.get_runtime_bootstrap",
984
1089
  "embed.list_agent_threads",
985
1090
  "embed.list_agent_threads_multi",
1091
+ "embed.resolve_agent_alias",
1092
+ "embed.resolve_conversation_run",
1093
+ "embed.resolve_customer_principal",
986
1094
  "embed.resume_agent_run",
987
1095
  "embed.set_agent_run_feedback",
1096
+ "embed.set_conversation_runtime_selection",
988
1097
  "embed.start_agent_run_mcp_auth",
989
1098
  "embed.stream_agent",
990
1099
  "embed.stream_agent_thread_events",
991
1100
  "embed.stream_agent_thread_events_multi",
992
1101
  "embed.upload_agent_attachments",
993
1102
  "instructions.publish",
994
- "resource_bundles.candidates",
995
- "resource_bundles.export",
996
- "resource_bundles.export_plan",
997
- "resource_bundles.import",
998
- "resource_bundles.import_preview",
1103
+ "resource_installations.accept_pull",
999
1104
  "resource_installations.apply",
1000
1105
  "resource_installations.bind_deployment",
1001
1106
  "resource_installations.configure_secrets",
1002
1107
  "resource_installations.create",
1003
1108
  "resource_installations.development_session_status",
1109
+ "resource_installations.download_pull",
1004
1110
  "resource_installations.get",
1111
+ "resource_installations.get_by_package_id",
1005
1112
  "resource_installations.link",
1006
1113
  "resource_installations.list",
1007
1114
  "resource_installations.operation_status",
1008
1115
  "resource_installations.plan",
1116
+ "resource_installations.plan_pull",
1009
1117
  "resource_installations.prepare_development_session",
1010
1118
  "resource_installations.publish",
1011
1119
  "resource_installations.resources",
1012
1120
  "resource_installations.revoke_development_session",
1013
- "resource_packages.compile",
1121
+ "resource_packages.candidates",
1014
1122
  "resource_packages.export",
1123
+ "resource_packages.export_plan",
1124
+ "resource_packages.exportability",
1125
+ "resource_packages.import",
1126
+ "resource_packages.import_preview",
1015
1127
  "resource_packages.validate",
1016
1128
  "resource_policies.clear_customer_assignment",
1017
1129
  "resource_policies.get_customer_assignment",