@agents24/node 0.3.0 → 0.4.0

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.js CHANGED
@@ -491,9 +491,9 @@ var EmbedNamespace = class {
491
491
  startAgentRunMcpAuth(agentId, runId, serverId, payload, options) {
492
492
  return this.http.requestJson(`/public/embed/agents/${agentId}/runs/${runId}/mcp/servers/${serverId}/auth/start`, { method: "POST", body: payload, options, mutation: true });
493
493
  }
494
- getRuntimeBootstrap(agentId, agentVersionId) {
494
+ getRuntimeBootstrap(agentId, agentVersionId, runtimeTarget = "published") {
495
495
  return this.http.requestJson(`/public/embed/agents/${agentId}/runtime/bootstrap`, {
496
- query: { agent_version_id: agentVersionId }
496
+ query: { agent_version_id: agentVersionId, runtime_target: runtimeTarget }
497
497
  });
498
498
  }
499
499
  getResourcePolicy(agentId, request) {
@@ -507,7 +507,8 @@ var EmbedNamespace = class {
507
507
  external_user_id: options.externalUserId,
508
508
  external_session_id: options.externalSessionId,
509
509
  skip: options.skip ?? 0,
510
- limit: options.limit ?? 20
510
+ limit: options.limit ?? 20,
511
+ runtime_target: options.runtimeTarget
511
512
  } });
512
513
  }
513
514
  listAgentThreadsMulti(options) {
@@ -517,7 +518,8 @@ var EmbedNamespace = class {
517
518
  const response = await this.http.fetchOrThrow(this.http.url(`/public/embed/agents/${agentId}/threads/events`, {
518
519
  external_user_id: options.externalUserId,
519
520
  external_session_id: options.externalSessionId,
520
- cursor: options.cursor
521
+ cursor: options.cursor,
522
+ runtime_target: options.runtimeTarget
521
523
  }), { method: "GET", headers: this.http.streamHeaders(), signal: options.signal }, "Failed to connect to the embedded-agent thread event endpoint.");
522
524
  await assertOk(response);
523
525
  await consumeThreadSummaryEventStream(response, onEvent, options.signal);
@@ -541,25 +543,29 @@ var EmbedNamespace = class {
541
543
  include_subthreads: options.includeSubthreads,
542
544
  subthread_depth: options.subthreadDepth,
543
545
  subthread_turn_limit: options.subthreadTurnLimit,
544
- subthread_child_limit: options.subthreadChildLimit
546
+ subthread_child_limit: options.subthreadChildLimit,
547
+ runtime_target: options.runtimeTarget
545
548
  } });
546
549
  }
547
550
  deleteAgentThread(agentId, threadId, options, requestOptions) {
548
551
  return this.http.requestJson(`/public/embed/agents/${agentId}/threads/${threadId}`, { method: "DELETE", query: {
549
552
  external_user_id: options.externalUserId,
550
- external_session_id: options.externalSessionId
553
+ external_session_id: options.externalSessionId,
554
+ runtime_target: options.runtimeTarget
551
555
  }, options: requestOptions, mutation: true });
552
556
  }
553
557
  getAgentRunContext(agentId, runId, options) {
554
558
  return this.http.requestJson(`/public/embed/agents/${agentId}/runs/${runId}/context`, { query: {
555
559
  external_user_id: options.externalUserId,
556
- external_session_id: options.externalSessionId
560
+ external_session_id: options.externalSessionId,
561
+ runtime_target: options.runtimeTarget
557
562
  } });
558
563
  }
559
564
  cancelAgentRun(agentId, runId, options, requestOptions) {
560
565
  return this.http.requestJson(`/public/embed/agents/${agentId}/runs/${runId}/cancel`, { method: "POST", query: {
561
566
  external_user_id: options.externalUserId,
562
- external_session_id: options.externalSessionId
567
+ external_session_id: options.externalSessionId,
568
+ runtime_target: options.runtimeTarget
563
569
  }, body: {}, options: requestOptions, mutation: true });
564
570
  }
565
571
  setAgentRunFeedback(agentId, runId, payload) {
@@ -573,6 +579,7 @@ var EmbedNamespace = class {
573
579
  form.set("external_user_id", options.externalUserId);
574
580
  if (options.externalSessionId) form.set("external_session_id", options.externalSessionId);
575
581
  if (options.threadId) form.set("thread_id", options.threadId);
582
+ if (options.runtimeTarget) form.set("runtime_target", options.runtimeTarget);
576
583
  for (const file of options.files) form.append("files", file, file.name);
577
584
  const response = await this.http.fetchOrThrow(this.http.url(`/public/embed/agents/${agentId}/attachments/upload`), {
578
585
  method: "POST",
@@ -660,7 +667,7 @@ var ResourcePackagesNamespace = class {
660
667
  const filename = /^[A-Za-z0-9][A-Za-z0-9._-]{0,200}\.zip$/.test(candidate) ? candidate : "resource.agents24.zip";
661
668
  formData.append("file", new Blob([archiveBytes]), filename);
662
669
  const response = await this.http.fetchOrThrow(
663
- this.http.url("/resource-packages/validate"),
670
+ this.http.url("/resource-packages/validate", void 0),
664
671
  { method: "POST", headers: this.http.multipartHeaders(), body: formData },
665
672
  "Failed to upload the Agents24 resource package."
666
673
  );
@@ -674,7 +681,7 @@ var ResourcePackagesNamespace = class {
674
681
  const filename = /^[A-Za-z0-9][A-Za-z0-9._-]{0,200}\.zip$/.test(candidate) ? candidate : "resource.agents24.zip";
675
682
  formData.append("file", new Blob([archiveBytes]), filename);
676
683
  const response = await this.http.fetchOrThrow(
677
- this.http.url("/resource-packages/compile"),
684
+ this.http.url("/resource-packages/compile", void 0),
678
685
  { method: "POST", headers: this.http.multipartHeaders(), body: formData },
679
686
  "Failed to upload the Agents24 resource package."
680
687
  );
@@ -683,6 +690,116 @@ var ResourcePackagesNamespace = class {
683
690
  }
684
691
  };
685
692
 
693
+ // src/generated/resourceInstallations.ts
694
+ var ResourceInstallationsNamespace = class {
695
+ constructor(http) {
696
+ this.http = http;
697
+ }
698
+ http;
699
+ list() {
700
+ return this.http.requestJson("/resource-installations");
701
+ }
702
+ create(request, options) {
703
+ return this.http.requestJson("/resource-installations", {
704
+ method: "POST",
705
+ body: request,
706
+ options,
707
+ mutation: true
708
+ });
709
+ }
710
+ get(installationId) {
711
+ return this.http.requestJson(`/resource-installations/${installationId}`);
712
+ }
713
+ async plan(upload) {
714
+ const formData = new FormData();
715
+ const archiveBytes = upload.data.slice().buffer;
716
+ const candidate = upload.filename || "";
717
+ const filename = /^[A-Za-z0-9][A-Za-z0-9._-]{0,200}\.zip$/.test(candidate) ? candidate : "resource.agents24.zip";
718
+ formData.append("file", new Blob([archiveBytes]), filename);
719
+ const response = await this.http.fetchOrThrow(
720
+ this.http.url("/resource-installations/plan", {
721
+ installation_id: upload.installationId,
722
+ prune: upload.prune,
723
+ development: upload.development
724
+ }),
725
+ { method: "POST", headers: this.http.multipartHeaders(), body: formData },
726
+ "Failed to upload the Agents24 resource package."
727
+ );
728
+ await assertOk(response);
729
+ return await response.json();
730
+ }
731
+ link(installationId, request, options) {
732
+ return this.http.requestJson(`/resource-installations/${installationId}/link`, {
733
+ method: "POST",
734
+ body: request,
735
+ options,
736
+ mutation: true
737
+ });
738
+ }
739
+ configureSecrets(installationId, request, options) {
740
+ return this.http.requestJson(`/resource-installations/${installationId}/secrets`, {
741
+ method: "PUT",
742
+ body: request,
743
+ options,
744
+ mutation: true
745
+ });
746
+ }
747
+ apply(operationId, request, options) {
748
+ return this.http.requestJson(`/resource-installations/operations/${operationId}/apply`, {
749
+ method: "POST",
750
+ body: request,
751
+ options,
752
+ mutation: true
753
+ });
754
+ }
755
+ operationStatus(operationId) {
756
+ return this.http.requestJson(`/resource-installations/operations/${operationId}/status`);
757
+ }
758
+ publish(installationId, request, options) {
759
+ return this.http.requestJson(`/resource-installations/${installationId}/publish`, {
760
+ method: "POST",
761
+ body: request,
762
+ options,
763
+ mutation: true
764
+ });
765
+ }
766
+ prepareDevelopmentSession(installationId, request, options) {
767
+ return this.http.requestJson(`/resource-installations/${installationId}/artifact-development-sessions`, {
768
+ method: "POST",
769
+ body: request,
770
+ options,
771
+ mutation: true
772
+ });
773
+ }
774
+ developmentSessionStatus(installationId, resourceKey) {
775
+ return this.http.requestJson(`/resource-installations/${installationId}/artifact-development-sessions/${resourceKey}`);
776
+ }
777
+ revokeDevelopmentSession(installationId, sessionId, options) {
778
+ return this.http.requestJson(`/resource-installations/${installationId}/artifact-development-sessions/${sessionId}`, {
779
+ method: "DELETE",
780
+ options,
781
+ mutation: true
782
+ });
783
+ }
784
+ bindDeployment(installationId, request, options) {
785
+ return this.http.requestJson(`/resource-installations/${installationId}/deployment`, {
786
+ method: "PUT",
787
+ body: request,
788
+ options,
789
+ mutation: true
790
+ });
791
+ }
792
+ resources(options) {
793
+ return this.http.requestJson("/resource-installations/resources/list", {
794
+ query: {
795
+ kind: options.kind,
796
+ query: options.query,
797
+ limit: options.limit
798
+ }
799
+ });
800
+ }
801
+ };
802
+
686
803
  // src/runs.ts
687
804
  var RunsNamespace = class {
688
805
  constructor(http) {
@@ -786,6 +903,7 @@ var Agents24 = class {
786
903
  runs;
787
904
  resourceBundles;
788
905
  resourcePackages;
906
+ resourceInstallations;
789
907
  clientDeployments;
790
908
  clientSessions;
791
909
  instructions;
@@ -797,6 +915,7 @@ var Agents24 = class {
797
915
  this.runs = new RunsNamespace(http);
798
916
  this.resourceBundles = new ResourceBundlesNamespace(http);
799
917
  this.resourcePackages = new ResourcePackagesNamespace(http);
918
+ this.resourceInstallations = new ResourceInstallationsNamespace(http);
800
919
  this.clientDeployments = new ClientDeploymentsNamespace(http);
801
920
  this.clientSessions = new ClientSessionsNamespace(http);
802
921
  this.instructions = new InstructionsNamespace(http);
@@ -876,6 +995,20 @@ var SDK_OPERATION_IDS = [
876
995
  "resource_bundles.export_plan",
877
996
  "resource_bundles.import",
878
997
  "resource_bundles.import_preview",
998
+ "resource_installations.apply",
999
+ "resource_installations.bind_deployment",
1000
+ "resource_installations.configure_secrets",
1001
+ "resource_installations.create",
1002
+ "resource_installations.development_session_status",
1003
+ "resource_installations.get",
1004
+ "resource_installations.link",
1005
+ "resource_installations.list",
1006
+ "resource_installations.operation_status",
1007
+ "resource_installations.plan",
1008
+ "resource_installations.prepare_development_session",
1009
+ "resource_installations.publish",
1010
+ "resource_installations.resources",
1011
+ "resource_installations.revoke_development_session",
879
1012
  "resource_packages.compile",
880
1013
  "resource_packages.export",
881
1014
  "resource_packages.validate",