tensorlake 0.5.141 → 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 +21 -9
  14. package/dist/index.d.ts +21 -9
  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
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { C as CloudClientOptions, A as ApplicationManifest, B as BinaryPayload, S as SandboxTemplate, a as ApplicationSummary, R as RequestInput, c as RequestMetadata, b as RequestOutput, d as SecretsList, e as Secret, N as NewSecret, U as UpsertSecretResponse, f as StartImageBuildRequest, g as BuildInfo, h as CreateApplicationBuildRequest, i as ApplicationBuildContext, j as ApplicationBuildResponse, k as BuildLogEntry, F as FileSystem } from './sandbox-image-ChzWDeZy.cjs';
2
2
  export { l as ApplicationBuildImageResult, m as CreateApplicationBuildImageRequest, n as CreateSandboxImageOptions, I as Image, o as ImageBuildOperation, p as ImageBuildOperationType, p as ImageBuildOperationTypeValue, q as ImageOptions, r as ImportSandboxImageOptions, s as RequestErrorInfo, t as SandboxImageSource, u as SecretsPagination, v as createSandboxImage, w as deleteSandboxImage, x as dockerfileContent, y as findSandboxImageByName, z as importSandboxImage, D as listSandboxImages } from './sandbox-image-ChzWDeZy.cjs';
3
- export { v as APIClient, A as ApplicationCapability, a as ApplicationOptions, F as File, b as FunctionOptions, c as Future, H as Headers, d as HeadersInit, e as HttpBody, P as Parameter, g as RegisteredFunction, h as RemoteOptions, j as RequestContext, S as Schema, l as SimpleApplicationOptions, m as SimpleFunctionOptions, T as TailCall, r as registerApplication, o as registerFunction, p as remoteOptions, q as retries, s as runLocal, t as runRemote, u as schema } from './remote-D95Y6Czr.cjs';
3
+ export { v as APIClient, A as ApplicationCapability, a as ApplicationOptions, F as File, b as FunctionOptions, c as Future, H as Headers, d as HeadersInit, e as HttpBody, P as Parameter, g as RegisteredFunction, h as RemoteOptions, j as RequestContext, S as Schema, l as SimpleApplicationOptions, m as SimpleFunctionOptions, T as TailCall, r as registerApplication, o as registerFunction, p as remoteOptions, q as retries, s as runLocal, t as runRemote, u as schema } from './remote-CNJ9TmcQ.cjs';
4
4
 
5
5
  /** An SDK result paired with its server-side W3C trace ID. */
6
6
  type Traced<T> = T & {
@@ -116,7 +116,7 @@ interface NativeRepositoryClient {
116
116
  pushWorktree(repo: string, root: string, branch: string, message: string, expectOid?: string | null): Promise<TracedJson>;
117
117
  mergeRepo(repo: string, ours: string, theirs: string, preflight: boolean, deep: boolean, materialize: boolean, message?: string | null, base?: string | null): Promise<TracedJson>;
118
118
  commitConflicts(repo: string, commit: string): Promise<TracedJson>;
119
- createFilesystem(name: string): Promise<string>;
119
+ createFilesystem(name: string, region?: string): Promise<string>;
120
120
  forkFilesystem(name: string, base: string, snapshot?: string | null): Promise<TracedJson>;
121
121
  listFilesystems(): Promise<TracedJson>;
122
122
  filesystemMeta(name: string): Promise<TracedJson>;
@@ -797,9 +797,12 @@ interface SandboxClientOptions {
797
797
  namespace?: string;
798
798
  maxRetries?: number;
799
799
  retryBackoffMs?: number;
800
- /** Total HTTP request timeout in seconds. Default: 300. */
800
+ /**
801
+ * HTTP request timeout in seconds. For a streamed response it bounds the
802
+ * wait for the stream to start and each wait for more data. Default: 300.
803
+ */
801
804
  requestTimeout?: number;
802
- /** @deprecated Use requestTimeout. Total HTTP request timeout in milliseconds. */
805
+ /** @deprecated Use requestTimeout. HTTP request timeout in milliseconds. */
803
806
  timeoutMs?: number;
804
807
  }
805
808
  interface SandboxOptions {
@@ -819,9 +822,14 @@ interface SandboxOptions {
819
822
  resolveProxyInfo?: (identifier: string) => Promise<SandboxInfo & {
820
823
  readonly traceId: string;
821
824
  }>;
822
- /** Optional total HTTP request timeout in seconds for sandbox proxy operations. Omit for no total proxy timeout. */
825
+ /**
826
+ * Optional HTTP request timeout in seconds for sandbox proxy operations. For
827
+ * streamed responses, such as `run()` and output follows, it bounds the wait
828
+ * for the stream to start and each wait for more data. Omit for no proxy
829
+ * timeout.
830
+ */
823
831
  requestTimeout?: number;
824
- /** @deprecated Use requestTimeout. Optional total HTTP request timeout in milliseconds for sandbox proxy operations. */
832
+ /** @deprecated Use requestTimeout. Optional HTTP request timeout in milliseconds for sandbox proxy operations. */
825
833
  timeoutMs?: number;
826
834
  /**
827
835
  * @internal Shared Rust-backed lifecycle client. When provided, the proxy
@@ -1988,7 +1996,9 @@ declare class RepositoryClient {
1988
1996
  * running sandbox.
1989
1997
  */
1990
1998
  /** Register a new file system for the current project. */
1991
- declare function createFileSystem(name: string, description?: string): Promise<FileSystem>;
1999
+ declare function createFileSystem(name: string, description?: string, options?: {
2000
+ region?: string;
2001
+ }): Promise<FileSystem>;
1992
2002
  /** List all registered file systems for the current project. */
1993
2003
  declare function listFileSystems(): Promise<FileSystem[]>;
1994
2004
  /** Delete a registered file system by its id (e.g. `file_system_...`). */
@@ -2169,8 +2179,10 @@ declare class FilesystemClient {
2169
2179
  * options are retained only for the separately installed `tl` CLI used by local mounts.
2170
2180
  */
2171
2181
  constructor(options?: FilesystemClientOptions);
2172
- /** Create a new filesystem and return a handle to it. */
2173
- create(name: string): Promise<Filesystem>;
2182
+ /** Create a filesystem; region fixes its storage placement. Forks inherit placement. */
2183
+ create(name: string, options?: {
2184
+ region?: string;
2185
+ }): Promise<Filesystem>;
2174
2186
  /**
2175
2187
  * Fork a filesystem at its live head or an explicit retained snapshot.
2176
2188
  * The server shares immutable content and publishes only metadata.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { C as CloudClientOptions, A as ApplicationManifest, B as BinaryPayload, S as SandboxTemplate, a as ApplicationSummary, R as RequestInput, c as RequestMetadata, b as RequestOutput, d as SecretsList, e as Secret, N as NewSecret, U as UpsertSecretResponse, f as StartImageBuildRequest, g as BuildInfo, h as CreateApplicationBuildRequest, i as ApplicationBuildContext, j as ApplicationBuildResponse, k as BuildLogEntry, F as FileSystem } from './sandbox-image-ChzWDeZy.js';
2
2
  export { l as ApplicationBuildImageResult, m as CreateApplicationBuildImageRequest, n as CreateSandboxImageOptions, I as Image, o as ImageBuildOperation, p as ImageBuildOperationType, p as ImageBuildOperationTypeValue, q as ImageOptions, r as ImportSandboxImageOptions, s as RequestErrorInfo, t as SandboxImageSource, u as SecretsPagination, v as createSandboxImage, w as deleteSandboxImage, x as dockerfileContent, y as findSandboxImageByName, z as importSandboxImage, D as listSandboxImages } from './sandbox-image-ChzWDeZy.js';
3
- export { v as APIClient, A as ApplicationCapability, a as ApplicationOptions, F as File, b as FunctionOptions, c as Future, H as Headers, d as HeadersInit, e as HttpBody, P as Parameter, g as RegisteredFunction, h as RemoteOptions, j as RequestContext, S as Schema, l as SimpleApplicationOptions, m as SimpleFunctionOptions, T as TailCall, r as registerApplication, o as registerFunction, p as remoteOptions, q as retries, s as runLocal, t as runRemote, u as schema } from './remote-omwTzbfj.js';
3
+ export { v as APIClient, A as ApplicationCapability, a as ApplicationOptions, F as File, b as FunctionOptions, c as Future, H as Headers, d as HeadersInit, e as HttpBody, P as Parameter, g as RegisteredFunction, h as RemoteOptions, j as RequestContext, S as Schema, l as SimpleApplicationOptions, m as SimpleFunctionOptions, T as TailCall, r as registerApplication, o as registerFunction, p as remoteOptions, q as retries, s as runLocal, t as runRemote, u as schema } from './remote-dblFxKug.js';
4
4
 
5
5
  /** An SDK result paired with its server-side W3C trace ID. */
6
6
  type Traced<T> = T & {
@@ -116,7 +116,7 @@ interface NativeRepositoryClient {
116
116
  pushWorktree(repo: string, root: string, branch: string, message: string, expectOid?: string | null): Promise<TracedJson>;
117
117
  mergeRepo(repo: string, ours: string, theirs: string, preflight: boolean, deep: boolean, materialize: boolean, message?: string | null, base?: string | null): Promise<TracedJson>;
118
118
  commitConflicts(repo: string, commit: string): Promise<TracedJson>;
119
- createFilesystem(name: string): Promise<string>;
119
+ createFilesystem(name: string, region?: string): Promise<string>;
120
120
  forkFilesystem(name: string, base: string, snapshot?: string | null): Promise<TracedJson>;
121
121
  listFilesystems(): Promise<TracedJson>;
122
122
  filesystemMeta(name: string): Promise<TracedJson>;
@@ -797,9 +797,12 @@ interface SandboxClientOptions {
797
797
  namespace?: string;
798
798
  maxRetries?: number;
799
799
  retryBackoffMs?: number;
800
- /** Total HTTP request timeout in seconds. Default: 300. */
800
+ /**
801
+ * HTTP request timeout in seconds. For a streamed response it bounds the
802
+ * wait for the stream to start and each wait for more data. Default: 300.
803
+ */
801
804
  requestTimeout?: number;
802
- /** @deprecated Use requestTimeout. Total HTTP request timeout in milliseconds. */
805
+ /** @deprecated Use requestTimeout. HTTP request timeout in milliseconds. */
803
806
  timeoutMs?: number;
804
807
  }
805
808
  interface SandboxOptions {
@@ -819,9 +822,14 @@ interface SandboxOptions {
819
822
  resolveProxyInfo?: (identifier: string) => Promise<SandboxInfo & {
820
823
  readonly traceId: string;
821
824
  }>;
822
- /** Optional total HTTP request timeout in seconds for sandbox proxy operations. Omit for no total proxy timeout. */
825
+ /**
826
+ * Optional HTTP request timeout in seconds for sandbox proxy operations. For
827
+ * streamed responses, such as `run()` and output follows, it bounds the wait
828
+ * for the stream to start and each wait for more data. Omit for no proxy
829
+ * timeout.
830
+ */
823
831
  requestTimeout?: number;
824
- /** @deprecated Use requestTimeout. Optional total HTTP request timeout in milliseconds for sandbox proxy operations. */
832
+ /** @deprecated Use requestTimeout. Optional HTTP request timeout in milliseconds for sandbox proxy operations. */
825
833
  timeoutMs?: number;
826
834
  /**
827
835
  * @internal Shared Rust-backed lifecycle client. When provided, the proxy
@@ -1988,7 +1996,9 @@ declare class RepositoryClient {
1988
1996
  * running sandbox.
1989
1997
  */
1990
1998
  /** Register a new file system for the current project. */
1991
- declare function createFileSystem(name: string, description?: string): Promise<FileSystem>;
1999
+ declare function createFileSystem(name: string, description?: string, options?: {
2000
+ region?: string;
2001
+ }): Promise<FileSystem>;
1992
2002
  /** List all registered file systems for the current project. */
1993
2003
  declare function listFileSystems(): Promise<FileSystem[]>;
1994
2004
  /** Delete a registered file system by its id (e.g. `file_system_...`). */
@@ -2169,8 +2179,10 @@ declare class FilesystemClient {
2169
2179
  * options are retained only for the separately installed `tl` CLI used by local mounts.
2170
2180
  */
2171
2181
  constructor(options?: FilesystemClientOptions);
2172
- /** Create a new filesystem and return a handle to it. */
2173
- create(name: string): Promise<Filesystem>;
2182
+ /** Create a filesystem; region fixes its storage placement. Forks inherit placement. */
2183
+ create(name: string, options?: {
2184
+ region?: string;
2185
+ }): Promise<Filesystem>;
2174
2186
  /**
2175
2187
  * Fork a filesystem at its live head or an explicit retained snapshot.
2176
2188
  * The server shares immutable content and publishes only metadata.
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ var init_defaults = __esm({
46
46
  "src/defaults.ts"() {
47
47
  "use strict";
48
48
  init_esm_shims();
49
- SDK_VERSION = "0.5.141";
49
+ SDK_VERSION = "0.5.143";
50
50
  API_URL = process.env.TENSORLAKE_API_URL ?? "https://api.tensorlake.ai";
51
51
  API_KEY = process.env.TENSORLAKE_API_KEY ?? void 0;
52
52
  NAMESPACE = process.env.INDEXIFY_NAMESPACE ?? "default";
@@ -490,7 +490,7 @@ var init_native_worker_client = __esm({
490
490
  }
491
491
  };
492
492
  runtimeKey = /* @__PURE__ */ Symbol.for(
493
- `tensorlake.native.worker.${false ? "source" : "0.5.141"}.v1`
493
+ `tensorlake.native.worker.${false ? "source" : "0.5.143"}.v1`
494
494
  );
495
495
  runtimes = globalThis;
496
496
  }
@@ -7319,15 +7319,21 @@ var FilesystemClient = class {
7319
7319
  this.cli = new FsCli(envOverrides);
7320
7320
  }
7321
7321
  // -- lifecycle --------------------------------------------------------------
7322
- /** Create a new filesystem and return a handle to it. */
7323
- async create(name) {
7322
+ /** Create a filesystem; region fixes its storage placement. Forks inherit placement. */
7323
+ async create(name, options = {}) {
7324
7324
  if (typeof name !== "string") {
7325
7325
  throw new TypeError("name must be a string");
7326
7326
  }
7327
7327
  if (name.length === 0) {
7328
7328
  throw new FilesystemError("filesystem name must not be empty");
7329
7329
  }
7330
- const raw = await callNative2(() => this.native.createFilesystem(name));
7330
+ const { region } = options;
7331
+ if (region !== void 0 && (typeof region !== "string" || region.length === 0 || region.trim() !== region)) {
7332
+ throw new FilesystemError(
7333
+ "region must be a nonempty string without surrounding whitespace"
7334
+ );
7335
+ }
7336
+ const raw = await callNative2(() => region === void 0 ? this.native.createFilesystem(name) : this.native.createFilesystem(name, region));
7331
7337
  const created = JSON.parse(raw);
7332
7338
  return new Filesystem(
7333
7339
  this,
@@ -7783,8 +7789,11 @@ var APIClient = class {
7783
7789
  async deleteSandboxImage(imageName) {
7784
7790
  await this.cloudClient.deleteSandboxImage(imageName);
7785
7791
  }
7786
- async createFileSystem(name, description, _options) {
7787
- const filesystem = await new FilesystemClient(this.filesystemOptions).create(name);
7792
+ async createFileSystem(name, description, options) {
7793
+ const filesystem = await new FilesystemClient(this.filesystemOptions).create(
7794
+ name,
7795
+ { region: options?.region }
7796
+ );
7788
7797
  return {
7789
7798
  id: filesystem.name,
7790
7799
  name: filesystem.name,
@@ -8185,11 +8194,11 @@ init_sandbox_image();
8185
8194
 
8186
8195
  // src/file-system.ts
8187
8196
  init_esm_shims();
8188
- async function createFileSystem(name, description) {
8197
+ async function createFileSystem(name, description, options = {}) {
8189
8198
  if (typeof name !== "string" || name.length === 0) {
8190
8199
  throw new TypeError("name must be a non-empty string");
8191
8200
  }
8192
- const filesystem = await new FilesystemClient().create(name);
8201
+ const filesystem = await new FilesystemClient().create(name, options);
8193
8202
  return {
8194
8203
  id: filesystem.name,
8195
8204
  name: filesystem.name,