luxin-cli 0.2.6 → 0.2.7

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/CHANGELOG.md CHANGED
@@ -6,6 +6,26 @@ provenance; this file is the human- and agent-readable release map.
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.2.7 - 2026-08-12
10
+
11
+ - Release (pricing): the guide's local credit quoting for xAI models moved from
12
+ a `startsWith("xai.grok-imagine-image")` prefix test to an explicit model-id
13
+ list. The prefix test would have priced any Grok Imagine model it had never
14
+ heard of off the 1.x table — for the new `xai.grok-imagine-image-2.0` that
15
+ meant quoting 4 credits for a 10-credit create. Models outside the list now
16
+ defer to the hosted registry's published debit instead of guessing.
17
+ - Adds the `xai.grok-imagine-image-2.0` quality×resolution credit matrix to
18
+ local guide pricing (low/1k through medium/2k), matching the registry the
19
+ hosted API serves since 2026-08-12. Every tier was verified against live
20
+ provider billing before release ($0.04/$0.06/$0.07/$0.08 receipts).
21
+ - The registry behind `models show` grew from 290 to 316 models server-side
22
+ (grok-imagine-image-2.0 create+edit executable and listed; 24 summer-wave
23
+ fal models cataloged with honest tier pricing before they are wired —
24
+ reachable via `models show MODEL_ID`, not yet in the `models list` output,
25
+ which serves executable models only). No CLI change was needed for that —
26
+ noted here because agents read this file to decide whether to upgrade:
27
+ upgrade for the pricing fix, not for model availability.
28
+
9
29
  ## 0.2.6 - 2026-08-09
10
30
 
11
31
  - Release (trust): `create --guide` now says when it cannot price the request it
package/bin/luxin.mjs CHANGED
@@ -15,7 +15,7 @@ import { Readable } from "node:stream";
15
15
  import { pipeline } from "node:stream/promises";
16
16
  import os from "node:os";
17
17
 
18
- const VERSION = "0.2.6";
18
+ const VERSION = "0.2.7";
19
19
  const PACKAGE_NAME = "luxin";
20
20
  const DEFAULT_API_BASE_URL = "https://api.luxin.sh";
21
21
  const DEFAULT_DOCS_BASE_URL = "https://luxin.sh";
@@ -101,12 +101,28 @@ const ACCEPTED_PUBLIC_MEDIA_HOSTS = [
101
101
  // price. These are prices, not costs: the CLI never computes or publishes
102
102
  // provider cost or margin.
103
103
  const XAI_IMAGE_CREDIT_PRICES = {
104
- source_image: { standard: 1 / 3, quality: 5 / 3 },
104
+ source_image: { standard: 1 / 3, quality: 5 / 3, image_2: 5 / 3 },
105
105
  output_image: {
106
106
  standard: 10 / 3,
107
107
  quality: { "1k": 25 / 3, "2k": 35 / 3 },
108
+ image_2: {
109
+ low: { "1k": 20 / 3, "2k": 10 },
110
+ medium: { "1k": 10, "2k": 40 / 3 },
111
+ },
108
112
  },
109
113
  };
114
+ // Mirrors src/credit-pricing.ts XAI_IMAGE_MODEL_IDS. This is an explicit list,
115
+ // not a prefix test: a Grok Imagine image model this CLI has never heard of is
116
+ // priced by the hosted registry's published debit, not by guessing it onto the
117
+ // 1.x price table.
118
+ const XAI_LOCALLY_PRICED_IMAGE_MODEL_IDS = new Set([
119
+ "xai.grok-imagine-image",
120
+ "xai.grok-imagine-image-edit",
121
+ "xai.grok-imagine-image-quality",
122
+ "xai.grok-imagine-image-quality-edit",
123
+ "xai.grok-imagine-image-2.0",
124
+ "xai.grok-imagine-image-2.0-edit",
125
+ ]);
110
126
  const MODALITY_COMMAND_ALIASES = new Map([
111
127
  ["image", { command: "create", intent: null }],
112
128
  ["video", { command: "create", intent: "video" }],
@@ -3039,14 +3055,16 @@ function createGuideAspectRatioCreditPricing(model, context) {
3039
3055
  }
3040
3056
 
3041
3057
  function createGuideCanPriceModelParameters(model) {
3042
- return String(model?.id ?? "").startsWith("xai.grok-imagine-image");
3058
+ return XAI_LOCALLY_PRICED_IMAGE_MODEL_IDS.has(String(model?.id ?? ""));
3043
3059
  }
3044
3060
 
3045
3061
  function createGuideXaiImagePricing(model, modelParameters, context) {
3046
3062
  const modelId = String(model?.id ?? "");
3047
3063
  const quality = modelId.includes("-quality");
3064
+ const image2 = modelId.startsWith("xai.grok-imagine-image-2.0");
3048
3065
  const edit = modelId.endsWith("-edit");
3049
3066
  const resolution = modelParameters?.resolution === "2k" ? "2k" : "1k";
3067
+ const image2Quality = modelParameters?.quality === "low" ? "low" : "medium";
3050
3068
  const outputImageCount =
3051
3069
  Number.isInteger(context?.outputCount) && context.outputCount > 0
3052
3070
  ? context.outputCount
@@ -3057,12 +3075,16 @@ function createGuideXaiImagePricing(model, modelParameters, context) {
3057
3075
  ? context.referenceAssetCount
3058
3076
  : 0;
3059
3077
  const sourceImageCount = edit ? 1 + referenceAssetCount : 0;
3060
- const sourceCredits = quality
3061
- ? XAI_IMAGE_CREDIT_PRICES.source_image.quality
3062
- : XAI_IMAGE_CREDIT_PRICES.source_image.standard;
3063
- const outputCredits = quality
3064
- ? XAI_IMAGE_CREDIT_PRICES.output_image.quality[resolution]
3065
- : XAI_IMAGE_CREDIT_PRICES.output_image.standard;
3078
+ const sourceCredits = image2
3079
+ ? XAI_IMAGE_CREDIT_PRICES.source_image.image_2
3080
+ : quality
3081
+ ? XAI_IMAGE_CREDIT_PRICES.source_image.quality
3082
+ : XAI_IMAGE_CREDIT_PRICES.source_image.standard;
3083
+ const outputCredits = image2
3084
+ ? XAI_IMAGE_CREDIT_PRICES.output_image.image_2[image2Quality][resolution]
3085
+ : quality
3086
+ ? XAI_IMAGE_CREDIT_PRICES.output_image.quality[resolution]
3087
+ : XAI_IMAGE_CREDIT_PRICES.output_image.standard;
3066
3088
  const creditsRequired = Math.max(
3067
3089
  1,
3068
3090
  Math.ceil(
@@ -3075,8 +3097,14 @@ function createGuideXaiImagePricing(model, modelParameters, context) {
3075
3097
  modelParameters?.resolution === undefined ||
3076
3098
  modelParameters?.resolution === null ||
3077
3099
  modelParameters?.resolution === "1k";
3100
+ const defaultQuality =
3101
+ !image2 ||
3102
+ modelParameters?.quality === undefined ||
3103
+ modelParameters?.quality === null ||
3104
+ modelParameters?.quality === "medium";
3078
3105
  const defaultShape =
3079
3106
  defaultResolution &&
3107
+ defaultQuality &&
3080
3108
  outputImageCount === 1 &&
3081
3109
  sourceImageCount === (edit ? 1 : 0);
3082
3110
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luxin-cli",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Image generation, image editing, video, audio, and image-to-3D for agents, with no API key to obtain first. The agent signs itself up, starts on free preview credits, and gets hosted media URLs, recoverable jobs, and cost receipts.",
5
5
  "type": "module",
6
6
  "private": false,