@ornncompute/cli 1.0.118 → 1.0.120

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.118",
3
+ "version": "1.0.120",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,5 @@
1
- import { gpuDisplay, HARDWARE_CATALOG_PATH, parseHardwareCatalog } from "../vendor/capabilities/cli.js";
1
+ import { getHardwareCatalog } from "../vendor/api-client/orchestrator.js";
2
+ import { gpuDisplay, parseHardwareCatalog } from "../vendor/capabilities/cli.js";
2
3
 
3
4
  const catalogs = new WeakMap();
4
5
 
@@ -7,11 +8,11 @@ const catalogs = new WeakMap();
7
8
  * per fetch. An unreadable catalog renders GPUs as unknown instead of
8
9
  * failing the command.
9
10
  */
10
- export async function gpuLabeler(fetch, path = HARDWARE_CATALOG_PATH) {
11
+ export async function gpuLabeler(fetch) {
11
12
  let terms = catalogs.get(fetch);
12
13
  if (!terms) {
13
14
  terms = Promise.resolve()
14
- .then(() => fetch(path, { method: "GET" }))
15
+ .then(() => getHardwareCatalog(fetch))
15
16
  .then((payload) => parseHardwareCatalog(payload).terms)
16
17
  .catch(() => []);
17
18
  catalogs.set(fetch, terms);
@@ -0,0 +1,57 @@
1
+ // ../../packages/api-client/dist/orchestrator/catalog.js
2
+ var hardwareCatalogPath = "/v1/orchestrator/catalog/hardware";
3
+ function getHardwareCatalog(request, signal) {
4
+ return request(hardwareCatalogPath, {
5
+ method: "GET",
6
+ ...signal ? { signal } : {}
7
+ });
8
+ }
9
+ function getSoftwareCatalog(request, signal) {
10
+ return request("/v1/orchestrator/catalog/software", {
11
+ method: "GET",
12
+ ...signal ? { signal } : {}
13
+ });
14
+ }
15
+
16
+ // ../../packages/api-client/dist/orchestrator/locality.js
17
+ var localityGeolocatePath = "/v1/orchestrator/locality/geolocate";
18
+ function listLocalityRegions(request, signal) {
19
+ return request("/v1/orchestrator/locality/regions", {
20
+ method: "GET",
21
+ ...signal ? { signal } : {}
22
+ });
23
+ }
24
+ function geolocate(request, query, signal) {
25
+ const target = query.ip !== void 0 ? `ip=${encodeURIComponent(query.ip)}` : `address=${encodeURIComponent(query.address)}`;
26
+ return request(`${localityGeolocatePath}?${target}`, {
27
+ method: "GET",
28
+ ...signal ? { signal } : {}
29
+ });
30
+ }
31
+
32
+ // ../../packages/api-client/dist/orchestrator/shell.js
33
+ var sessionsPath = "/v1/orchestrator/shell/sessions";
34
+ function createShellSession(fetcher) {
35
+ return fetcher(sessionsPath, { method: "POST" });
36
+ }
37
+ function getCurrentShellSession(fetcher) {
38
+ return fetcher(`${sessionsPath}/current`, { method: "GET" });
39
+ }
40
+ function closeShellSession(fetcher, id) {
41
+ return fetcher(`${sessionsPath}/${encodeURIComponent(id)}`, { method: "DELETE" });
42
+ }
43
+ function shellSessionAttachPath(id) {
44
+ return `${sessionsPath}/${encodeURIComponent(id)}/attach`;
45
+ }
46
+ export {
47
+ closeShellSession,
48
+ createShellSession,
49
+ geolocate,
50
+ getCurrentShellSession,
51
+ getHardwareCatalog,
52
+ getSoftwareCatalog,
53
+ hardwareCatalogPath,
54
+ listLocalityRegions,
55
+ localityGeolocatePath,
56
+ shellSessionAttachPath
57
+ };
@@ -1320,6 +1320,25 @@ function listOffers(request, filter = {}) {
1320
1320
  // ../../packages/capabilities/dist/capabilities/admin-capacity-reservations.js
1321
1321
  import { z as z9 } from "zod";
1322
1322
 
1323
+ // ../../packages/api-client/dist/orchestrator/catalog.js
1324
+ var hardwareCatalogPath = "/v1/orchestrator/catalog/hardware";
1325
+ function getHardwareCatalog(request, signal) {
1326
+ return request(hardwareCatalogPath, {
1327
+ method: "GET",
1328
+ ...signal ? { signal } : {}
1329
+ });
1330
+ }
1331
+
1332
+ // ../../packages/api-client/dist/orchestrator/locality.js
1333
+ var localityGeolocatePath = "/v1/orchestrator/locality/geolocate";
1334
+ function geolocate(request, query3, signal) {
1335
+ const target = query3.ip !== void 0 ? `ip=${encodeURIComponent(query3.ip)}` : `address=${encodeURIComponent(query3.address)}`;
1336
+ return request(`${localityGeolocatePath}?${target}`, {
1337
+ method: "GET",
1338
+ ...signal ? { signal } : {}
1339
+ });
1340
+ }
1341
+
1323
1342
  // ../../packages/capabilities/dist/capabilities/staff-shared.js
1324
1343
  function statusOf(error) {
1325
1344
  if (error && typeof error === "object" && "status" in error) {
@@ -1331,16 +1350,13 @@ function statusOf(error) {
1331
1350
  }
1332
1351
 
1333
1352
  // ../../packages/capabilities/dist/capabilities/locality.js
1334
- var LOCALITY_GEOLOCATE_PATH = "/v1/orchestrator/locality/geolocate";
1335
1353
  async function locateRegion(fetch, place) {
1336
1354
  const address = place.trim();
1337
1355
  if (!address)
1338
1356
  return null;
1339
1357
  let located;
1340
1358
  try {
1341
- located = await fetch(`${LOCALITY_GEOLOCATE_PATH}?address=${encodeURIComponent(address)}`, {
1342
- method: "GET"
1343
- });
1359
+ located = await geolocate(fetch, { address });
1344
1360
  } catch (error) {
1345
1361
  if (statusOf(error) === 404)
1346
1362
  return null;
@@ -1941,7 +1957,6 @@ var commerceMarketCapabilities = [
1941
1957
  import { z as z11 } from "zod";
1942
1958
 
1943
1959
  // ../../packages/capabilities/dist/spec-catalog.js
1944
- var HARDWARE_CATALOG_PATH = "/v1/orchestrator/catalog/hardware";
1945
1960
  var UNRESOLVED_CATALOG_HINT = "Leave this field empty. Only dictionary.csv product names are allowed. Do not ask to add spec-sheet text to the dictionary.";
1946
1961
  var HARDWARE_LISTING_FIELDS = [
1947
1962
  { field: "gpu_type", kind: "gpu" },
@@ -1994,7 +2009,7 @@ function parseHardwareCatalog(payload) {
1994
2009
  return { terms };
1995
2010
  }
1996
2011
  async function loadHardwareCatalog(fetchImpl) {
1997
- return parseHardwareCatalog(await fetchImpl(HARDWARE_CATALOG_PATH, { method: "GET" }));
2012
+ return parseHardwareCatalog(await getHardwareCatalog(fetchImpl));
1998
2013
  }
1999
2014
  var UNKNOWN_GPU = "Unknown GPU";
2000
2015
  function gpuDisplay(terms, slug) {
@@ -5253,7 +5268,7 @@ var listCatalogTermsCapability = defineCapability({
5253
5268
  roles: ["admin"],
5254
5269
  description: "Dump the orchestrator hardware dictionary (display name + aliases). Call once and pick from it. Hardware fields on listings must match a term. Optional kind filter: gpu, cpu, node, or link.",
5255
5270
  mutation: "read",
5256
- http: { method: "GET", path: "/v1/orchestrator/catalog/hardware" },
5271
+ http: { method: "GET", path: hardwareCatalogPath },
5257
5272
  slack: {
5258
5273
  parameters: {
5259
5274
  type: "object",
@@ -8072,15 +8087,10 @@ var LEGACY_CLI_MIGRATIONS = [
8072
8087
  function findLegacyCliMigration(argv) {
8073
8088
  return [...LEGACY_CLI_MIGRATIONS].sort((left, right) => right.legacy.length - left.legacy.length).find((entry) => entry.legacy.every((part, index) => argv[index] === part)) ?? null;
8074
8089
  }
8075
-
8076
- // ../../packages/capabilities/dist/software-catalog.js
8077
- var SOFTWARE_CATALOG_PATH = "/v1/orchestrator/catalog/software";
8078
8090
  export {
8079
8091
  ADMIN_CLI_ROOTS,
8080
8092
  CLI_MIGRATION_GUIDE_URL,
8081
- HARDWARE_CATALOG_PATH,
8082
8093
  LEGACY_CLI_MIGRATIONS,
8083
- SOFTWARE_CATALOG_PATH,
8084
8094
  byCliCommand,
8085
8095
  byMcpName,
8086
8096
  catalog,