@goodandready/dsh-image-gen 0.10.21 → 0.10.22

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/README.md CHANGED
@@ -41,6 +41,11 @@
41
41
 
42
42
  ---
43
43
 
44
+ ## 🚀 Updates v0.10.22: Referential Stability & React Error #185 Infinite Loop Fix (#230)
45
+ * **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`.
46
+ * **Deep DSH Store Integration**: Added seamless runtime integration with `@deepseek-ai/dsh-client-store` (`runtime.createSnapshotStore`) paired with a robust standalone snapshot caching fallback.
47
+ * **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.
48
+
44
49
  ## 🚀 Updates v0.10.21: Variations Workbench, Smart Aspect Ratio Crop & Brand Asset Pack (#228)
45
50
  * **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.
46
51
  * **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.
package/README.ru.md CHANGED
@@ -34,6 +34,11 @@
34
34
  </div>
35
35
 
36
36
  ---
37
+ ## 🚀 Обновления v0.10.22: Стабилизация состояния карточки настроек и устранение React Error #185 (#230)
38
+ * **Референциальная стабильность карточки настроек**: Устранена критическая ошибка React #185 (`Maximum update depth exceeded`) в `FalSettingsCardController` и `CardForm.prototype.bind`. Снимки состояния кэшируются по ссылке (`Object.is(prev, next) === true`) во время циклов рендера, полностью предотвращая бесконечные циклы перерисовки в React 18 / `useSyncExternalStore`.
39
+ * **Глубокая интеграция со стором DSH**: Добавлена бесшовная поддержка официального `@deepseek-ai/dsh-client-store` (`runtime.createSnapshotStore`) с автономным отказоустойчивым кэширующим fallback-режимом.
40
+ * **Автоматические регрессионные тесты**: Добавлен специализированный тест стабильности ссылок в `test/client-syntax.test.mjs`, контролирующий идентичность снимков при последовательных чтениях, атомарность уведомлений и корректную отписку.
41
+
37
42
  ## 🚀 Обновления v0.10.21: Верстак вариаций, умный кроппер и экспорт бренд-ассетов (#228)
38
43
  * **Интерактивный верстак вариаций и ремиксов (Remix Workbench)**: Встроенная панель в `FalImageCard` и галерее генераций. Настройка силы вариаций ползунком креативности (0.05–0.95), быстрые пресеты («Тонкие правки 0.25», «Креатив 0.65») и текстовое до-руливание стилем.
39
44
  * **Умное кадрирование под стандарты пропорций (`smart_crop_image`)**: Мгновенный пересчет и кадрирование под соцсети и баннеры (`1:1`, `16:9`, `9:16`, `4:3`, `3:2`, `2:3`) с режимами центрирования, третей (`rule_of_thirds`), умного фокуса и рамки (`letterbox`) на чистом SVG без внешних бинарников.
package/README.zh.md CHANGED
@@ -47,6 +47,11 @@
47
47
 
48
48
  ---
49
49
 
50
+ ## 🚀 更新 v0.10.22: 设置卡片状态引用稳定性与修复 React Error #185 无限循环 (#230)
51
+ * **设置卡片状态引用稳定性**: 修复了 `FalSettingsCardController` 和 `CardForm.prototype.bind` 中引发的 React Error #185(`Maximum update depth exceeded`)。快照在渲染周期内进行引用缓存(`Object.is(prev, next) === true`),彻底杜绝 React 18 / `useSyncExternalStore` 的无限重新渲染死循环。
52
+ * **深度 DSH 运行时集成**: 无缝集成官方 `@deepseek-ai/dsh-client-store`(`runtime.createSnapshotStore`),并提供零依赖的高性能独立快照缓存兜底。
53
+ * **自动化回归测试集**: 在 `test/client-syntax.test.mjs` 中引入针对引用一致性的专项测试,严密校验多次连续读取的一致性、单次发布通知机制与监听器注销完整性。
54
+
50
55
  ## 🚀 更新 v0.10.21: 变体工作台、智能比例裁切与品牌资源包导出 (#228)
51
56
  * **交互式变体与风格重混工作台 (Remix Workbench)**: 直接集成在 `FalImageCard` 和图库中的交互抽屉。支持连续创意度/去噪强度滑块 (0.05 到 0.95)、预设快捷按钮(“微调 0.25”、“强创意 0.65”)及提示词引导。
52
57
  * **智能比例无损画布裁切器 (`smart_crop_image`)**: 快速裁切适配各大社交与设计标准比例 (`1:1`, `16:9`, `9:16`, `4:3`, `3:2`, `2:3`),支持自动对焦、三分法构图 (`rule_of_thirds`) 与黑边留白 (`letterbox`)。
package/lib/client.js CHANGED
@@ -17,6 +17,14 @@ window.__ModuleLoader__.load({
17
17
  }
18
18
  }
19
19
 
20
+ let runtime = null
21
+ for (const id of ['@deepseek-ai/dsh-client-store', '@deepseek-ai/dsh-client-runtime/client']) {
22
+ try {
23
+ runtime = require(id)
24
+ if (runtime && typeof runtime.createSnapshotStore === 'function') break
25
+ } catch (_) {}
26
+ }
27
+
20
28
  const NS = 'dsh-image-gen'
21
29
  const SETTINGS_NS = 'dsh-image-gen'
22
30
  const TITLE = 'Image Studio'
@@ -298,11 +306,22 @@ window.__ModuleLoader__.load({
298
306
  }
299
307
  }
300
308
  bind(project) {
309
+ if (runtime && typeof runtime.createSnapshotStore === 'function') {
310
+ const store = runtime.createSnapshotStore(project())
311
+ this.listeners.add(() => store.set(project()))
312
+ return store
313
+ }
314
+ let cached = project()
315
+ const storeListeners = new Set()
316
+ this.listeners.add(() => {
317
+ cached = project()
318
+ for (const listener of storeListeners) listener()
319
+ })
301
320
  return {
302
- getSnapshot: () => project(),
321
+ getSnapshot: () => cached,
303
322
  subscribe: (cb) => {
304
- this.listeners.add(cb)
305
- return () => this.listeners.delete(cb)
323
+ storeListeners.add(cb)
324
+ return () => storeListeners.delete(cb)
306
325
  },
307
326
  }
308
327
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-image-gen",
3
- "version": "0.10.21",
3
+ "version": "0.10.22",
4
4
  "description": "Image generation for DeepSeek Harness: a generate_image tool with pluggable providers — the FAL queue, any OpenAI-compatible images API, or a ChatGPT/Grok subscription with no API key at all. The picture is shown inline in the conversation; the model receives either a link (works with any chat model) or the image itself (needs dsh-vision-bridge or a vision-capable model).",
5
5
  "keywords": [
6
6
  "deepseek-harness",