@ornncompute/cli 1.0.175 → 1.0.177

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
@@ -190,6 +190,28 @@ ornn admin capacity-offers
190
190
  ornn admin reservations
191
191
  ```
192
192
 
193
+ Supplier networking is available under the existing supplier root:
194
+
195
+ ```text
196
+ ornn admin suppliers connections list | show | create
197
+ ornn admin suppliers gateways register | regions | create | show
198
+ ```
199
+
200
+ **gateways register** saves an existing Supplier Jump Host and its connection
201
+ config. It takes `--supplier`, `--name`, `--address`, optional `--ssh-port` (22)
202
+ and `--ssh-username` (`admin`); it provisions no VM. Use **connections list** with
203
+ `--gateway` to find the saved connection ID for enrollment. **connections create**
204
+ saves NetBird or reverse-SSH settings; **gateways create** explicitly provisions
205
+ its billable gateway in the chosen supported region. **gateways show** reports
206
+ creation status, and `--retry` on create explicitly retries a failed attempt.
207
+ These operations execute directly with the staff session on the native
208
+ `/v1/orchestrator/supplier-*` gateway routes; they add no owner API or staff alias.
209
+ Lists preserve the owner's `next_cursor` as `--cursor` and do not auto-paginate.
210
+ Examples and retry guidance live in the
211
+ [staff CLI reference](../../docs/cli.md#supplier-connections-and-jump-hosts).
212
+ Enrollment help links to these commands. Setup does not change the enrollment
213
+ API or automatically select a connection for another enrollment command.
214
+
193
215
  Every `ornn admin` command, read or mutation, requires an admin session.
194
216
  `ornn admin users list` and `ornn admin organizations list` search the
195
217
  Authorization directory by person name, email, or company name, with bounded `--limit` and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.175",
3
+ "version": "1.0.177",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,3 +1,4 @@
1
+ import { adminSupplierNetworkingHandlers } from "./admin-supplier-networking.mjs";
1
2
  import { adminSshHandlers } from "./admin-ssh.mjs";
2
3
  import { adminCapacityReservationHandlers } from "./admin-capacity-reservations.mjs";
3
4
  import { adminCreditHandlers } from "./admin-credits.mjs";
@@ -8,6 +9,7 @@ import { adminNodeSanitizeHandlers } from "./admin-node-sanitize.mjs";
8
9
  import { ADMIN_MUTATION_SAFETY, assertAdminMutationContext } from "./admin-mutations.mjs";
9
10
 
10
11
  const handlers = [
12
+ ...adminSupplierNetworkingHandlers,
11
13
  ...adminSshHandlers,
12
14
  ...adminCapacityReservationHandlers,
13
15
  ...adminCreditHandlers,
@@ -0,0 +1,37 @@
1
+ import { ADMIN_MUTATION_SAFETY, AdminMutationError } from "./admin-mutations.mjs";
2
+ import { parseSemanticArguments } from "./interaction-runtime.mjs";
3
+
4
+ function parse(argv, capability) {
5
+ const { $positionals, ...options } = parseSemanticArguments(argv);
6
+ if ($positionals.length) throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}`);
7
+ const aliases = { supplier: "organization_id", gateway: "gateway_id", cursor: "after" };
8
+ const input = {};
9
+ for (const [option, value] of Object.entries(options)) {
10
+ const field =
11
+ aliases[option] ?? option.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
12
+ if (Object.hasOwn(input, field)) throw new AdminMutationError(`Supply ${field} only once.`);
13
+ input[field] = ["limit", "ssh_port"].includes(field) ? Number(value) : value;
14
+ }
15
+ const parsed = capability.input.safeParse(input);
16
+ if (!parsed.success)
17
+ throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}\n${parsed.error.message}`);
18
+ return { input: parsed.data };
19
+ }
20
+
21
+ async function run({ execute, input }) {
22
+ return {
23
+ data: await execute(input),
24
+ exitCode: 0,
25
+ outcome: { class: "ready", phase: "complete" },
26
+ };
27
+ }
28
+
29
+ export const adminSupplierNetworkingHandlers = [
30
+ "supplier-connection.list",
31
+ "supplier-connection.get",
32
+ "supplier-connection.create",
33
+ "supplier-gateway.register",
34
+ "supplier-gateway.regions",
35
+ "supplier-gateway.create",
36
+ "supplier-gateway.get",
37
+ ].map((capabilityId) => ({ capabilityId, parse, run, safety: ADMIN_MUTATION_SAFETY.direct }));
@@ -761,13 +761,24 @@ function parseCapabilityInput(capability, rawInput) {
761
761
  }
762
762
 
763
763
  // Native Commerce and Markets routes authenticate the caller at the gateway.
764
- // Commerce's /internal/v1 routes additionally require staff.
765
- const DIRECT_GATEWAY_PREFIXES = ["/commerce", "/internal/v1", "/v1/markets"];
764
+ // Commerce's /internal/v1 routes additionally require staff. Supplier networking
765
+ // retains its native supplier/staff policy after the CLI staff preflight.
766
+ const DIRECT_GATEWAY_PREFIXES = [
767
+ "/commerce",
768
+ "/internal/v1",
769
+ "/v1/markets",
770
+ "/v1/orchestrator/supplier-connection-configs",
771
+ "/v1/orchestrator/supplier-gateways",
772
+ ];
773
+ const DIRECT_GATEWAY_PATHS = new Set(["/v1/orchestrator/supplier-gateway-regions"]);
766
774
 
767
775
  function isDirectGatewayPath(path) {
768
776
  const pathname = String(path).split("?")[0];
769
- return DIRECT_GATEWAY_PREFIXES.some(
770
- (prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)
777
+ return (
778
+ DIRECT_GATEWAY_PATHS.has(pathname) ||
779
+ DIRECT_GATEWAY_PREFIXES.some(
780
+ (prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)
781
+ )
771
782
  );
772
783
  }
773
784
 
@@ -20,6 +20,7 @@ const BOOLEAN_OPTIONS = new Set([
20
20
  "read-only",
21
21
  "read-write",
22
22
  "recursive",
23
+ "retry",
23
24
  "tenant-access-revoked",
24
25
  "wait",
25
26
  ]);
@@ -306,19 +306,6 @@ function setBillingPaymentMethod(request, input, idempotencyKey) {
306
306
  headers: { "Idempotency-Key": idempotencyKey }
307
307
  });
308
308
  }
309
- function getInferenceWallet(request, organizationId, signal) {
310
- return request(`/commerce/billing/inference/${encodeURIComponent(organizationId)}`, {
311
- method: "GET",
312
- signal
313
- });
314
- }
315
- function activateInferenceWallet(request, organizationId, input, idempotencyKey) {
316
- return request(`/commerce/billing/inference/${encodeURIComponent(organizationId)}/activate`, {
317
- method: "POST",
318
- body: input,
319
- headers: { "Idempotency-Key": idempotencyKey }
320
- });
321
- }
322
309
  function getStorageAgreement(request, signal) {
323
310
  return request("/commerce/billing/storage-agreements", {
324
311
  method: "GET",
@@ -1065,7 +1052,6 @@ function updateGTMDealDiligence(request, dealId, input) {
1065
1052
  });
1066
1053
  }
1067
1054
  export {
1068
- activateInferenceWallet,
1069
1055
  activateReservation,
1070
1056
  addCapacityTerms,
1071
1057
  addReservationNodes,
@@ -1144,7 +1130,6 @@ export {
1144
1130
  getGTMDealDiligence,
1145
1131
  getGTMPersonalWorkspace,
1146
1132
  getGTMTicket,
1147
- getInferenceWallet,
1148
1133
  getMarketOutlook,
1149
1134
  getReservation,
1150
1135
  getReservationHour,