trainfabric 0.1.15 → 0.1.16

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 (2) hide show
  1. package/dist/index.cjs +10 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -8799,11 +8799,16 @@ var import_node_fs = __toESM(require("node:fs"), 1);
8799
8799
  var import_node_os = __toESM(require("node:os"), 1);
8800
8800
  var import_node_path2 = __toESM(require("node:path"), 1);
8801
8801
  function collectRuntimeFiles(repoPath) {
8802
- const candidates = ["training.yaml", "train.runtime.yaml", "pyproject.toml", "requirements.txt", "environment.yml", "Dockerfile", "train.py"];
8802
+ const manifestFiles = /* @__PURE__ */ new Set(["training.yaml", "train.runtime.yaml", "pyproject.toml", "requirements.txt", "environment.yml", "Dockerfile"]);
8803
8803
  const ignoredDirectories = /* @__PURE__ */ new Set([".git", ".hg", ".svn", "node_modules", ".venv", "venv", "__pycache__", ".mypy_cache", ".pytest_cache", "dist", "build"]);
8804
8804
  const found = [];
8805
+ const maxFiles = 256;
8806
+ const maxFileBytes = 256 * 1024;
8807
+ function shouldIncludeFile(fileName) {
8808
+ return manifestFiles.has(fileName) || fileName.endsWith(".py");
8809
+ }
8805
8810
  function walk(currentPath) {
8806
- if (found.length >= 64) {
8811
+ if (found.length >= maxFiles) {
8807
8812
  return;
8808
8813
  }
8809
8814
  for (const entry of import_node_fs.default.readdirSync(currentPath, { withFileTypes: true })) {
@@ -8815,11 +8820,11 @@ function collectRuntimeFiles(repoPath) {
8815
8820
  }
8816
8821
  continue;
8817
8822
  }
8818
- if (!entry.isFile() || !candidates.includes(entry.name)) {
8823
+ if (!entry.isFile() || !shouldIncludeFile(entry.name)) {
8819
8824
  continue;
8820
8825
  }
8821
8826
  const stat = import_node_fs.default.statSync(absolute);
8822
- if (stat.size > 256 * 1024) {
8827
+ if (stat.size > maxFileBytes) {
8823
8828
  continue;
8824
8829
  }
8825
8830
  found.push({
@@ -8922,7 +8927,7 @@ function buildComputeSpec(options) {
8922
8927
 
8923
8928
  // src/index.ts
8924
8929
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
8925
- var CLI_VERSION = "0.1.15";
8930
+ var CLI_VERSION = "0.1.16";
8926
8931
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
8927
8932
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
8928
8933
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Trainfabric CLI for launching GPU training jobs on the hosted Trainfabric backend.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",