@tensorlakeai/tensorlake 0.5.150 → 0.5.152

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 (42) hide show
  1. package/README.md +8 -0
  2. package/dist/applications/index.cjs +14 -3
  3. package/dist/applications/index.cjs.map +1 -1
  4. package/dist/applications/index.d.cts +3 -3
  5. package/dist/applications/index.d.ts +3 -3
  6. package/dist/applications/index.js +14 -3
  7. package/dist/applications/index.js.map +1 -1
  8. package/dist/function-agent/main.cjs +1 -1
  9. package/dist/function-agent/main.cjs.map +1 -1
  10. package/dist/function-agent/main.js +1 -1
  11. package/dist/function-agent/main.js.map +1 -1
  12. package/dist/function-executor/main.cjs +2 -2
  13. package/dist/function-executor/main.cjs.map +1 -1
  14. package/dist/function-executor/main.js +2 -2
  15. package/dist/function-executor/main.js.map +1 -1
  16. package/dist/index.cjs +53 -190
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +5 -9
  19. package/dist/index.d.ts +5 -9
  20. package/dist/index.js +52 -189
  21. package/dist/index.js.map +1 -1
  22. package/dist/{remote-dblFxKug.d.ts → remote-BbSrvgUn.d.ts} +1 -1
  23. package/dist/{remote-CNJ9TmcQ.d.cts → remote-CC48cvYP.d.cts} +1 -1
  24. package/dist/{sandbox-image-ChzWDeZy.d.cts → sandbox-image-CAK_K7ND.d.cts} +14 -0
  25. package/dist/{sandbox-image-ChzWDeZy.d.ts → sandbox-image-CAK_K7ND.d.ts} +14 -0
  26. package/dist/sandbox-image.cjs +14 -3
  27. package/dist/sandbox-image.cjs.map +1 -1
  28. package/dist/sandbox-image.d.cts +1 -1
  29. package/dist/sandbox-image.d.ts +1 -1
  30. package/dist/sandbox-image.js +14 -3
  31. package/dist/sandbox-image.js.map +1 -1
  32. package/package.json +8 -7
  33. package/runtime/function-executor/manifest.json +7 -7
  34. package/runtime/function-executor/package/dist/function-executor/main.js +2 -2
  35. package/runtime/function-executor/package/dist/function-executor/main.js.map +1 -1
  36. package/runtime/function-executor/package/npm-shrinkwrap.json +2 -2
  37. package/runtime/function-executor/package/package.json +1 -1
  38. package/runtime/typescript-function-runner/manifest.json +7 -7
  39. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +1 -1
  40. package/runtime/typescript-function-runner/package/dist/function-agent/main.js.map +1 -1
  41. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +26 -26
  42. package/runtime/typescript-function-runner/package/package.json +7 -7
package/README.md CHANGED
@@ -145,6 +145,12 @@ Cloud, sandbox, repository, and filesystem HTTP operations use the Rust SDK
145
145
  through an internal worker. Keep the platform-specific optional native package
146
146
  installed. Importing Tensorlake does not replace the application's HTTP dispatcher.
147
147
 
148
+ TCP port forwarding also uses this worker and the shared Rust tunnel transport,
149
+ used by the CLI and Python's synchronous and async interfaces. Rust owns the
150
+ listener, WebSocket/TLS connection, backpressure, keepalive, and shutdown. Public
151
+ tunnel APIs and the server protocol are unchanged. The shared regression tests
152
+ are in `crates/cloud-sdk/src/sandboxes/tunnel/tests.rs`.
153
+
148
154
  The worker starts with an empty `execArgv` and a copied environment with
149
155
  `NODE_OPTIONS` cleared, so application `--require`, `--import`, and loader hooks
150
156
  do not run inside it. Other environment variables are copied when it starts.
@@ -165,3 +171,5 @@ Cloud requests advertise gzip support and decode gzip responses, including live
165
171
 
166
172
  After building the SDK and native addon, run `npm run test:native-cloud` to check
167
173
  the cloud transport against a local HTTP server.
174
+ Run `npm run test:native-tunnel` to check TCP forwarding through the worker and
175
+ native addon against a local WebSocket server.
@@ -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.150";
52
+ SDK_VERSION = "0.5.152";
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";
@@ -346,6 +346,11 @@ function createWorkerBinding(runtime) {
346
346
  return runtime.handle("NativeRepositoryClient", args);
347
347
  }
348
348
  },
349
+ NativeTcpTunnel: class {
350
+ constructor() {
351
+ return runtime.handle("NativeTcpTunnel", []);
352
+ }
353
+ },
349
354
  validateManagedName: (name) => runtime.call(void 0, "validateManagedName", [name])
350
355
  };
351
356
  }
@@ -525,7 +530,7 @@ var init_native_worker_client = __esm({
525
530
  }
526
531
  };
527
532
  runtimeKey = /* @__PURE__ */ Symbol.for(
528
- `tensorlake.native.worker.${false ? "source" : "0.5.150"}.v1`
533
+ `tensorlake.native.worker.${false ? "source" : "0.5.152"}.v1`
529
534
  );
530
535
  runtimes = globalThis;
531
536
  }
@@ -1590,6 +1595,7 @@ async function createSandboxImage(source, options = {}, deps = {}) {
1590
1595
  useScopeHeaders: usePat,
1591
1596
  userAgent: void 0,
1592
1597
  dockerCompat: options.dockerCompat ?? false,
1598
+ dockerConfigJson: options.dockerConfigJson,
1593
1599
  dockerfileText,
1594
1600
  contextDir: nativeContextDir
1595
1601
  },
@@ -1668,7 +1674,8 @@ async function importSandboxImage(imageReference, options = {}, deps = {}) {
1668
1674
  namespace: context.namespace,
1669
1675
  useScopeHeaders: usePat,
1670
1676
  userAgent: void 0,
1671
- dockerCompat: options.dockerCompat ?? false
1677
+ dockerCompat: options.dockerCompat ?? false,
1678
+ dockerConfigJson: options.dockerConfigJson
1672
1679
  },
1673
1680
  (event) => {
1674
1681
  try {
@@ -1803,10 +1810,12 @@ async function runCreateSandboxImageCli(argv = process.argv.slice(2)) {
1803
1810
  `Invalid --builder_disk_mb value: ${parsed.values.builder_disk_mb}`
1804
1811
  );
1805
1812
  }
1813
+ const dockerConfigJson = loadNativeBinding().loadDockerConfigJson();
1806
1814
  await createSandboxImage(
1807
1815
  dockerfilePath,
1808
1816
  {
1809
1817
  registeredName: parsed.values.name,
1818
+ dockerConfigJson,
1810
1819
  cpus,
1811
1820
  memoryMb,
1812
1821
  diskMb,
@@ -1855,10 +1864,12 @@ async function runImportSandboxImageCli(argv = process.argv.slice(2)) {
1855
1864
  `Invalid --builder_disk_mb value: ${parsed.values.builder_disk_mb}`
1856
1865
  );
1857
1866
  }
1867
+ const dockerConfigJson = loadNativeBinding().loadDockerConfigJson();
1858
1868
  await importSandboxImage(
1859
1869
  imageReference,
1860
1870
  {
1861
1871
  registeredName: parsed.values.name,
1872
+ dockerConfigJson,
1862
1873
  cpus,
1863
1874
  memoryMb,
1864
1875
  diskMb,