tensorlake 0.5.142 → 0.5.143

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 (31) hide show
  1. package/dist/applications/index.cjs +16 -7
  2. package/dist/applications/index.cjs.map +1 -1
  3. package/dist/applications/index.d.cts +2 -2
  4. package/dist/applications/index.d.ts +2 -2
  5. package/dist/applications/index.js +16 -7
  6. package/dist/applications/index.js.map +1 -1
  7. package/dist/function-agent/main.cjs +1 -1
  8. package/dist/function-agent/main.js +1 -1
  9. package/dist/function-executor/main.cjs +2 -2
  10. package/dist/function-executor/main.js +2 -2
  11. package/dist/index.cjs +18 -9
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +9 -5
  14. package/dist/index.d.ts +9 -5
  15. package/dist/index.js +18 -9
  16. package/dist/index.js.map +1 -1
  17. package/dist/{remote-D95Y6Czr.d.cts → remote-CNJ9TmcQ.d.cts} +2 -1
  18. package/dist/{remote-omwTzbfj.d.ts → remote-dblFxKug.d.ts} +2 -1
  19. package/dist/sandbox-image.cjs +2 -2
  20. package/dist/sandbox-image.cjs.map +1 -1
  21. package/dist/sandbox-image.js +2 -2
  22. package/dist/sandbox-image.js.map +1 -1
  23. package/package.json +7 -7
  24. package/runtime/function-executor/manifest.json +5 -5
  25. package/runtime/function-executor/package/dist/function-executor/main.js +2 -2
  26. package/runtime/function-executor/package/npm-shrinkwrap.json +2 -2
  27. package/runtime/function-executor/package/package.json +1 -1
  28. package/runtime/typescript-function-runner/manifest.json +5 -5
  29. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +1 -1
  30. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +20 -20
  31. package/runtime/typescript-function-runner/package/package.json +7 -7
@@ -402,7 +402,7 @@ var NativeWorkerClient = class {
402
402
  }
403
403
  };
404
404
  var runtimeKey = /* @__PURE__ */ Symbol.for(
405
- `tensorlake.native.worker.${false ? "source" : "0.5.142"}.v1`
405
+ `tensorlake.native.worker.${false ? "source" : "0.5.143"}.v1`
406
406
  );
407
407
  var runtimes = globalThis;
408
408
  function configureNativeWorker(workerPath) {
@@ -390,7 +390,7 @@ var NativeWorkerClient = class {
390
390
  }
391
391
  };
392
392
  var runtimeKey = /* @__PURE__ */ Symbol.for(
393
- `tensorlake.native.worker.${false ? "source" : "0.5.142"}.v1`
393
+ `tensorlake.native.worker.${false ? "source" : "0.5.143"}.v1`
394
394
  );
395
395
  var runtimes = globalThis;
396
396
  function configureNativeWorker(workerPath) {
@@ -51,7 +51,7 @@ var cancelNativeCall = /* @__PURE__ */ Symbol.for("tensorlake.native.cancel.v1")
51
51
  var closeNativeHandle = /* @__PURE__ */ Symbol.for("tensorlake.native.close.v1");
52
52
 
53
53
  // src/defaults.ts
54
- var SDK_VERSION = "0.5.142";
54
+ var SDK_VERSION = "0.5.143";
55
55
  var API_URL = process.env.TENSORLAKE_API_URL ?? "https://api.tensorlake.ai";
56
56
  var API_KEY = process.env.TENSORLAKE_API_KEY ?? void 0;
57
57
  var NAMESPACE = process.env.INDEXIFY_NAMESPACE ?? "default";
@@ -247,7 +247,7 @@ var NativeWorkerClient = class {
247
247
  }
248
248
  };
249
249
  var runtimeKey = /* @__PURE__ */ Symbol.for(
250
- `tensorlake.native.worker.${false ? "source" : "0.5.142"}.v1`
250
+ `tensorlake.native.worker.${false ? "source" : "0.5.143"}.v1`
251
251
  );
252
252
  var runtimes = globalThis;
253
253
  function configureNativeWorker(workerPath) {
@@ -10,7 +10,7 @@ var cancelNativeCall = /* @__PURE__ */ Symbol.for("tensorlake.native.cancel.v1")
10
10
  var closeNativeHandle = /* @__PURE__ */ Symbol.for("tensorlake.native.close.v1");
11
11
 
12
12
  // src/defaults.ts
13
- var SDK_VERSION = "0.5.142";
13
+ var SDK_VERSION = "0.5.143";
14
14
  var API_URL = process.env.TENSORLAKE_API_URL ?? "https://api.tensorlake.ai";
15
15
  var API_KEY = process.env.TENSORLAKE_API_KEY ?? void 0;
16
16
  var NAMESPACE = process.env.INDEXIFY_NAMESPACE ?? "default";
@@ -206,7 +206,7 @@ var NativeWorkerClient = class {
206
206
  }
207
207
  };
208
208
  var runtimeKey = /* @__PURE__ */ Symbol.for(
209
- `tensorlake.native.worker.${false ? "source" : "0.5.142"}.v1`
209
+ `tensorlake.native.worker.${false ? "source" : "0.5.143"}.v1`
210
210
  );
211
211
  var runtimes = globalThis;
212
212
  function configureNativeWorker(workerPath) {
package/dist/index.cjs CHANGED
@@ -49,7 +49,7 @@ var init_defaults = __esm({
49
49
  "src/defaults.ts"() {
50
50
  "use strict";
51
51
  init_cjs_shims();
52
- SDK_VERSION = "0.5.142";
52
+ SDK_VERSION = "0.5.143";
53
53
  API_URL = process.env.TENSORLAKE_API_URL ?? "https://api.tensorlake.ai";
54
54
  API_KEY = process.env.TENSORLAKE_API_KEY ?? void 0;
55
55
  NAMESPACE = process.env.INDEXIFY_NAMESPACE ?? "default";
@@ -493,7 +493,7 @@ var init_native_worker_client = __esm({
493
493
  }
494
494
  };
495
495
  runtimeKey = /* @__PURE__ */ Symbol.for(
496
- `tensorlake.native.worker.${false ? "source" : "0.5.142"}.v1`
496
+ `tensorlake.native.worker.${false ? "source" : "0.5.143"}.v1`
497
497
  );
498
498
  runtimes = globalThis;
499
499
  }
@@ -7394,15 +7394,21 @@ var FilesystemClient = class {
7394
7394
  this.cli = new FsCli(envOverrides);
7395
7395
  }
7396
7396
  // -- lifecycle --------------------------------------------------------------
7397
- /** Create a new filesystem and return a handle to it. */
7398
- async create(name) {
7397
+ /** Create a filesystem; region fixes its storage placement. Forks inherit placement. */
7398
+ async create(name, options = {}) {
7399
7399
  if (typeof name !== "string") {
7400
7400
  throw new TypeError("name must be a string");
7401
7401
  }
7402
7402
  if (name.length === 0) {
7403
7403
  throw new FilesystemError("filesystem name must not be empty");
7404
7404
  }
7405
- const raw = await callNative2(() => this.native.createFilesystem(name));
7405
+ const { region } = options;
7406
+ if (region !== void 0 && (typeof region !== "string" || region.length === 0 || region.trim() !== region)) {
7407
+ throw new FilesystemError(
7408
+ "region must be a nonempty string without surrounding whitespace"
7409
+ );
7410
+ }
7411
+ const raw = await callNative2(() => region === void 0 ? this.native.createFilesystem(name) : this.native.createFilesystem(name, region));
7406
7412
  const created = JSON.parse(raw);
7407
7413
  return new Filesystem(
7408
7414
  this,
@@ -7858,8 +7864,11 @@ var APIClient = class {
7858
7864
  async deleteSandboxImage(imageName) {
7859
7865
  await this.cloudClient.deleteSandboxImage(imageName);
7860
7866
  }
7861
- async createFileSystem(name, description, _options) {
7862
- const filesystem = await new FilesystemClient(this.filesystemOptions).create(name);
7867
+ async createFileSystem(name, description, options) {
7868
+ const filesystem = await new FilesystemClient(this.filesystemOptions).create(
7869
+ name,
7870
+ { region: options?.region }
7871
+ );
7863
7872
  return {
7864
7873
  id: filesystem.name,
7865
7874
  name: filesystem.name,
@@ -8260,11 +8269,11 @@ init_sandbox_image();
8260
8269
 
8261
8270
  // src/file-system.ts
8262
8271
  init_cjs_shims();
8263
- async function createFileSystem(name, description) {
8272
+ async function createFileSystem(name, description, options = {}) {
8264
8273
  if (typeof name !== "string" || name.length === 0) {
8265
8274
  throw new TypeError("name must be a non-empty string");
8266
8275
  }
8267
- const filesystem = await new FilesystemClient().create(name);
8276
+ const filesystem = await new FilesystemClient().create(name, options);
8268
8277
  return {
8269
8278
  id: filesystem.name,
8270
8279
  name: filesystem.name,