@tensorlakeai/tensorlake 0.5.162 → 0.5.163

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 (49) hide show
  1. package/dist/applications/index.cjs +26 -5
  2. package/dist/applications/index.cjs.map +1 -1
  3. package/dist/applications/index.d.cts +3 -3
  4. package/dist/applications/index.d.ts +3 -3
  5. package/dist/applications/index.js +26 -5
  6. package/dist/applications/index.js.map +1 -1
  7. package/dist/function-agent/main.cjs +18 -4
  8. package/dist/function-agent/main.cjs.map +1 -1
  9. package/dist/function-agent/main.js +18 -4
  10. package/dist/function-agent/main.js.map +1 -1
  11. package/dist/function-executor/main.cjs +5 -2
  12. package/dist/function-executor/main.cjs.map +1 -1
  13. package/dist/function-executor/main.js +5 -2
  14. package/dist/function-executor/main.js.map +1 -1
  15. package/dist/index.cjs +47 -12
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +9 -4
  18. package/dist/index.d.ts +9 -4
  19. package/dist/index.js +47 -12
  20. package/dist/index.js.map +1 -1
  21. package/dist/native-worker.cjs +12 -3
  22. package/dist/native-worker.cjs.map +1 -1
  23. package/dist/native-worker.js +12 -3
  24. package/dist/native-worker.js.map +1 -1
  25. package/dist/{remote-DYBXCTNC.d.ts → remote-BMibssYe.d.ts} +29 -29
  26. package/dist/{remote-CEs4GFGP.d.cts → remote-BzVx-ai8.d.cts} +29 -29
  27. package/dist/sandbox-image.cjs +12 -3
  28. package/dist/sandbox-image.cjs.map +1 -1
  29. package/dist/sandbox-image.d.cts +1 -1
  30. package/dist/sandbox-image.d.ts +1 -1
  31. package/dist/sandbox-image.js +12 -3
  32. package/dist/sandbox-image.js.map +1 -1
  33. package/package.json +14 -9
  34. package/runtime/function-executor/manifest.json +13 -13
  35. package/runtime/function-executor/package/dist/function-executor/main.js +5 -2
  36. package/runtime/function-executor/package/dist/function-executor/main.js.map +1 -1
  37. package/runtime/function-executor/package/dist/native-worker.cjs +12 -3
  38. package/runtime/function-executor/package/dist/native-worker.cjs.map +1 -1
  39. package/runtime/function-executor/package/npm-shrinkwrap.json +27 -27
  40. package/runtime/function-executor/package/package.json +4 -4
  41. package/runtime/typescript-function-runner/manifest.json +13 -13
  42. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +18 -4
  43. package/runtime/typescript-function-runner/package/dist/function-agent/main.js.map +1 -1
  44. package/runtime/typescript-function-runner/package/dist/native-worker.cjs +12 -3
  45. package/runtime/typescript-function-runner/package/dist/native-worker.cjs.map +1 -1
  46. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +48 -48
  47. package/runtime/typescript-function-runner/package/package.json +7 -7
  48. package/dist/{sandbox-image-C2GTVnx3.d.cts → image-CN0M59QP.d.cts} +48 -48
  49. package/dist/{sandbox-image-C2GTVnx3.d.ts → image-CN0M59QP.d.ts} +48 -48
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
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, I as Image, l as CreateSandboxImageDeps, F as FileSystem } from './sandbox-image-C2GTVnx3.cjs';
2
- export { m as ApplicationBuildImageResult, n as CreateApplicationBuildImageRequest, o as CreateSandboxImageOptions, p as ImageBuildOperation, q as ImageBuildOperationType, q as ImageBuildOperationTypeValue, r as ImageOptions, s as ImportSandboxImageOptions, t as RequestErrorInfo, u as SandboxImageSource, v as SecretsPagination, w as createSandboxImage, x as deleteSandboxImage, y as dockerfileContent, z as findSandboxImageByName, D as importSandboxImage, E as listSandboxImages } from './sandbox-image-C2GTVnx3.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-CEs4GFGP.cjs';
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, I as Image, l as CreateSandboxImageDeps, F as FileSystem } from './image-CN0M59QP.cjs';
2
+ export { m as ApplicationBuildImageResult, n as CreateApplicationBuildImageRequest, o as CreateSandboxImageOptions, p as ImageBuildOperation, q as ImageBuildOperationType, q as ImageBuildOperationTypeValue, r as ImageOptions, s as ImportSandboxImageOptions, t as RequestErrorInfo, u as SandboxImageSource, v as SecretsPagination, w as createSandboxImage, x as deleteSandboxImage, y as dockerfileContent, z as findSandboxImageByName, D as importSandboxImage, E as listSandboxImages } from './image-CN0M59QP.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-BzVx-ai8.cjs';
4
4
 
5
5
  /** An SDK result paired with its server-side W3C trace ID. */
6
6
  type Traced<T> = T & {
@@ -1399,7 +1399,12 @@ declare class Sandbox {
1399
1399
  * the sandbox image. `bash` is present on every image we ship.
1400
1400
  */
1401
1401
  private waitForPortReady;
1402
- ptyWsUrl(sessionId: string, token: string): string;
1402
+ /**
1403
+ * WebSocket URL for a PTY session. The token is not part of the URL, so it
1404
+ * doesn't leak into proxy or CDN access logs. Send it in the `X-PTY-Token`
1405
+ * header instead.
1406
+ */
1407
+ ptyWsUrl(sessionId: string): string;
1403
1408
  /** Check the sandbox daemon health. */
1404
1409
  health(): Promise<Traced<HealthResponse>>;
1405
1410
  /** Get sandbox daemon info (version, uptime, process counts). */
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
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, I as Image, l as CreateSandboxImageDeps, F as FileSystem } from './sandbox-image-C2GTVnx3.js';
2
- export { m as ApplicationBuildImageResult, n as CreateApplicationBuildImageRequest, o as CreateSandboxImageOptions, p as ImageBuildOperation, q as ImageBuildOperationType, q as ImageBuildOperationTypeValue, r as ImageOptions, s as ImportSandboxImageOptions, t as RequestErrorInfo, u as SandboxImageSource, v as SecretsPagination, w as createSandboxImage, x as deleteSandboxImage, y as dockerfileContent, z as findSandboxImageByName, D as importSandboxImage, E as listSandboxImages } from './sandbox-image-C2GTVnx3.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-DYBXCTNC.js';
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, I as Image, l as CreateSandboxImageDeps, F as FileSystem } from './image-CN0M59QP.js';
2
+ export { m as ApplicationBuildImageResult, n as CreateApplicationBuildImageRequest, o as CreateSandboxImageOptions, p as ImageBuildOperation, q as ImageBuildOperationType, q as ImageBuildOperationTypeValue, r as ImageOptions, s as ImportSandboxImageOptions, t as RequestErrorInfo, u as SandboxImageSource, v as SecretsPagination, w as createSandboxImage, x as deleteSandboxImage, y as dockerfileContent, z as findSandboxImageByName, D as importSandboxImage, E as listSandboxImages } from './image-CN0M59QP.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-BMibssYe.js';
4
4
 
5
5
  /** An SDK result paired with its server-side W3C trace ID. */
6
6
  type Traced<T> = T & {
@@ -1399,7 +1399,12 @@ declare class Sandbox {
1399
1399
  * the sandbox image. `bash` is present on every image we ship.
1400
1400
  */
1401
1401
  private waitForPortReady;
1402
- ptyWsUrl(sessionId: string, token: string): string;
1402
+ /**
1403
+ * WebSocket URL for a PTY session. The token is not part of the URL, so it
1404
+ * doesn't leak into proxy or CDN access logs. Send it in the `X-PTY-Token`
1405
+ * header instead.
1406
+ */
1407
+ ptyWsUrl(sessionId: string): string;
1403
1408
  /** Check the sandbox daemon health. */
1404
1409
  health(): Promise<Traced<HealthResponse>>;
1405
1410
  /** Get sandbox daemon info (version, uptime, process counts). */
package/dist/index.js CHANGED
@@ -4,11 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ var __esm = (fn, res, err) => function __init() {
8
+ if (err) throw err[0];
9
+ try {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ } catch (e) {
12
+ throw err = [e], e;
13
+ }
9
14
  };
10
15
  var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e) {
19
+ throw mod = 0, e;
20
+ }
12
21
  };
13
22
  var __export = (target, all) => {
14
23
  for (var name in all)
@@ -46,7 +55,7 @@ var init_defaults = __esm({
46
55
  "src/defaults.ts"() {
47
56
  "use strict";
48
57
  init_esm_shims();
49
- SDK_VERSION = "0.5.162";
58
+ SDK_VERSION = "0.5.163";
50
59
  API_URL = process.env.TENSORLAKE_API_URL ?? "https://api.tensorlake.ai";
51
60
  API_KEY = process.env.TENSORLAKE_API_KEY ?? void 0;
52
61
  NAMESPACE = process.env.INDEXIFY_NAMESPACE ?? "default";
@@ -366,6 +375,7 @@ var init_native_worker_client = __esm({
366
375
  )) {
367
376
  this.workerPath = workerPath;
368
377
  }
378
+ workerPath;
369
379
  worker;
370
380
  nextId = 1;
371
381
  registered = /* @__PURE__ */ new Set();
@@ -519,7 +529,7 @@ var init_native_worker_client = __esm({
519
529
  }
520
530
  };
521
531
  runtimeKey = /* @__PURE__ */ Symbol.for(
522
- `tensorlake.native.worker.${false ? "source" : "0.5.162"}.v1`
532
+ `tensorlake.native.worker.${false ? "source" : "0.5.163"}.v1`
523
533
  );
524
534
  runtimes = globalThis;
525
535
  }
@@ -857,6 +867,7 @@ var init_pending_sandbox = __esm({
857
867
  this.errorDetails = record.errorDetails;
858
868
  this.traceId = binding.traceId;
859
869
  }
870
+ binding;
860
871
  sandboxId;
861
872
  name;
862
873
  state;
@@ -1149,6 +1160,10 @@ var init_tunnel = __esm({
1149
1160
  void this.lifetime.catch(() => {
1150
1161
  });
1151
1162
  }
1163
+ native;
1164
+ remotePort;
1165
+ localHost;
1166
+ localPort;
1152
1167
  closePromise = null;
1153
1168
  lifetime;
1154
1169
  static async listen(options) {
@@ -3274,6 +3289,8 @@ var init_sandbox = __esm({
3274
3289
  );
3275
3290
  }
3276
3291
  }
3292
+ sandbox;
3293
+ options;
3277
3294
  baseUrl = "";
3278
3295
  wsHeaders = {};
3279
3296
  nativeProxy = null;
@@ -4392,15 +4409,13 @@ var init_sandbox = __esm({
4392
4409
  /** Attach to an existing PTY session by ID and token and return a connected `Pty` handle. */
4393
4410
  async connectPty(sessionId, token, options) {
4394
4411
  await this.proxy.ensureResolved();
4395
- const wsUrl = new URL(this.ptyWsUrl(sessionId, token));
4396
- const authToken = wsUrl.searchParams.get("token") ?? token;
4397
4412
  const pty = new Pty({
4398
4413
  sessionId,
4399
- token: authToken,
4400
- wsUrl: wsUrl.toString(),
4414
+ token,
4415
+ wsUrl: this.ptyWsUrl(sessionId),
4401
4416
  wsHeaders: {
4402
4417
  ...this.wsHeaders,
4403
- "X-PTY-Token": authToken
4418
+ "X-PTY-Token": token
4404
4419
  },
4405
4420
  killSession: async () => {
4406
4421
  const proxy = await this.proxy.client();
@@ -4478,7 +4493,12 @@ var init_sandbox = __esm({
4478
4493
  `port ${port} did not become reachable inside sandbox within the connect timeout${detail}`
4479
4494
  );
4480
4495
  }
4481
- ptyWsUrl(sessionId, token) {
4496
+ /**
4497
+ * WebSocket URL for a PTY session. The token is not part of the URL, so it
4498
+ * doesn't leak into proxy or CDN access logs. Send it in the `X-PTY-Token`
4499
+ * header instead.
4500
+ */
4501
+ ptyWsUrl(sessionId) {
4482
4502
  let wsBase;
4483
4503
  if (this.baseUrl.startsWith("https://")) {
4484
4504
  wsBase = "wss://" + this.baseUrl.slice(8);
@@ -4487,7 +4507,7 @@ var init_sandbox = __esm({
4487
4507
  } else {
4488
4508
  wsBase = this.baseUrl;
4489
4509
  }
4490
- return `${wsBase}/api/v1/pty/${sessionId}/ws?token=${token}`;
4510
+ return `${wsBase}/api/v1/pty/${sessionId}/ws`;
4491
4511
  }
4492
4512
  // --- Health ---
4493
4513
  /** Check the sandbox daemon health. */
@@ -7128,6 +7148,7 @@ var NativeCloudTransport = class {
7128
7148
  throw new RangeError("retryBackoffMs must be a non-negative finite number");
7129
7149
  }
7130
7150
  }
7151
+ options;
7131
7152
  native;
7132
7153
  closed = false;
7133
7154
  client() {
@@ -7756,6 +7777,8 @@ var MountCli = class {
7756
7777
  this.command = command;
7757
7778
  this.envOverrides = envOverrides;
7758
7779
  }
7780
+ command;
7781
+ envOverrides;
7759
7782
  binary = null;
7760
7783
  async findCli() {
7761
7784
  const candidates = [];
@@ -8570,6 +8593,10 @@ var RepositoryMount = class {
8570
8593
  this.path = path5;
8571
8594
  this.readOnly = readOnly;
8572
8595
  }
8596
+ cli;
8597
+ target;
8598
+ path;
8599
+ readOnly;
8573
8600
  /** Inspect workspace state, pending changes, and daemon diagnostics. */
8574
8601
  async status() {
8575
8602
  return this.cli.status(this.path);
@@ -10418,6 +10445,7 @@ var MemoryRequestContext = class {
10418
10445
  this.headers = new Headers(options.headers);
10419
10446
  this.signal = options.signal ?? new AbortController().signal;
10420
10447
  }
10448
+ requestId;
10421
10449
  headers;
10422
10450
  signal;
10423
10451
  values = /* @__PURE__ */ new Map();
@@ -10464,6 +10492,9 @@ var LocalRequest = class {
10464
10492
  this.value = value;
10465
10493
  this.cancelRequest = cancelRequest;
10466
10494
  }
10495
+ id;
10496
+ value;
10497
+ cancelRequest;
10467
10498
  output() {
10468
10499
  return this.value;
10469
10500
  }
@@ -10631,6 +10662,10 @@ var RemoteRequest = class {
10631
10662
  this.client = client;
10632
10663
  this.outputIsFile = outputIsFile;
10633
10664
  }
10665
+ id;
10666
+ applicationName;
10667
+ client;
10668
+ outputIsFile;
10634
10669
  async output() {
10635
10670
  let output;
10636
10671
  try {