@agentrun/sdk 0.0.3-test.21470120979 → 0.0.3-test.21476828976

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
@@ -4962,16 +4962,28 @@ var init_sandbox = __esm({
4962
4962
  return new SandboxClient2();
4963
4963
  }
4964
4964
  static async create(arg1, arg2) {
4965
+ if (typeof arg1 === "object" && arg1 !== null && "input" in arg1) {
4966
+ return await _Sandbox.getClient().createSandbox(arg1);
4967
+ }
4968
+ logger.warn(
4969
+ "Deprecated: Sandbox.create(input, config) is deprecated. Use Sandbox.create({ input, config }) instead."
4970
+ );
4965
4971
  return await _Sandbox.getClient().createSandbox(arg1, arg2);
4966
4972
  }
4967
4973
  static async delete(arg1, arg2) {
4968
4974
  if (typeof arg1 === "string") {
4975
+ logger.warn(
4976
+ "Sandbox.delete(id, config) is deprecated. Use Sandbox.delete({ id, config }) instead."
4977
+ );
4969
4978
  return await _Sandbox.getClient().deleteSandbox(arg1, arg2);
4970
4979
  }
4971
4980
  return await _Sandbox.getClient().deleteSandbox(arg1);
4972
4981
  }
4973
4982
  static async stop(arg1, arg2) {
4974
4983
  if (typeof arg1 === "string") {
4984
+ logger.warn(
4985
+ "Sandbox.stop(id, config) is deprecated. Use Sandbox.stop({ id, config }) instead."
4986
+ );
4975
4987
  return await _Sandbox.getClient().stopSandbox(arg1, arg2);
4976
4988
  }
4977
4989
  return await _Sandbox.getClient().stopSandbox(arg1);
@@ -5047,7 +5059,10 @@ var init_sandbox = __esm({
5047
5059
  }
5048
5060
  }
5049
5061
  static async list(arg1, arg2) {
5050
- if (arg2 !== void 0 || arg1 && ("maxResults" in arg1 || "nextToken" in arg1 || "status" in arg1 || "templateName" in arg1)) {
5062
+ if (arg2 !== void 0 || arg1 && ("maxResults" in arg1 || "nextToken" in arg1 || "status" in arg1 || "templateName" in arg1 || "templateType" in arg1)) {
5063
+ logger.warn(
5064
+ "Deprecated: Sandbox.list(input, config) is deprecated. Use Sandbox.list({ input, config }) instead."
5065
+ );
5051
5066
  return await _Sandbox.getClient().listSandboxes(
5052
5067
  arg1,
5053
5068
  arg2
@@ -5659,12 +5674,16 @@ var init_template = __esm({
5659
5674
  }
5660
5675
  return void 0;
5661
5676
  };
5662
- this.sandboxIdleTimeoutInSeconds = toNumber(this.sandboxIdleTimeoutInSeconds) ?? this.sandboxIdleTimeoutInSeconds;
5663
- this.sandboxTtlInSeconds = toNumber(this.sandboxTtlInSeconds) ?? this.sandboxTtlInSeconds;
5664
- this.shareConcurrencyLimitPerSandbox = toNumber(this.shareConcurrencyLimitPerSandbox) ?? this.shareConcurrencyLimitPerSandbox;
5665
- this.cpu = toNumber(this.cpu) ?? this.cpu;
5666
- this.memory = toNumber(this.memory) ?? this.memory;
5667
- this.diskSize = toNumber(this.diskSize) ?? this.diskSize;
5677
+ this.sandboxIdleTimeoutInSeconds = toNumber(
5678
+ this.sandboxIdleTimeoutInSeconds
5679
+ );
5680
+ this.sandboxTtlInSeconds = toNumber(this.sandboxTtlInSeconds);
5681
+ this.shareConcurrencyLimitPerSandbox = toNumber(
5682
+ this.shareConcurrencyLimitPerSandbox
5683
+ );
5684
+ this.cpu = toNumber(this.cpu);
5685
+ this.memory = toNumber(this.memory);
5686
+ this.diskSize = toNumber(this.diskSize);
5668
5687
  }
5669
5688
  };
5670
5689
  }
@@ -5867,17 +5886,17 @@ var init_client3 = __esm({
5867
5886
  let input;
5868
5887
  let templateType;
5869
5888
  let config2;
5870
- if ("templateName" in arg1) {
5889
+ if ("input" in arg1) {
5890
+ const params = arg1;
5891
+ input = params.input;
5892
+ templateType = params.templateType;
5893
+ config2 = params.config;
5894
+ } else {
5871
5895
  logger.warn(
5872
5896
  "Deprecated: createSandbox(input, config) is deprecated. Use createSandbox({ input, config }) instead."
5873
5897
  );
5874
5898
  input = arg1;
5875
5899
  config2 = arg2;
5876
- } else {
5877
- const params = arg1;
5878
- input = params.input;
5879
- templateType = params.templateType;
5880
- config2 = params.config;
5881
5900
  }
5882
5901
  const cfg = Config.withConfigs(this.config, config2);
5883
5902
  try {
@@ -5962,15 +5981,19 @@ var init_client3 = __esm({
5962
5981
  /**
5963
5982
  * Stop a Sandbox
5964
5983
  */
5965
- stopSandbox = async (...args) => {
5966
- let params = args?.[0];
5967
- if (typeof args[0] === "string") {
5984
+ stopSandbox = async (arg1, arg2) => {
5985
+ let id;
5986
+ let config2;
5987
+ if (typeof arg1 === "string") {
5968
5988
  logger.warn(
5969
5989
  "Deprecated: stopSandbox(id, config) is deprecated. Use stopSandbox({ id, config }) instead."
5970
5990
  );
5971
- params = { id: args[0], config: args[1] };
5991
+ id = arg1;
5992
+ config2 = arg2;
5993
+ } else {
5994
+ id = arg1.id;
5995
+ config2 = arg1.config;
5972
5996
  }
5973
- const { id, config: config2 } = params;
5974
5997
  const cfg = Config.withConfigs(this.config, config2);
5975
5998
  try {
5976
5999
  const result = await this.controlApi.stopSandbox({