@duyquangnvx/image-gen 0.13.0 → 0.13.2
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 +21 -0
- package/README.md +1 -1
- package/dist/cli.mjs +13 -8
- package/package.json +1 -1
- package/skills/image-gen/SKILL.md +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,27 @@ A release turns `## Unreleased` into `## vX.Y.Z (YYYY-MM-DD)`, which from the se
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## v0.13.2 (2026-10-12)
|
|
10
|
+
|
|
11
|
+
### Upgrade from v0.13.1
|
|
12
|
+
|
|
13
|
+
- Nothing to do.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `image-gen update` and the `registry` row of `image-gen doctor` work under npm 12, which answers `npm view` in an array; they failed with `E_NO_LATEST` there.
|
|
18
|
+
|
|
19
|
+
## v0.13.1 (2026-10-12)
|
|
20
|
+
|
|
21
|
+
### Upgrade from v0.13.0
|
|
22
|
+
|
|
23
|
+
- Nothing to do.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- The skill and the README no longer tell an agent to raise the Bash tool's timeout: Claude Code moves a command past it to the background and delivers the output when the command exits.
|
|
28
|
+
- The skill's `E_REGISTRY_AUTH` row for a sandboxed Bash now covers every command, not only `update`: the agent asks the user to type the command with `!` in front.
|
|
29
|
+
|
|
9
30
|
## v0.13.0 (2026-10-09)
|
|
10
31
|
|
|
11
32
|
### Upgrade from v0.12.1
|
package/README.md
CHANGED
|
@@ -180,7 +180,7 @@ be written has `null` for everything but `plate` and `kept`.
|
|
|
180
180
|
`hint` naming the next command, and `details`. A plan call takes 30–145 s and gets up to 270 s, less when the
|
|
181
181
|
run's 9 minutes are nearly used, so that the whole run, writes included, ends within them; the
|
|
182
182
|
`E_NO_ANSWER` message gives the time the call actually had. A run with under 10 s left for its call
|
|
183
|
-
does not send it (`E_TIMEOUT`).
|
|
183
|
+
does not send it (`E_TIMEOUT`).
|
|
184
184
|
Ctrl-C stops a run from sending more, but lets the calls already sent finish and writes their images.
|
|
185
185
|
[`skills/image-gen/`](./skills/image-gen/SKILL.md) is a Claude Code skill for driving the CLI; it
|
|
186
186
|
ships in the package, `image-gen skill install` copies it to
|
package/dist/cli.mjs
CHANGED
|
@@ -614,11 +614,11 @@ function createProviders() {
|
|
|
614
614
|
}
|
|
615
615
|
//#endregion
|
|
616
616
|
//#region src/cli/version.ts
|
|
617
|
-
const VERSION = "0.13.
|
|
617
|
+
const VERSION = "0.13.2";
|
|
618
618
|
/** The short SHA, with `+dirty` when the tree had uncommitted changes. */
|
|
619
|
-
const COMMIT = "
|
|
619
|
+
const COMMIT = "0ee0cb5";
|
|
620
620
|
/** ISO 8601, UTC. */
|
|
621
|
-
const BUILT_AT = "2026-10-
|
|
621
|
+
const BUILT_AT = "2026-10-12T07:02:35.631Z";
|
|
622
622
|
/** `engines.node` from package.json, always `>=X.Y`. */
|
|
623
623
|
const NODE_ENGINE = ">=22.12";
|
|
624
624
|
const BUILD = {
|
|
@@ -702,7 +702,11 @@ function npmContext(host, child) {
|
|
|
702
702
|
//#region src/cli/adapters/packages/npm-run.ts
|
|
703
703
|
const NPM_ERROR_CODE = /^npm (?:error|ERR!) code (\S+)$/mu;
|
|
704
704
|
const NPM_ERROR_PATH = /^npm (?:error|ERR!) path (.+)$/mu;
|
|
705
|
-
/**
|
|
705
|
+
/**
|
|
706
|
+
* The `code` npm prints when the registry refuses its credentials, or has none from it. Claude Code's
|
|
707
|
+
* sandbox refuses a host with the same 403, and npm prints none of its proxy's headers, so only the
|
|
708
|
+
* skill's Failures row tells them apart.
|
|
709
|
+
*/
|
|
706
710
|
const AUTH_CODES = /* @__PURE__ */ new Set(["E401", "E403"]);
|
|
707
711
|
/** The `code` npm prints when it cannot reach the registry at all. */
|
|
708
712
|
const NETWORK_CODES = /* @__PURE__ */ new Set([
|
|
@@ -1007,7 +1011,8 @@ async function latest(ctx, signal) {
|
|
|
1007
1011
|
code: done.code,
|
|
1008
1012
|
said: done.stderr
|
|
1009
1013
|
}, "E_NPM_FAILED");
|
|
1010
|
-
const
|
|
1014
|
+
const answer = jsonOf(done.stdout);
|
|
1015
|
+
const version = Array.isArray(answer) && answer.length === 1 ? answer[0] : answer;
|
|
1011
1016
|
if (!isVersion(version)) throw new UserError("E_NO_LATEST", `npm answered no version ${doing}: '${done.stdout.trim()}'`);
|
|
1012
1017
|
return version;
|
|
1013
1018
|
}
|
|
@@ -1036,7 +1041,7 @@ async function install(ctx, version) {
|
|
|
1036
1041
|
}
|
|
1037
1042
|
});
|
|
1038
1043
|
}
|
|
1039
|
-
/**
|
|
1044
|
+
/** `latest` and `install` through the npm beside the running Node, on the package's registry. */
|
|
1040
1045
|
function createPackages(host, child = {
|
|
1041
1046
|
spawn,
|
|
1042
1047
|
spawnSync
|
|
@@ -3253,7 +3258,7 @@ function differences(asked, recorded) {
|
|
|
3253
3258
|
//#endregion
|
|
3254
3259
|
//#region src/cli/commands/image/timeouts.ts
|
|
3255
3260
|
const MS_PER_MINUTE = 6e4;
|
|
3256
|
-
/**
|
|
3261
|
+
/** Bounds a hang before sending. A sent call is bounded by `REQUEST_TIMEOUT_MS` instead (ADR-0013). */
|
|
3257
3262
|
const RUN_TIMEOUT_MS = 9 * MS_PER_MINUTE;
|
|
3258
3263
|
/** A sent call's own bound, which fires before undici gives up on headers (ADR-0013). */
|
|
3259
3264
|
const REQUEST_TIMEOUT_MS = 27e4;
|
|
@@ -3801,7 +3806,7 @@ async function update(ctx) {
|
|
|
3801
3806
|
if (problem !== null) throw problem;
|
|
3802
3807
|
const latest = await packages.latest(ctx.signal);
|
|
3803
3808
|
const before = await skill.state();
|
|
3804
|
-
if (standing("0.13.
|
|
3809
|
+
if (standing("0.13.2", latest) !== "behind") {
|
|
3805
3810
|
deliver(ctx, latest, {
|
|
3806
3811
|
installed: null,
|
|
3807
3812
|
skill: before,
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ Each image is billed to whoever the chosen model bills: `--model provider:id` fo
|
|
|
15
15
|
1. **Intent.** An existing image the user wants changed while keeping the rest is an **edit**; images given only for style, composition, or mood are references to a **generate**; no images is a generate. Assume a new image unless the user clearly asks to change one.
|
|
16
16
|
2. **Destination.** A file the project will use goes where the user says, or where the project keeps such assets. A preview or a round of iteration goes to a scratch directory inside the project, such as `previews/` (create it first): the sandbox may let a command write nowhere else. Keep existing files: write a sibling such as `hero-v2.png`, and pass `--force` only when the user asked for the file to be replaced.
|
|
17
17
|
3. **Prompt.** Read [references/prompting.md](references/prompting.md) once per session before the first prompt. An entry from a game's art manifest goes through [references/art-entries.md](references/art-entries.md) first: it maps each field to the prompt and flags, and the game's gate to what the CLI reports. Classify the request into a [use-case slug](references/prompting.md#use-case-taxonomy), then write it in the [prompt schema](references/prompting.md#prompt-schema); [references/sample-prompts.md](references/sample-prompts.md) has a recipe per slug. Pick the [flags](#commands) the request needs, `--aspect` for its shape first.
|
|
18
|
-
4. **Run** the [command](#commands) through the Bash tool
|
|
18
|
+
4. **Run** the [command](#commands) through the Bash tool: a call takes 30–145 s and gets up to 270 s, less when the run's 9 minutes are nearly used. Several distinct assets follow [Many assets](#many-assets).
|
|
19
19
|
5. **Read the envelope.** Every file in `data.images` was written and billed, whether `ok` is `true` or not, and goes into the report even when the run failed. On `ok: false`, act on the [failure](#failures); a rerun asks only for the images still missing, under new names unless it reruns a set.
|
|
20
20
|
6. **Look.** With two or more candidates, or any image with alpha, build a [`contact-sheet`](#commands) of them and `Read` it once; `Read` a single opaque image directly. Check subject, style, composition, verbatim text, and every invariant. On a miss, change one thing in the prompt, repeat the invariants, and run again to a new `--out`.
|
|
21
21
|
7. **Report** the final path(s), the final prompt, who was billed (`data.billing`), and any `data.warnings`.
|
|
@@ -73,17 +73,17 @@ A failure has `ok: false` and a diagnostic with a `code`, a `message`, often a `
|
|
|
73
73
|
| `E_OUT_OF_CREDIT` (exit 2) | Stop. Tell the user the OpenAI account needs Credit, and offer the plan's route from `hint` as a choice. Never switch to it unasked. |
|
|
74
74
|
| `E_LOGIN_REQUIRED`, `E_NO_TTY` | Stop. Ask the user to type `! image-gen login`: its sign-in needs a person at a browser. To see which provider is ready without spending quota, run `image-gen --json doctor`. |
|
|
75
75
|
| `E_LOGIN_DENIED`; or in Claude Code's sandbox `E_FILE_DENIED`, or `E_NETWORK` or `E_NO_ANSWER` from a provider no run has reached yet | The sandbox is blocking image-gen. Keep `--out` inside the project, stop, and follow [Sandbox](references/setup.md#sandbox). When the user says these are allowed already, follow the row below that fits the code. |
|
|
76
|
-
| `E_REGISTRY_AUTH` while Bash runs sandboxed | The sandbox's proxy refused the registry's host with a 403, which npm reports as a refused login, so the `hint` does not apply. For `update`, ask the user to type `! image-gen update`, which runs outside the sandbox; in `doctor`, only the `registry` row is affected. |
|
|
77
76
|
| `E_PROVIDER_WARNED`, `E_WRONG_SIZE` | Billed, and the images were written anyway (`data.images`). `Read` them and tell the user what the provider dropped or what size came back (an image's `askedFor` is the size asked for); keep one that serves. Do not rerun just to keep it: `--allow-warnings` only turns the same miss into a success. |
|
|
78
77
|
| `E_UNSUPPORTED_REQUEST` | Nothing was billed: the model cannot honour the request as asked, such as `--transparent` on Gemini or a `--mask` on the plan. Rerun with what `hint` names changed; when only another model can do it, ask the user, since the model decides who is billed. |
|
|
79
78
|
| `E_OUTPUT_EXISTS` | While rerunning a set, that asset is done: skip it, per [Many assets](#many-assets). Otherwise pick a new sibling name, per step 2. `message` names the file in the way: the image, its `.json` record, or under `--cutout` its `.plate.png`. When `hint` says the call was billed, another program took the name during the run: tell the user. |
|
|
80
|
-
| `E_INTERRUPTED` (exit 130, 143) | The run was stopped
|
|
79
|
+
| `E_INTERRUPTED` (exit 130, 143) | The run was stopped by a signal: Ctrl-C (130) or SIGTERM (143). It sent nothing more, but let the calls already sent finish: every image that came back was billed and written, and `data.images` lists them. Rerun the same command with `--resume`, which sends only for what is missing. |
|
|
81
80
|
| `E_NO_ANSWER` (exit 2) | Stop. A request may have reached the provider and been billed, yet no image came back for it, at all or within the time it had, which `message` gives. Every image that did come back was written, and `data.images` lists them. Tell the user; once they accept paying again for what is missing, run the `--resume` command the `hint` names, which sends only for that. |
|
|
82
81
|
| `E_NO_IMAGE` | The model answered without an image, usually because it declined the content. Rephrase once, then tell the user. |
|
|
83
82
|
| `E_HTTP` with `details.status` 400 | The provider refused the request; `message` quotes its words. For a content refusal, rephrase once, then tell the user. |
|
|
84
83
|
| `command not found` (exit 127) | Under nvm every Node version has its own global packages, so image-gen may sit under another one. Look with `ls ~/.nvm/versions/node/*/bin/image-gen` (nvm-windows: `ls "$NVM_HOME"/v*/image-gen.cmd`) and `node --version`; tell the user which Node holds it and which one this shell runs. Otherwise install it as [setup](references/setup.md#install) says. |
|
|
85
84
|
| exit 70 | A bug in image-gen, with no envelope. Stop, give the user its stderr verbatim, and offer the message [Feedback](#feedback) describes. |
|
|
86
85
|
| `E_SKILL_DENIED` | Claude Code's sandbox cannot write the skill's folder. Ask the user to type `! image-gen skill install`, which runs outside it. |
|
|
86
|
+
| `E_REGISTRY_AUTH` while Bash runs sandboxed | The sandbox's proxy refuses a registry it does not allow with a 403, which npm reports as a refused login, so the `hint` does not apply. Ask the user to type the command with `!` in front, which runs it outside the sandbox; in `doctor`, it touches only the `registry` row. |
|
|
87
87
|
| `E_SKILL_REINSTALL_FAILED` | `update` installed the new version, whose own `skill install` then failed with the code in `details.code`, which this skill may not know. Follow the `hint`, then load the skill again. |
|
|
88
88
|
| `E_NODE_VERSION` | This shell runs a Node older than image-gen needs, as when nvm gives your shell another version than the user's terminal. Give the user the `hint` verbatim. |
|
|
89
89
|
| exit 2 | The user must act on their machine: give them the `message` and `hint` verbatim, never ask for a secret in the conversation, and run the command again once they say it is done. |
|