@ornncompute/cli 1.0.194 → 1.0.196

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.194",
3
+ "version": "1.0.196",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -948,6 +948,32 @@ function listStaffNodeVirtualMachines(request, nodeId, signal) {
948
948
  ...signal ? { signal } : {}
949
949
  });
950
950
  }
951
+ async function listStaffVirtualMachines(request, input, signal) {
952
+ const virtual_machines = [];
953
+ let cursor = input.cursor;
954
+ const seen = new Set(cursor ? [cursor] : []);
955
+ for (; ; ) {
956
+ const query = new URLSearchParams({
957
+ node_ids: input.node_ids.join(","),
958
+ limit: String(input.limit ?? 500)
959
+ });
960
+ if (cursor)
961
+ query.set("cursor", cursor);
962
+ const page = await request(`/v1/staff/virtual-machines?${query}`, {
963
+ method: "GET",
964
+ ...signal ? { signal } : {}
965
+ });
966
+ if (!Array.isArray(page.virtual_machines) || page.next_cursor === void 0)
967
+ throw new Error("The virtual machine catalog did not return a complete page.");
968
+ virtual_machines.push(...page.virtual_machines);
969
+ if (!page.next_cursor)
970
+ return { ...page, virtual_machines };
971
+ if (seen.has(page.next_cursor))
972
+ throw new Error("Virtual machine pagination repeated a cursor.");
973
+ seen.add(page.next_cursor);
974
+ cursor = page.next_cursor;
975
+ }
976
+ }
951
977
  function listReservationVirtualMachines(request, reservationId, signal) {
952
978
  return request(`/v1/orchestrator/reservations/${encodeURIComponent(reservationId)}/virtual-machines`, { method: "GET", ...signal ? { signal } : {} });
953
979
  }
@@ -1131,6 +1157,7 @@ export {
1131
1157
  listSshBastions,
1132
1158
  listStaffNodeVirtualMachines,
1133
1159
  listStaffNodes,
1160
+ listStaffVirtualMachines,
1134
1161
  listStorageInventory,
1135
1162
  listStorageTargets,
1136
1163
  listSupplierConnectionConfigs,
@@ -4798,7 +4798,7 @@ var listNodesCapability = defineCapability({
4798
4798
  domain: "fleet",
4799
4799
  roles: ["user", "admin"],
4800
4800
  mcp: { roles: ["admin"] },
4801
- description: "List nodes. Users see their own reserved machines. Admins see enrolled and ghost nodes. Call with no filters for the whole fleet. Optional reservation_id lists the nodes on one reservation (find a customer's reservations with reservation.list customerId). Optional organization_id (supplier), facility_id, and status (ghost, bare-metal) narrow the same list. Paginate large fleets with cursor + max: pass the response's next_cursor back as cursor to fetch the next page; next_cursor is omitted once the page is not full. Never invent nodes. Never print private keys.",
4801
+ description: "List nodes. Users pass reservation_id for one of their own reservations and see its machines. Admins see enrolled and ghost nodes. Call with no filters for the whole fleet. Optional reservation_id lists the nodes on one reservation (find a customer's reservations with reservation.list customerId). Optional organization_id (supplier), facility_id, and status (ghost, bare-metal) narrow the same list. Paginate large fleets with cursor + max: pass the response's next_cursor back as cursor to fetch the next page; next_cursor is omitted once the page is not full. Never invent nodes. Never print private keys.",
4802
4802
  mutation: "read",
4803
4803
  cli: {
4804
4804
  command: ["admin", "nodes", "list"],
@@ -4851,7 +4851,10 @@ var listNodesCapability = defineCapability({
4851
4851
  limit: parsed.max != null || parsed.limit != null ? String(parsed.max ?? parsed.limit) : void 0
4852
4852
  };
4853
4853
  if (ctx.role === "user") {
4854
- return listNodes(ctx.fetch, pagination);
4854
+ return listNodes(ctx.fetch, {
4855
+ reservation_id: parsed.reservation_id,
4856
+ ...pagination
4857
+ });
4855
4858
  }
4856
4859
  return listStaffNodes(ctx.fetch, {
4857
4860
  organization_id: parsed.organization_id,