@tuned-tensor/cli 0.27.0 → 0.28.0

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.
@@ -4,7 +4,7 @@
4
4
  import { createHash as createHash4 } from "crypto";
5
5
  import { createReadStream as createReadStream3 } from "fs";
6
6
  import { lstat as lstat3, mkdir as mkdir3, readFile as readFile3, readdir as readdir4, realpath as realpath3, stat as stat3 } from "fs/promises";
7
- import { isAbsolute as isAbsolute3, join as join6, relative as relative3, resolve as resolve7, sep as sep3 } from "path";
7
+ import { isAbsolute as isAbsolute4, join as join6, relative as relative3, resolve as resolve7, sep as sep3 } from "path";
8
8
 
9
9
  // src/local-runtime/contracts.ts
10
10
  import { z } from "zod";
@@ -77,7 +77,7 @@ function pythonEnvironmentPath(kind, hash, env = process.env) {
77
77
 
78
78
  // src/local-runtime/model-registry.ts
79
79
  import { lstat as lstat2, readdir as readdir2 } from "fs/promises";
80
- import { resolve as resolve3 } from "path";
80
+ import { isAbsolute as isAbsolute3, resolve as resolve3 } from "path";
81
81
  import { fileURLToPath } from "url";
82
82
 
83
83
  // src/local-runtime/artifacts.ts
@@ -86,10 +86,11 @@ import { createReadStream } from "fs";
86
86
  import { copyFile, lstat, mkdir, open, readFile, readdir, realpath, rename, stat, writeFile } from "fs/promises";
87
87
  import { dirname, isAbsolute as isAbsolute2, join as join2, relative, resolve as resolve2, sep } from "path";
88
88
  import { createGunzip } from "zlib";
89
+ import { pathToFileURL } from "url";
89
90
  var RUN_OWNER_FILE = ".tt-local-run-owner.json";
90
91
  var ARTIFACT_WORKFLOW_LOCK_FILE = ".tt-local-workflow.lock";
91
92
  function fileUri(path) {
92
- return `file://${resolve2(path)}`;
93
+ return pathToFileURL(resolve2(path)).href;
93
94
  }
94
95
  function defaultArtifactPrefix(input) {
95
96
  return join2("users", input.userId, "specs", input.behaviorSpecId, "runs", input.runId);
@@ -856,7 +857,12 @@ function assertCertifiedBaseModelConfig(value, label = "base-model config.json",
856
857
  );
857
858
  }
858
859
  function localModelArtifactPath(uri) {
859
- if (uri.startsWith("file://")) return fileURLToPath(new URL(uri));
860
+ if (uri.startsWith("file://")) {
861
+ const legacy = uri.slice("file://".length);
862
+ if (process.platform === "win32" && /^[a-z]:[\\/]/i.test(legacy)) return resolve3(legacy);
863
+ return fileURLToPath(new URL(uri));
864
+ }
865
+ if (isAbsolute3(uri)) return resolve3(uri);
860
866
  if (/^[a-z][a-z0-9+.-]*:/i.test(uri)) {
861
867
  throw new Error(`Model artifact must be a local path or file URI: ${uri}`);
862
868
  }
@@ -2246,7 +2252,7 @@ async function enforceSpecLock(args) {
2246
2252
  `Base model ${model.id}@${revision} is not downloaded (${snapshot}). Run \`tt models prefetch\` with this spec first.`
2247
2253
  );
2248
2254
  }
2249
- const { prefetchBaseModel: prefetchBaseModel2 } = await import("./prefetch-B6I7B4LR.js");
2255
+ const { prefetchBaseModel: prefetchBaseModel2 } = await import("./prefetch-LBIOO7ZO.js");
2250
2256
  await prefetchBaseModel2({ request: args.request, config: args.config, reporter: args.reporter });
2251
2257
  }
2252
2258
  const { files } = await snapshotDigests(snapshot);
@@ -2320,7 +2326,7 @@ async function certifiedFileDigest(path, expected) {
2320
2326
  }
2321
2327
  function isStrictPhysicalDescendant(parent, child) {
2322
2328
  const candidate = relative3(parent, child);
2323
- return candidate !== "" && candidate !== ".." && !candidate.startsWith(`..${sep3}`) && !isAbsolute3(candidate);
2329
+ return candidate !== "" && candidate !== ".." && !candidate.startsWith(`..${sep3}`) && !isAbsolute4(candidate);
2324
2330
  }
2325
2331
  async function verifySnapshotCacheLocation(path, modelId, revision, modelCache) {
2326
2332
  const repository = `models--${modelId.replaceAll("/", "--")}`;
@@ -2811,4 +2817,4 @@ export {
2811
2817
  applySpecLock,
2812
2818
  enforceSpecLock
2813
2819
  };
2814
- //# sourceMappingURL=chunk-2AIP63QO.js.map
2820
+ //# sourceMappingURL=chunk-FSVTMX4L.js.map