trainfabric 0.1.44 → 0.1.45

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 +34 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7526,6 +7526,25 @@ var NEVER = INVALID;
7526
7526
  var experimentProviderIds = ["mlflow"];
7527
7527
  var experimentTrackingModes = ["online", "offline"];
7528
7528
  var baseModels = ["llama-3-8b", "mistral-7b", "qwen-2.5-7b"];
7529
+ var runStatuses = [
7530
+ "draft",
7531
+ "validating",
7532
+ "queued",
7533
+ "awaiting_capacity",
7534
+ "scheduled",
7535
+ "provisioning",
7536
+ "launching",
7537
+ "starting",
7538
+ "running",
7539
+ "checkpointing",
7540
+ "evaluating",
7541
+ "completed",
7542
+ "failed",
7543
+ "canceled",
7544
+ "resuming",
7545
+ "paused",
7546
+ "terminated"
7547
+ ];
7529
7548
  var organizationRoles = ["owner", "admin", "member", "billing"];
7530
7549
  var apiKeyScopes = [
7531
7550
  "org:read",
@@ -9291,7 +9310,7 @@ function buildComputeSpec(options) {
9291
9310
 
9292
9311
  // src/index.ts
9293
9312
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
9294
- var CLI_VERSION = "0.1.44";
9313
+ var CLI_VERSION = "0.1.45";
9295
9314
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
9296
9315
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
9297
9316
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
@@ -9667,6 +9686,16 @@ function requireProjectId(options, config) {
9667
9686
  }
9668
9687
  return projectId;
9669
9688
  }
9689
+ function normalizeRunStatusFilter(status) {
9690
+ if (status === void 0) {
9691
+ return void 0;
9692
+ }
9693
+ const normalized = String(status).trim().toLowerCase();
9694
+ if (!runStatuses.includes(normalized)) {
9695
+ throw new Error(`Run status is invalid. Use one of: ${runStatuses.join(", ")}.`);
9696
+ }
9697
+ return normalized;
9698
+ }
9670
9699
  function optionWasProvided(command, optionName) {
9671
9700
  return command.getOptionValueSource(optionName) === "cli";
9672
9701
  }
@@ -10113,8 +10142,10 @@ program2.command("runs:quote").option("--project <projectId>").requiredOption("-
10113
10142
  printJson(redactInlineSource(bundle));
10114
10143
  }
10115
10144
  });
10116
- program2.command("runs:list").option("--project <projectId>").description("List runs").action(async (options) => {
10117
- printJson(await createClient(loadConfig()).runs.list(normalizeOptionalId(options.project, "project", "Project ID")));
10145
+ program2.command("runs:list").option("--project <projectId>").option("--status <status>", "filter by run status").option("--json", "print raw JSON output; this is the default").description("List runs").action(async (options) => {
10146
+ const status = normalizeRunStatusFilter(options.status);
10147
+ const runs = await createClient(loadConfig()).runs.list(normalizeOptionalId(options.project, "project", "Project ID"));
10148
+ printJson(status ? runs.filter((run) => run.status === status) : runs);
10118
10149
  });
10119
10150
  program2.command("runs:status").argument("<runId>").description("Fetch full run detail").action(async (runId) => {
10120
10151
  const detail = await createClient(loadConfig()).runs.get(normalizeId(runId, "run", "Run ID"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
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",