@duyquangnvx/image-gen 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ 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.1 (2026-10-12)
10
+
11
+ ### Upgrade from v0.13.0
12
+
13
+ - Nothing to do.
14
+
15
+ ### Changed
16
+
17
+ - 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.
18
+ - 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.
19
+
9
20
  ## v0.13.0 (2026-10-09)
10
21
 
11
22
  ### 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`). Give the tool a timeout of 10 minutes.
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.0";
617
+ const VERSION = "0.13.1";
618
618
  /** The short SHA, with `+dirty` when the tree had uncommitted changes. */
619
- const COMMIT = "b279cf3";
619
+ const COMMIT = "1d3c077";
620
620
  /** ISO 8601, UTC. */
621
- const BUILT_AT = "2026-10-09T16:13:14.981Z";
621
+ const BUILT_AT = "2026-10-12T04:16:52.394Z";
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
- /** The `code` npm prints when the registry refuses its credentials, or has none from it. */
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([
@@ -1036,7 +1040,7 @@ async function install(ctx, version) {
1036
1040
  }
1037
1041
  });
1038
1042
  }
1039
- /** The npm channel: `latest` and `install` through the npm beside the running Node. */
1043
+ /** `latest` and `install` through the npm beside the running Node, on the package's registry. */
1040
1044
  function createPackages(host, child = {
1041
1045
  spawn,
1042
1046
  spawnSync
@@ -3253,7 +3257,7 @@ function differences(asked, recorded) {
3253
3257
  //#endregion
3254
3258
  //#region src/cli/commands/image/timeouts.ts
3255
3259
  const MS_PER_MINUTE = 6e4;
3256
- /** How long a run may take, writes included; under the 10 minutes an agent's Bash tool allows at most. */
3260
+ /** Bounds a hang before sending. A sent call is bounded by `REQUEST_TIMEOUT_MS` instead (ADR-0013). */
3257
3261
  const RUN_TIMEOUT_MS = 9 * MS_PER_MINUTE;
3258
3262
  /** A sent call's own bound, which fires before undici gives up on headers (ADR-0013). */
3259
3263
  const REQUEST_TIMEOUT_MS = 27e4;
@@ -3801,7 +3805,7 @@ async function update(ctx) {
3801
3805
  if (problem !== null) throw problem;
3802
3806
  const latest = await packages.latest(ctx.signal);
3803
3807
  const before = await skill.state();
3804
- if (standing("0.13.0", latest) !== "behind") {
3808
+ if (standing("0.13.1", latest) !== "behind") {
3805
3809
  deliver(ctx, latest, {
3806
3810
  installed: null,
3807
3811
  skill: before,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duyquangnvx/image-gen",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Generate, edit and cut out images through the AI SDK, as a TypeScript library and the image-gen CLI",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -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 with `timeout: 600000` (its maximum): a call takes 30–145 s and gets up to 270 s, less when the run's 9 minutes are nearly used, past Bash's 120 s default. Several distinct assets follow [Many assets](#many-assets).
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, usually by a tool timeout. 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, with the `timeout` from step 4. |
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. |