@ornncompute/cli 1.0.352 → 1.0.353

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.
package/README.md CHANGED
@@ -338,8 +338,10 @@ clears the type without changing the count. A blank count is rejected.
338
338
  version. `ornn admin nodes maintenance` lists one maintenance-history page, and
339
339
  `maintenance show <record-id>` reads one record. `ornn admin nodes test-pool`
340
340
  reads the pool, `test-pool update` resizes it, and `test-pool runs`,
341
- `runs create`, and `runs delete` list, create, and delete runs. These writes
342
- print their review and then submit in an eligible human terminal.
341
+ `runs create`, and `runs delete` list, create, and delete runs.
342
+ `runs create --organization UUID` enrolls the VM under that supplier once it is
343
+ ready, and `runs enroll <run-id> --organization UUID` enrolls a ready run. These
344
+ writes print their review and then submit in an eligible human terminal.
343
345
 
344
346
  `ornn admin downtime list` reads the customer downtime register. `downtime create`
345
347
  records an incident. `downtime update <incident-id> --version N` replaces the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.352",
3
+ "version": "1.0.353",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -249,10 +249,10 @@ function parsePoolRuns(argv) {
249
249
 
250
250
  function parsePoolCreate(argv) {
251
251
  const usage =
252
- "Usage: ornn admin nodes test-pool runs create --run-id UUID --ttl MINUTES [--machine t4|n4]";
252
+ "Usage: ornn admin nodes test-pool runs create --run-id UUID --ttl MINUTES [--machine t4|n4] [--organization UUID]";
253
253
  const { options, positionals } = parseOptions(
254
254
  argv,
255
- new Set(["run-id", "ttl", "machine", "idempotency-key"]),
255
+ new Set(["run-id", "ttl", "machine", "organization", "idempotency-key"]),
256
256
  usage
257
257
  );
258
258
  noPositionals(positionals, usage);
@@ -261,6 +261,25 @@ function parsePoolCreate(argv) {
261
261
  run_id: requireUuid(options["run-id"], "run-id", usage),
262
262
  ttl_minutes: integerValue(options.ttl, "ttl", usage, { min: 30, max: 480 }),
263
263
  ...(options.machine ? { machine: enumValue(options.machine, "machine", ["t4", "n4"], usage) } : {}),
264
+ ...(options.organization !== undefined
265
+ ? { organization_id: requireUuid(options.organization, "organization", usage) }
266
+ : {}),
267
+ },
268
+ idempotencyKey: options["idempotency-key"],
269
+ };
270
+ }
271
+
272
+ function parsePoolEnroll(argv) {
273
+ const usage = "Usage: ornn admin nodes test-pool runs enroll <run-id> --organization UUID";
274
+ const { options, positionals } = parseOptions(
275
+ argv,
276
+ new Set(["organization", "idempotency-key"]),
277
+ usage
278
+ );
279
+ return {
280
+ input: {
281
+ run_id: requireUuid(onePositional(positionals, usage, "run-id"), "run-id", usage),
282
+ organization_id: requireUuid(options.organization, "organization", usage),
264
283
  },
265
284
  idempotencyKey: options["idempotency-key"],
266
285
  };
@@ -380,6 +399,7 @@ const WRITE_CONSEQUENCE = {
380
399
  "test-pool.update": "The test pool will be resized. Shrinking deletes pool resources.",
381
400
  "test-pool.run.create": "A test-pool run will be created and expires with its TTL.",
382
401
  "test-pool.run.delete": "This test-pool run and its resources will be deleted.",
402
+ "test-pool.run.enroll": "This test-pool run's VM will be enrolled under the supplier.",
383
403
  "downtime.create": "This customer downtime incident will be recorded.",
384
404
  "downtime.update": "This downtime incident will be replaced with the supplied fields.",
385
405
  };
@@ -452,6 +472,7 @@ export const adminFleetHandlers = [
452
472
  command("test-pool.run.list", parsePoolRuns),
453
473
  command("test-pool.run.create", parsePoolCreate, true),
454
474
  command("test-pool.run.delete", parsePoolDelete, true),
475
+ command("test-pool.run.enroll", parsePoolEnroll, true),
455
476
  command("downtime.list", parseDowntimeList),
456
477
  command("downtime.create", parseDowntimeCreate, true),
457
478
  command("downtime.update", parseDowntimeUpdate, true),
@@ -2169,6 +2169,12 @@ function deleteTemporaryTestNode(request, runId) {
2169
2169
  method: "DELETE"
2170
2170
  });
2171
2171
  }
2172
+ function enrollTemporaryTestNode(request, runId, body2) {
2173
+ return request(`${path5}/runs/${encodeURIComponent(runId)}/enroll`, {
2174
+ method: "POST",
2175
+ body: body2
2176
+ });
2177
+ }
2172
2178
 
2173
2179
  // ../../packages/capabilities/dist/capabilities/staff-fleet-ops.js
2174
2180
  import { z as z7 } from "zod";
@@ -2298,22 +2304,24 @@ var testPoolRunCreateInput = z7.strictObject({
2298
2304
  run_id: NON_NIL_UUID,
2299
2305
  ttl_minutes: z7.number().int().min(30).max(480),
2300
2306
  machine: z7.enum(["t4", "n4"]).optional(),
2307
+ organization_id: NON_NIL_UUID.optional(),
2301
2308
  ...confirmField
2302
2309
  });
2303
2310
  var testPoolRunCreate = defineStaffMcpCapability({
2304
2311
  id: "test-pool.run.create",
2305
2312
  domain: "fleet",
2306
2313
  roles: ["admin"],
2307
- description: "Internal staff only: create a test-pool run. Provisioning may incur costs; the TTL expires and destroys resources. Preserve run_id unchanged across retries.",
2314
+ description: "Internal staff only: create a test-pool run. Provisioning may incur costs; the TTL expires and destroys resources. Preserve run_id unchanged across retries. Set organization_id to a supplier organization to enroll the node under it as soon as the VM is ready; follow the run for node_id or enroll_error.",
2308
2315
  mutation: "preview-confirm",
2309
- cli: adminCli(["nodes", "test-pool", "runs", "create"], "Create a test-pool run.", "--run-id UUID --ttl MINUTES [--machine t4|n4]", { machine: true, review: "Run id, TTL, and machine." }),
2316
+ cli: adminCli(["nodes", "test-pool", "runs", "create"], "Create a test-pool run.", "--run-id UUID --ttl MINUTES [--machine t4|n4] [--organization UUID]", { machine: true, review: "Run id, TTL, machine, and enrolling supplier." }),
2310
2317
  input: testPoolRunCreateInput,
2311
2318
  execute: async (ctx, input) => {
2312
2319
  const parsed = staffInput(ctx, testPoolRunCreateInput, input);
2313
2320
  const body2 = {
2314
2321
  run_id: parsed.run_id,
2315
2322
  ttl_minutes: parsed.ttl_minutes,
2316
- ...parsed.machine === void 0 ? {} : { machine: parsed.machine }
2323
+ ...parsed.machine === void 0 ? {} : { machine: parsed.machine },
2324
+ ...parsed.organization_id === void 0 ? {} : { organization_id: parsed.organization_id }
2317
2325
  };
2318
2326
  if (!ctx.confirmed)
2319
2327
  return preview("test-pool.run.create", body2);
@@ -2337,6 +2345,27 @@ var testPoolRunDelete = defineStaffMcpCapability({
2337
2345
  return deleteTemporaryTestNode(ctx.fetch, parsed.run_id);
2338
2346
  }
2339
2347
  });
2348
+ var testPoolRunEnrollInput = z7.strictObject({
2349
+ run_id: UUID,
2350
+ organization_id: NON_NIL_UUID,
2351
+ ...confirmField
2352
+ });
2353
+ var testPoolRunEnroll = defineStaffMcpCapability({
2354
+ id: "test-pool.run.enroll",
2355
+ domain: "fleet",
2356
+ roles: ["admin"],
2357
+ description: "Internal staff only: Quick enroll a ready test-pool run's VM under a supplier organization. Starts the node installer over SSH and returns the configurable enrollment run to follow; the run shows node_id once enrolled.",
2358
+ mutation: "preview-confirm",
2359
+ cli: adminCli(["nodes", "test-pool", "runs", "enroll"], "Enroll a test-pool run's VM.", "<run-id> --organization UUID", { machine: true, review: "Run and enrolling supplier." }),
2360
+ input: testPoolRunEnrollInput,
2361
+ execute: async (ctx, input) => {
2362
+ const parsed = staffInput(ctx, testPoolRunEnrollInput, input);
2363
+ const body2 = { organization_id: parsed.organization_id };
2364
+ if (!ctx.confirmed)
2365
+ return preview("test-pool.run.enroll", { run_id: parsed.run_id, ...body2 });
2366
+ return enrollTemporaryTestNode(ctx.fetch, parsed.run_id, body2);
2367
+ }
2368
+ });
2340
2369
  var controlplaneList = defineStaffMcpCapability({
2341
2370
  id: "controlplane.list",
2342
2371
  domain: "fleet",
@@ -2445,6 +2474,7 @@ var staffFleetOpsCapabilities = [
2445
2474
  testPoolRunList,
2446
2475
  testPoolRunCreate,
2447
2476
  testPoolRunDelete,
2477
+ testPoolRunEnroll,
2448
2478
  controlplaneList,
2449
2479
  controlplaneSize,
2450
2480
  controlplaneLicenseList,