@ornncompute/cli 1.0.426 → 1.0.428

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.426",
3
+ "version": "1.0.428",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -287,9 +287,8 @@ var createListing = z2.strictObject({
287
287
  upstream_credential: z2.string().nullable().optional(),
288
288
  ...rates
289
289
  });
290
- var updateListing = createListing.omit({ public_model_id: true }).partial().extend({
291
- active: z2.boolean().optional()
292
- });
290
+ var listingChanges = createListing.partial();
291
+ var providerListingStatusHelp = "Set active to false to disable your listing. Only Ornn staff can publish it.";
293
292
  var requests = z2.strictObject({
294
293
  request_id: z2.uuid().optional(),
295
294
  public_model_id: text.optional(),
@@ -488,7 +487,7 @@ var inferenceCapabilities = [
488
487
  }),
489
488
  operation({
490
489
  command: ["charges", "list"],
491
- description: "Read recorded inference charges. Use view=provider for this provider's earnings; summary=daily returns daily and per-model totals for providers. Amounts are exact decimal strings in USD cents. Unaccounted requests have no receipt; pass next_cursor as cursor.",
490
+ description: "Read your organization's recorded inference charges. Use summary=daily for daily and per-model totals. Use view=provider for provider earnings. Amounts are exact decimal strings in USD cents. Pass next_cursor as cursor for itemized receipts.",
492
491
  input: charges,
493
492
  usage: `${chargeUsage} [--view provider]`,
494
493
  execute: readCharges
@@ -527,21 +526,29 @@ var inferenceCapabilities = [
527
526
  usage: "--body JSON",
528
527
  write: true,
529
528
  execute: (ctx, { body: body2 }) => staff ? createStaffInferenceListing(ctx.fetch, body2) : createProviderInferenceListing(ctx.fetch, body2)
530
- }),
531
- operation({
532
- command: [...staff ? [] : ["provider"], "listings", "update"],
533
- staff,
534
- description: "Update an inference listing. Send only changed fields. Set a nullable field to null to clear it.",
535
- input: listingId.extend({
536
- body: staff ? updateListing.extend({
537
- public_model_id: text.optional()
538
- }) : updateListing
539
- }),
540
- usage: "--listing-id UUID --body JSON",
541
- write: true,
542
- execute: (ctx, { listing_id, body: body2 }) => staff ? updateStaffInferenceListing(ctx.fetch, listing_id, body2) : updateProviderInferenceListing(ctx.fetch, listing_id, body2)
543
529
  })
544
530
  ]),
531
+ operation({
532
+ command: ["provider", "listings", "update"],
533
+ description: `Update your inference listing. Send only changed fields and use null to clear nullable fields. ${providerListingStatusHelp}`,
534
+ input: listingId.extend({
535
+ body: listingChanges.omit({ public_model_id: true }).extend({
536
+ active: z2.literal(false, { error: providerListingStatusHelp }).optional()
537
+ })
538
+ }),
539
+ usage: "--listing-id UUID --body JSON",
540
+ write: true,
541
+ execute: (ctx, { listing_id, body: body2 }) => updateProviderInferenceListing(ctx.fetch, listing_id, body2)
542
+ }),
543
+ operation({
544
+ command: ["listings", "update"],
545
+ staff: true,
546
+ description: "Update an inference listing. Send only changed fields. Set a nullable field to null to clear it.",
547
+ input: listingId.extend({ body: listingChanges.extend({ active: z2.boolean().optional() }) }),
548
+ usage: "--listing-id UUID --body JSON",
549
+ write: true,
550
+ execute: (ctx, { listing_id, body: body2 }) => updateStaffInferenceListing(ctx.fetch, listing_id, body2)
551
+ }),
545
552
  operation({
546
553
  command: ["fees", "show"],
547
554
  staff: true,
@@ -5140,6 +5147,8 @@ import { z as z22 } from "zod";
5140
5147
 
5141
5148
  // ../../packages/capabilities/dist/ledger-amount.js
5142
5149
  function parsePostingCents(value) {
5150
+ if (value == null)
5151
+ return null;
5143
5152
  if (typeof value === "number" && !Number.isSafeInteger(value))
5144
5153
  return null;
5145
5154
  const match = /^(-?\d+)(?:\.(\d+))?$/.exec(String(value));