trainfabric 0.1.58 → 0.1.59

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 +13 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -9364,7 +9364,7 @@ function buildComputeSpec(options) {
9364
9364
 
9365
9365
  // src/index.ts
9366
9366
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
9367
- var CLI_VERSION = "0.1.58";
9367
+ var CLI_VERSION = "0.1.59";
9368
9368
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
9369
9369
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
9370
9370
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
@@ -10214,9 +10214,16 @@ program2.command("projects:create").requiredOption("--name <name>").option("--or
10214
10214
  })
10215
10215
  );
10216
10216
  });
10217
- program2.command("projects:delete").argument("<projectId>").description("Delete an empty project").action(async (projectId) => {
10217
+ program2.command("projects:delete").argument("<projectId>").option("--json", "print raw JSON output; this is the default").description("Delete an empty project").action(async (projectId) => {
10218
10218
  const normalizedProjectId = normalizeId(projectId, "project", "Project ID");
10219
- await createClient(loadConfig()).projects.delete(normalizedProjectId);
10219
+ const client = createClient(loadConfig());
10220
+ try {
10221
+ await client.projects.get(normalizedProjectId);
10222
+ } catch {
10223
+ printJson({ deleted: false, alreadyDeleted: true, id: normalizedProjectId });
10224
+ return;
10225
+ }
10226
+ await client.projects.delete(normalizedProjectId);
10220
10227
  printJson({ deleted: true, id: normalizedProjectId });
10221
10228
  });
10222
10229
  program2.command("datasets:validate").argument("<file>").description("Validate a local dataset file").action(async (file) => {
@@ -10372,7 +10379,7 @@ program2.command("runs:explanation").argument("<runId>").option("--json", "print
10372
10379
  program2.command("runs:cancel").argument("<runId>").description("Cancel a run").action(async (runId) => {
10373
10380
  printJson(await createClient(loadConfig()).runs.cancel(normalizeId(runId, "run", "Run ID")));
10374
10381
  });
10375
- program2.command("runs:resume").argument("<runId>").description("Resume a run from the latest checkpoint").action(async (runId) => {
10382
+ program2.command("runs:resume").argument("<runId>").option("--json", "print raw JSON output; this is the default").description("Resume a run from the latest checkpoint").action(async (runId) => {
10376
10383
  printJson(await createClient(loadConfig()).runs.resume(normalizeId(runId, "run", "Run ID")));
10377
10384
  });
10378
10385
  program2.command("runs:terminate").argument("<runId>").description("Terminate a queued, launchable, or active run").action(async (runId) => {
@@ -10393,7 +10400,7 @@ program2.command("models:export").argument("<modelId>").option("--json", "print
10393
10400
  program2.command("deployments:list").option("--json", "print raw JSON output; this is the default").description("List deployments").action(async () => {
10394
10401
  printJson(await createClient(loadConfig()).deployments.list());
10395
10402
  });
10396
- program2.command("deployments:create").requiredOption("--model <modelId>").option("--project <projectId>", "accepted for consistency; deployment project is inferred from the model").description("Create a hosted deployment for a model. Requires TRAINING_DEPLOYMENT_BASE_URL to be configured on the backend.").action(async (options) => {
10403
+ program2.command("deployments:create").requiredOption("--model <modelId>").option("--project <projectId>", "accepted for consistency; deployment project is inferred from the model").option("--json", "print raw JSON output; this is the default").description("Create a hosted deployment for a model. Requires TRAINING_DEPLOYMENT_BASE_URL to be configured on the backend.").action(async (options) => {
10397
10404
  const config = loadConfig();
10398
10405
  const client = createClient(config);
10399
10406
  const projectId = normalizeOptionalId(options.project, "project", "Project ID");
@@ -10460,7 +10467,7 @@ program2.command("treasury:billing").option("--json", "print raw JSON output; th
10460
10467
  program2.command("treasury:funding").option("--json", "print raw JSON output; this is the default").description("List supplier funding summaries").action(async () => {
10461
10468
  printJson(await createClient(loadConfig()).treasury.listSupplierFunding());
10462
10469
  });
10463
- program2.command("treasury:funding-preview").requiredOption("--estimated-supplier-cost <usd>").option("--supplier <supplierId>").option("--pool <poolId>").description("Preview treasury funding readiness for a supplier-backed launch").action(async (options) => {
10470
+ program2.command("treasury:funding-preview").requiredOption("--estimated-supplier-cost <usd>").option("--supplier <supplierId>").option("--pool <poolId>").option("--json", "print raw JSON output; this is the default").description("Preview treasury funding readiness for a supplier-backed launch").action(async (options) => {
10464
10471
  printJson(
10465
10472
  await createClient(loadConfig()).treasury.previewFunding({
10466
10473
  estimatedSupplierCostUsd: normalizePositiveUsd(options.estimatedSupplierCost, "Estimated supplier cost"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
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",