johns-harness 2026.11.5 → 2026.11.6
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 +19 -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 +28 -8
- 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 +39 -5
- package/docs/PATCHES.md +26 -0
- package/models/models.json +4 -4
- package/package.json +2 -1
- package/scripts/check-image-edit-defaults.mjs +100 -0
- package/scripts/check-models-master.mjs +3 -1
- package/scripts/models-sync.mjs +18 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.11.6
|
|
4
|
+
|
|
5
|
+
### Latest Sunburst edits, highest requested quality
|
|
6
|
+
- Default image edits now request the newest subscription Sunburst at its highest supported rendering quality: currently `gpt-image-2.6-sunburst` / `max`. Single-image, multi-image and masked edits share the same path. Explicit tool/config model and explicit quality overrides, including `auto`, remain exact. Generation quality defaults are unchanged.
|
|
7
|
+
- Move `image`, `image-sunburst` and `image-flare` into numeric latest-family rules in the master. The master default primary now references `image`; sync resolves it for the shipped runtime. Registering a newer model moves generation and editing together. Preserve versioned aliases and the subscription-only 2.5 Sunburst then GPT Image2 fallbacks. No implicit paid OpenAI API fallback.
|
|
8
|
+
- Select implicit quality per candidate: 2.6/2.5 use max; legacy Image2 uses high. Explicit max is never silently lowered for an incompatible fallback. Configured model aliases now resolve before candidate selection. Master validation rejects implicit paid or non-editable image defaults.
|
|
9
|
+
|
|
10
|
+
### Fix the subscription edit transport
|
|
11
|
+
- Real testing found that the previous multipart request fails on Codex `/images/edits` with HTTP400 Unsupported content type. Use the native JSON `images: [{image_url: dataURL}]` and optional `mask: {image_url: dataURL}` shape instead. Keep explicit OpenAI API multipart editing unchanged. Input MIME types are sniffed from bytes. No file upload or API billing workaround.
|
|
12
|
+
- Three real subscription edits succeeded: omitted-quality max, explicit-high diagnostic, and omitted-quality max with a PNG mask. Every request used exact `gpt-image-2.6-sunburst` on `chatgpt.com/backend-api/codex/images/edits`, with no fallback. **Provider caveat:** all three accepted the requested quality but reported `quality: low`; all returned 1254x1254 (the input size), not requested 1024x1024. Max is the correct requested model quality, but these responses do not prove max rendering. High showed the same deviation, so silently reducing the default would not solve it.
|
|
13
|
+
- Tool details expose requested `quality`, `responseQuality`, `responseSize` and a visible quality-disagreement warning. No provider downgrade is silently presented as verified max output.
|
|
14
|
+
- Add executable release guards for the actual single/multiple/masked tool path and a regenerated future-version fixture, including numeric latest selection, a new highest quality, paid/Flare exclusion, fallback quality, explicit overrides and transport bytes. No live credentials or inference in automated tests. Verifier: **580/580**. Full suite: **1,335 passed, zero failed/cancelled, 5 existing skips** (1,340 tests), including 22 new regressions.
|
|
15
|
+
|
|
16
|
+
Transport sources checked 2026-11-05:
|
|
17
|
+
- https://github.com/openai/codex/blob/main/codex-rs/codex-api/src/endpoint/images.rs
|
|
18
|
+
- https://developers.openai.com/api/reference/resources/images/methods/edit
|
|
19
|
+
|
|
20
|
+
Rollback: `npm i -g johns-harness@2026.11.5`. John runs `/update` when ready; this release does not install or restart the running gateway.
|
|
21
|
+
|
|
3
22
|
## 2026.11.5
|
|
4
23
|
|
|
5
24
|
### GPT Image 2.6 Sunburst and Flare
|
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ In a terminal, run `johnness login` to list choices, `johnness login chatgpt` or
|
|
|
60
60
|
|
|
61
61
|
<!-- JOHNNESS_PATCH_DEFAULTS_61 -->
|
|
62
62
|
### Batteries included
|
|
63
|
-
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
|
|
63
|
+
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: the latest GPT Image Sunburst (currently `openai-codex/gpt-image-2.6-sunburst`, alias `image`), then 2.5 Sunburst, then GPT Image 2 (`image2`); API-key image models are never an implicit fallback, only an explicit `model` or `agents.defaults.imageGenerationModel`. Also selectable: GPT Image 2.6 Flare (`image-flare`), with 2.5 retained as `image-sunburst25` / `image-flare25`, 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`. Image edits request the highest quality for the actual GPT candidate (`max` on 2.6/2.5, `high` on Image2); explicit model/config/quality overrides remain exact, and generation quality is unchanged. Latest-family master rules move generation and editing together. Codex edits use JSON image/mask references rather than multipart. Tool output warns when the provider reports a different quality: live max and high requests currently report low, so the harness does not claim verified max rendering.
|
|
64
64
|
|
|
65
65
|
**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.
|
|
66
66
|
|
|
@@ -5161,7 +5161,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
5161
5161
|
grok46: "xai/grok-4.6"
|
|
5162
5162
|
});
|
|
5163
5163
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
5164
|
-
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-4-argon","gemini31":"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
|
|
5164
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
5165
5165
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5166
5166
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5167
5167
|
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-4-argon","gemini31":"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
|
|
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-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-4-argon","gemini31":"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
|
|
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-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
|
@@ -63,7 +63,7 @@ const IMAGE_MODEL_ALIAS_TABLE = {
|
|
|
63
63
|
"gpt-image-2": "openai-codex/gpt-image-2",
|
|
64
64
|
};
|
|
65
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.
|
|
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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare"})) IMAGE_MODEL_ALIAS_TABLE[alias] = ref;
|
|
67
67
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
68
68
|
export const IMAGE_MODEL_ALIASES = Object.freeze(IMAGE_MODEL_ALIAS_TABLE);
|
|
69
69
|
|
|
@@ -91,7 +91,8 @@ export function coerceImageGenerationModelConfig(cfg) {
|
|
|
91
91
|
export function listImageGenerationCandidates(cfg) {
|
|
92
92
|
const { primary, fallbacks } = coerceImageGenerationModelConfig(cfg);
|
|
93
93
|
const out = [];
|
|
94
|
-
for (const
|
|
94
|
+
for (const raw of [primary, ...fallbacks]) {
|
|
95
|
+
const ref = resolveImageModelRef(raw);
|
|
95
96
|
if (!ref || out.some((c) => c.ref === ref)) continue;
|
|
96
97
|
const slash = ref.indexOf("/");
|
|
97
98
|
if (slash <= 0) continue;
|
|
@@ -187,6 +188,15 @@ export function extensionForMimeType(mimeType) {
|
|
|
187
188
|
|
|
188
189
|
export function imageRulesFor(ref) { return IMAGE_MODEL_RULES[ref] ?? {}; }
|
|
189
190
|
|
|
191
|
+
/** GPT edit quality is resolved per candidate, never baked into caller params. The master lists
|
|
192
|
+
* qualities lowest to highest; auto is provider choice, not the highest rendering quality.
|
|
193
|
+
* Legacy GPT Image models without explicit rules retain their low/medium/high/auto ladder. */
|
|
194
|
+
export function defaultImageEditQuality(ref) {
|
|
195
|
+
if (!/^(openai|openai-codex)\//.test(ref)) return undefined;
|
|
196
|
+
const qualities = imageRulesFor(ref).qualities ?? ["low", "medium", "high", "auto"];
|
|
197
|
+
return qualities.findLast(quality => quality !== "auto");
|
|
198
|
+
}
|
|
199
|
+
|
|
190
200
|
/** Image MIME type from the magic bytes (PNG, JPEG, WebP, GIF); `fallback` when unrecognised.
|
|
191
201
|
* xAI rejects a data URI whose declared type disagrees with its bytes ("Invalid base64-encoded image"),
|
|
192
202
|
* and xAI/Gemini return JPEG, so neither the request nor the written extension trusts a label alone. */
|
|
@@ -289,6 +299,12 @@ async function callProvider({ candidate, apiKey, params, images, mask, fetchImpl
|
|
|
289
299
|
headers["content-type"] = "application/json";
|
|
290
300
|
const sources = images.map(img => ({ url: `data:${sniffImageMimeType(img.buffer, img.mimeType)};base64,${Buffer.from(img.buffer).toString("base64")}`, type: "image_url" }));
|
|
291
301
|
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 } : {}) });
|
|
302
|
+
} else if (edit && candidate.provider === "openai-codex") {
|
|
303
|
+
// Codex Images edits require JSON references. Multipart returns HTTP400 Unsupported content type.
|
|
304
|
+
// Inline local bytes, including mask, without file uploads or any paid API call.
|
|
305
|
+
headers["content-type"] = "application/json";
|
|
306
|
+
const inline = img => ({ image_url: `data:${sniffImageMimeType(img.buffer, img.mimeType)};base64,${Buffer.from(img.buffer).toString("base64")}` });
|
|
307
|
+
body = JSON.stringify({ model: candidate.model, prompt: params.prompt, n: params.count, images: images.map(inline), ...(mask ? { mask: inline(mask) } : {}), ...(params.size !== "auto" ? { size: params.size } : {}), ...(params.quality ? { quality: params.quality } : {}) });
|
|
292
308
|
} else if (edit) {
|
|
293
309
|
body = new FormData();
|
|
294
310
|
body.set("model", candidate.model);
|
|
@@ -325,7 +341,7 @@ async function callProvider({ candidate, apiKey, params, images, mask, fetchImpl
|
|
|
325
341
|
}
|
|
326
342
|
}
|
|
327
343
|
if (buffers.length === 0) throw new Error(`${candidate.provider}: response carried no image data`);
|
|
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") };
|
|
344
|
+
return { buffers, usage: json?.usage ?? null, responseQuality: json?.quality ?? null, responseSize: json?.size ?? null, mode: edit ? "edit" : "generate", mimeType: sniffImageMimeType(buffers[0], typeof data[0]?.mime_type === "string" ? data[0].mime_type : "image/png") };
|
|
329
345
|
}
|
|
330
346
|
|
|
331
347
|
/**
|
|
@@ -355,8 +371,11 @@ export async function generateWithFallback({ cfg, params, images, mask, resolveA
|
|
|
355
371
|
continue;
|
|
356
372
|
}
|
|
357
373
|
try {
|
|
374
|
+
// Resolve only an omitted edit quality, after selecting this candidate. Explicit auto/low/max
|
|
375
|
+
// remain exact. A legacy fallback can use its own high without inheriting implicit max.
|
|
376
|
+
if (images.length > 0 && perCandidate.quality === undefined) perCandidate.quality = defaultImageEditQuality(candidate.ref);
|
|
358
377
|
const result = await callProvider({ candidate, apiKey, params: perCandidate, images, mask, fetchImpl, userAgent });
|
|
359
|
-
return { provider: candidate.provider, model: candidate.model, ...result, attempts };
|
|
378
|
+
return { provider: candidate.provider, model: candidate.model, quality: perCandidate.quality ?? null, ...result, attempts };
|
|
360
379
|
} catch (error) {
|
|
361
380
|
if (error instanceof ProviderUnsupported) {
|
|
362
381
|
attempts.push({ provider: candidate.provider, skipped: error.message });
|
|
@@ -383,7 +402,7 @@ export function createImageGenerateTool(options, deps) {
|
|
|
383
402
|
return {
|
|
384
403
|
label: "Image Generate",
|
|
385
404
|
name: "image_generate",
|
|
386
|
-
description: "Generate or edit PNG images with GPT Image
|
|
405
|
+
description: "Generate or edit PNG images with the latest GPT Image Sunburst (subscription default, subscription 2.5 Sunburst then GPT Image 2 fallbacks). GPT edits default to the highest supported quality (currently max); explicit model and quality override the defaults. Also supports 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.",
|
|
387
406
|
parameters: Type.Object({
|
|
388
407
|
prompt: Type.String({ description: "What to draw or how to change the input image." }),
|
|
389
408
|
image: Type.Optional(Type.String({ description: "Input image path to edit (workspace or allowed local root)." })),
|
|
@@ -391,7 +410,7 @@ export function createImageGenerateTool(options, deps) {
|
|
|
391
410
|
mask: Type.Optional(Type.String({ description: "PNG mask path; transparent areas are edited." })),
|
|
392
411
|
size: Type.Optional(Type.String({ description: "1024x1024, 1536x1024, 1024x1536, auto, or GPT Image2.5 custom size: multiples of16, ratio<=3, edges<=3840, pixels655360..8294400." })),
|
|
393
412
|
count: Type.Optional(Type.Number({ description: "Number of images, 1..4 (default 1)." })),
|
|
394
|
-
quality: Type.Optional(Type.String({ description: "GPT Image2.6/2.5: low, medium, high, xhigh, max, auto. Rendering quality, not planning complexity. Older GPT Image: low/medium/high/auto. xAI: low/medium/auto." })),
|
|
413
|
+
quality: Type.Optional(Type.String({ description: "GPT Image2.6/2.5: low, medium, high, xhigh, max, auto. GPT edits default to the highest supported quality (max on 2.6/2.5, high on older GPT Image); explicit auto uses provider choice. Generation quality is unchanged. Rendering quality, not planning complexity. Older GPT Image: low/medium/high/auto. xAI: low/medium/auto." })),
|
|
395
414
|
output: Type.Optional(Type.String({ description: "Output path inside the workspace (default media/generated/gpt-image-<timestamp>.png)." })),
|
|
396
415
|
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
416
|
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." })),
|
|
@@ -434,10 +453,11 @@ export function createImageGenerateTool(options, deps) {
|
|
|
434
453
|
written.push(outputs[i]);
|
|
435
454
|
}
|
|
436
455
|
const served = `${result.provider}/${result.model}`;
|
|
437
|
-
const
|
|
456
|
+
const qualityWarning = result.quality && result.quality !== "auto" && result.responseQuality && result.responseQuality !== result.quality ? `Provider reported quality ${result.responseQuality} instead of requested ${result.quality}.` : null;
|
|
457
|
+
const text = [`${result.mode === "edit" ? "Edited" : "Generated"} ${written.length} image${written.length === 1 ? "" : "s"} with ${served}.`, ...(qualityWarning ? [qualityWarning] : []), ...written.map((p) => `MEDIA:${p}`)].join("\n");
|
|
438
458
|
return {
|
|
439
459
|
content: [{ type: "text", text }],
|
|
440
|
-
details: { provider: result.provider, model: result.model, mode: result.mode, paths: written, usage: result.usage, attempts: result.attempts },
|
|
460
|
+
details: { provider: result.provider, model: result.model, quality: result.quality, responseQuality: result.responseQuality ?? null, responseSize: result.responseSize ?? null, qualityWarning, mode: result.mode, paths: written, usage: result.usage, attempts: result.attempts },
|
|
441
461
|
};
|
|
442
462
|
},
|
|
443
463
|
};
|
|
@@ -1713,7 +1713,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1713
1713
|
grok46: "xai/grok-4.6"
|
|
1714
1714
|
});
|
|
1715
1715
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1716
|
-
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-4-argon","gemini31":"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
|
|
1716
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
1717
1717
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1718
1718
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1719
1719
|
const DEFAULT_MODEL_COST = {
|
|
@@ -1688,7 +1688,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1688
1688
|
grok46: "xai/grok-4.6"
|
|
1689
1689
|
});
|
|
1690
1690
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1691
|
-
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-4-argon","gemini31":"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
|
|
1691
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
1692
1692
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1693
1693
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1694
1694
|
const DEFAULT_MODEL_COST = {
|
|
@@ -1619,7 +1619,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
1619
1619
|
grok46: "xai/grok-4.6"
|
|
1620
1620
|
});
|
|
1621
1621
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
1622
|
-
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-4-argon","gemini31":"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
|
|
1622
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
1623
1623
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
1624
1624
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
1625
1625
|
const DEFAULT_MODEL_COST = {
|
|
@@ -7109,7 +7109,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
7109
7109
|
grok46: "xai/grok-4.6"
|
|
7110
7110
|
});
|
|
7111
7111
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
7112
|
-
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-4-argon","gemini31":"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
|
|
7112
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
7113
7113
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
7114
7114
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
7115
7115
|
const DEFAULT_MODEL_COST = {
|
|
@@ -8110,7 +8110,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
8110
8110
|
grok46: "xai/grok-4.6"
|
|
8111
8111
|
});
|
|
8112
8112
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
8113
|
-
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-4-argon","gemini31":"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
|
|
8113
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
8114
8114
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
8115
8115
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
8116
8116
|
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-4-argon","gemini31":"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
|
|
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-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 = {
|
|
@@ -6027,7 +6027,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
6027
6027
|
grok46: "xai/grok-4.6"
|
|
6028
6028
|
});
|
|
6029
6029
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
6030
|
-
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-4-argon","gemini31":"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
|
|
6030
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
6031
6031
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
6032
6032
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
6033
6033
|
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-4-argon","gemini31":"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
|
|
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-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 = {
|
|
@@ -5000,7 +5000,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
5000
5000
|
grok46: "xai/grok-4.6"
|
|
5001
5001
|
});
|
|
5002
5002
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
5003
|
-
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-4-argon","gemini31":"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
|
|
5003
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
5004
5004
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5005
5005
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5006
5006
|
const DEFAULT_MODEL_COST = {
|
|
@@ -5000,7 +5000,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
5000
5000
|
grok46: "xai/grok-4.6"
|
|
5001
5001
|
});
|
|
5002
5002
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
5003
|
-
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-4-argon","gemini31":"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
|
|
5003
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
5004
5004
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
5005
5005
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
5006
5006
|
const DEFAULT_MODEL_COST = {
|
|
@@ -4808,7 +4808,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
|
|
|
4808
4808
|
grok46: "xai/grok-4.6"
|
|
4809
4809
|
});
|
|
4810
4810
|
/* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
|
|
4811
|
-
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-4-argon","gemini31":"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
|
|
4811
|
+
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-4-argon","gemini31":"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-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"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","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","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-6.1-terra","grok":"xai/grok-4.7"};
|
|
4812
4812
|
for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
|
|
4813
4813
|
/* JOHNNESS_MODELS_MASTER:END */
|
|
4814
4814
|
const DEFAULT_MODEL_COST = {
|
package/docs/MODELS.md
CHANGED
|
@@ -69,8 +69,15 @@ markers. Never edit inside them. The older hand-written literals stay in place b
|
|
|
69
69
|
`customSizes`. `image_generate` validates every request, and every fallback candidate, against
|
|
70
70
|
them. A provider with no transport in `dist/image-generate.js` cannot be registered: build the
|
|
71
71
|
transport there first (xAI got its native JSON branch in 2026.10.12).
|
|
72
|
-
- `imageGenerationDefault` is the default `image_generate` chain.
|
|
73
|
-
|
|
72
|
+
- `imageGenerationDefault` is the default `image_generate` chain. Its primary is the `image`
|
|
73
|
+
alias, resolved by `imageDefaultOf` at sync time. `image`, `image-sunburst` and `image-flare`
|
|
74
|
+
are numeric `latest` rules, so new master registrations advance generation AND edits.
|
|
75
|
+
Preserve a versioned alias for the previous model. Never freeze the default to a version ID.
|
|
76
|
+
Keep defaults subscription only (`openai-codex/...`): paid models require explicit selection.
|
|
77
|
+
- `harness.image.qualities` is ordered lowest to highest; `auto` means provider choice, not top.
|
|
78
|
+
Omitted GPT edit quality becomes the last non-auto quality per candidate (2.6/2.5 max, Image2
|
|
79
|
+
high). Explicit quality remains exact, including auto; generation quality is unchanged.
|
|
80
|
+
Explicit configured imageGenerationModel overrides remain supported, including aliases.
|
|
74
81
|
- Image-only cards whose token limits are not published use `contextWindow`/`maxTokens: null`
|
|
75
82
|
(N/A), with the reason in `harness.notes` and the source in `harness.source`; the validator
|
|
76
83
|
refuses null on anything else. The generated catalog omits the keys (shipped code reads them
|
|
@@ -123,7 +130,8 @@ account/tier; the cards publish no universal RPM/TPM. Token ceilings are
|
|
|
123
130
|
The current custom-dimension guide/API reference still enumerates only 2 and 2.5, so
|
|
124
131
|
**do not invent 2.6 native pixel/edge/aspect bounds** or enable custom sizes from an ID
|
|
125
132
|
prefix. `harness.image.customSizes: false` overrides the generic adapter default.
|
|
126
|
-
- The harness exposes PNG generation and image/mask
|
|
133
|
+
- The harness exposes PNG generation and JSON image/mask edits on Codex (multipart on explicit
|
|
134
|
+
OpenAI API), 1..4 output images,
|
|
127
135
|
up to 4 references and a 20 MiB local-input safety cap. It enforces the API's 32,000-character
|
|
128
136
|
prompt limit. The API documents up to 10 outputs and 16 reference images, which this
|
|
129
137
|
integration does not expose. SVG/GIF output, markup-guided edits, explicit complexity,
|
|
@@ -136,8 +144,8 @@ The provider changed the requested dimensions; the harness sends size unchanged
|
|
|
136
144
|
not resize the output. Tests guarded the exact chatgpt.com origin and
|
|
137
145
|
subscription path, disabled redirects, resolved only subscription credentials, and configured
|
|
138
146
|
no fallback. No paid API inference, auth refresh/write, global install or gateway restart.
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
That 2026.11.5 release tested API/edit/extended quality behavior offline. The 2026.11.6 live
|
|
148
|
+
edit findings below supersede the earlier edit transport assumption. No paid API inference.
|
|
141
149
|
|
|
142
150
|
Official sources, checked 2026-11-05:
|
|
143
151
|
- https://developers.openai.com/api/docs/models/gpt-image-2.6-sunburst
|
|
@@ -147,3 +155,29 @@ Official sources, checked 2026-11-05:
|
|
|
147
155
|
- https://developers.openai.com/api/reference/resources/images/methods/generate
|
|
148
156
|
- https://developers.openai.com/api/reference/resources/images/methods/edit
|
|
149
157
|
- https://developers.openai.com/api/docs/changelog (2026-11-04 release)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## Highest-quality edit defaults and subscription wire proof (2026.11.6)
|
|
161
|
+
|
|
162
|
+
Codex `/images/edits` rejects multipart with HTTP400 Unsupported content type. The native JSON shape
|
|
163
|
+
is `images: [{image_url: dataURL}]`, with optional `mask: {image_url: dataURL}`. Local bytes stay inline;
|
|
164
|
+
there are no file uploads or implicit paid API requests. Explicit OpenAI API editing keeps multipart.
|
|
165
|
+
Sources: openai/codex `codex-rs/codex-api/src/endpoint/images.rs`, and the Images edit API reference.
|
|
166
|
+
|
|
167
|
+
The real tool succeeded on single-image and PNG-masked edits through the subscription with model
|
|
168
|
+
and quality omitted: resolved `gpt-image-2.6-sunburst` / `max`. An explicit-high diagnostic also worked.
|
|
169
|
+
All three requests returned HTTP200, but the provider reported `quality: low` and 1254x1254 (input
|
|
170
|
+
size) instead of requested 1024x1024. These prove max requests are accepted, not max rendering.
|
|
171
|
+
Do not silently reduce the default or switch to the paid API to hide this deviation. The tool returns
|
|
172
|
+
`quality` (requested), `responseQuality`, `responseSize` and a visible `qualityWarning` on disagreement.
|
|
173
|
+
|
|
174
|
+
Run the executable offline release guards after model updates:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
node scripts/check-image-edit-defaults.mjs . current
|
|
178
|
+
node scripts/check-image-edit-defaults.mjs . future
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The second regenerates a synthetic newer numeric Sunburst with a new top quality and exercises the
|
|
182
|
+
actual generated tool for single/multiple/masked input. It excludes newer paid and Flare siblings,
|
|
183
|
+
checks version-alias preservation, and cleans its temporary fixture without touching the package.
|
package/docs/PATCHES.md
CHANGED
|
@@ -3144,3 +3144,29 @@ endpoint shapes and alternative valid windows, account isolation, fallback,
|
|
|
3144
3144
|
malformed payloads, cache expiry/coalescing, bounded failures and exact preflighted
|
|
3145
3145
|
reconstruction. Historical-family byte comparisons stay strict via the exact
|
|
3146
3146
|
normalization/re-layering helpers. See the changelog and usage tracking docs.
|
|
3147
|
+
|
|
3148
|
+
|
|
3149
|
+
## Family 94: latest subscription image edit defaults (2026-11-05)
|
|
3150
|
+
|
|
3151
|
+
Shared helper `dist/image-generate.js` owns all ten tool registrations. Default GPT edits choose
|
|
3152
|
+
highest supported quality at the per-candidate boundary, preserving explicit tool/config overrides
|
|
3153
|
+
and the subscription-only 2.6 Sunburst -> 2.5 Sunburst -> Image2 chain. Legacy fallback chooses high
|
|
3154
|
+
instead of inheriting implicit max; explicitly requested max is never downgraded. Generations keep
|
|
3155
|
+
their previous quality behavior.
|
|
3156
|
+
|
|
3157
|
+
Master `latest` rules now own image/image-sunburst/image-flare. The default primary references image
|
|
3158
|
+
rather than a frozen version. Sync resolves it into the shipped runtime, so the next registration
|
|
3159
|
+
advances generation and edits together. `harness.image.qualities` is ordered low to high; auto is
|
|
3160
|
+
excluded when selecting the top. Master validation disallows implicit paid or non-editable defaults.
|
|
3161
|
+
|
|
3162
|
+
Live proof exposed the older transport bug: subscription /images/edits rejects multipart with 400.
|
|
3163
|
+
Codex now sends JSON image references and optional mask references; explicit API still uses multipart.
|
|
3164
|
+
Source: openai/codex codex-rs/codex-api/src/endpoint/images.rs and the OpenAI Images edit reference.
|
|
3165
|
+
Tests compare exact image/mask bytes in both native formats. Tool metadata and visible warnings
|
|
3166
|
+
separate requested from provider-reported quality. The live subscription accepted max, but returned
|
|
3167
|
+
low and source-sized output, including an explicit-high diagnostic. That is not proof of max rendering.
|
|
3168
|
+
|
|
3169
|
+
Verifier 94.current executes single/multi/masked edits offline. 94.future regenerates a synthetic
|
|
3170
|
+
newer numeric version and higher quality, then executes that generated tool. It excludes newer paid
|
|
3171
|
+
and Flare siblings and leaves no files in the tested package. See tests/image-edit-defaults.test.mjs.
|
|
3172
|
+
Rollback: npm i -g johns-harness@2026.11.5. No activation or gateway restart is part of publication.
|
package/models/models.json
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
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.cacheWrite1h is the native Anthropic one-hour write price (cacheWrite is five-minute). Otherwise cost is flat; tiered official prices keep the base tier here and the rest in harness.notes. Google native (google-generative-ai): harness.thinking level sends thinkingConfig.thinkingLevel rather than thinkingBudget; thinkingDefault plus efforts governs all /think levels including the non-disableable provider default; cache implicit-only refuses explicit cachedContent. Ordinary per-stream maxTokens only; long decode/continuation is not implemented.",
|
|
4
4
|
"imageGenerationDefault": {
|
|
5
|
-
"primary": "
|
|
5
|
+
"primary": "image",
|
|
6
6
|
"fallbacks": ["openai-codex/gpt-image-2.5-sunburst", "openai-codex/gpt-image-2"]
|
|
7
7
|
},
|
|
8
8
|
"latest": {
|
|
9
|
+
"image": {"provider":"openai-codex","match":"^gpt-image-(\\d+)(?:\\.(\\d+))?-sunburst$"},
|
|
10
|
+
"image-sunburst": {"provider":"openai-codex","match":"^gpt-image-(\\d+)(?:\\.(\\d+))?-sunburst$"},
|
|
11
|
+
"image-flare": {"provider":"openai-codex","match":"^gpt-image-(\\d+)(?:\\.(\\d+))?-flare$"},
|
|
9
12
|
"opus": {"provider":"anthropic","match":"^claude-opus-(\\d+)(?:-(\\d{1,2}))?$"},
|
|
10
13
|
"sonnet": {"provider":"anthropic","match":"^claude-sonnet-(\\d+)(?:-(\\d{1,2}))?$"},
|
|
11
14
|
"fable": {"provider":"anthropic","match":"^claude-fable-(\\d+)(?:-(\\d{1,2}))?$","keepPrevious":false},
|
|
@@ -37,9 +40,6 @@
|
|
|
37
40
|
"nano-banana-pro-preview": "google/gemini-3-pro-image-preview",
|
|
38
41
|
"nano-banana-lite": "google/gemini-3.1-flash-lite-image",
|
|
39
42
|
"grok-image": "xai/grok-imagine-image-2.0",
|
|
40
|
-
"image": "openai-codex/gpt-image-2.6-sunburst",
|
|
41
|
-
"image-sunburst": "openai-codex/gpt-image-2.6-sunburst",
|
|
42
|
-
"image-flare": "openai-codex/gpt-image-2.6-flare",
|
|
43
43
|
"image-sunburst25": "openai-codex/gpt-image-2.5-sunburst",
|
|
44
44
|
"image-flare25": "openai-codex/gpt-image-2.5-flare",
|
|
45
45
|
"image2": "openai-codex/gpt-image-2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "johns-harness",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.6",
|
|
4
4
|
"description": "John's Harness: a production agent harness that runs autonomous coding agents as one cooperative swarm.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"models/",
|
|
43
43
|
"scripts/models-sync.mjs",
|
|
44
44
|
"scripts/check-models-master.mjs",
|
|
45
|
+
"scripts/check-image-edit-defaults.mjs",
|
|
45
46
|
"scripts/postinstall.mjs",
|
|
46
47
|
"scripts/prepare-slim-bundles.mjs",
|
|
47
48
|
"scripts/strip-sourcemaps.mjs",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Family 94: executable, offline release guard. Never reads credentials or sends a real request.
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { pathToFileURL } from 'node:url';
|
|
8
|
+
import { createRequire } from 'node:module';
|
|
9
|
+
import { resolvedAliases, imageDefaultOf, targets, stripGenerated, validateMaster, runnerUpProblems } from './models-sync.mjs';
|
|
10
|
+
|
|
11
|
+
const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMB/WHacN8AAAAASUVORK5CYII=', 'base64');
|
|
12
|
+
const JWT = `header.${Buffer.from(JSON.stringify({ 'https://api.openai.com/auth': { chatgpt_account_id: 'offline' } })).toString('base64url')}.signature`;
|
|
13
|
+
const ok = () => Response.json({ data: [{ b64_json: PNG.toString('base64') }], quality: 'low', size: '1x1' });
|
|
14
|
+
|
|
15
|
+
export async function checkImageEditDefaults(root, mode = 'current') {
|
|
16
|
+
const master = JSON.parse(fs.readFileSync(path.join(root, 'models/models.json'), 'utf8'));
|
|
17
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
18
|
+
assert.ok(manifest.files.includes('scripts/check-image-edit-defaults.mjs'), 'release guard must be in npm files allowlist');
|
|
19
|
+
assert.ok(fs.existsSync(path.join(root, 'scripts/check-image-edit-defaults.mjs')), 'release guard must ship in the artifact');
|
|
20
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'johnness-edit-check-'));
|
|
21
|
+
try {
|
|
22
|
+
let modulePath = path.join(root, 'dist/image-generate.js');
|
|
23
|
+
let expected = resolvedAliases(master).image;
|
|
24
|
+
let quality = master.providers['openai-codex'][expected.split('/')[1]].harness.image.qualities.findLast(q => q !== 'auto');
|
|
25
|
+
assert.ok(quality && quality !== 'auto');
|
|
26
|
+
assert.equal(master.imageGenerationDefault.primary, 'image', 'default follows the latest alias, not a frozen ID');
|
|
27
|
+
assert.ok(master.latest.image && master.latest['image-sunburst'] && master.latest['image-flare']);
|
|
28
|
+
assert.deepEqual(validateMaster(master), []);
|
|
29
|
+
if (mode === 'future') {
|
|
30
|
+
// Synthetic registrations only, never shipped or called live. Compare numeric versions,
|
|
31
|
+
// exclude newer paid/Flare siblings, and discover a new top quality without a code edit.
|
|
32
|
+
const cards = master.providers['openai-codex'];
|
|
33
|
+
const current = expected.split('/')[1];
|
|
34
|
+
const oldFlare = resolvedAliases(master)['image-flare'];
|
|
35
|
+
const major = Number(/^gpt-image-(\d+)/.exec(current)[1]) + 1;
|
|
36
|
+
const previous = `gpt-image-${major}.7-sunburst`;
|
|
37
|
+
const newest = `gpt-image-${major}.10-sunburst`;
|
|
38
|
+
const flare = `gpt-image-${major + 1}.0-flare`;
|
|
39
|
+
for (const id of [previous, newest, flare]) {
|
|
40
|
+
cards[id] = structuredClone(cards[current]);
|
|
41
|
+
cards[id].harness.image.qualities = ['low', 'medium', 'high', 'xhigh', 'max', 'ultra', 'auto'];
|
|
42
|
+
}
|
|
43
|
+
master.providers.openai[`gpt-image-${major + 2}.0-sunburst`] = structuredClone(master.providers.openai[current]);
|
|
44
|
+
master.aliases['test-previous-sunburst'] = expected;
|
|
45
|
+
master.aliases['test-runner-up-sunburst'] = `openai-codex/${previous}`;
|
|
46
|
+
master.aliases['test-previous-flare'] = oldFlare;
|
|
47
|
+
assert.deepEqual(validateMaster(master), []);
|
|
48
|
+
assert.deepEqual(runnerUpProblems(master), []);
|
|
49
|
+
expected = `openai-codex/${newest}`;
|
|
50
|
+
quality = 'ultra';
|
|
51
|
+
assert.equal(resolvedAliases(master).image, expected);
|
|
52
|
+
assert.equal(resolvedAliases(master)['image-sunburst'], expected);
|
|
53
|
+
assert.equal(imageDefaultOf(master).primary, expected);
|
|
54
|
+
const target = targets(master).find(t => t.rel === 'dist/image-generate.js');
|
|
55
|
+
let source = stripGenerated(fs.readFileSync(modulePath, 'utf8'));
|
|
56
|
+
for (const edit of target.edits) source = edit(source, target.rel);
|
|
57
|
+
// Resolve this one external import against the tested package, without mutating its tree.
|
|
58
|
+
const req = createRequire(pathToFileURL(modulePath));
|
|
59
|
+
source = source.replace('from "@sinclair/typebox"', `from ${JSON.stringify(pathToFileURL(req.resolve('@sinclair/typebox')).href)}`);
|
|
60
|
+
modulePath = path.join(dir, 'image-generate.mjs');
|
|
61
|
+
fs.writeFileSync(modulePath, source);
|
|
62
|
+
} else assert.equal(mode, 'current');
|
|
63
|
+
const m = await import(pathToFileURL(modulePath).href);
|
|
64
|
+
assert.deepEqual(m.DEFAULT_IMAGE_GENERATION_MODEL, imageDefaultOf(master));
|
|
65
|
+
assert.equal(m.DEFAULT_IMAGE_GENERATION_MODEL.primary, expected);
|
|
66
|
+
assert.ok(m.listImageGenerationCandidates({}).every(c => c.provider === 'openai-codex'));
|
|
67
|
+
const requests = [];
|
|
68
|
+
const tool = m.createImageGenerateTool({ config: {}, workspaceDir: dir, agentDir: path.join(dir, 'agent') }, {
|
|
69
|
+
resolveApiKeyForProvider: async ({ provider }) => { assert.equal(provider, 'openai-codex'); return { apiKey: JWT }; },
|
|
70
|
+
loadWebMedia: async () => ({ kind: 'image', buffer: PNG, contentType: 'image/png' }),
|
|
71
|
+
fetch: async (url, init) => {
|
|
72
|
+
assert.equal(url, 'https://chatgpt.com/backend-api/codex/images/edits');
|
|
73
|
+
assert.equal(init.headers['content-type'], 'application/json');
|
|
74
|
+
requests.push(JSON.parse(init.body));
|
|
75
|
+
return ok();
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
for (const input of [{ image: 'a.png' }, { images: ['a.png', 'b.png'] }, { image: 'a.png', mask: 'mask.png' }]) {
|
|
79
|
+
const result = await tool.execute('offline', { prompt: 'Edit image', ...input });
|
|
80
|
+
const body = requests.at(-1);
|
|
81
|
+
assert.equal(body.model, expected.split('/')[1]);
|
|
82
|
+
assert.equal(body.quality, quality);
|
|
83
|
+
assert.equal(body.images.length, input.images?.length ?? 1);
|
|
84
|
+
assert.equal(Boolean(body.mask), Boolean(input.mask));
|
|
85
|
+
assert.equal(result.details.quality, quality);
|
|
86
|
+
assert.equal(result.details.responseQuality, 'low');
|
|
87
|
+
assert.equal(result.details.qualityWarning, `Provider reported quality low instead of requested ${quality}.`);
|
|
88
|
+
assert.ok(result.content[0].text.includes(result.details.qualityWarning));
|
|
89
|
+
assert.equal(`${result.details.provider}/${result.details.model}`, expected);
|
|
90
|
+
assert.equal(result.details.mode, 'edit');
|
|
91
|
+
assert.deepEqual(fs.readFileSync(result.details.paths[0]), PNG);
|
|
92
|
+
}
|
|
93
|
+
return { mode, model: expected, quality, edits: requests.length };
|
|
94
|
+
} finally { fs.rmSync(dir, { recursive: true, force: true }); }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (process.argv[1] && fs.realpathSync(process.argv[1]) === fs.realpathSync(new URL(import.meta.url))) {
|
|
98
|
+
const result = await checkImageEditDefaults(path.resolve(process.argv[2] ?? path.join(import.meta.dirname, '..')), process.argv[3] ?? 'current');
|
|
99
|
+
console.log(JSON.stringify(result));
|
|
100
|
+
}
|
|
@@ -49,7 +49,9 @@ for (const rel of sync.XHIGH12) {
|
|
|
49
49
|
const imageTool = path.join(root, sync.IMAGE_TOOL);
|
|
50
50
|
if (!fs.existsSync(imageTool)) problems.push(`missing ${sync.IMAGE_TOOL}`);
|
|
51
51
|
else {
|
|
52
|
-
const { IMAGE_MODEL_ALIASES } = await import(pathToFileURL(imageTool).href);
|
|
52
|
+
const { IMAGE_MODEL_ALIASES, IMAGE_GENERATION_DEFAULT, IMAGE_MODEL_RULES } = await import(pathToFileURL(imageTool).href);
|
|
53
|
+
if (JSON.stringify(IMAGE_GENERATION_DEFAULT) !== JSON.stringify(sync.imageDefaultOf(master))) problems.push(`${sync.IMAGE_TOOL}: default differs from resolved master`);
|
|
54
|
+
if (JSON.stringify(IMAGE_MODEL_RULES) !== JSON.stringify(sync.imageRulesOf(master))) problems.push(`${sync.IMAGE_TOOL}: rules differ from master`);
|
|
53
55
|
for (const [alias, ref] of Object.entries(sync.imageAliasesOf(master))) {
|
|
54
56
|
if (IMAGE_MODEL_ALIASES?.[alias] !== ref) problems.push(`${sync.IMAGE_TOOL}: image alias ${alias} is ${IMAGE_MODEL_ALIASES?.[alias] ?? "(missing)"}, master says ${ref}`);
|
|
55
57
|
}
|
package/scripts/models-sync.mjs
CHANGED
|
@@ -165,10 +165,16 @@ export function validateMaster(master) {
|
|
|
165
165
|
const d = master.imageGenerationDefault;
|
|
166
166
|
if (d !== undefined) {
|
|
167
167
|
if (!d || typeof d.primary !== "string" || !Array.isArray(d.fallbacks)) problems.push("imageGenerationDefault needs primary and fallbacks");
|
|
168
|
-
else
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
else try {
|
|
169
|
+
const resolved = imageDefaultOf(master);
|
|
170
|
+
for (const ref of [resolved.primary, ...resolved.fallbacks]) {
|
|
171
|
+
const slash = typeof ref === "string" ? ref.indexOf("/") : -1;
|
|
172
|
+
const card = slash > 0 ? master.providers[ref.slice(0, slash)]?.[ref.slice(slash + 1)] : undefined;
|
|
173
|
+
if (card?.imageGeneration !== true) problems.push(`imageGenerationDefault ${ref} is not an image model`);
|
|
174
|
+
if (card?.imageEditing !== true) problems.push(`imageGenerationDefault ${ref} must support editing`);
|
|
175
|
+
if (!ref?.startsWith("openai-codex/")) problems.push(`imageGenerationDefault ${ref} must be subscription-only (openai-codex)`);
|
|
176
|
+
}
|
|
177
|
+
} catch (error) { problems.push(error.message); }
|
|
172
178
|
}
|
|
173
179
|
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`);
|
|
174
180
|
return problems;
|
|
@@ -290,8 +296,15 @@ export function imageRulesOf(master) {
|
|
|
290
296
|
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;
|
|
291
297
|
return out;
|
|
292
298
|
}
|
|
299
|
+
// Defaults accept image aliases so adding a newer master card advances both generation and edits.
|
|
300
|
+
// Resolve at sync time, keeping the runtime independent of the build-time master file.
|
|
301
|
+
export function imageDefaultOf(master) {
|
|
302
|
+
const aliases = resolvedAliases(master);
|
|
303
|
+
const resolve = ref => aliases[ref] ?? ref;
|
|
304
|
+
return { primary: resolve(master.imageGenerationDefault.primary), fallbacks: master.imageGenerationDefault.fallbacks.map(resolve) };
|
|
305
|
+
}
|
|
293
306
|
function imageRuntimeBlock(master) {
|
|
294
|
-
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
|
|
307
|
+
return HEAD("image runtime") + `export const IMAGE_MODEL_RULES = Object.freeze(${JSON.stringify(imageRulesOf(master))});\nexport const IMAGE_GENERATION_DEFAULT = Object.freeze(${JSON.stringify(imageDefaultOf(master))});\n` + TAIL();
|
|
295
308
|
}
|
|
296
309
|
export function xhighRefsOf(master) {
|
|
297
310
|
const refs = [];
|