## πŸš€ Updates v0.12.21: Composer Provider Pill & In-Card Regenerate Modal (#501, #502) - **Quick Provider Switcher Pill in Composer (#501)**: Mounted in `conversation.input.right` slot. Quick-switch providers and models on the fly directly from the composer toolbar without navigating to settings. - **In-Card Regenerate with Prompt Edit Modal (#502)**: Edit prompt and choose new vs same seed right from the chat message card with the `πŸ”„ Regenerate…` button. ## πŸš€ Updates v0.12.20: Interactive A/B Comparison Slider & Persistent Revision Carousel (#499, #500) - **Interactive In-Chat A/B Comparison Slider (#499)**: Touch- and mouse-friendly Before/After split comparison slider with draggable vertical divider handle and translucent badges. Seamlessly reveals original vs enhanced versions in chat cards for face restoration, inpainting, remix variations, and multi-version revisions. - **Persistent Revision Switcher Carousel in Chat Cards (#500)**: In-card revision history switcher with `< v1 / N >` navigation buttons, seed / timestamp metadata badges, and client-side `localStorage` caching (`dsh_image_gen_revisions:`) capped at 20 revisions across page reloads. ## πŸš€ Updates v0.12.12: Right Sidebar Image Studio & Session Asset Cataloging (#452, #453) - **Native Image Studio Workspace Panel (#452)**: Registered persistent right sidebar extension slot `sidebarRightTabs` and `sidebar.right.pane.tab` with identifier `dsh-image-studio`. Includes prompt style tag auto-completion, negative prompt exclusion chips, provider/model/aspect ratio selectors, transparent background toggle, compact recent thumbnail grid, and one-click Copy File Path / Insert into Chat actions. - **Session-Scoped Asset Cataloging & Semantic Naming (#453)**: Introduced `organizeBySession: boolean` (default: `true`) to organize assets into `/assets/images//`. Integrated `buildSemanticSlug` prompt entity extractor for clean filenames (e.g. `futuristic-hero-banner-cyberpunk-v1.png`) with full backward compatibility in Asset Vault. ## πŸš€ Updates v0.12.9: Full DSH Desktop Electron Compatibility (#478) - **DSH Desktop Scheme Authorization**: Extended `isTrustedLocalRequest`, `getRouteRejectionStatus`, and `getRouteWriteRejectionStatus` to authorize the privileged `dsh-app://app/` custom scheme from local loopback connections. - **Desktop Endpoint & Image Unblocking**: Unblocks `/dsh-image-gen/image`, `/dsh-image-gen/approval`, `/dsh-image-gen/vault`, and `/dsh-image-gen/config` from HTTP 403 Forbidden under Electron, restoring thumbnail rendering, Interactive Approval Gate actions, and Studio Vault functionality in DSH Desktop. - **Fail-Closed Security Invariant**: Untrusted non-loopback LAN origins and spoofed custom schemes (`evil-scheme://`, `dsh-app://untrusted.host`) remain strictly rejected with HTTP 403 Forbidden. ## πŸš€ Updates v0.12.8: Interactive Generation Approval Gate (#450) - **Interactive Approval Gate**: Added interactive confirmation gate before billable image generation calls. Configurable via `requireApproval: boolean` (default `false`) and `approvalTimeoutSec: number` (default `120`, range 5-600) under Settings > Safety. - **FalApprovalCard Toolview Card**: Renders interactive chat card with prompt, provider, model, dimensions, and estimated USD cost, offering `[πŸš€ Confirm Generation]` and `[✏️ Modify / Cancel]` actions. - **Fail-Safe Rollback & Coordination Endpoint**: Zero spend leakage on timeout or user cancellation; coordinated via protected `/dsh-image-gen/approval` endpoint. Supports `approved: true` parameter bypass for explicit confirmed runs. ## πŸš€ Updates v0.10.8: Lossless JSON Unification, Dual-Output & Strict Validation (#199) - **Lossless JSON & Dual-Output Unification**: `upscale_image`, `remove_background`, `blend_images`, and `vectorize_image` now consistently return `toLosslessJson` and formatted markdown `summary` for text-only LLMs. - **Strict Input Image Validation**: `extract_design_tokens`, `image_to_css_gradient`, and `check_image_contrast` explicitly validate source image readability instead of silent fallback. - **Unit Testing Suite**: Added `test/tool-consistency.test.mjs` covering tokenization, gradient generator, and PWA suite. # πŸ“¦ @goodandready/dsh-image-gen

Comprehensive Visual Generation & Image Processing Suite for DeepSeek Harness

npm version license DSH Plugin Node version

All Projects

πŸ‡¬πŸ‡§ English β€’ πŸ‡·πŸ‡Ί Русский β€’ πŸ‡¨πŸ‡³ δΈ­ζ–‡θ―΄ζ˜Ž

⭐ If you like this plugin, please star it on GitHub β€” it shows me that the plugin is useful to you and motivates me to keep developing it.

πŸ› If you find a bug or would like to request a feature, open a GitHub issue in any language β€” I will review your proposal and implement useful suggestions in a future plugin version.
--- ## πŸš€ Updates v0.10.26: Architecture Decomposition & Repository Sanitization (#235, #238, #239) * **Architecture & Modular Decomposition (#239)**: All server modules in `lib/` now strictly meet the <= 600 line threshold: extracted `lib/tools/generation-pack.js` (74 lines, reduces `lib/tools/generation.js` to 547 lines), `lib/history.js` (93 lines), and `lib/attachment-helper.js` (82 lines, reduces `lib/index.js` to 557 lines). Client codebase modularized across 15 sub-modules in `src/client/*` (all <= 337 lines). * **Repository Sanitization (#235)**: Internal agent workflow files (`AGENTS.md`, `index.md`) fully untracked from Git and excluded via `.gitignore` and `.gitattributes`. * **Theme Parity Completed (#238)**: Full verification and closure of zero-standalone-color rule across all Web UI surfaces with native `--dsw-alias-*` variables and `color-mix(...)` state tints. * **Package Integrity**: Added canonical `README.ru.md` and `README.zh.md` to npm package `files` allowlist. ## πŸš€ Updates v0.10.25: Theme Color Parity, Responsive Mockups, Patterns & Spritesheets (#173, #177, #178, #238) * **100% Theme Color Parity (#238)**: Completely replaced all hardcoded `rgba(...)` and hex color literals in the Web UI (`src/client/10-css.js`, `src/client/80-gallery.js`) with native DSH theme variables (`--dsw-alias-*`) and dynamic `color-mix(...)`. Badges, alerts, and modal overlays automatically adapt to light and dark themes with zero hardcoded values. * **Responsive Multi-Device Mockup Generator (`generate_responsive_mockups`, #173)**: Single product prompt generates coherent Mobile (9:16), Tablet (3:4), and Desktop (16:9) viewports in parallel via `asyncPool` concurrency limit (3). Interactive toolview with tabbed preview navigation. * **Seamless Pattern Generator (`generate_seamless_pattern`, #178)**: Automated tileable background texture generation with periodic boundary condition checks and CSS tiling preview. * **2D Spritesheet Generator (`generate_spritesheet`, #177)**: Produces horizontal animation strips with CSS keyframe generator and multi-frame SVG previews for 2D game dev and web UI animations. * **Client Modular Source Build (#244)**: Decomposed monolithic `lib/client.js` into 15 structured fragments under `src/client/*` with automated build runner `scripts/build-client.mjs`. Preflight check `FAIL=0`, 179/179 automated tests passing. ## πŸš€ Updates v0.10.24: Quality Block β€” Publication Boundary, Settings Status, Theme Colors & Module Split (#235–#242) * **Publication Boundary**: Added `.gitattributes` with `export-ignore` for `AGENTS.md`, `index.md`, `docs/`, and `.gitea/` so GitHub source archives and `git archive` no longer ship internal workflow files. * **Settings Status Fallback**: Corrected provider/config status handling in the Settings Card so partial/unknown states no longer show a false β€œunavailable”. * **Design-System Alignment**: Renamed residual `fal-` CSS class prefixes to the `ig-` system and bound colors to DSH theme variables via `var(--dsw-alias-*, )`. * **Sensitive File Hardening**: History, cache meta/data, and spend-meter writes now enforce `0600` permissions after write. * **Dead Code Removal & Module Split**: Removed unused `listCuratedStyles`; split oversized server modules β€” `providers.js` utils extracted to `provider-utils.js`, `processing.js` into `processing-basic.js` + `processing-advanced.js`. Client file split is tracked separately (#244). ## πŸš€ Updates v0.10.23: In-App Auto-Updater, Settings Synchronization, Active Probes & Language Purity (#232) * **One-Click In-App Auto-Updater**: Direct 1-click update support inside the plugin Settings Card (`UpdaterSection`) backed by `/api/dsh-image-gen/update`. Fetches the npm registry for release manifests, verifies semver differences, and securely triggers `dsh plugin add @goodandready/dsh-image-gen@latest` restricted to loopback and private LAN connections. * **1:1 Settings Synchronization**: Fully synchronized host `Config` schema in `lib/index.js` with client UI fields (`lib/client.js`), exposing `autoEnhancePrompt` and `defaultStylePreset` under the `✨ Enhancer` tab. * **Active Diagnostic Probes**: Added real HTTP network probes in `testProviderConnection` for Replicate (`/v1/models`), Google Gemini (`/v1beta/models`), and ByteDance Seedream with timeout protection and live roundtrip latency tracking. * **Strict Multi-Language Compliance**: Pure standard `en` and `zh` localization bundles embedded in core package; modularized Russian language support via `goodandready/dsh-russian-lang` per DSH plugin guidelines. Exactly 0 Cyrillic characters in product code (`lib/`). * **WAI-ARIA Accessibility Hardening**: Enhanced tab navigation and input form validation with `role="tablist"`, `role="tab"`, `aria-selected`, `aria-controls`, `role="tabpanel"`, `aria-describedby`, and `role="alert"`. ## πŸš€ Updates v0.10.22: Referential Stability & React Error #185 Infinite Loop Fix (#230) * **Settings Card Referential Stability**: Resolved React Error #185 (`Maximum update depth exceeded`) in `FalSettingsCardController` and `CardForm.prototype.bind`. Store snapshots are referentially cached during render cycles (`Object.is(prev, next) === true`), completely preventing infinite re-render loops in React 18 / `useSyncExternalStore`. * **Deep DSH Store Integration**: Added seamless runtime integration with `@deepseek-ai/dsh-client-store` (`runtime.createSnapshotStore`) paired with a robust standalone snapshot caching fallback. * **Automated Regression Test Suite**: Added dedicated referential identity test in `test/client-syntax.test.mjs` verifying snapshot immutability across repeated reads, single-notification publish triggers, and clean listener lifecycle. ## πŸš€ Updates v0.10.21: Variations Workbench, Smart Aspect Ratio Crop & Brand Asset Pack (#228) * **Variations & Style Remix Workbench**: Interactive visual drawer embedded directly in `FalImageCard` and Gallery. Fine-tune variations with a continuous creativity / denoising strength slider (0.05 to 0.95), preset quick buttons ("Subtle 0.25", "Creative 0.65"), and prompt modifier guidance. * **Intelligent Aspect-Ratio Canvas Cropper & Resizer (`smart_crop_image`)**: Instant lossless aspect ratio framing for social and responsive surfaces (`1:1`, `16:9`, `9:16`, `4:3`, `3:2`, `2:3`) supporting focal heuristics (`auto_focus`, `center`, `rule_of_thirds`, `letterbox`) via zero-dependency pure Node.js SVG vector raster wrapper. * **Project Asset Pack & Social Card Exporter (`export_asset_pack`)**: Production-ready automated brand asset generation producing SVG favicons, PWA application icon suite (`icon-192.svg`, `icon-512.svg`), `manifest.webmanifest`, high-resolution OpenGraph social banner preview (`og-card.svg` at 1200Γ—630), and an asset manifest catalog (`catalog.json`). * **Dedicated Toolviews for 12 Visual Tools**: Direct interactive action buttons and visual renderers in conversation sessions for all generation, editing, inpainting, remix, crop, export, and collage tools. * **Strict Localization Standard**: Complete `zh` and `en` UI dictionary integration; Russian locale registered via `goodandready/dsh-russian-lang`. ## πŸš€ Updates v0.10.19: Sidebar Gallery, Diagnostics & Style Engine (#224) * **Native Sidebar Gallery & History Drawer**: Integrated directly into DSH's native right sidebar pane (`sidebarRightTabs` and `sidebar.right.pane.tab`), `betterSidebar`, and a quick-access utility chip in the conversation header (`conversation.session.header.utilities`). Browse past generations, inspect metadata, copy prompts, and export links without cluttering the chat. * **Interactive Provider Diagnostics**: Real-time "Test Connection" button in the Settings Card under the Providers tab. Ping Fal.ai, ComfyUI, Automatic1111, or Custom OpenAI-compatible endpoints with live roundtrip latency tracking and status badges (Ready, High Latency, Unreachable). * **Curated Style Presets & Smart Prompt Polisher**: Built-in artistic engine with 10 curated styles (`cinematic`, `photorealistic`, `anime`, `minimalist_vector`, `isometric_3d`, `analog_film`, `cyberpunk`, `pixel_art`, `oil_painting`, `claymation`), optional `autoEnhancePrompt` setting, and `style_preset` tool parameter. * **Collage & Comparison Grid Assembler (`assemble_image_grid`)**: Stitch 2 to 4 images into clean side-by-side, 2x2 grid, or vertical collage comparison graphics via pure Node.js SVG raster rendering, zero heavy external binaries (< 250 KiB package size). * **Color Palette-Constrained Generation**: Pass `palette_colors` (hex color array) into `generate_image` to mathematically bias the prompt and negative prompt toward your exact brand color palette with automated WCAG contrast validation. * **Inpainting & Mask Support in `edit_image`**: Added `mask_image` (alias for `mask`) and fine-grained `strength` (0.0 to 1.0) control for localized inpainting in Fal.ai and custom gateways. * **Full Chinese & English UI Dictionaries**: Complete `zh` and `en` localization coverage in Web UI, with Russian translation registered via `goodandready/dsh-russian-lang`. ## πŸš€ Updates v0.10.18: Speed Acceleration & Quality Hardening (#222) * **Parallel Batch & Pack Generation**: Multi-variation requests (`count > 1`, `prompts` array) and `generate_image_pack` multi-ratio workflows now execute concurrently with a concurrency limit (`concurrency: 3`) via `asyncPool`, reducing generation wait times by up to **3x**. * **Zero-Delay Initial Polling**: Eliminated artificial initial delay in `pollStatus` and queue runners (Fal.ai, ComfyUI), inspecting generation status immediately on first attempt and shaving 1–1.5s off fast generative workflows. * **Sub-Millisecond L1 In-Memory Cache**: Built-in 32-entry in-memory LRU cache atop disk cache L2 provides instantaneous (< 0.1 ms) cache hits without synchronous disk I/O. * **Fast-Fail Quota Detection**: Added classification for HTTP 402 (Payment Required) and exhausted account quota/credits in `isFatalClientError`, enabling immediate, clean fallback transitions without fruitless retry loops. * **Expanded Test Suite**: Added `test/batch5-speed-quality.test.mjs`, bringing total test coverage to **136 automated unit tests (100% pass)**. ## πŸš€ Updates v0.10.17: Modular Tool Lifecycle (#216, #217) * **Tool modules extracted from `apply()`**: host lifecycle in `lib/index.js` is now a thin cordis entry (~650 lines). Tool definitions live in `lib/tools/{generation,processing,editing,inspect,frontend}.js` behind `lib/register-tools.js`. * **Per-tool labeled `ctx.effect`**: each of the 15 tools registers in its own effect (`dsh-image-gen: tool `) for clean unload/reload disposal. * **Project meta**: `AGENTS.md` and `index.md` document architecture, constraints, and the test matrix (internal workflow files β€” not shipped in the npm package). * **Design contract**: `docs/design/DESIGN.md` no longer advertises the removed HistoryGallery UI (#203). * **Regression lock**: `test/lifecycle-structure.test.mjs` asserts modular layout, labeled effects, and meta files. Suite: **132 unit tests**. ## ⚑ Overview **`@goodandready/dsh-image-gen`** is a premier graphic generation and visual processing suite for DeepSeek Harness. It equips autonomous agents with an extensible set of tools for image generation, transformation, background removal, upscaling, vectorization, multi-reference blending, and quality inspection across 8 generative backends. --- ## πŸ›‘οΈ Reliability, Performance & Quality (v0.10.0) * **Exponential Backoff with Jitter**: Adaptive polling for FAL, Replicate, and ComfyUI queues protects against HTTP 429 rate limits. * **Error Classification in Fallback Cascade**: Client-side errors (Content Policy, 400 Bad Request, NSFW) fail fast without wasting API credits on other providers. * **Deterministic Hash Caching**: Exact matches of prompt, model, and seed return instantly from local storage with zero API expense. * **ComfyUI & Automatic1111 Drag-and-Drop**: Metadata is packed into PNG `Parameters` chunks in standard format. * **Dimension Snapping**: Automatic normalization to multiples of 64 guarantees VAE bucket compatibility. * **Enhanced Style Presets**: Built-in styles include tailor-made negative prompts and optimal guidance scale settings. --- ## πŸ› οΈ Complete Tools Reference * **`save_image_to_workspace` (#510)**: Deterministic content-addressed export of generated images to the workspace disk (`image-.`) with dual lexical/realpath containment checks and staged atomic rename. * **`compose_baoyu_prompt` (#505)**: 5-dimension style & composition prompt assembler. Synthesizes orthogonal design specifications across Composition Type, Palette, Rendering Medium, Text Layout, and Mood with rendering constraints and taxonomy discovery. * **`canvas_state` (#506)**: Inspect the image-gen workbench infinite canvas: shapes, image provenance, hand-drawn sketches, notes, and active selection metrics. * **`view_canvas` (#507)**: Materialize current workbench canvas selection as a durable conversation image attachment for sketch-to-image and multimodal visual reasoning. * **`compare_models_matrix` (#503)**: Multi-model shootout benchmarking tool. Concurrently generates a prompt across multiple models (Gemini Imagen 3, FAL FLUX Dev, Replicate FLUX Schnell, Seedream 3, DALL-E 3) with target aspect ratio adapters, latency/cost metering, and Sharp contact sheet grid preview. * **`search_inspiration_prompts` (#504)**: Curated offline inspiration catalog of 970+ battle-tested prompts from `awesome-gpt-image-2` and `handraw-style`. Filterable by style, category, scene, and keywords with zero token/network overhead. * **`generate_seamless_texture` (#468)**: Production-ready seamless repeating textures and materials for 3D surfaces, games, and web patterns with toroidal wrapping and 3Γ—3 inspection grid. * **`reverse_prompt_and_recreate` (#465)**: Deconstruct visual aesthetics, lighting, optics, medium, and palette mood of any image into a structured reverse-engineered prompt, with optional instant style recreation. * **`restore_face_and_details` (#467)**: Localized face, eyes, and high-frequency detail restoration (Hi-Res detail fix) with automatic zone targeting and seamless feathered edge alpha blending. * **`generate_with_control` (#463)**: Structural conditioning and geometry-guided generation using reference input controls (`mode: "canny" | "depth" | "pose" | "sketch"`). Provides edge feature extraction, depth gradients, and pose bounding box normalization. * **`generate_turnaround_sheet` (#464)**: Coherent multi-angle turnaround model sheets for 3D asset modeling and concept sheets (`front`, `side`, `back`, `three_quarter`), with automated Sharp slicing into individual camera angle assets and JSON manifest. * **`outpaint_image` (#459)**: Intelligent canvas expansion across directional borders (`top`, `bottom`, `left`, `right`) with Sharp-powered transparent compositing, automated SVG outpaint mask generation, and seamless background scenery continuation. * **`async_generate_image` (#460)**: Asynchronous generation pipeline with immediate `task_id` dispatch (`wait: false`), live progress updates (`queued` -> `processing X%` -> `completed`), and configurable exponential backoff polling guard. * **`translate_image_text` (#454)**: Translate in-image typography into Russian, English, or Chinese with grounding/OCR text detection, automated background inpainting mask generation to cleanly erase source text, and typography re-rendering with matching coordinates, color, and font metrics. * **`render_wireframe_asset` (#455)**: Transform rough wireframes, whiteboard sketches, or UI mockups into high-fidelity design assets using curated design system presets (`modern_saas`, `dark_glassmorphism`, `brutalist`, `apple_minimal`) and calibrated layout preservation fidelity. * **`generate_drawio_diagram` (#451)**: Generate editable Draw.io / diagrams.net (`.drawio` / `mxfile` XML) architectural schemes and workflows with clean standalone SVG vector preview. Supports 5 aesthetic themes (`light`, `dark`, `blueprint`, `corporate`, `nord`), 10 node shapes (rounded, rectangle, ellipse, diamond, cylinder, cloud, actor, hexagon, parallelogram, step), connector routing (orthogonal, straight, curved, dashed, bidirectional), and automatic topological layout (`horizontal`, `vertical`, `grid`, `tree`). Includes clipboard snippets for Figma and Penpot. * **`generate_image`**: Generate images with pluggable providers, reproducible seeds, aspect ratios, character & subject consistency binding (`reference_image`, `reference_strength`: 0.1–1.0 with FLUX Redux, Seedream, Midjourney `--cref`, Replicate), safe multi-turn context compaction guard (#456), curated style presets (`photorealistic`, `anime`, `isometric_3d`, `pixel_art`, `cinematic`, `minimalist_vector`, `claymation`, `cyberpunk`, `analog_film`, `oil_painting`), negative prompt filtering with automated natural-language fallback adapter for non-negative models (DALL-E, FLUX), and precision inference tuning (`steps`: 1–150, `guidance_scale`: 1–30, `sampler_name`: `euler`, `dpmpp_2m`, etc.)., reproducible seeds, aspect ratios, curated style presets (`photorealistic`, `anime`, `isometric_3d`, `pixel_art`, `cinematic`, `minimalist_vector`, `claymation`, `cyberpunk`, `analog_film`, `oil_painting`), negative prompt filtering with automated natural-language fallback adapter for non-negative models (DALL-E, FLUX), and precision inference tuning (`steps`: 1–150, `guidance_scale`: 1–30, `sampler_name`: `euler`, `dpmpp_2m`, etc.). * **`set_style_anchor` (#283)**: Lock session visual identity (subject, outfit, medium, color palette, lighting) for consistent multi-turn generation. * **`generate_ui_asset` (#284)**: Layout-aware UI asset generator for icons, stickers, badges, spot graphics, and heroes with negative space constraints (`isolated`, `centered`, `left_empty`, `right_empty`, `top_empty`, `bottom_empty`) and auto-transparency. * **`generate_style_matrix` (#286)**: 2x2 visual benchmarking matrix exploring 4 aesthetic presets simultaneously with blind compare mode and 1-click style preset adoption. * **`In-Chat Inpainting Canvas` (#285)**: Interactive brush overlay and mask drawer mounted directly over image message cards in chat. * **`Smart Provider Fallback Chain` (#282)**: Intelligent cascading failover across providers on 429, 5xx, timeouts, or depleted balance. * **`edit_image`**: Targeted inpainting and modification with automatic session reference resolution (#142, #144, #145). * **`vary_image`**: Controlled variation generation preserving composition (#143, #144). * **`remove_background`**: Extract subject with transparent PNG output (FAL BiRefNet / Rembg). * **`upscale_image`**: 2x / 4x super-resolution with clarity reconstruction. * **`vectorize_image`**: Convert raster graphics to clean scalable SVG vectors with palette quantization. * **`blend_images`**: Multi-reference composition mixing. * **`generate_image_pack`**: Simultaneous multi-aspect ratio rendering with graceful partial recovery. * **`generate_responsive_mockups` (#173)**: One shared product prompt rendered as Mobile (9:16), Tablet (3:4) and Desktop (16:9) UI mockups in parallel. Keeps style/palette coherent across viewports, saves `mockup-mobile.png` / `mockup-tablet.png` / `mockup-desktop.png`, and shows a tabbed viewport preview in chat. * **`compare_images`**: Pixel-level visual difference ratio comparison. * **`inspect_image_quality`**: Automated visual audit, Laplacian sharpness scoring, and defect detection. * **`extract_design_tokens`**: Extract CSS Variables, Tailwind color palettes, and W3C Design Tokens from concept art (#172). * **`image_to_css_gradient`**: Generate lightweight pure CSS Mesh / Radial / Linear gradients (< 1KB) from image colors (#174). * **`check_image_contrast`**: Evaluate background luminance and WCAG 2.1 AA/AAA contrast for text with scrim suggestions (#175). * **`optimize_vector_svg`**: Clean and sanitize SVG, normalize viewBox, and export ready-to-use React TSX components (#176). * **`generate_pwa_icon_suite`**: Generate full PWA icon sets, HTML meta tags, and web app manifest.json (#190). --- ## πŸš€ Updates in v0.10.4: Cordis Lifecycle, Full Settings GUI, and i18n - **Cordis Lifecycle (#136)**: wrapped all 7 tool registrations in `ctx.effect` for proper disposal on reload. - **Settings GUI Completeness (#137)**: exposed fields for Replicate, SeaDream, Gemini, Local ComfyUI/A1111, style presets, and LLM enhancer. - **Package Manifest (#138)**: declared kernel `peerDependencies` (`host-webserver`, `settings`, `llm`, `system-prompt`). - **React Cleanup (#139)**: removed dead state hooks from `FalImageCard`. - **Complete Localization (#140)**: eliminated hardcoded strings, wiring comprehensive dictionaries for en, ru, and zh. ### πŸš€ What's New in v0.10.7 (#197) * **Robust Error Formatting**: completely prevents `[object Object]` from appearing in provider refusal chains, extracting deep `.message`, `.detail`, and `.error` objects cleanly. * **Deduplicated Provider Prefixes**: eliminates redundant `codex: codex: ...` prefixes. * **FAL Credential Aliasing**: seamless fallback between `FAL_API_KEY` and `FAL_KEY` in credentials and environment. * **Subscription Aspect Ratio Mapping**: maps aspect ratios (`16:9`, `3:2`, `9:16`, `2:3`) to appropriate subscription dimensions (`1536x1024` / `1024x1536`) instead of falling back to default square `1024x1024`. ### πŸš€ What's New in v0.10.16 * **Safe Attachment Service Fallback (#214)**: Added graceful fallback handling in `saveAttachmentSafe` across all 8 visual tools (`generate_image`, variations, `remove_background`, `upscale_image`, `blend_images`, etc.). When running in headless CLI mode or when the attachment store is unavailable, outputs are safely written to disk with full file paths and data references rather than crashing tool execution. * **HTTP Image Endpoint Strict Validation**: Hardened `/dsh-image-gen/image` route against malformed or NaN parameters (`b`, `w`, `h`), cleanly responding with HTTP 400 or 404 without leaking internal system traces. * **ComfyUI Node Error Extraction**: Integrated `extractComfyNodeErrors` to parse node execution errors from `/history/{pid}` status responses, immediately reporting root-cause node diagnostics rather than timing out. * **Custom Provider Error Normalization**: Standardized gateway error extracts through `formatErrorMessage`, eliminating raw JSON or `[object Object]` artifacts on 4xx/5xx API responses. * **Cache & History Consistency**: Ensured content-addressed disk cache hits synchronize seamlessly with generation history and sidecar metadata. * **Test Suite Expansion**: Added `test/batch4-hardening.test.mjs`, expanding test coverage to **128 automated unit tests (100% pass)**. ### πŸš€ What's New in v0.11.12 * **Character Sheet Generator (`generate_character_sheet`, #181)**: Synthesizes consistent character turnaround and model sheets (1x3, 2x2, emotions) preserving facial features and attire across anime, 3D, concept, and comic styles. * **FaceID & Portrait Consistency (`face_reference`, #183)**: FaceID / IP-Adapter prompt directives and `face` anchor mode in `set_style_anchor` for persistent facial likeness across scenes. * **OCR Localization & Text Replacement (`replace_image_text`, #180)**: Automated OCR text detection via `dsh-vision-bridge`, seamless background inpainting, and crisp typography replacement at original coordinates. * **3D Isometric Diagram Beautifier (`beautify_diagram`, #185)**: Converts raw Mermaid/Graphviz architecture diagrams into stunning 3D isometric tech illustrations for documentation and hero headers. * **Interactive Inpainting Canvas (#328)**: In-chat masking overlay with aspect ratio auto-detection, adjustable brush/eraser, and direct prompt dispatch. * **Live Progress Stream (#329)**: Real-time progress bar, stage indicators, and denoising step counters in `FalImageCard`. ### πŸš€ What's New in v0.11.9 * **ComfyUI Local Backend Payload Fix (#322, GitHub #7)**: Eliminated redundant nesting in `lib/providers/backends/local.js` that wrapped workflows as `{ prompt: { prompt: workflowGraph } }`, resolving `missing_node_type: Node 'ID #prompt' has no class_type` HTTP 400 errors during local ComfyUI generations. Added node shape validation before submission. ### πŸš€ What's New in v0.11.8 * **Bounded Config Payloads (#313)**: `PUT /dsh-image-gen/config` now uses bounded request streaming (`readBoundedRequestBody`) with a 64 KB cap, returning HTTP 413 `Payload Too Large` on oversized bodies to prevent memory exhaustion DoS. * **Build Parity Gate (#316)**: `scripts/build-client.mjs` supports `--check` mode, enforcing client distribution parity in `npm test`. * **Architecture Decomposition (#317)**: `lib/index.js` simplified into a lightweight facade (<400 lines) with dedicated `lib/config-schema.js` and `lib/resolve-source.js`. * **Runtime & Permissions Polish (#318, #319)**: Idempotent startup permissions repair and removal of legacy `loc.get` fallback in favor of standard Cordis translation runtime. ### πŸš€ What's New in v0.10.15 * **Loop Guard Zero-Limit Bypass (#212)**: Fixed an edge case where setting `loopGuardLimit: 0` (configured to disable protection) enforced a limit of 1 due to `Math.max(1, limit)`. Setting limit to 0 now properly bypasses loop checks. * **Security Hardening (Token Masking)**: Added automatic pattern masking for Replicate API tokens (`r8_...`) and Google Gemini API keys (`AIza...`) in `sanitizeErrorAndLogs`. * **Cache Resilience**: Isolated LRU touch updates in `getCachedGeneration` so that metadata write contention does not discard valid image bytes on cache hits. * **Defensive File Safety**: Added explicit file existence, empty file (0 bytes), and 50 MB maximum size cap checks in `resolveConversationImage` preventing OOM crashes on huge files. * **Vectorize Image Attachment & Toolview Preview**: `vectorize_image` now registers the SVG in `ctx.attachments` and provides `url`, enabling interactive preview in `tool.call.toolview`. * **SVG Markup Validation**: Added strict validation in `optimizeSvgContent` rejecting non-SVG strings with descriptive errors. * **Cost Meter Safety**: Hardened `assertBudgetAvailable` to handle string/undefined/NaN values safely. * **Expanded Test Suite**: Added `test/batch3-quality.test.mjs` expanding suite to **126 automated tests (100% pass)**. ### πŸš€ What's New in v0.10.14 * **dsh-clinebot Unified Visual Overhaul (#210)**: Redesigned client settings card following the high-end `dsh-clinebot` unified design system. Added top quick stats row (`.ig-grid-4`, `.ig-stat-box`) showing active provider, default specs, safety/loop guard, and daily budget/cache status. Integrated status badges (`.ig-badge-ok/warn/bad`). * **5 Categorized Settings Tabs**: Settings fields organized into intuitive tabs: βš™οΈ General, πŸ”Œ Provider, ✨ Prompt & Styles, πŸ›‘οΈ Safety & Budget, ⚑ Cache & Storage. * **Client ErrorBoundary Protection**: Wrapped all settings forms and toolviews in an `ErrorBoundary` with retry capability, preventing any component render crash from affecting DSH core UI. * **Full Host Config ↔ Client Fields Synchronization**: Synchronized all 40 config properties between `Config` schema in `lib/index.js`, staged `FIELDS` in `lib/client.js`, and localization dictionaries (`en`/`ru`). Exposes controls: `qualityGate`, `dailyBudgetUsd`, `loopGuardLimit`, `diskCache`, `subscriptionQuality`, `cacheBySeed`, `cacheByPrompt`. * **Complete Toolview Registration**: Registered `tool.call.toolview` for all 8 visual tools (`generate_image`, `edit_image`, `vary_image`, `blend_images`, `generate_image_pack`, `remove_background`, `upscale_image`, `vectorize_image`). * **Safety, Budget & Loop Guard Hardening**: Extended `trackAndAssertLoopGuard`, `assertBudgetAvailable`, and `sanitizeErrorAndLogs` error masking across `edit_image`, `vary_image`, `blend_images`, `remove_background`, and `upscale_image`. Added `seedreamBaseURL` support. ### πŸš€ What's New in v0.12.10 (#480, #481, #482, #483) * **Route Reliability & WebServer Hardening (#480)**: Resolved empty 400 Bad Request responses on REST endpoints caused by Cordis context proxy evaluation of uninjected properties. Introduced `safeJsonHandler` and `getConnection` wrappers across all registered routes for structured JSON error reporting. * **Interactive Approval Gate Hardening (#481)**: Eliminated model self-bypass of `requireApproval`. Removed `approved` parameter from tool schema, sanitized non-interactive error directives, and blocked bypass via `approved: true` or `force: true`. * **Strict Write Origin & CSRF Defense (#482)**: Enforced mandatory `Origin` / `Referer` validation matching `Host` for all mutating endpoints (POST, PUT, DELETE), preventing reverse proxy bypass via loopback tunnels (e.g., `dsh-lanmode`). * **Test Isolation & Hygiene (#483)**: Replaced fixed test artifact paths with workspace-confined temporary directories to prevent race conditions during parallel test runs, added release candidate archive guards, and pruned unused exports. ### πŸš€ What's New in v0.10.13 * **Plugin Settings Location (#208)**: Moved settings card exclusively into the standard `Settings β†’ Plugins β†’ Plugin settings` section (`settings.plugin.item` slot). Removed the legacy fallback to `settings.section` that previously caused duplicate entries in the top-level sidebar navigation. * **Deferred Slot Injection (`registerSlotWhenReady`)**: Implemented robust deferred injection via `ctx.slots.inject` ensuring the settings card safely mounts when the parent settings container is rendered, eliminating timing collisions at startup. ### πŸš€ What's New in v0.10.12 * **Fix Syntax Error (#208)**: Resolved variable redeclaration collision (`const hPrompt`) in `checkCache` within `lib/index.js` which could prevent plugin initialization on strict Node.js runtimes. Added automated syntax check across all source modules to test suite. ### πŸš€ What's New in v0.10.11 (#165, #166, #167, #168, #169, #170) * **Negative Prompt Sanitizer (#165)**: Automatic defect filtering and deduplication for diffusion models (SDXL, ComfyUI, Seedream, Local) with style-conflict protection (preserves intentional grainy, vintage, or dark aesthetics). * **Automated Quality Gate & Silent Re-roll (#166)**: Heuristic variance and sharpness inspection combined with `dsh-vision-bridge` hook; performs silent re-rolls (up to 2 attempts) for blank, corrupted, or solid frames before returning results. * **Cost Metering & Daily Budget (#167)**: Full rate card pricing per provider and resolution, spend tracking in `~/.dsh/storages/dsh-image-gen-spend.json`, dispatch to `dsh-cost-meter`, and hard daily budget enforcement via `dailyBudgetUsd`. * **Fail-Fast Loop Guard (#168)**: Session-scoped circuit breaker prevents runaway agent retry loops (default max 3 consecutive generations without user interaction). * **Secure Credential Masking (#169)**: Comprehensive masking of tokens in logs, URLs, and errors (`Bearer sk-...abcd`), with `0600` file permission enforcement. * **Content-Addressed Disk Cache (#170)**: Instant retrieval (<50ms, zero API cost) for identical requests by SHA-256 hash, with automated LRU disk eviction (500 MB limit) and `force: true` bypass. ### πŸš€ What's New in v0.10.10 (#201, #203) * **Settings GUI Stabilization (#201)**: Fixed `booleanField` spec in client runtime that prevented the settings configuration pane from rendering in DSH Web UI. All configuration fields (providers, model identifiers, API credentials, style presets, LLM enhancer, timeouts, cache retention) render cleanly. * **Streamlined Settings UI (#203)**: Removed the bulky in-settings history gallery to keep the configuration panel focused, fast, and organized. * **Comprehensive Localization (#201)**: Added 100% dictionary coverage for all provider credentials, endpoints, and field hints in English and Russian. * **Robust Slot Mounting**: Implemented `registerFirst` helper with graceful fallback between `settings.plugin.item` and `settings.section`. ## 🎨 Supported Generation Backends * **`fal`** (Default): FAL.ai queue for FLUX.1, SDXL, Clarity Upscaler, and BiRefNet. * **`replicate`**: FLUX and SDXL models via Replicate API. * **`custom`**: OpenAI-compatible endpoint (DALL-E 3, SiliconFlow, Together AI, local gateways). * **`codex`**: ChatGPT Plus/Pro subscription generation via `dsh-subscriptions` (OAuth). * **`grok`**: Grok Imagine subscription generation via `dsh-subscriptions` (OAuth). * **`local`**: Local ComfyUI workflow execution or Automatic1111 web API. * **`seedream`**: ByteDance SeaDream generative API. * **`gemini`**: Google Imagen 3 via GenAI API. > [!NOTE] > **SSRF Protection & Base URLs**: By default, provider endpoints (`baseURL`, `customBaseURL`, `seedreamBaseURL`, `localBaseURL`) are validated against an allowlist of official provider domains and loopback/LAN addresses. To configure custom reverse proxies or third-party gateways, enable **Allow Custom Base URLs** (`allowCustomBaseUrl: true`) in the Provider settings tab. --- ## πŸ“¦ Quick Installation ```bash dsh plugin --profile web add @goodandready/dsh-image-gen ``` --- ## πŸ“„ License MIT Β© [GooDAnDReaDY](https://github.com/GooDAnDReaDY)