@soat/sdk 0.18.0 → 0.18.2

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
@@ -855,6 +855,94 @@ var Agents = class {
855
855
  });
856
856
  }
857
857
  };
858
+ var AgentVersions = class {
859
+ /**
860
+ * List an agent's config versions
861
+ *
862
+ * Returns the agent's archived configurations, newest first. A version is written on create and on every subsequent write that changes the config — through the REST API or a formation apply alike. See [Versioning and Staged Rollout](/docs/modules/agents#versioning-and-staged-rollout).
863
+ *
864
+ */
865
+ static listAgentVersions(options) {
866
+ return (options.client ?? client).get({
867
+ url: "/api/v1/agents/{agent_id}/versions",
868
+ ...options
869
+ });
870
+ }
871
+ /**
872
+ * Get an archived agent config version
873
+ *
874
+ * Returns the exact configuration the agent held at a given version, so a generation can be traced back to the config that produced it.
875
+ *
876
+ */
877
+ static getAgentVersion(options) {
878
+ return (options.client ?? client).get({
879
+ url: "/api/v1/agents/{agent_id}/versions/{version}",
880
+ ...options
881
+ });
882
+ }
883
+ /**
884
+ * Restore an archived config as a new version
885
+ *
886
+ * Copies the named version's configuration onto the agent as a **new** version rather than rewinding the counter, so history stays append-only and the versions in between remain retrievable. Restoring the config the agent already holds is a no-op and creates no version.
887
+ *
888
+ * The restored config fully replaces the current one: a field the archived version did not set is cleared, not merged. Restore re-validates the config, so a tool, provider, or guardrail deleted since the snapshot was taken fails the request instead of writing a broken agent.
889
+ *
890
+ */
891
+ static restoreAgentVersion(options) {
892
+ return (options.client ?? client).post({
893
+ url: "/api/v1/agents/{agent_id}/versions/{version}/restore",
894
+ ...options,
895
+ headers: {
896
+ "Content-Type": "application/json",
897
+ ...options.headers
898
+ }
899
+ });
900
+ }
901
+ /**
902
+ * Set or replace a staged rollout
903
+ *
904
+ * Starts serving two archived versions side by side: `canary_percent` of traffic gets `canary_version`, the rest gets `stable_version`.
905
+ *
906
+ * Assignment is deterministic — it hashes the actor behind the request's session (falling back to the session itself), so one end user never flip-flops between configs mid-conversation. Requests with neither are split randomly.
907
+ *
908
+ * While a release is active the agent's live columns act as a **draft**: further edits archive new versions but do not disturb either side of the running split. End the rollout with `promote` or `abort`.
909
+ *
910
+ */
911
+ static setAgentRelease(options) {
912
+ return (options.client ?? client).put({
913
+ url: "/api/v1/agents/{agent_id}/release",
914
+ ...options,
915
+ headers: {
916
+ "Content-Type": "application/json",
917
+ ...options.headers
918
+ }
919
+ });
920
+ }
921
+ /**
922
+ * Promote the canary and end the rollout
923
+ *
924
+ * Makes the canary version's config the agent's live config and clears the release. The canary is pinned by version, so an edit that landed mid-rollout is not promoted in its place — it stays an unreleased draft in the version history.
925
+ *
926
+ */
927
+ static promoteAgentRelease(options) {
928
+ return (options.client ?? client).post({
929
+ url: "/api/v1/agents/{agent_id}/release/promote",
930
+ ...options
931
+ });
932
+ }
933
+ /**
934
+ * Abort the rollout and roll back to stable
935
+ *
936
+ * Restores the stable version's config as the agent's live config and clears the release, so all traffic returns to the configuration the rollout was measured against — not to whatever draft the live columns happened to hold.
937
+ *
938
+ */
939
+ static abortAgentRelease(options) {
940
+ return (options.client ?? client).post({
941
+ url: "/api/v1/agents/{agent_id}/release/abort",
942
+ ...options
943
+ });
944
+ }
945
+ };
858
946
  var AiProviders = class {
859
947
  /**
860
948
  * List AI providers
@@ -1505,6 +1593,12 @@ var Documents = class {
1505
1593
  * are read as a single source. How the source is chunked is controlled by
1506
1594
  * `chunk_strategy`.
1507
1595
  *
1596
+ * A file can only back one Document — a second call with the same `file_id`
1597
+ * returns `409 FILE_ALREADY_INGESTED`. To re-process an already-ingested file
1598
+ * (e.g. with a different `chunk_strategy`), use
1599
+ * `POST /documents/{document_id}/ingest`; to ingest the same source under a
1600
+ * different path, upload a new copy of the file first.
1601
+ *
1508
1602
  */
1509
1603
  static ingestDocument(options) {
1510
1604
  return (options.client ?? client).post({
@@ -3888,6 +3982,7 @@ var SoatClient = class {
3888
3982
  //#endregion
3889
3983
  exports.Activity = Activity;
3890
3984
  exports.Actors = Actors;
3985
+ exports.AgentVersions = AgentVersions;
3891
3986
  exports.Agents = Agents;
3892
3987
  exports.AiProviders = AiProviders;
3893
3988
  exports.ApiKeys = ApiKeys;