johns-harness 2026.9.40 → 2026.10.12
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 +22 -0
- package/README.md +1 -1
- package/dist/auth-profiles-5CHn7vq1.js +1 -1
- package/dist/config-koj5M_EO.js +1 -1
- package/dist/daemon-cli.js +1 -1
- package/dist/image-generate.js +109 -35
- package/dist/model-selection-BGlGpPgM.js +1 -1
- package/dist/model-selection-BU6wl1le.js +1 -1
- package/dist/model-selection-L7RMwsG-.js +1 -1
- package/dist/plugin-sdk/config-4Fgm-yEH.js +1 -1
- package/dist/plugin-sdk/config-Di-lyCdh.js +1 -1
- package/dist/plugin-sdk/discord.js +1 -1
- package/dist/plugin-sdk/model-auth-CX9cPHdC.js +1 -1
- package/dist/plugin-sdk/model-auth-Ciehz0x5.js +1 -1
- package/dist/plugin-sdk/model-auth-DVyo6JSX.js +1 -1
- package/dist/plugin-sdk/model-auth-kiHYHGrs.js +1 -1
- package/dist/plugin-sdk/model-selection-Dbj4jDYM.js +1 -1
- package/docs/MODELS.md +18 -0
- package/docs/PATCHES.md +24 -0
- package/models/models.json +19 -4
- package/node_modules/@mariozechner/pi-ai/dist/models.generated.js +7 -0
- package/package.json +1 -1
- package/scripts/check-models-master.mjs +10 -1
- package/scripts/models-sync.mjs +52 -1
- package/vendor/patched-deps/@mariozechner/pi-ai/dist/models.generated.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.10.12
|
|
4
|
+
|
|
5
|
+
Five image models that were already callable but missing from the catalog (sources checked 2026-10-12). All are image-only (`chat: false`) and reached through `image_generate`; no chat model, chat alias or chat default changed.
|
|
6
|
+
|
|
7
|
+
- **GPT Image 2.5 Sunburst** (`gpt-image-2.5-sunburst`) and **GPT Image 2.5 Flare** (`gpt-image-2.5-flare`), released 2026-09-08, on `openai-codex` (ChatGPT subscription, $0) and `openai` (API key). Shared official rate card: text input $5, cached text $1.25, image input $8, cached image $2, image output $30 per MTok (Batch image output $15); text output not billed; per-image cost depends on size and quality. Token limits and knowledge cutoff are not published (card limits N/A). Quality adds `xhigh` and `max`; custom sizes such as `1536x864` (multiples of 16, ratio 1:3 to 3:1, longest edge 3840, 655,360 to 8,294,400 pixels; above 2560x1440 experimental). <https://developers.openai.com/api/docs/models/gpt-image-2.5-sunburst>, <https://developers.openai.com/api/docs/models/gpt-image-2.5-flare>, <https://developers.openai.com/api/docs/guides/image-generation>
|
|
8
|
+
- **xAI Grok Imagine Image 2.0** (`xai/grok-imagine-image-2.0`) with a new native xAI transport: JSON generation and editing on `api.x.ai/v1/images/*` (not OpenAI multipart), up to 5 source images, quality `low`/`medium`/`auto`, resolution `1K`/`2K`, xAI's aspect ratios, no masks, 64,000 character prompt limit. Billed per image: $0.01 per input image; output 1K low $0.04, 2K low $0.06, 1K medium $0.06, 2K medium $0.08 (auto = low for generation, medium for edits). <https://docs.x.ai/developers/models/grok-imagine-image-2.0>, <https://docs.x.ai/developers/model-capabilities/images/generation>, <https://docs.x.ai/developers/model-capabilities/images/editing>, <https://docs.x.ai/developers/rest-api-reference/inference/images>
|
|
9
|
+
- **Nano Banana Pro GA** (`google/gemini-3-pro-image`, GA 2026-05-28): $2/MTok input, $12 text/thinking and $120 image output ($0.134 per 1K/2K image, $0.24 per 4K), 1K/2K/4K, 131,072/32,768 tokens (API value; the model page says 65,536/32,768). <https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image>, <https://ai.google.dev/gemini-api/docs/pricing#gemini-3-pro-image>
|
|
10
|
+
- **Nano Banana 2 Lite** (`google/gemini-3.1-flash-lite-image`, GA 2026-06-30): $0.25/MTok input, $1.50 text and $30 image output ($0.0336 per 1K image), 1K only, 65,536/65,536 tokens (API value; the page says 65,536/4,096). A sibling, not a successor: `nano-banana` stays on 2.1. <https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite-image>, <https://ai.google.dev/gemini-api/docs/pricing#gemini-3.1-flash-lite-image>
|
|
11
|
+
- **Aliases**: `image` (and new `image-sunburst`) -> `openai-codex/gpt-image-2.5-sunburst`; `image-flare` -> `openai-codex/gpt-image-2.5-flare`; `image2` keeps `openai-codex/gpt-image-2`; `nano-banana-pro` -> GA `google/gemini-3-pro-image`, the preview stays on `nano-banana-pro-preview`; new `nano-banana-lite` and `grok-image`. `nano-banana`/`banana` unchanged (Nano Banana 2.1).
|
|
12
|
+
- **Default image chain is subscription only**: `openai-codex/gpt-image-2.5-sunburst`, then `openai-codex/gpt-image-2`. The implicit `openai/gpt-image-2` API-key fallback is removed, so a default call never bills an API key; an explicit `model` or `agents.defaults.imageGenerationModel` still reaches any provider.
|
|
13
|
+
- `image_generate` validates quality, size, aspect ratio, resolution, input count, masks and prompt length per model from `models/models.json` (`harness.image`), re-validates each fallback candidate (skipping one that can't honour the request instead of sending it a bad one), refuses unknown providers instead of sending them to api.openai.com, and types images by their bytes (xAI rejects a JPEG labeled PNG).
|
|
14
|
+
- Live (2026-10-12) through the repo's `image_generate`: subscription Sunburst `xhigh` and Flare `max` HTTP 200 with the API-key provider blocked; Nano Banana Pro GA and Lite generation HTTP 200; xAI generation HTTP 200 and edit HTTP 200. No paid OpenAI API call was made.
|
|
15
|
+
- Roll back with `npm i -g johns-harness@2026.9.41`.
|
|
16
|
+
|
|
17
|
+
## 2026.9.41
|
|
18
|
+
|
|
19
|
+
- `nano-banana` and `banana` now mean Nano Banana 2.1 (`google/gemini-nano-banana-2.1`, GA 2026-10-06), in `/model` and in `image_generate`. Google's model card puts it ahead of Nano Banana Pro on every image eval (Overall Preference Elo 1050 thinking vs 935 for Pro; General Editing 1026 vs 939), and it costs about a third as much: $30/MTok image output, about $0.034 per 1K image plus thinking tokens at $7.50/MTok (about $0.045 all-in at the default thinking level in the live run), vs $0.134 for Pro. Google deprecated `gemini-3.1-flash-image` (Nano Banana 2) in its favor. Nano Banana Pro (`google/gemini-3-pro-image-preview`) stays reachable as `nano-banana-pro`. The default image chain is unchanged: `openai-codex/gpt-image-2` (subscription), then `openai/gpt-image-2`; Nano Banana is still opt-in with `model: "nano-banana"`.
|
|
20
|
+
- `image_generate` additions for Nano Banana: `imageSize` (`1K` default, `2K`, `4K`; `generationConfig.imageConfig.imageSize`), up to 14 reference images per call with a Google model (the OpenAI path stays at 4), and the 2.1 panoramic aspect ratios `1:4`, `4:1`, `1:8`, `8:1`.
|
|
21
|
+
- The image tool's alias table is now generated from `models/models.json` (`JOHNNESS_MODELS_MASTER:BEGIN image aliases` in `dist/image-generate.js`): every shipped alias whose target is an image generation model also resolves in `image_generate`, so moving `nano-banana` is one edit to the master. `models-sync` covers 38 files; `check-models-master.mjs` and verifier 83.7-83.8 check the tool against the master.
|
|
22
|
+
- Live through the shipped tool (2026-10-11): a `model: "nano-banana"` 16:9 generation returned HTTP 200 and a 1376x768 JPEG from `gemini-nano-banana-2.1` (1,120 image tokens), and an edit of that image returned HTTP 200 with the composition kept and the requested on-screen text rendered.
|
|
23
|
+
- Roll back with `npm i -g johns-harness@2026.9.40`.
|
|
24
|
+
|
|
3
25
|
## 2026.9.40
|
|
4
26
|
|
|
5
27
|
- Claude Haiku 5.5 (`anthropic/claude-haiku-5-5`, GA 2026-10-07) is first-class. Card (docs.claude.com/docs/en/models/haiku-5-5/overview, pricing, effort and thinking pages, release notes, and `GET /v1/models/claude-haiku-5-5`, checked 2026-10-08): 1M context (the harness uses the full native window), 128K max output, text + image input, adaptive thinking on by default (default effort `medium`, thinking display omitted), effort `low` through `max`, knowledge cutoff Jun 2026, newer tokenizer (about 30% more tokens than Haiku 4.5). Manual thinking (`thinking.type: "enabled"` / `budget_tokens`) and any non-default `temperature`/`top_p`/`top_k` return 400.
|
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Expired ChatGPT credentials trigger an owner notice with the `/login` recovery c
|
|
|
55
55
|
|
|
56
56
|
<!-- JOHNNESS_PATCH_DEFAULTS_61 -->
|
|
57
57
|
### Batteries included
|
|
58
|
-
The harness ships the current model catalog and the short aliases `opus`, `sonnet`, `fable`, `astra`, `sol`, `luna`, `terra`, `gpt`, `grok`, `flash`, `banana`, `image`, `deepseek`, `deepseek-pro`, `muse`, and `gemini-lite`, so `/model opus` works on a fresh install with no `models.providers` block. Channels you configure load without a `plugins.allow` list; only an explicit `enabled: false` or `plugins.deny` turns one off. Updating the harness updates the catalog and aliases for every agent. Any `openai-codex/<model>` primary that hits its ChatGPT usage limit fails over to `openai/<model>` on the API key first, then to your configured fallbacks, with no config (the sibling is skipped when no OpenAI API key is present). Image generation and editing
|
|
58
|
+
The harness ships the current model catalog and the short aliases `opus`, `sonnet`, `fable`, `astra`, `sol`, `luna`, `terra`, `gpt`, `grok`, `flash`, `banana`, `image`, `deepseek`, `deepseek-pro`, `muse`, and `gemini-lite`, so `/model opus` works on a fresh install with no `models.providers` block. Channels you configure load without a `plugins.allow` list; only an explicit `enabled: false` or `plugins.deny` turns one off. Updating the harness updates the catalog and aliases for every agent. Any `openai-codex/<model>` primary that hits its ChatGPT usage limit fails over to `openai/<model>` on the API key first, then to your configured fallbacks, with no config (the sibling is skipped when no OpenAI API key is present). Image generation and editing go through the `image_generate` tool. The default chain is subscription only: GPT Image 2.5 Sunburst (`openai-codex/gpt-image-2.5-sunburst`, alias `image`) on the ChatGPT subscription, then GPT Image 2 on the subscription (`image2`); API-key image models are never an implicit fallback, only an explicit `model` or `agents.defaults.imageGenerationModel`. Also selectable: GPT Image 2.5 Flare (`image-flare`), Nano Banana 2.1 (`google/gemini-nano-banana-2.1`, `nano-banana`/`banana`, `aspectRatio`, `imageSize` 1K/2K/4K, up to 14 reference images), Nano Banana Pro GA (`google/gemini-3-pro-image`, `nano-banana-pro`; the preview stays on `nano-banana-pro-preview`), Nano Banana 2 Lite (`nano-banana-lite`, 1K only) and xAI Grok Imagine Image 2.0 (`grok-image`, native xAI JSON generation and editing). GPT Image 2.5 adds `quality` `xhigh`/`max` and custom sizes; per-model rules come from `models/models.json`.
|
|
59
59
|
|
|
60
60
|
**The alias contract.** Every shipped alias points at the newest model in its line, so an install or an `/update` moves every agent forward with zero per-instance config. Your own `agents.defaults.models[*].alias` entries are still consulted first and still win. Every catalog bump must move the matching alias; the verifier fails the release if it does not. `/model deepseek` always selects the newest DeepSeek model (currently V4.1 Flash); `deepseek-pro` the newest Pro.
|
|
61
61
|
|
|
@@ -5157,7 +5157,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
5157
5157
|
grok46: "xai/grok-4.6"
|
|
5158
5158
|
});
|
|
5159
5159
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
5160
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
5160
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
5161
5161
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5162
5162
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5163
5163
|
const DEFAULT_MODEL_COST = {
|
package/dist/config-koj5M_EO.js
CHANGED
|
@@ -1852,7 +1852,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1852
1852
|
grok46: "xai/grok-4.6"
|
|
1853
1853
|
});
|
|
1854
1854
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1855
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
1855
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
1856
1856
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1857
1857
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1858
1858
|
const DEFAULT_MODEL_COST = {
|
package/dist/daemon-cli.js
CHANGED
|
@@ -5004,7 +5004,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
5004
5004
|
grok46: "xai/grok-4.6"
|
|
5005
5005
|
});
|
|
5006
5006
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
5007
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
5007
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
5008
5008
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5009
5009
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5010
5010
|
const DEFAULT_MODEL_COST = {
|
package/dist/image-generate.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// JOHNNESS_PATCH_GPT_IMAGE_62
|
|
3
3
|
// First-class `image_generate` agent tool: OpenAI Images API (generations when no input
|
|
4
4
|
// image, edits when one is given) with the model from `agents.defaults.imageGenerationModel`.
|
|
5
|
-
// Default
|
|
6
|
-
//
|
|
5
|
+
// Default: subscription Sunburst, older subscription fallback. Paid API providers are explicit only.
|
|
6
|
+
// Models, aliases, image-specific wire rules and defaults come from models/models.json.
|
|
7
7
|
// A provider that rejects the request as unsupported (404/405/501, 429 usage limit, or no
|
|
8
8
|
// credentials) yields to the next entry; the result names the provider that served it.
|
|
9
9
|
// Output is written as PNG under <workspace>/media/generated and the path is returned so the
|
|
@@ -13,35 +13,59 @@ import fs from "node:fs/promises";
|
|
|
13
13
|
import path from "node:path";
|
|
14
14
|
import { Type } from "@sinclair/typebox";
|
|
15
15
|
|
|
16
|
+
/* JOHNNESS_MODELS_MASTER:BEGIN image runtime (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
17
|
+
export const IMAGE_MODEL_RULES = Object.freeze({"google/gemini-3-pro-image":{"transport":"google","imageSizes":["1K","2K","4K"],"aspectRatios":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"maxImages":14,"mask":false},"google/gemini-3.1-flash-lite-image":{"transport":"google","imageSizes":["1K"],"aspectRatios":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"maxImages":14,"mask":false},"openai/gpt-image-2.5-sunburst":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true},"openai/gpt-image-2.5-flare":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true},"openai-codex/gpt-image-2.5-sunburst":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true},"openai-codex/gpt-image-2.5-flare":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true},"xai/grok-imagine-image-2.0":{"transport":"xai","qualities":["low","medium","auto"],"imageSizes":["1K","2K"],"aspectRatios":["auto","1:1","16:9","9:16","4:3","3:4","3:2","2:3","2:1","1:2","19.5:9","9:19.5","20:9","9:20","21:9","5:2"],"maxImages":5,"maxPromptLength":64000,"mask":false}});
|
|
18
|
+
export const IMAGE_GENERATION_DEFAULT = Object.freeze({"primary":"openai-codex/gpt-image-2.5-sunburst","fallbacks":["openai-codex/gpt-image-2"]});
|
|
19
|
+
/* JOHNNESS_MODELS_MASTER:END */
|
|
16
20
|
export const DEFAULT_IMAGE_GENERATION_MODEL = Object.freeze({
|
|
17
|
-
primary:
|
|
18
|
-
fallbacks: Object.freeze([
|
|
21
|
+
primary: IMAGE_GENERATION_DEFAULT.primary,
|
|
22
|
+
fallbacks: Object.freeze([...IMAGE_GENERATION_DEFAULT.fallbacks]),
|
|
19
23
|
});
|
|
20
24
|
export const IMAGE_GENERATION_MODEL_ID = "gpt-image-2";
|
|
21
25
|
const OPENAI_BASE = "https://api.openai.com/v1";
|
|
26
|
+
export const XAI_BASE = "https://api.x.ai/v1";
|
|
22
27
|
const CODEX_BASE = "https://chatgpt.com/backend-api/codex";
|
|
23
28
|
const SIZES = new Set(["1024x1024", "1536x1024", "1024x1536", "auto"]);
|
|
24
29
|
const DEFAULT_MAX_INPUT_BYTES = 20 * 1024 * 1024;
|
|
25
30
|
const JWT_CLAIM_PATH = "https://api.openai.com/auth";
|
|
26
31
|
|
|
27
|
-
// JOHNNESS_PATCH_NANO_BANANA_63:
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
32
|
+
// JOHNNESS_PATCH_NANO_BANANA_63: Gemini image models (Nano Banana) are selectable, not a
|
|
33
|
+
// default. The default chain stays subscription-only; Gemini is API-key billed,
|
|
34
|
+
// so it is reached only through the tool's
|
|
35
|
+
// `model` param or agents.defaults.imageGenerationModel.
|
|
36
|
+
// Since 2026.9.41 `nano-banana`/`banana` mean Nano Banana 2.1 (google/gemini-nano-banana-2.1,
|
|
37
|
+
// GA 2026-10-06, ahead of Pro on Google's evals); Nano Banana Pro stays reachable as
|
|
38
|
+
// `nano-banana-pro`.
|
|
31
39
|
export const GOOGLE_BASE = "https://generativelanguage.googleapis.com/v1beta";
|
|
32
|
-
export const NANO_BANANA_MODEL_ID = "gemini-
|
|
40
|
+
export const NANO_BANANA_MODEL_ID = "gemini-nano-banana-2.1";
|
|
33
41
|
export const NANO_BANANA_REF = `google/${NANO_BANANA_MODEL_ID}`;
|
|
34
|
-
|
|
35
|
-
export const
|
|
36
|
-
/**
|
|
37
|
-
|
|
42
|
+
export const NANO_BANANA_PRO_MODEL_ID = "gemini-3-pro-image";
|
|
43
|
+
export const NANO_BANANA_PRO_REF = `google/${NANO_BANANA_PRO_MODEL_ID}`;
|
|
44
|
+
/** Aspect ratios the Gemini image models accept. 1:4, 4:1, 1:8 and 8:1 are Nano Banana 2.1 only.
|
|
45
|
+
* Ignored by the OpenAI providers, which use `size`. */
|
|
46
|
+
export const ASPECT_RATIOS = Object.freeze(["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9", "1:4", "4:1", "1:8", "8:1"]);
|
|
47
|
+
/** Gemini output resolutions (generationConfig.imageConfig.imageSize). Ignored by the OpenAI providers. */
|
|
48
|
+
export const IMAGE_SIZES = Object.freeze(["1K", "2K", "4K"]);
|
|
49
|
+
/** Input images per call: the OpenAI Images edits limit, and Nano Banana's reference-image limit. */
|
|
50
|
+
export const MAX_INPUT_IMAGES = 4;
|
|
51
|
+
export const MAX_GOOGLE_INPUT_IMAGES = 14;
|
|
52
|
+
// Bare names the `model` param accepts, resolved to catalog refs before provider routing. The
|
|
53
|
+
// hand-written entries are the fallback; the generated block below copies every image alias from
|
|
54
|
+
// models/models.json over them, so moving `nano-banana` is one edit to the master.
|
|
55
|
+
const IMAGE_MODEL_ALIAS_TABLE = {
|
|
38
56
|
"nano-banana": NANO_BANANA_REF,
|
|
39
57
|
banana: NANO_BANANA_REF,
|
|
40
|
-
"nano-banana-pro":
|
|
41
|
-
"gemini-
|
|
58
|
+
"nano-banana-pro": NANO_BANANA_PRO_REF,
|
|
59
|
+
"gemini-nano-banana-2.1": NANO_BANANA_REF,
|
|
60
|
+
"gemini-3-pro-image": NANO_BANANA_PRO_REF,
|
|
61
|
+
"gemini-3-pro-image-preview": "google/gemini-3-pro-image-preview",
|
|
42
62
|
image: "openai-codex/gpt-image-2",
|
|
43
63
|
"gpt-image-2": "openai-codex/gpt-image-2",
|
|
44
|
-
}
|
|
64
|
+
};
|
|
65
|
+
/* JOHNNESS_MODELS_MASTER:BEGIN image aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
66
|
+
for (const [alias, ref] of Object.entries({"banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2"})) IMAGE_MODEL_ALIAS_TABLE[alias] = ref;
|
|
67
|
+
/* JOHNNESS_MODELS_MASTER:END */
|
|
68
|
+
export const IMAGE_MODEL_ALIASES = Object.freeze(IMAGE_MODEL_ALIAS_TABLE);
|
|
45
69
|
|
|
46
70
|
/** Resolve an alias or a provider/model ref to a full provider/model ref. */
|
|
47
71
|
export function resolveImageModelRef(raw) {
|
|
@@ -103,7 +127,8 @@ export function buildProviderRequest({ provider, apiKey, edit, userAgent = "john
|
|
|
103
127
|
headers: { Authorization: `Bearer ${apiKey}`, "chatgpt-account-id": accountId, originator: "pi", "User-Agent": userAgent },
|
|
104
128
|
};
|
|
105
129
|
}
|
|
106
|
-
|
|
130
|
+
if (!["openai", "xai"].includes(provider)) throw new Error(`Unsupported image provider ${provider}`);
|
|
131
|
+
return { url: `${provider === "xai" ? XAI_BASE : OPENAI_BASE}/images/${edit ? "edits" : "generations"}`, headers: { Authorization: `Bearer ${apiKey}` } };
|
|
107
132
|
}
|
|
108
133
|
|
|
109
134
|
export class ProviderUnsupported extends Error {
|
|
@@ -160,32 +185,62 @@ export function extensionForMimeType(mimeType) {
|
|
|
160
185
|
return "png";
|
|
161
186
|
}
|
|
162
187
|
|
|
188
|
+
export function imageRulesFor(ref) { return IMAGE_MODEL_RULES[ref] ?? {}; }
|
|
189
|
+
|
|
190
|
+
/** Image MIME type from the magic bytes (PNG, JPEG, WebP, GIF); `fallback` when unrecognised.
|
|
191
|
+
* xAI rejects a data URI whose declared type disagrees with its bytes ("Invalid base64-encoded image"),
|
|
192
|
+
* and xAI/Gemini return JPEG, so neither the request nor the written extension trusts a label alone. */
|
|
193
|
+
export function sniffImageMimeType(buffer, fallback = "image/png") {
|
|
194
|
+
const b = buffer ? Buffer.from(buffer) : Buffer.alloc(0);
|
|
195
|
+
if (b.length >= 8 && b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47) return "image/png";
|
|
196
|
+
if (b.length >= 3 && b[0] === 0xff && b[1] === 0xd8 && b[2] === 0xff) return "image/jpeg";
|
|
197
|
+
if (b.length >= 12 && b.toString("ascii", 0, 4) === "RIFF" && b.toString("ascii", 8, 12) === "WEBP") return "image/webp";
|
|
198
|
+
if (b.length >= 6 && b.toString("ascii", 0, 4) === "GIF8") return "image/gif";
|
|
199
|
+
return fallback;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function validCustomSize(size) {
|
|
203
|
+
const match = /^(\d+)x(\d+)$/.exec(size);
|
|
204
|
+
if (!match) return false;
|
|
205
|
+
const [width, height] = match.slice(1).map(Number);
|
|
206
|
+
return width > 0 && height > 0 && width % 16 === 0 && height % 16 === 0 && Math.max(width, height) <= 3840 && Math.max(width, height) / Math.min(width, height) <= 3 && width * height >= 655360 && width * height <= 8294400;
|
|
207
|
+
}
|
|
208
|
+
|
|
163
209
|
export function validateParams(args) {
|
|
164
210
|
const record = args && typeof args === "object" ? args : {};
|
|
165
211
|
const prompt = typeof record.prompt === "string" ? record.prompt.trim() : "";
|
|
166
212
|
if (!prompt) throw new Error("prompt required");
|
|
213
|
+
const model = typeof record.model === "string" && record.model.trim() ? resolveImageModelRef(record.model) : void 0;
|
|
214
|
+
const rules = imageRulesFor(model ?? DEFAULT_IMAGE_GENERATION_MODEL.primary);
|
|
167
215
|
const inputs = [];
|
|
168
216
|
if (typeof record.image === "string" && record.image.trim()) inputs.push(record.image.trim());
|
|
169
217
|
if (Array.isArray(record.images)) for (const v of record.images) if (typeof v === "string" && v.trim()) inputs.push(v.trim());
|
|
170
|
-
|
|
218
|
+
const maxInputs = rules.maxImages ?? (model?.startsWith("google/") ? MAX_GOOGLE_INPUT_IMAGES : MAX_INPUT_IMAGES);
|
|
219
|
+
if (inputs.length > maxInputs) throw new Error(`at most ${maxInputs} input images`);
|
|
171
220
|
const mask = typeof record.mask === "string" && record.mask.trim() ? record.mask.trim() : void 0;
|
|
172
221
|
if (mask && inputs.length === 0) throw new Error("mask requires an input image");
|
|
222
|
+
if (mask && rules.mask === false) throw new Error(`${model} does not support masks`);
|
|
173
223
|
const size = typeof record.size === "string" && record.size.trim() ? record.size.trim() : "auto";
|
|
174
|
-
if (!SIZES.has(size)) throw new Error(`size must be one of ${[...SIZES].join(", ")}`);
|
|
224
|
+
if (!SIZES.has(size) && !(rules.customSizes && validCustomSize(size))) throw new Error(`size must be one of ${[...SIZES].join(", ")}, or a supported custom size for GPT Image 2.5 (multiples of16, edges<=3840, ratio<=3, pixels655360..8294400)`);
|
|
175
225
|
const countRaw = typeof record.count === "number" ? Math.floor(record.count) : 1;
|
|
176
226
|
if (!Number.isFinite(countRaw) || countRaw < 1 || countRaw > 4) throw new Error("count must be 1..4");
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
const
|
|
227
|
+
const qualities = rules.qualities ?? ["low", "medium", "high", "auto"];
|
|
228
|
+
if (record.quality !== undefined && !qualities.includes(record.quality)) throw new Error(`quality for ${model ?? DEFAULT_IMAGE_GENERATION_MODEL.primary} must be ${qualities.join("|")}`);
|
|
229
|
+
const quality = typeof record.quality === "string" ? record.quality : void 0;
|
|
180
230
|
const aspectRatio = typeof record.aspectRatio === "string" && record.aspectRatio.trim() ? record.aspectRatio.trim() : void 0;
|
|
181
|
-
|
|
182
|
-
|
|
231
|
+
const ratios = rules.aspectRatios ?? ASPECT_RATIOS;
|
|
232
|
+
if (aspectRatio && !ratios.includes(aspectRatio)) throw new Error(`aspectRatio must be one of ${ratios.join(", ")}`);
|
|
233
|
+
const imageSize = typeof record.imageSize === "string" && record.imageSize.trim() ? record.imageSize.trim().toUpperCase() : void 0;
|
|
234
|
+
const resolutions = rules.imageSizes ?? IMAGE_SIZES;
|
|
235
|
+
if (imageSize && !resolutions.includes(imageSize)) throw new Error(`imageSize must be one of ${resolutions.join(", ")}`);
|
|
236
|
+
if (rules.maxPromptLength && [...prompt].length > rules.maxPromptLength) throw new Error(`prompt exceeds ${rules.maxPromptLength} characters`);
|
|
237
|
+
return { prompt, inputs, mask, size, count: countRaw, quality, aspectRatio, imageSize, output: typeof record.output === "string" ? record.output : void 0, model };
|
|
183
238
|
}
|
|
184
239
|
|
|
185
240
|
/**
|
|
186
241
|
* JOHNNESS_PATCH_NANO_BANANA_63: Gemini generateContent branch.
|
|
187
242
|
* Generations send the prompt alone; edits send the prompt plus one inlineData part per input
|
|
188
|
-
* image. `aspectRatio`
|
|
243
|
+
* image. `aspectRatio` and `imageSize` ride generationConfig.imageConfig. Failure classification is shared with
|
|
189
244
|
* the OpenAI branches (isUnsupportedStatus) so fallback chaining behaves identically.
|
|
190
245
|
*/
|
|
191
246
|
async function callGoogleProvider({ candidate, apiKey, params, images, fetchImpl, userAgent }) {
|
|
@@ -195,6 +250,7 @@ async function callGoogleProvider({ candidate, apiKey, params, images, fetchImpl
|
|
|
195
250
|
for (const img of images) parts.push({ inlineData: { mimeType: img.mimeType, data: Buffer.from(img.buffer).toString("base64") } });
|
|
196
251
|
const generationConfig = { responseModalities: ["IMAGE"] };
|
|
197
252
|
if (params.aspectRatio) generationConfig.imageConfig = { aspectRatio: params.aspectRatio };
|
|
253
|
+
if (params.imageSize) generationConfig.imageConfig = { ...generationConfig.imageConfig, imageSize: params.imageSize };
|
|
198
254
|
const res = await fetchImpl(url, { method: "POST", headers, body: JSON.stringify({ contents: [{ role: "user", parts }], generationConfig }) });
|
|
199
255
|
const text = await res.text();
|
|
200
256
|
if (!res.ok) {
|
|
@@ -228,7 +284,12 @@ async function callProvider({ candidate, apiKey, params, images, mask, fetchImpl
|
|
|
228
284
|
const edit = images.length > 0;
|
|
229
285
|
const { url, headers } = buildProviderRequest({ provider: candidate.provider, apiKey, edit, userAgent, model: candidate.model });
|
|
230
286
|
let body;
|
|
231
|
-
if (
|
|
287
|
+
if (candidate.provider === "xai") {
|
|
288
|
+
if (mask) throw new Error("xAI image editing does not support masks");
|
|
289
|
+
headers["content-type"] = "application/json";
|
|
290
|
+
const sources = images.map(img => ({ url: `data:${sniffImageMimeType(img.buffer, img.mimeType)};base64,${Buffer.from(img.buffer).toString("base64")}`, type: "image_url" }));
|
|
291
|
+
body = JSON.stringify({ model: candidate.model, prompt: params.prompt, n: params.count, response_format: "b64_json", quality: params.quality ?? "auto", resolution: (params.imageSize ?? "1K").toLowerCase(), ...(params.aspectRatio ? { aspect_ratio: params.aspectRatio } : {}), ...(sources.length === 1 ? { image: sources[0] } : sources.length > 1 ? { images: sources } : {}) });
|
|
292
|
+
} else if (edit) {
|
|
232
293
|
body = new FormData();
|
|
233
294
|
body.set("model", candidate.model);
|
|
234
295
|
body.set("prompt", params.prompt);
|
|
@@ -264,7 +325,7 @@ async function callProvider({ candidate, apiKey, params, images, mask, fetchImpl
|
|
|
264
325
|
}
|
|
265
326
|
}
|
|
266
327
|
if (buffers.length === 0) throw new Error(`${candidate.provider}: response carried no image data`);
|
|
267
|
-
return { buffers, usage: json?.usage ?? null, mode: edit ? "edit" : "generate", mimeType: "image/png" };
|
|
328
|
+
return { buffers, usage: json?.usage ?? null, mode: edit ? "edit" : "generate", mimeType: sniffImageMimeType(buffers[0], typeof data[0]?.mime_type === "string" ? data[0].mime_type : "image/png") };
|
|
268
329
|
}
|
|
269
330
|
|
|
270
331
|
/**
|
|
@@ -284,8 +345,17 @@ export async function generateWithFallback({ cfg, params, images, mask, resolveA
|
|
|
284
345
|
attempts.push({ provider: candidate.provider, skipped: `auth: ${redact(error?.message ?? error)}` });
|
|
285
346
|
continue;
|
|
286
347
|
}
|
|
348
|
+
// Each candidate's master rules (qualities, sizes, ratios, masks, input count) apply to its own
|
|
349
|
+
// request; a fallback that cannot honour the parameters is skipped, never sent a bad request.
|
|
350
|
+
let perCandidate;
|
|
351
|
+
try {
|
|
352
|
+
perCandidate = validateParams({ ...params, model: candidate.ref, images: images.map((_, i) => `input-${i}`), mask: mask ? "mask" : undefined });
|
|
353
|
+
} catch (error) {
|
|
354
|
+
attempts.push({ provider: candidate.provider, skipped: `params: ${redact(error?.message ?? error)}` });
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
287
357
|
try {
|
|
288
|
-
const result = await callProvider({ candidate, apiKey, params, images, mask, fetchImpl, userAgent });
|
|
358
|
+
const result = await callProvider({ candidate, apiKey, params: perCandidate, images, mask, fetchImpl, userAgent });
|
|
289
359
|
return { provider: candidate.provider, model: candidate.model, ...result, attempts };
|
|
290
360
|
} catch (error) {
|
|
291
361
|
if (error instanceof ProviderUnsupported) {
|
|
@@ -313,21 +383,25 @@ export function createImageGenerateTool(options, deps) {
|
|
|
313
383
|
return {
|
|
314
384
|
label: "Image Generate",
|
|
315
385
|
name: "image_generate",
|
|
316
|
-
description: "Generate or edit images with GPT Image 2 (default
|
|
386
|
+
description: "Generate or edit images with GPT Image 2.5 (subscription Sunburst default, GPT Image 2 subscription fallback), xAI Grok Imagine 2.0 (grok-image), Nano Banana 2.1 (nano-banana), Nano Banana Pro (nano-banana-pro) or Lite (nano-banana-lite). Give a prompt; add image (or images, up to 4, up to5 with xAI, or up to14 with Nano Banana) to edit, and an optional mask PNG. Writes image files under the workspace media/generated folder and returns their paths; send them with the message tool.",
|
|
317
387
|
parameters: Type.Object({
|
|
318
388
|
prompt: Type.String({ description: "What to draw or how to change the input image." }),
|
|
319
389
|
image: Type.Optional(Type.String({ description: "Input image path to edit (workspace or allowed local root)." })),
|
|
320
|
-
images: Type.Optional(Type.Array(Type.String(), { description: "Multiple input images to edit together (
|
|
390
|
+
images: Type.Optional(Type.Array(Type.String(), { description: "Multiple input images to edit together (OpenAI4, xAI5, Google14)." })),
|
|
321
391
|
mask: Type.Optional(Type.String({ description: "PNG mask path; transparent areas are edited." })),
|
|
322
|
-
size: Type.Optional(Type.String({ description: "1024x1024, 1536x1024, 1024x1536, or
|
|
392
|
+
size: Type.Optional(Type.String({ description: "1024x1024, 1536x1024, 1024x1536, auto, or GPT Image2.5 custom size: multiples of16, ratio<=3, edges<=3840, pixels655360..8294400." })),
|
|
323
393
|
count: Type.Optional(Type.Number({ description: "Number of images, 1..4 (default 1)." })),
|
|
324
|
-
quality: Type.Optional(Type.String({ description: "low, medium, high,
|
|
394
|
+
quality: Type.Optional(Type.String({ description: "GPT Image2.5: low, medium, high, xhigh, max, auto. Older GPT Image: low/medium/high/auto. xAI: low/medium/auto." })),
|
|
325
395
|
output: Type.Optional(Type.String({ description: "Output path inside the workspace (default media/generated/gpt-image-<timestamp>.png)." })),
|
|
326
|
-
model: Type.Optional(Type.String({ description: "Override provider/model, for example openai/gpt-image-2, or an alias: nano-banana (Nano Banana Pro), banana, image." })),
|
|
327
|
-
aspectRatio: Type.Optional(Type.String({ description: "
|
|
396
|
+
model: Type.Optional(Type.String({ description: "Override provider/model, for example openai/gpt-image-2, or an alias: nano-banana or banana (Nano Banana 2.1), nano-banana-pro (GA Pro), nano-banana-pro-preview, nano-banana-lite, grok-image, image/image-sunburst (subscription Sunburst), image-flare, image2 (older subscription)." })),
|
|
397
|
+
aspectRatio: Type.Optional(Type.String({ description: "Google/xAI: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, or 21:9; Nano Banana 2.1 also takes 1:4, 4:1, 1:8 and 8:1. Ignored by the GPT Image 2 providers." })),
|
|
398
|
+
imageSize: Type.Optional(Type.String({ description: "Google/xAI output resolution:1K (default),2K,4K. Lite only1K; xAI1K/2K. Ignored by the GPT Image 2 providers, which use size." })),
|
|
328
399
|
}),
|
|
329
400
|
execute: async (_toolCallId, args) => {
|
|
330
|
-
const
|
|
401
|
+
const explicit = args?.model;
|
|
402
|
+
const selected = explicit ?? listImageGenerationCandidates(options?.config)[0]?.ref;
|
|
403
|
+
const params = validateParams({ ...args, model: selected });
|
|
404
|
+
if (!explicit) params.model = undefined;
|
|
331
405
|
const maxBytes = deps.maxInputBytes ?? DEFAULT_MAX_INPUT_BYTES;
|
|
332
406
|
const load = async (ref) => {
|
|
333
407
|
const raw = ref.startsWith("@") ? ref.slice(1).trim() : ref;
|
|
@@ -1709,7 +1709,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1709
1709
|
grok46: "xai/grok-4.6"
|
|
1710
1710
|
});
|
|
1711
1711
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1712
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
1712
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
1713
1713
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1714
1714
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1715
1715
|
const DEFAULT_MODEL_COST = {
|
|
@@ -1684,7 +1684,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1684
1684
|
grok46: "xai/grok-4.6"
|
|
1685
1685
|
});
|
|
1686
1686
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1687
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
1687
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
1688
1688
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1689
1689
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1690
1690
|
const DEFAULT_MODEL_COST = {
|
|
@@ -1615,7 +1615,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1615
1615
|
grok46: "xai/grok-4.6"
|
|
1616
1616
|
});
|
|
1617
1617
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1618
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
1618
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
1619
1619
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1620
1620
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1621
1621
|
const DEFAULT_MODEL_COST = {
|
|
@@ -7102,7 +7102,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
7102
7102
|
grok46: "xai/grok-4.6"
|
|
7103
7103
|
});
|
|
7104
7104
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
7105
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
7105
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
7106
7106
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
7107
7107
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
7108
7108
|
const DEFAULT_MODEL_COST = {
|
|
@@ -8103,7 +8103,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
8103
8103
|
grok46: "xai/grok-4.6"
|
|
8104
8104
|
});
|
|
8105
8105
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
8106
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
8106
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
8107
8107
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
8108
8108
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
8109
8109
|
const DEFAULT_MODEL_COST = {
|
|
@@ -5232,7 +5232,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
5232
5232
|
grok46: "xai/grok-4.6"
|
|
5233
5233
|
});
|
|
5234
5234
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
5235
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
5235
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
5236
5236
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5237
5237
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5238
5238
|
const DEFAULT_MODEL_COST = {
|
|
@@ -6023,7 +6023,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
6023
6023
|
grok46: "xai/grok-4.6"
|
|
6024
6024
|
});
|
|
6025
6025
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
6026
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
6026
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
6027
6027
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
6028
6028
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
6029
6029
|
const DEFAULT_MODEL_COST = {
|
|
@@ -4992,7 +4992,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
4992
4992
|
grok46: "xai/grok-4.6"
|
|
4993
4993
|
});
|
|
4994
4994
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
4995
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
4995
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
4996
4996
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
4997
4997
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
4998
4998
|
const DEFAULT_MODEL_COST = {
|
|
@@ -4996,7 +4996,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
4996
4996
|
grok46: "xai/grok-4.6"
|
|
4997
4997
|
});
|
|
4998
4998
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
4999
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
4999
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
5000
5000
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5001
5001
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5002
5002
|
const DEFAULT_MODEL_COST = {
|
|
@@ -4996,7 +4996,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
4996
4996
|
grok46: "xai/grok-4.6"
|
|
4997
4997
|
});
|
|
4998
4998
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
4999
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
4999
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
5000
5000
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5001
5001
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5002
5002
|
const DEFAULT_MODEL_COST = {
|
|
@@ -4805,7 +4805,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
4805
4805
|
grok46: "xai/grok-4.6"
|
|
4806
4806
|
});
|
|
4807
4807
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
4808
|
-
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-3-pro-image
|
|
4808
|
+
const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image":"openai-codex/gpt-image-2.5-sunburst","image-sunburst":"openai-codex/gpt-image-2.5-sunburst","image-flare":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-1","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-5.6-terra","grok":"xai/grok-4.7"};
|
|
4809
4809
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
4810
4810
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
4811
4811
|
const DEFAULT_MODEL_COST = {
|
package/docs/MODELS.md
CHANGED
|
@@ -17,6 +17,8 @@ versioned alias (`aliases`). `scripts/models-sync.mjs` generates every copy in t
|
|
|
17
17
|
| Anthropic adaptive thinking, effort, thinking-off and temperature rules (`anthropic rules` block) | `providers/anthropic.js` (vendor + installed) |
|
|
18
18
|
| `DEFAULT_MODEL_ALIASES` (the shipped alias table) | 14 bundles (`model-selection-*`, `config-*`, `model-auth-*`, `auth-profiles-*`, `daemon-cli`, `discord`) |
|
|
19
19
|
| `XHIGH_MODEL_REFS` (`/think xhigh` gate) | 12 `thinking-*` copies plus the Telegram and Mattermost bundles |
|
|
20
|
+
| Image aliases (every alias whose target has `imageGeneration: true`: `image`, `image2`, `image-flare`, `nano-banana`, `nano-banana-pro`, `nano-banana-lite`, `grok-image`, ...) | `dist/image-generate.js` (the `image_generate` tool's `model` param) |
|
|
21
|
+
| Image wire rules (`harness.image`: transport, qualities, sizes, ratios, max inputs, prompt length, mask) and the default chain (`imageGenerationDefault`) | `dist/image-generate.js` (`image runtime` block: `IMAGE_MODEL_RULES`, `IMAGE_GENERATION_DEFAULT`) |
|
|
20
22
|
|
|
21
23
|
Generated code sits between `/* JOHNNESS_MODELS_MASTER:BEGIN ... */` and `/* JOHNNESS_MODELS_MASTER:END */`
|
|
22
24
|
markers. Never edit inside them. The older hand-written literals stay in place byte for byte
|
|
@@ -44,6 +46,22 @@ markers. Never edit inside them. The older hand-written literals stay in place b
|
|
|
44
46
|
setting them (Claude Haiku 5.5, 2026-10-08, was the first user).
|
|
45
47
|
- `cost` is flat. When a model's official price is tiered (for example by prompt length), use the
|
|
46
48
|
base tier and write the other tier in `harness.notes` and the CHANGELOG.
|
|
49
|
+
- Image models (`imageGeneration: true`, `chat: false`) are reached through `image_generate`. Point a
|
|
50
|
+
plain alias in `aliases` at one (`nano-banana` -> Nano Banana 2.1 since 2026.9.41) and the sync
|
|
51
|
+
copies it into the tool's alias table; when an alias moves, keep the old model on a versioned
|
|
52
|
+
alias (`nano-banana-pro`).
|
|
53
|
+
- Image wire rules live on the entry as `harness.image` (since 2026.10.12): `transport`
|
|
54
|
+
(`openai` for openai/openai-codex, `google`, `xai`; must match the serving provider), and optional
|
|
55
|
+
`qualities`, `imageSizes`, `aspectRatios`, `maxImages`, `maxPromptLength` (characters), `mask`,
|
|
56
|
+
`customSizes`. `image_generate` validates every request, and every fallback candidate, against
|
|
57
|
+
them. A provider with no transport in `dist/image-generate.js` cannot be registered: build the
|
|
58
|
+
transport there first (xAI got its native JSON branch in 2026.10.12).
|
|
59
|
+
- `imageGenerationDefault` is the default `image_generate` chain. Keep it subscription only
|
|
60
|
+
(`openai-codex/...`): John's API keys are billed, so a paid model is reached only when named.
|
|
61
|
+
- Image-only cards whose token limits are not published use `contextWindow`/`maxTokens: null`
|
|
62
|
+
(N/A), with the reason in `harness.notes` and the source in `harness.source`; the validator
|
|
63
|
+
refuses null on anything else. The generated catalog omits the keys (shipped code reads them
|
|
64
|
+
as optional numbers). Never invent a token window from a character or pixel limit.
|
|
47
65
|
- Shorthands move by themselves: a `latest` rule points its alias at the highest version in the
|
|
48
66
|
line. If a shorthand moved, add a versioned alias for the model it left (for example `sol6`),
|
|
49
67
|
or the sync refuses to run.
|
package/docs/PATCHES.md
CHANGED
|
@@ -2888,3 +2888,27 @@ John's rule: model updates are one change to one master file. `models/models.jso
|
|
|
2888
2888
|
- **Aliases.** `sol` and `gpt` -> `openai-codex/gpt-6.1-sol`; new `sol6` -> `openai-codex/gpt-6-sol`; `sol56`, `luna`, `luna56`, `astra` unchanged. `gpt-6.1-luna` is not on the API (`model_not_found` on 2026-09-29), so `luna` stays on GPT-6 Luna.
|
|
2889
2889
|
- Verifier 83.1-83.6 check the tree against the master; `tests/models-master.test.mjs` does the same from the master (no per-model strings).
|
|
2890
2890
|
- Roll back with `npm i -g johns-harness@2026.9.37`.
|
|
2891
|
+
|
|
2892
|
+
### Nano Banana 2.1 as `nano-banana` (2026.9.41)
|
|
2893
|
+
|
|
2894
|
+
John's call (2026-10-11): Nano Banana 2.1 is better than Pro, so the shorthand should point at it. Sources checked 2026-10-11: <https://ai.google.dev/gemini-api/docs/models/gemini-nano-banana-2.1>, the image generation guide, `/pricing`, `/changelog` (GA 2026-10-06; `gemini-3.1-flash-image` deprecated, migrate to `gemini-nano-banana-2.1`), `/deprecations` and the DeepMind model card <https://deepmind.google/models/model-cards/nano-banana-2-1/> (Overall Preference Elo 1050 thinking / 1015 no thinking vs 935 for Gemini 3 Pro Image; Pro trails on every listed T2I and editing eval). `GET /v1beta/models/gemini-nano-banana-2.1` still reports 65,536 / 65,536 tokens (the model page says 131,072 / 32,768); the card limits stay on the API values from 2026.9.39.
|
|
2895
|
+
|
|
2896
|
+
- **Aliases** (master `aliases`): `nano-banana`, `banana` -> `google/gemini-nano-banana-2.1`; new `nano-banana-pro` -> `google/gemini-3-pro-image-preview`. `image` unchanged.
|
|
2897
|
+
- **image_generate**: `NANO_BANANA_MODEL_ID` is now `gemini-nano-banana-2.1`; `NANO_BANANA_PRO_MODEL_ID`/`NANO_BANANA_PRO_REF` name Pro. The hand-written alias table is followed by a generated `image aliases` block (models-sync target 38) that copies every shipped alias whose target has `imageGeneration: true`. New `imageSize` param (`1K`/`2K`/`4K` on `generationConfig.imageConfig.imageSize`), up to 14 input images when the model is a Google one (4 otherwise), and aspect ratios `1:4`, `4:1`, `1:8`, `8:1`. Default chain unchanged (GPT Image 2, subscription first); Google stays opt-in.
|
|
2898
|
+
- **Checks**: `check-models-master.mjs` loads the tool and compares its aliases with the master; verifier 83.7 (generated block present) and 83.8 (resolution, default chain, imageSize, 14 refs). `tests/nano-banana-catalog.test.mjs` covers the new defaults, Pro routing, imageSize, 14 references, panoramic ratios and master/tool agreement; its alias loader now reads through the generated master block.
|
|
2899
|
+
- **Live (2026-10-11)**, real Gemini API through the repo's `image_generate`: generation (`model: "nano-banana"`, 16:9) HTTP 200, 1376x768 JPEG, 1,120 image tokens + 1,294 thought tokens; edit of that image HTTP 200, composition kept, requested on-screen text legible.
|
|
2900
|
+
- Roll back with `npm i -g johns-harness@2026.9.40`.
|
|
2901
|
+
|
|
2902
|
+
## 84 - image models from the master (2026-10-12, 2026.10.12)
|
|
2903
|
+
|
|
2904
|
+
The 2026-10-12 detection (`/tmp/detect-20261012/REPORT.md`) found five callable image models missing from the master. All five are integrated through `models/models.json` + `models-sync.mjs` only; `dist/image-generate.js` (the family 62/63 custom entrypoint, copied whole by both patchers) carries the transport. Sources checked 2026-10-12.
|
|
2905
|
+
|
|
2906
|
+
- **GPT Image 2.5 Sunburst / Flare** (`gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, released 2026-09-08) on `openai` and `openai-codex`. <https://developers.openai.com/api/docs/models/gpt-image-2.5-sunburst>, <https://developers.openai.com/api/docs/models/gpt-image-2.5-flare>, <https://developers.openai.com/api/docs/guides/image-generation>. Shared rate card: text input $5, cached text $1.25, image input $8, cached image $2, image output $30 per MTok (Batch image output $15). Token limits and cutoff unpublished (null/N/A). Quality low/medium/high/xhigh/max/auto; custom sizes (multiples of 16, ratio 1:3..3:1, edge <= 3840, 655,360..8,294,400 px). Codex subscription: live 200 for Sunburst xhigh and Flare max with every non-subscription endpoint and the API-key provider blocked.
|
|
2907
|
+
- **xAI Grok Imagine Image 2.0** (`xai/grok-imagine-image-2.0`, api `xai-images`). <https://docs.x.ai/developers/models/grok-imagine-image-2.0>, `/model-capabilities/images/generation`, `/editing`, `/multi-image-editing`, `/rest-api-reference/inference/images`. Per image: $0.01 per input image; output 1K low $0.04, 2K low $0.06, 1K medium $0.06, 2K medium $0.08 (card also lists 1.5K). New native transport: `https://api.x.ai/v1/images/{generations,edits}`, JSON body only (`response_format: b64_json`, `quality`, lowercase `resolution`, `aspect_ratio`, `image` / `images` data URIs typed by magic bytes); masks rejected; 64,000 character prompt limit kept as `maxPromptLength`, not a token window. Live: generation 200 and edit 200 (the first edit 400 "Invalid base64-encoded image" was a JPEG labeled PNG; fixed by sniffing).
|
|
2908
|
+
- **Nano Banana Pro GA** (`google/gemini-3-pro-image`, GA 2026-05-28) and **Nano Banana 2 Lite** (`google/gemini-3.1-flash-lite-image`, GA 2026-06-30). Pro: $2 in, $12 text/thinking out, $120 image out per MTok ($0.134 per 1K/2K, $0.24 per 4K); API-native 131,072/32,768 over the page's 65,536/32,768. Lite: $0.25 in, $1.50 text out, $30 image out ($0.0336 per 1K), 1K only; API 65,536/65,536 over the page's 65,536/4,096. Both live 200.
|
|
2909
|
+
- **Aliases**: `image`, `image-sunburst` -> `openai-codex/gpt-image-2.5-sunburst`; `image-flare` -> `openai-codex/gpt-image-2.5-flare`; `image2` -> `openai-codex/gpt-image-2`; `nano-banana-pro` -> GA; `nano-banana-pro-preview` -> preview; `nano-banana-lite`; `grok-image`. `nano-banana`/`banana` unchanged (2.1). No chat alias or default changed.
|
|
2910
|
+
- **Default chain**: master `imageGenerationDefault` = Sunburst then GPT Image 2, both `openai-codex`. The old implicit `openai/gpt-image-2` paid fallback is gone; explicit config keeps working.
|
|
2911
|
+
- **Master layer**: `harness.image` per-model rules and `imageGenerationDefault` generate the `image runtime` block (target 38 now has two blocks); validator rules for transport/provider match, rule shapes, default chain and documented-null limits; catalog omits null limits.
|
|
2912
|
+
- **Tool**: per-model quality/size/ratio/mask/input/prompt validation (the default primary's rules when no model is given); each fallback candidate re-validated and skipped with `params:` if it cannot honour the request; unknown providers fail closed instead of going to api.openai.com; response MIME from magic bytes.
|
|
2913
|
+
- **Checks**: verifier 62.19/63.10/83.8 now assert the master-driven chain, 84.1-84.4 new; `tests/image-models-84.test.mjs` (21 tests).
|
|
2914
|
+
- Roll back with `npm i -g johns-harness@2026.9.41`.
|
package/models/models.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"about": "Master model file for John's Harness (family 83). Every shipped catalog entry, wire rule and alias lives here; scripts/models-sync.mjs generates every copy in the tree from it. See docs/MODELS.md.",
|
|
3
3
|
"fields": "providers.<provider>.<id>: the pi-ai catalog card (name, api, baseUrl, reasoning, input, cost per MTok, contextWindow = the window the harness uses, maxTokens). harness.xhigh: /think xhigh and wire xhigh allowed. harness.efforts: reasoning efforts the API accepts (others map to the nearest accepted). harness.temperature: drop | drop-unless-effort-none. Anthropic (anthropic-messages) only: harness.thinking adaptive (adaptive thinking + output_config.effort instead of budget_tokens), harness.thinkingOff disabled (thinking.type disabled when /think is off), harness.efforts low..max, harness.temperature drop (also top_p/top_k). harness.nativeContextWindow/source/checked/notes: documentation only. cost is flat; tiered official prices keep the base tier here and the rest in harness.notes.",
|
|
4
|
+
"imageGenerationDefault": {"primary":"openai-codex/gpt-image-2.5-sunburst","fallbacks":["openai-codex/gpt-image-2"]},
|
|
4
5
|
"latest": {
|
|
5
6
|
"opus": {"provider":"anthropic","match":"^claude-opus-(\\d+)(?:-(\\d{1,2}))?$"},
|
|
6
7
|
"sonnet": {"provider":"anthropic","match":"^claude-sonnet-(\\d+)(?:-(\\d{1,2}))?$"},
|
|
@@ -26,9 +27,16 @@
|
|
|
26
27
|
"gemini-flash": "google/gemini-3.8-flash",
|
|
27
28
|
"gemini-flash-lite": "google/gemini-2.5-flash-lite",
|
|
28
29
|
"flash": "google/gemini-3.8-flash",
|
|
29
|
-
"banana": "google/gemini-
|
|
30
|
-
"nano-banana": "google/gemini-
|
|
31
|
-
"
|
|
30
|
+
"banana": "google/gemini-nano-banana-2.1",
|
|
31
|
+
"nano-banana": "google/gemini-nano-banana-2.1",
|
|
32
|
+
"nano-banana-pro": "google/gemini-3-pro-image",
|
|
33
|
+
"nano-banana-pro-preview": "google/gemini-3-pro-image-preview",
|
|
34
|
+
"nano-banana-lite": "google/gemini-3.1-flash-lite-image",
|
|
35
|
+
"grok-image": "xai/grok-imagine-image-2.0",
|
|
36
|
+
"image": "openai-codex/gpt-image-2.5-sunburst",
|
|
37
|
+
"image-sunburst": "openai-codex/gpt-image-2.5-sunburst",
|
|
38
|
+
"image-flare": "openai-codex/gpt-image-2.5-flare",
|
|
39
|
+
"image2": "openai-codex/gpt-image-2",
|
|
32
40
|
"sonnet5": "anthropic/claude-sonnet-5",
|
|
33
41
|
"opus5": "anthropic/claude-opus-5",
|
|
34
42
|
"haiku45": "anthropic/claude-haiku-4-5",
|
|
@@ -258,7 +266,9 @@
|
|
|
258
266
|
"gemini-2.5-pro-preview-05-06": {"name":"Gemini 2.5 Pro Preview 05-06","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.31,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
259
267
|
"gemini-2.5-pro-preview-06-05": {"name":"Gemini 2.5 Pro Preview 06-05","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.31,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
260
268
|
"gemini-3-pro-image-preview": {"name":"Nano Banana Pro","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":2,"output":120,"cacheRead":0.2,"cacheWrite":0},"contextWindow":32768,"maxTokens":8192},
|
|
261
|
-
"gemini-
|
|
269
|
+
"gemini-3-pro-image": {"name":"Nano Banana Pro","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":2,"output":120,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":32768,"harness":{"source":"https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image ; https://ai.google.dev/gemini-api/docs/pricing#gemini-3-pro-image ; authenticated model GET 200 (131072/32768).","checked":"2026-10-12","notes":"GA 2026-05-28. API-native limits 131072/32768 chosen over model page 65536/32768. Cutoff Jan2025. Tools/function calling/structured output unsupported; image tool only, not chat. Input $2/MTok text/image (560 input tokens/image); output text/thinking $12/MTok vs image $120/MTok ($0.1344 per1K/2K; $0.24 per4K) plus inputs/thinking. Batch 50% off, priority $3.60/$21.60 text/$216 image. Cache unsupported; numeric cache zeros mean N/A. No 200K tier reachable under native131K. Up to14 references; 1K/2K/4K.","image":{"transport":"google","imageSizes":["1K","2K","4K"],"aspectRatios":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"maxImages":14,"mask":false}}},
|
|
270
|
+
"gemini-3.1-flash-lite-image": {"name":"Nano Banana 2 Lite","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0.25,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536,"harness":{"source":"https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite-image ; https://ai.google.dev/gemini-api/docs/pricing#gemini-3.1-flash-lite-image ; authenticated model GET 200 (65536/65536).","checked":"2026-10-12","notes":"GA 2026-06-30. API-native limits65536/65536 chosen over model page65536/4096. Cutoff Jan2025. Sibling efficiency model, NOT successor to Nano Banana2.1; banana aliases unchanged. Only1K images, up to14 references, text/image input. Input $0.25/MTok; text/thinking output $1.50/MTok, image output $30/MTok ($0.0336 per1120-token1K) plus inputs/thinking. Batch $0.125/$0.75/$15 (50% off; image $0.0168). Paid tier only. Cache unsupported; cache zeros N/A. Function calling/structured outputs unsupported; image tool only, not chat.","image":{"transport":"google","imageSizes":["1K"],"aspectRatios":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"maxImages":14,"mask":false}}},
|
|
271
|
+
"gemini-nano-banana-2.1": {"name":"Nano Banana 2.1","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":1.5,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536,"harness":{"source":"generativelanguage.googleapis.com/v1beta/models/gemini-nano-banana-2.1 (inputTokenLimit 65536, outputTokenLimit 65536; models list agrees, rechecked 2026-10-11) and ai.google.dev/gemini-api/docs/models/gemini-nano-banana-2.1 + /pricing + /changelog (GA 2026-10-06; gemini-3.1-flash-image deprecated in its favor) + deepmind.google/models/model-cards/nano-banana-2-1 (Overall Preference Elo 1050 thinking vs Nano Banana Pro 935). Official limits conflict: the model page says 131,072 input / 32,768 output; the harness uses the API endpoint values.","checked":"2026-10-11","notes":"GA 2026-10-06. Image generation and conversational image editing, the update to Nano Banana 2 (gemini-3.1-flash-image). Image-only like Nano Banana Pro (function calling and structured outputs unsupported); the nano-banana/banana aliases since 2026.9.41 (image_generate model nano-banana), Pro stays on nano-banana-pro. Up to 14 reference images; aspect ratios add 1:4, 4:1, 1:8, 8:1. $1.50/MTok input, $30/MTok image output ($7.50 text/thinking output), about $0.034 per 1K image; caching unsupported. Thinking minimal/medium(default)/high; 1K/2K/4K output."}},
|
|
262
272
|
"gemini-3.8-flash": {"name":"Gemini 3.8 Flash","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.75,"output":3.75,"cacheRead":0.075,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
263
273
|
"gemini-3-flash-preview": {"name":"Gemini 3 Flash Preview","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.5,"output":3,"cacheRead":0.05,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
264
274
|
"gemini-3-pro-preview": {"name":"Gemini 3 Pro Preview","api":"google-generative-ai","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1000000,"maxTokens":64000},
|
|
@@ -415,6 +425,8 @@
|
|
|
415
425
|
"gpt-6-sol": {"name":"GPT-6 Sol","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"efforts":["none","low","medium","high","xhigh","max"],"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
416
426
|
"gpt-6-luna": {"name":"GPT-6 Luna","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"efforts":["none","low","medium","high","xhigh","max"],"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
417
427
|
"gpt-image-2": {"name":"GPT Image 2","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":40,"cacheRead":1.25,"cacheWrite":0},"contextWindow":32000,"maxTokens":4096},
|
|
428
|
+
"gpt-image-2.5-sunburst": {"name":"GPT Image 2.5 Sunburst","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":30,"cacheRead":1.25,"cacheWrite":0},"contextWindow":null,"maxTokens":null,"harness":{"source":"https://developers.openai.com/api/docs/models/gpt-image-2.5-sunburst ; https://developers.openai.com/api/docs/guides/image-generation ; Models API GET 200; Codex image generations LIVE 200 with xhigh quality (no API fallback).","checked":"2026-10-12","notes":"Released 2026-09-08. Dedicated images generations/edits only, not chat; context/output token ceilings and knowledge cutoff not published (null = N/A). Official rates shared by both 2.5 models: text input $5, cached text $1.25, image input $8, cached image $2, image output $30 per MTok (Batch: image output $15); text output not billed. cost.input/cacheRead = text rates, cost.output = image output; image-input rates live here. No cache-write price published. Metadata and wire mocks checked; paid API inference intentionally NOT run. Quality low/medium/high/xhigh/max/auto; custom sizes multiples of 16, 1:3..3:1, edges <=3840, pixels 655360..8294400; >2560x1440 experimental. Per-image price varies with dimensions/quality; see official card. Transport preserves old multipart edits and mask.","image":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true}}},
|
|
429
|
+
"gpt-image-2.5-flare": {"name":"GPT Image 2.5 Flare","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":30,"cacheRead":1.25,"cacheWrite":0},"contextWindow":null,"maxTokens":null,"harness":{"source":"https://developers.openai.com/api/docs/models/gpt-image-2.5-flare ; https://developers.openai.com/api/docs/guides/image-generation ; Models API GET 200; Codex image generations LIVE 200 with max quality (no API fallback).","checked":"2026-10-12","notes":"Released 2026-09-08. Dedicated images generations/edits only, not chat; context/output token ceilings and knowledge cutoff not published (null = N/A). Official rates shared by both 2.5 models: text input $5, cached text $1.25, image input $8, cached image $2, image output $30 per MTok (Batch: image output $15); text output not billed. cost.input/cacheRead = text rates, cost.output = image output; image-input rates live here. No cache-write price published. Same per-token price as Sunburst; token use per image differs by model/quality. Metadata and wire mocks checked; paid API inference intentionally NOT run. Quality low/medium/high/xhigh/max/auto; custom sizes multiples of 16, 1:3..3:1, edges <=3840, pixels 655360..8294400; >2560x1440 experimental. Per-image price varies with dimensions/quality; see official card. Transport preserves old multipart edits and mask.","image":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true}}},
|
|
418
430
|
"gpt-5.6-sol": {"name":"GPT-5.6 Sol","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
419
431
|
"gpt-5.6-terra": {"name":"GPT-5.6 Terra","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
420
432
|
"gpt-5.6-luna": {"name":"GPT-5.6 Luna","api":"openai-responses","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.2,"cacheRead":0.02,"cacheWrite":0.25},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
@@ -440,6 +452,8 @@
|
|
|
440
452
|
"gpt-6-sol": {"name":"GPT-6 Sol (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"efforts":["none","low","medium","high","xhigh","max"],"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
441
453
|
"gpt-6-luna": {"name":"GPT-6 Luna (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"efforts":["none","low","medium","high","xhigh","max"],"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
442
454
|
"gpt-image-2": {"name":"GPT Image 2 (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32000,"maxTokens":4096},
|
|
455
|
+
"gpt-image-2.5-sunburst": {"name":"GPT Image 2.5 Sunburst (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":null,"maxTokens":null,"harness":{"source":"https://developers.openai.com/api/docs/models/gpt-image-2.5-sunburst ; https://developers.openai.com/api/docs/guides/image-generation ; Models API GET 200; Codex image generations LIVE 200 with xhigh quality (no API fallback).","checked":"2026-10-12","notes":"Released 2026-09-08. Dedicated images generations/edits only, not chat; context/output token ceilings and knowledge cutoff not published (null = N/A). ChatGPT/Codex subscription usage, no per-token API bill. Quality low/medium/high/xhigh/max/auto; custom sizes multiples of 16, 1:3..3:1, edges <=3840, pixels 655360..8294400; >2560x1440 experimental. Per-image price varies with dimensions/quality; see official card. Transport preserves old multipart edits and mask.","image":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true}}},
|
|
456
|
+
"gpt-image-2.5-flare": {"name":"GPT Image 2.5 Flare (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":null,"maxTokens":null,"harness":{"source":"https://developers.openai.com/api/docs/models/gpt-image-2.5-flare ; https://developers.openai.com/api/docs/guides/image-generation ; Models API GET 200; Codex image generations LIVE 200 with max quality (no API fallback).","checked":"2026-10-12","notes":"Released 2026-09-08. Dedicated images generations/edits only, not chat; context/output token ceilings and knowledge cutoff not published (null = N/A). ChatGPT/Codex subscription usage, no per-token API bill. Quality low/medium/high/xhigh/max/auto; custom sizes multiples of 16, 1:3..3:1, edges <=3840, pixels 655360..8294400; >2560x1440 experimental. Per-image price varies with dimensions/quality; see official card. Transport preserves old multipart edits and mask.","image":{"transport":"openai","qualities":["low","medium","high","xhigh","max","auto"],"customSizes":true,"maxImages":4,"mask":true}}},
|
|
443
457
|
"gpt-6-astra": {"name":"GPT-6 Astra","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"efforts":["low","medium","high","xhigh","max"],"temperature":"drop","nativeContextWindow":1050000}},
|
|
444
458
|
"gpt-5.5": {"name":"GPT-5.5 (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
445
459
|
"gpt-5.6-sol": {"name":"GPT-5.6 Sol (Codex)","api":"openai-codex-responses","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000,"harness":{"xhigh":true,"temperature":"drop-unless-effort-none","nativeContextWindow":1050000}},
|
|
@@ -852,6 +866,7 @@
|
|
|
852
866
|
"zai/glm-5": {"name":"GLM-5","api":"anthropic-messages","baseUrl":"https://ai-gateway.vercel.sh","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.1999999999999997,"cacheRead":0.19999999999999998,"cacheWrite":0},"contextWindow":202800,"maxTokens":131072}
|
|
853
867
|
},
|
|
854
868
|
"xai": {
|
|
869
|
+
"grok-imagine-image-2.0": {"name":"Grok Imagine Image 2.0","api":"xai-images","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":null,"maxTokens":null,"harness":{"source":"https://docs.x.ai/developers/models/grok-imagine-image-2.0 ; https://docs.x.ai/developers/model-capabilities/images/generation ; /images/editing ; /rest-api-reference/inference/images ; authenticated /v1/image-generation-models GET 200.","checked":"2026-10-12","notes":"Native image JSON transport (not OpenAI multipart). Input text/image; image-only output; no chat/token context/token output/cutoff published (null=N/A). Per-image billing, numeric token costs0 are NOT free: $0.01/input image;1K low $0.04,1.5K low $0.05,2K low $0.06;1K medium $0.06,1.5K medium $0.07,2K medium $0.08. Auto generation=low; auto edit=medium, billed served quality. Card lists1.5K pricing but generation guide documents1k/2k only: harness exposes1K/2K. Batch API supported (card lists batch pricing N/A); no cache/priority image tier. Up to5 sources (url/data URI); response_format b64_json; masks unsupported. Team metadata max_prompt_length64000 characters,6RPS.","image":{"transport":"xai","qualities":["low","medium","auto"],"imageSizes":["1K","2K"],"aspectRatios":["auto","1:1","16:9","9:16","4:3","3:4","3:2","2:3","2:1","1:2","19.5:9","9:19.5","20:9","9:20","21:9","5:2"],"maxImages":5,"maxPromptLength":64000,"mask":false}}},
|
|
855
870
|
"grok-2": {"name":"Grok 2","api":"openai-completions","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
856
871
|
"grok-2-1212": {"name":"Grok 2 (1212)","api":"openai-completions","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
857
872
|
"grok-2-latest": {"name":"Grok 2 Latest","api":"openai-completions","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
@@ -13860,6 +13860,8 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
13860
13860
|
"gemini-2.5-pro-preview-05-06":{"id":"gemini-2.5-pro-preview-05-06","name":"Gemini 2.5 Pro Preview 05-06","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.31,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
13861
13861
|
"gemini-2.5-pro-preview-06-05":{"id":"gemini-2.5-pro-preview-06-05","name":"Gemini 2.5 Pro Preview 06-05","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.31,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
13862
13862
|
"gemini-3-pro-image-preview":{"id":"gemini-3-pro-image-preview","name":"Nano Banana Pro","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":2,"output":120,"cacheRead":0.2,"cacheWrite":0},"contextWindow":32768,"maxTokens":8192},
|
|
13863
|
+
"gemini-3-pro-image":{"id":"gemini-3-pro-image","name":"Nano Banana Pro","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":2,"output":120,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":32768},
|
|
13864
|
+
"gemini-3.1-flash-lite-image":{"id":"gemini-3.1-flash-lite-image","name":"Nano Banana 2 Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0.25,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536},
|
|
13863
13865
|
"gemini-nano-banana-2.1":{"id":"gemini-nano-banana-2.1","name":"Nano Banana 2.1","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":1.5,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536},
|
|
13864
13866
|
"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.75,"output":3.75,"cacheRead":0.075,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
13865
13867
|
"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.5,"output":3,"cacheRead":0.05,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
@@ -14017,6 +14019,8 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
14017
14019
|
"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":272000,"maxTokens":128000},
|
|
14018
14020
|
"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125},"contextWindow":272000,"maxTokens":128000},
|
|
14019
14021
|
"gpt-image-2":{"id":"gpt-image-2","name":"GPT Image 2","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":40,"cacheRead":1.25,"cacheWrite":0},"contextWindow":32000,"maxTokens":4096},
|
|
14022
|
+
"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","name":"GPT Image 2.5 Sunburst","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":30,"cacheRead":1.25,"cacheWrite":0}},
|
|
14023
|
+
"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","name":"GPT Image 2.5 Flare","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":30,"cacheRead":1.25,"cacheWrite":0}},
|
|
14020
14024
|
"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5},"contextWindow":272000,"maxTokens":128000},
|
|
14021
14025
|
"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":272000,"maxTokens":128000},
|
|
14022
14026
|
"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.2,"cacheRead":0.02,"cacheWrite":0.25},"contextWindow":272000,"maxTokens":128000},
|
|
@@ -14042,6 +14046,8 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
14042
14046
|
"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14043
14047
|
"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14044
14048
|
"gpt-image-2":{"id":"gpt-image-2","name":"GPT Image 2 (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32000,"maxTokens":4096},
|
|
14049
|
+
"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","name":"GPT Image 2.5 Sunburst (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}},
|
|
14050
|
+
"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","name":"GPT Image 2.5 Flare (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}},
|
|
14045
14051
|
"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14046
14052
|
"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5 (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14047
14053
|
"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
@@ -14454,6 +14460,7 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
14454
14460
|
"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","api":"anthropic-messages","provider":"vercel-ai-gateway","baseUrl":"https://ai-gateway.vercel.sh","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.1999999999999997,"cacheRead":0.19999999999999998,"cacheWrite":0},"contextWindow":202800,"maxTokens":131072},
|
|
14455
14461
|
},
|
|
14456
14462
|
"xai": {
|
|
14463
|
+
"grok-imagine-image-2.0":{"id":"grok-imagine-image-2.0","name":"Grok Imagine Image 2.0","api":"xai-images","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}},
|
|
14457
14464
|
"grok-2":{"id":"grok-2","name":"Grok 2","api":"openai-completions","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
14458
14465
|
"grok-2-1212":{"id":"grok-2-1212","name":"Grok 2 (1212)","api":"openai-completions","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
14459
14466
|
"grok-2-latest":{"id":"grok-2-latest","name":"Grok 2 Latest","api":"openai-completions","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
package/package.json
CHANGED
|
@@ -45,9 +45,18 @@ for (const rel of sync.XHIGH12) {
|
|
|
45
45
|
const line = src.slice(at).split("\n")[1];
|
|
46
46
|
if (JSON.stringify(new Function(`const XHIGH_MODEL_REFS = []; ${line} return XHIGH_MODEL_REFS;`)()) !== refs) problems.push(`${rel}: XHIGH_MODEL_REFS differ from models/models.json`);
|
|
47
47
|
}
|
|
48
|
+
// image_generate's `model` param resolves the same image aliases /model does (2026.9.41).
|
|
49
|
+
const imageTool = path.join(root, sync.IMAGE_TOOL);
|
|
50
|
+
if (!fs.existsSync(imageTool)) problems.push(`missing ${sync.IMAGE_TOOL}`);
|
|
51
|
+
else {
|
|
52
|
+
const { IMAGE_MODEL_ALIASES } = await import(pathToFileURL(imageTool).href);
|
|
53
|
+
for (const [alias, ref] of Object.entries(sync.imageAliasesOf(master))) {
|
|
54
|
+
if (IMAGE_MODEL_ALIASES?.[alias] !== ref) problems.push(`${sync.IMAGE_TOOL}: image alias ${alias} is ${IMAGE_MODEL_ALIASES?.[alias] ?? "(missing)"}, master says ${ref}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
48
57
|
if (problems.length) {
|
|
49
58
|
for (const line of problems.slice(0, 20)) console.error(`FAIL ${line}`);
|
|
50
59
|
console.error(`models master check: ${problems.length} problem(s)`);
|
|
51
60
|
process.exit(1);
|
|
52
61
|
}
|
|
53
|
-
console.log(`models master check: ${models / 2} models x 2 catalogs, ${sync.ALIAS14.length} alias copies, ${sync.XHIGH12.length} xhigh copies match models/models.json`);
|
|
62
|
+
console.log(`models master check: ${models / 2} models x 2 catalogs, ${sync.ALIAS14.length} alias copies, ${sync.XHIGH12.length} xhigh copies and the image_generate aliases match models/models.json`);
|
package/scripts/models-sync.mjs
CHANGED
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
// every other model keeps the historical adapter gates.
|
|
21
21
|
// - 14 DEFAULT_MODEL_ALIASES copies: one generated Object.assign block (the full shipped table).
|
|
22
22
|
// - 12 XHIGH_MODEL_REFS copies: the command-level /think xhigh gate, rebuilt from the master.
|
|
23
|
+
// - dist/image-generate.js: every shipped alias that names an image generation model (banana,
|
|
24
|
+
// nano-banana, nano-banana-pro, image) also resolves in the image_generate `model` param
|
|
25
|
+
// (since 2026.9.41, when nano-banana moved to Nano Banana 2.1).
|
|
23
26
|
// Older hand-written literals stay byte-for-byte in place (older exact-replay families hash them);
|
|
24
27
|
// the generated blocks run last and win. Never hand-edit a generated block: edit the master, run
|
|
25
28
|
// `node scripts/models-sync.mjs`, then `node scripts/models-sync.mjs --check`.
|
|
@@ -51,6 +54,7 @@ export const ALIAS14 = [
|
|
|
51
54
|
"dist/plugin-sdk/model-auth-DVyo6JSX.js", "dist/plugin-sdk/model-auth-kiHYHGrs.js",
|
|
52
55
|
"dist/plugin-sdk/model-selection-Dbj4jDYM.js",
|
|
53
56
|
];
|
|
57
|
+
export const IMAGE_TOOL = "dist/image-generate.js";
|
|
54
58
|
export const XHIGH12 = [
|
|
55
59
|
"dist/thinking-B5B36ffe.js", "dist/thinking-BYwvlJ3S.js", "dist/thinking-CAzdgmNV.js", "dist/thinking-DykY2Fzj.js",
|
|
56
60
|
"dist/plugin-sdk/thinking-B-rIrY_n.js", "dist/plugin-sdk/thinking-CopbP_Cn.js", "dist/plugin-sdk/thinking-WQ4Zq8Nl.js",
|
|
@@ -75,6 +79,10 @@ export function stripGenerated(text) {
|
|
|
75
79
|
function orderedModel(provider, id, entry) {
|
|
76
80
|
const { harness: _harness, ...card } = entry;
|
|
77
81
|
const { name, api, ...rest } = card;
|
|
82
|
+
// null contextWindow/maxTokens = N/A (unpublished) for image-only cards. Shipped code treats these as
|
|
83
|
+
// optional numbers (pi-coding-agent models.json schema, `<= 0` guards, `?? default`), so the generated
|
|
84
|
+
// catalog omits the key rather than shipping null.
|
|
85
|
+
for (const key of ["contextWindow", "maxTokens"]) if (rest[key] === null) delete rest[key];
|
|
78
86
|
return { id, name, api, provider, ...rest };
|
|
79
87
|
}
|
|
80
88
|
|
|
@@ -90,13 +98,26 @@ export function validateMaster(master) {
|
|
|
90
98
|
if (typeof entry.baseUrl !== "string") problems.push(`${ref}: baseUrl must be a string (upstream Azure entries use "")`);
|
|
91
99
|
if (typeof entry.reasoning !== "boolean") problems.push(`${ref}: reasoning must be true/false`);
|
|
92
100
|
if (!Array.isArray(entry.input) || entry.input.length === 0) problems.push(`${ref}: input modalities missing`);
|
|
93
|
-
|
|
101
|
+
// null = not published (N/A). Only image-only cards may say so, and their notes must say why.
|
|
102
|
+
for (const key of ["contextWindow", "maxTokens"]) {
|
|
103
|
+
if (entry[key] === null && entry.imageGeneration === true && entry.chat === false) {
|
|
104
|
+
if (!/N\/A/.test(entry.harness?.notes ?? "") || typeof entry.harness?.source !== "string") problems.push(`${ref}: ${key} null needs harness.source and harness.notes stating the limit is N/A (unpublished)`);
|
|
105
|
+
} else if (!Number.isInteger(entry[key]) || entry[key] <= 0) problems.push(`${ref}: ${key} must be a positive integer (or null/N/A for image-only models)`);
|
|
106
|
+
}
|
|
94
107
|
const cost = entry.cost;
|
|
95
108
|
// Upstream pi-ai marks router-priced entries (openrouter/auto) with a negative sentinel cost.
|
|
96
109
|
if (!cost || ["input", "output", "cacheRead", "cacheWrite"].some((k) => typeof cost[k] !== "number" || !Number.isFinite(cost[k]))) problems.push(`${ref}: cost needs numeric input/output/cacheRead/cacheWrite`);
|
|
97
110
|
if ("id" in entry || "provider" in entry) problems.push(`${ref}: id/provider come from the keys; remove them from the entry`);
|
|
98
111
|
const h = entry.harness;
|
|
99
112
|
if (h !== undefined) {
|
|
113
|
+
if (h?.image !== undefined) {
|
|
114
|
+
const r = h.image;
|
|
115
|
+
if (entry.imageGeneration !== true || entry.chat !== false || !r || !["openai", "google", "xai"].includes(r.transport)) problems.push(`${ref}: harness.image needs an image-only card and a supported transport`);
|
|
116
|
+
if ((r?.transport === "google" && provider !== "google") || (r?.transport === "xai" && provider !== "xai") || (r?.transport === "openai" && !["openai", "openai-codex"].includes(provider))) problems.push(`${ref}: image transport does not match serving provider`);
|
|
117
|
+
for (const key of ["qualities", "imageSizes", "aspectRatios"]) if (r?.[key] !== undefined && (!Array.isArray(r[key]) || !r[key].length || r[key].some(v => typeof v !== "string" || !v))) problems.push(`${ref}: harness.image.${key} needs a nonempty string array`);
|
|
118
|
+
for (const key of ["maxImages", "maxPromptLength"]) if (r?.[key] !== undefined && (!Number.isInteger(r[key]) || r[key] <= 0)) problems.push(`${ref}: harness.image.${key} needs a positive integer`);
|
|
119
|
+
for (const key of ["mask", "customSizes"]) if (r?.[key] !== undefined && typeof r[key] !== "boolean") problems.push(`${ref}: harness.image.${key} must be boolean`);
|
|
120
|
+
}
|
|
100
121
|
if (typeof h !== "object" || h === null) { problems.push(`${ref}: harness must be an object`); continue; }
|
|
101
122
|
if (h.xhigh !== undefined && typeof h.xhigh !== "boolean") problems.push(`${ref}: harness.xhigh must be true/false`);
|
|
102
123
|
if (h.efforts !== undefined && (!Array.isArray(h.efforts) || h.efforts.length === 0 || h.efforts.some((e) => !EFFORTS.includes(e)))) problems.push(`${ref}: harness.efforts must list ${EFFORTS.join("|")}`);
|
|
@@ -133,6 +154,14 @@ export function validateMaster(master) {
|
|
|
133
154
|
for (const [alias, rule] of Object.entries(master.latest ?? {})) {
|
|
134
155
|
try { resolveLatest(master, alias, rule); } catch (error) { problems.push(error.message); }
|
|
135
156
|
}
|
|
157
|
+
const d = master.imageGenerationDefault;
|
|
158
|
+
if (d !== undefined) {
|
|
159
|
+
if (!d || typeof d.primary !== "string" || !Array.isArray(d.fallbacks)) problems.push("imageGenerationDefault needs primary and fallbacks");
|
|
160
|
+
else for (const ref of [d.primary, ...d.fallbacks]) {
|
|
161
|
+
const slash = typeof ref === "string" ? ref.indexOf("/") : -1;
|
|
162
|
+
if (slash < 1 || master.providers[ref.slice(0, slash)]?.[ref.slice(slash + 1)]?.imageGeneration !== true) problems.push(`imageGenerationDefault ${ref} is not an image model`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
136
165
|
for (const ref of master.xhighExtraRefs ?? []) if (refs.has(ref)) problems.push(`xhighExtraRefs ${ref} is in the catalog; set harness.xhigh on the entry instead`);
|
|
137
166
|
return problems;
|
|
138
167
|
}
|
|
@@ -223,6 +252,24 @@ export function anthropicRulesOf(master) {
|
|
|
223
252
|
}
|
|
224
253
|
return rules;
|
|
225
254
|
}
|
|
255
|
+
// Shipped aliases whose target is an image generation model: the image_generate tool's `model`
|
|
256
|
+
// param accepts them too, so `/model nano-banana` and `image_generate model: nano-banana` agree.
|
|
257
|
+
export function imageAliasesOf(master) {
|
|
258
|
+
const out = {};
|
|
259
|
+
for (const [alias, ref] of Object.entries(resolvedAliases(master))) {
|
|
260
|
+
const slash = ref.indexOf("/");
|
|
261
|
+
if (master.providers[ref.slice(0, slash)]?.[ref.slice(slash + 1)]?.imageGeneration === true) out[alias] = ref;
|
|
262
|
+
}
|
|
263
|
+
return out;
|
|
264
|
+
}
|
|
265
|
+
export function imageRulesOf(master) {
|
|
266
|
+
const out = {};
|
|
267
|
+
for (const [provider, entries] of Object.entries(master.providers)) for (const [id, entry] of Object.entries(entries)) if (entry.harness?.image) out[`${provider}/${id}`] = entry.harness.image;
|
|
268
|
+
return out;
|
|
269
|
+
}
|
|
270
|
+
function imageRuntimeBlock(master) {
|
|
271
|
+
return HEAD("image runtime") + `export const IMAGE_MODEL_RULES = Object.freeze(${JSON.stringify(imageRulesOf(master))});\nexport const IMAGE_GENERATION_DEFAULT = Object.freeze(${JSON.stringify(master.imageGenerationDefault)});\n` + TAIL();
|
|
272
|
+
}
|
|
226
273
|
export function xhighRefsOf(master) {
|
|
227
274
|
const refs = [];
|
|
228
275
|
for (const [provider, models] of Object.entries(master.providers)) for (const [id, entry] of Object.entries(models)) if (entry.harness?.xhigh === true) refs.push(`${provider}/${id}`);
|
|
@@ -332,6 +379,9 @@ function aliasBlock(master) {
|
|
|
332
379
|
return HEAD("aliases") + `const JOHNNESS_MASTER_ALIASES = ${JSON.stringify(resolvedAliases(master))};\n`
|
|
333
380
|
+ "for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;\n" + TAIL();
|
|
334
381
|
}
|
|
382
|
+
function imageAliasBlock(master) {
|
|
383
|
+
return HEAD("image aliases") + `for (const [alias, ref] of Object.entries(${JSON.stringify(imageAliasesOf(master))})) IMAGE_MODEL_ALIAS_TABLE[alias] = ref;\n` + TAIL();
|
|
384
|
+
}
|
|
335
385
|
function xhighRefsBlock(master) {
|
|
336
386
|
// Single-quoted on purpose: older verifier checks count the historical double-quoted literals.
|
|
337
387
|
const refs = xhighRefsOf(master);
|
|
@@ -384,6 +434,7 @@ export function targets(master) {
|
|
|
384
434
|
}
|
|
385
435
|
for (const rel of ALIAS14) out.push({ rel, edits: [insertBefore("const DEFAULT_MODEL_COST = {", aliasBlock(master))] });
|
|
386
436
|
for (const rel of XHIGH12) out.push({ rel, edits: [afterArray("const XHIGH_MODEL_REFS = [", xhighRefsBlock(master))] });
|
|
437
|
+
out.push({ rel: IMAGE_TOOL, edits: [insertBefore("export const IMAGE_MODEL_ALIASES = Object.freeze(IMAGE_MODEL_ALIAS_TABLE);\n", imageAliasBlock(master)), insertBefore("export const DEFAULT_IMAGE_GENERATION_MODEL = Object.freeze({\n", imageRuntimeBlock(master))] });
|
|
387
438
|
return out;
|
|
388
439
|
}
|
|
389
440
|
|
|
@@ -13860,6 +13860,8 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
13860
13860
|
"gemini-2.5-pro-preview-05-06":{"id":"gemini-2.5-pro-preview-05-06","name":"Gemini 2.5 Pro Preview 05-06","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.31,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
13861
13861
|
"gemini-2.5-pro-preview-06-05":{"id":"gemini-2.5-pro-preview-06-05","name":"Gemini 2.5 Pro Preview 06-05","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.31,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
13862
13862
|
"gemini-3-pro-image-preview":{"id":"gemini-3-pro-image-preview","name":"Nano Banana Pro","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":2,"output":120,"cacheRead":0.2,"cacheWrite":0},"contextWindow":32768,"maxTokens":8192},
|
|
13863
|
+
"gemini-3-pro-image":{"id":"gemini-3-pro-image","name":"Nano Banana Pro","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":2,"output":120,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":32768},
|
|
13864
|
+
"gemini-3.1-flash-lite-image":{"id":"gemini-3.1-flash-lite-image","name":"Nano Banana 2 Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0.25,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536},
|
|
13863
13865
|
"gemini-nano-banana-2.1":{"id":"gemini-nano-banana-2.1","name":"Nano Banana 2.1","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":1.5,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536},
|
|
13864
13866
|
"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.75,"output":3.75,"cacheRead":0.075,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
13865
13867
|
"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.5,"output":3,"cacheRead":0.05,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},
|
|
@@ -14017,6 +14019,8 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
14017
14019
|
"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":272000,"maxTokens":128000},
|
|
14018
14020
|
"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125},"contextWindow":272000,"maxTokens":128000},
|
|
14019
14021
|
"gpt-image-2":{"id":"gpt-image-2","name":"GPT Image 2","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":40,"cacheRead":1.25,"cacheWrite":0},"contextWindow":32000,"maxTokens":4096},
|
|
14022
|
+
"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","name":"GPT Image 2.5 Sunburst","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":30,"cacheRead":1.25,"cacheWrite":0}},
|
|
14023
|
+
"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","name":"GPT Image 2.5 Flare","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":5,"output":30,"cacheRead":1.25,"cacheWrite":0}},
|
|
14020
14024
|
"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5},"contextWindow":272000,"maxTokens":128000},
|
|
14021
14025
|
"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":272000,"maxTokens":128000},
|
|
14022
14026
|
"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.2,"cacheRead":0.02,"cacheWrite":0.25},"contextWindow":272000,"maxTokens":128000},
|
|
@@ -14042,6 +14046,8 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
14042
14046
|
"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14043
14047
|
"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14044
14048
|
"gpt-image-2":{"id":"gpt-image-2","name":"GPT Image 2 (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32000,"maxTokens":4096},
|
|
14049
|
+
"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","name":"GPT Image 2.5 Sunburst (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}},
|
|
14050
|
+
"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","name":"GPT Image 2.5 Flare (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}},
|
|
14045
14051
|
"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14046
14052
|
"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5 (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
14047
14053
|
"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol (Codex)","api":"openai-codex-responses","provider":"openai-codex","baseUrl":"https://chatgpt.com/backend-api","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":272000,"maxTokens":128000},
|
|
@@ -14454,6 +14460,7 @@ const JOHNNESS_MODELS_MASTER = {
|
|
|
14454
14460
|
"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","api":"anthropic-messages","provider":"vercel-ai-gateway","baseUrl":"https://ai-gateway.vercel.sh","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.1999999999999997,"cacheRead":0.19999999999999998,"cacheWrite":0},"contextWindow":202800,"maxTokens":131072},
|
|
14455
14461
|
},
|
|
14456
14462
|
"xai": {
|
|
14463
|
+
"grok-imagine-image-2.0":{"id":"grok-imagine-image-2.0","name":"Grok Imagine Image 2.0","api":"xai-images","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text","image"],"output":["image"],"imageGeneration":true,"imageEditing":true,"chat":false,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}},
|
|
14457
14464
|
"grok-2":{"id":"grok-2","name":"Grok 2","api":"openai-completions","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
14458
14465
|
"grok-2-1212":{"id":"grok-2-1212","name":"Grok 2 (1212)","api":"openai-completions","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|
|
14459
14466
|
"grok-2-latest":{"id":"grok-2-latest","name":"Grok 2 Latest","api":"openai-completions","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":10,"cacheRead":2,"cacheWrite":0},"contextWindow":131072,"maxTokens":8192},
|