@ornncompute/cli 1.0.312 → 1.0.314

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
@@ -188,8 +188,8 @@ Reuse the key and payload on retries. This booking command requires an eligible
188
188
  human terminal.
189
189
 
190
190
  For exact-node delivery off the market, `ornn admin reservations direct-delivery`
191
- accepts a draft primary listing's Reserved term, every attached
192
- node UUID, a named organization, and the reservation window. Reuse the supplied
191
+ accepts a draft primary listing's Reserved term, one or more selected attached
192
+ node UUIDs, a named organization, and the reservation window. Reuse the supplied
193
193
  transaction UUID with the same inputs on retries. Use `--format json` for
194
194
  automation. See the [staff command reference](../../docs/cli.md#staff-namespace).
195
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.312",
3
+ "version": "1.0.314",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,20 +1,35 @@
1
1
  // ../../packages/api-client/dist/inference/index.js
2
+ var inferenceApiTypes = [
3
+ "chat_completions",
4
+ "responses",
5
+ "messages",
6
+ "decisions"
7
+ ];
2
8
  function listModels(request, signal) {
3
9
  return request("/v1/inference/models", { method: "GET", signal });
4
10
  }
5
- function postInference(fetcher, path6, body2, signal) {
11
+ function listInferenceListings(request, query3 = {}, signal) {
12
+ return request(`/v1/inference/listings${queryString(query3)}`, {
13
+ method: "GET",
14
+ signal
15
+ });
16
+ }
17
+ function postInference(fetcher, path6, body2, listingId2, signal) {
6
18
  return fetcher(path6, {
7
19
  method: "POST",
8
- headers: { "Content-Type": "application/json" },
20
+ headers: {
21
+ "Content-Type": "application/json",
22
+ "X-Ornn-Listing-Id": listingId2
23
+ },
9
24
  body: JSON.stringify(body2),
10
25
  signal
11
26
  });
12
27
  }
13
- function createChatCompletion(fetcher, body2, signal) {
14
- return postInference(fetcher, "/v1/inference/chat/completions", body2, signal);
28
+ function createChatCompletion(fetcher, body2, listingId2, signal) {
29
+ return postInference(fetcher, "/v1/inference/chat/completions", body2, listingId2, signal);
15
30
  }
16
- function createDecision(fetcher, body2, signal) {
17
- return postInference(fetcher, "/v1/inference/decisions", body2, signal);
31
+ function createDecision(fetcher, body2, listingId2, signal) {
32
+ return postInference(fetcher, "/v1/inference/decisions", body2, listingId2, signal);
18
33
  }
19
34
  function queryString(query3) {
20
35
  const params = new URLSearchParams();
@@ -165,6 +180,7 @@ var rates = {
165
180
  };
166
181
  var createListing = z2.strictObject({
167
182
  public_model_id: text,
183
+ api_type: z2.enum(inferenceApiTypes).optional(),
168
184
  upstream_url: text,
169
185
  upstream_model: text,
170
186
  upstream_credential: z2.string().nullable().optional(),
@@ -279,26 +295,34 @@ var chargeUsage = "[--public-model-id ID] [--request-id UUID] [--from TIME --to
279
295
  var inferenceCapabilities = [
280
296
  operation({
281
297
  command: ["models", "list"],
282
- description: "List available inference models and their token prices in USD per million tokens.",
298
+ description: "List available public inference model IDs.",
283
299
  input: z2.strictObject({}),
284
300
  execute: (ctx) => listModels(ctx.fetch)
285
301
  }),
302
+ operation({
303
+ command: ["listings", "list"],
304
+ description: "List active inference offers with their API format and token prices.",
305
+ input: z2.strictObject({ public_model_id: text.optional() }),
306
+ usage: "[--public-model-id ID]",
307
+ execute: (ctx, input) => listInferenceListings(ctx.fetch, input)
308
+ }),
286
309
  operation({
287
310
  command: ["completions", "create"],
288
311
  description: "Call an inference model using a Chat Completions body. Generation parameters pass through unchanged. Spends the organization's credits; returns the upstream JSON response. MCP uses non-streaming responses.",
289
- input: z2.strictObject({ body: completionBody }),
312
+ input: z2.strictObject({ listing_id: z2.uuid(), body: completionBody }),
290
313
  mcpInput: z2.strictObject({
314
+ listing_id: z2.uuid(),
291
315
  body: completionBody.extend({ stream: z2.literal(false).nullable().optional() })
292
316
  }),
293
- usage: "--body JSON",
317
+ usage: "--body JSON --listing-id UUID",
294
318
  write: true,
295
- execute: async (ctx, { body: body2 }) => {
319
+ execute: async (ctx, { body: body2, listing_id }) => {
296
320
  if (body2.stream && ctx.cli?.interaction?.format !== "human") {
297
321
  throw new Error("Streaming returns raw SSE. Use --format human in the CLI, or stream=false in MCP.");
298
322
  }
299
323
  if (!ctx.fetchResponse)
300
324
  throw new Error("This client does not support completion responses.");
301
- const response = await createChatCompletion(ctx.fetchResponse, body2);
325
+ const response = await createChatCompletion(ctx.fetchResponse, body2, listing_id);
302
326
  return body2.stream ? response : response.json();
303
327
  }
304
328
  }),
@@ -306,18 +330,19 @@ var inferenceCapabilities = [
306
330
  command: ["decisions", "create"],
307
331
  description: "Ask questions about input using a Decisions model. Returns the provider's answers and spends the organization's credits at the listing's rates.",
308
332
  input: z2.strictObject({
333
+ listing_id: z2.uuid(),
309
334
  body: z2.looseObject({
310
335
  model: text,
311
336
  input: z2.union([z2.string(), z2.array(z2.looseObject({}))]),
312
337
  questions: z2.array(z2.looseObject({}))
313
338
  })
314
339
  }),
315
- usage: "--body JSON",
340
+ usage: "--body JSON --listing-id UUID",
316
341
  write: true,
317
- execute: async (ctx, { body: body2 }) => {
342
+ execute: async (ctx, { body: body2, listing_id }) => {
318
343
  if (!ctx.fetchResponse)
319
344
  throw new Error("This client does not support decision responses.");
320
- const response = await createDecision(ctx.fetchResponse, body2);
345
+ const response = await createDecision(ctx.fetchResponse, body2, listing_id);
321
346
  return response.json();
322
347
  }
323
348
  }),
@@ -374,7 +399,11 @@ var inferenceCapabilities = [
374
399
  command: [...staff ? [] : ["provider"], "models", "update"],
375
400
  staff,
376
401
  description: "Update an inference listing's endpoint, token prices, credential, or active flag. Send only changed fields; null clears a nullable value.",
377
- input: listingId.extend({ body: updateListing }),
402
+ input: listingId.extend({
403
+ body: staff ? updateListing.extend({
404
+ public_model_id: text.optional()
405
+ }) : updateListing
406
+ }),
378
407
  usage: "--listing-id UUID --body JSON",
379
408
  write: true,
380
409
  execute: (ctx, { listing_id, body: body2 }) => staff ? updateStaffInferenceListing(ctx.fetch, listing_id, body2) : updateProviderInferenceListing(ctx.fetch, listing_id, body2)
@@ -2654,7 +2683,7 @@ var adminReservationsCreateCapability = defineCapability({
2654
2683
  var directDeliveryInput = z11.strictObject({
2655
2684
  organizationId: z11.uuid().describe("The customer organization receiving the reservation."),
2656
2685
  listingTermId: z11.uuid().describe("A non-renewable Reserved term on the draft primary listing."),
2657
- nodeIds: z11.array(z11.uuid()).min(1).max(5e3).describe("Every attached node ID on the draft."),
2686
+ nodeIds: z11.array(z11.uuid()).min(1).max(5e3).describe("One or more selected node IDs attached to the draft listing."),
2658
2687
  startsAt: wholeSecondInstant.describe("RFC 3339 start in whole seconds, with a timezone."),
2659
2688
  endsAt: wholeSecondInstant.describe("RFC 3339 end in whole seconds, within the term's duration."),
2660
2689
  transactionId: z11.uuid().describe("A caller-generated UUID. Reuse it on retry with the same input."),
@@ -2671,11 +2700,11 @@ var adminReservationDirectDeliveryCapability = defineCapability({
2671
2700
  id: directDeliveryCapabilityId,
2672
2701
  domain: "reservations",
2673
2702
  roles: ["admin"],
2674
- description: "Reserve exact nodes for a customer off the market. Use a draft primary VM or Bare Metal listing with every selected node attached and a non-renewable Reserved term. Creates the reservation immediately, even with a future start. Reuse the transactionId and inputs after an uncertain response. Returns the saved reservation.",
2703
+ description: "Reserve one or more selected nodes for a customer off the market. Use attached nodes from a draft primary VM or Bare Metal listing and a non-renewable Reserved term. Other nodes on the same draft can serve separate reservations. Creates the reservation immediately, even with a future start. Reuse the transactionId and inputs after an uncertain response. Returns the saved reservation.",
2675
2704
  mutation: "preview-confirm",
2676
2705
  cli: {
2677
2706
  command: ["admin", "reservations", "direct-delivery"],
2678
- vnext: adminHelp("Reserve exact nodes for a customer off the market.", "ornn admin reservations direct-delivery --organization-id UUID --listing-term-id UUID --node-ids JSON --starts-at TIME --ends-at TIME --transaction-id UUID [--vm-disk-id UUID]", "Use --format json. Supply all node UUIDs as a JSON array and reuse --transaction-id with the same inputs when retrying.")
2707
+ vnext: adminHelp("Reserve exact nodes for a customer off the market.", "ornn admin reservations direct-delivery --organization-id UUID --listing-term-id UUID --node-ids JSON --starts-at TIME --ends-at TIME --transaction-id UUID [--vm-disk-id UUID]", "Use --format json. Supply the selected node UUIDs as a JSON array, including for one node. Reuse --transaction-id with the same inputs when retrying.")
2679
2708
  },
2680
2709
  slack: false,
2681
2710
  input: directDeliveryInput,