@goodandready/dsh-image-gen 0.10.11 → 0.10.13

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
@@ -84,6 +84,13 @@
84
84
  * **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`.
85
85
 
86
86
 
87
+ ### 🚀 What's New in v0.10.13
88
+ * **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.
89
+ * **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.
90
+
91
+ ### 🚀 What's New in v0.10.12
92
+ * **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.
93
+
87
94
  ### 🚀 What's New in v0.10.11 (#165, #166, #167, #168, #169, #170)
88
95
  * **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).
89
96
  * **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.
package/README.ru.md CHANGED
@@ -130,6 +130,13 @@ graph LR
130
130
  - **100% интернационализация (#140)**: устранены захардкоженные русские строки, добавлены переводы на русский, английский и китайский языки.
131
131
 
132
132
 
133
+ ### 🚀 Что нового в v0.10.13
134
+ * **Размещение карточки настроек (#208)**: Карточка настроек плагина перенесена строго в стандартную вкладку «Настройки → Плагины → Настройки плагинов» (слот `settings.plugin.item`). Удалён устаревший запасной путь `settings.section`, из-за которого настройки отображались отдельным пунктом в общем корневом меню настроек.
135
+ * **Безопасная отложенная регистрация слота (`registerSlotWhenReady`)**: Регистрация через `ctx.slots.inject` гарантирует корректную загрузку и монтирование формы настроек при открытии страницы в DSH UI без ошибок синхронизации.
136
+
137
+ ### 🚀 Что нового в v0.10.12
138
+ * **Исправление синтаксической ошибки (#208)**: Устранено повторное объявление переменной (`const hPrompt`) в функции `checkCache` внутри `lib/index.js`. Добавлена автоматическая проверка синтаксиса всех модулей в набор юнит-тестов.
139
+
133
140
  ### 🚀 Что нового в v0.10.11 (#165, #166, #167, #168, #169, #170)
134
141
  * **Negative Prompt Sanitizer (#165)**: Автоматическая санитизация и дедупликация негативных промптов для диффузионных моделей (SDXL, ComfyUI, Seedream, Local) с защитой от конфликта стилей (сохраняет намеренно запрошенную зернистость, винтажность или тени).
135
142
  * **Quality Gate и Silent Re-roll (#166)**: Экспресс-контроль резкости/энтропии кадра и интеграция с `dsh-vision-bridge` с автоматическим тихим ре-роллом дефектных, пустых или черных кадров (до 2 попыток).
package/lib/client.js CHANGED
@@ -1251,50 +1251,49 @@ function FalImageCard(props) {
1251
1251
  FalImageCard,
1252
1252
  ),
1253
1253
  )
1254
- // Карточка во вкладке «Настройки плагинов» вместо строки в боковом
1255
- // списке: список плоский и перестал помещаться, а карточки вкладки
1256
- // сворачиваются. Ключ слота обязан равняться пространству настроек:
1257
- // вкладка перебирает именно их, с чужим ключом карточка исчезла бы молча.
1258
- // Заголовок, пояснение и сворачивание рисует сама карточка — ядро даёт
1259
- // только рамку списка.
1260
- //
1261
- // Запасной путь: слот объявлен пакетом настроек ядра. Если в сборке его
1262
- // нет, регистрация бросает — тогда остаётся прежний раздел в боковом
1263
- // списке, чтобы настройки не пропали.
1264
- function registerFirst(ctx, candidates, component) {
1265
- if (!ctx || !ctx.slots) return undefined
1266
- for (const entry of candidates) {
1267
- try {
1268
- if (typeof ctx.slots?.has === 'function' && !ctx.slots.has(entry.name)) {
1269
- continue
1254
+ // Карточка во вкладке «Настройки → Плагины → Настройки плагинов» (слот settings.plugin.item).
1255
+ // Ключ слота обязан равняться пространству настроек (SETTINGS_NS):
1256
+ // вкладка перебирает пространства и отрисовывает карточку.
1257
+ // Раздел верхнего уровня settings.section исключён, чтобы настройки не
1258
+ // засоряли общий боковой список настроек.
1259
+ // Отложенная регистрация через ctx.slots.inject предотвращает ошибки монтирования,
1260
+ // так как дочерние слоты страниц DSH UI объявляются родительскими компонентами.
1261
+ function registerSlotWhenReady(slotName, registerFn) {
1262
+ if (!ctx.slots) return
1263
+ if (typeof ctx.slots.inject === 'function') {
1264
+ try {
1265
+ ctx.slots.inject(slotName, () => {
1266
+ try {
1267
+ return registerFn()
1268
+ } catch (err) {
1269
+ console.warn('[dsh-image-gen] Error registering slot ' + slotName + ':', err)
1270
+ }
1271
+ })
1272
+ return
1273
+ } catch (err) {
1274
+ console.warn('[dsh-image-gen] Failed to inject slot ' + slotName + ':', err)
1275
+ }
1276
+ }
1277
+ if (typeof ctx.slots.register === 'function') {
1278
+ try {
1279
+ registerFn()
1280
+ } catch (err) {
1281
+ console.warn('[dsh-image-gen] Failed direct registration for ' + slotName + ':', err)
1270
1282
  }
1271
- let ok = false
1272
- ctx.slots.inject(entry.name, () => {
1273
- ctx.slots.register(entry, component)
1274
- ok = true
1275
- })
1276
- if (ok) return entry.name
1277
- } catch {}
1283
+ }
1278
1284
  }
1279
- return undefined
1280
- }
1281
1285
 
1282
- registerFirst(ctx, [
1283
- {
1284
- name: 'settings.plugin.item',
1285
- key: SETTINGS_NS,
1286
- locale: NS,
1287
- inject: () => cardOnce().inject(),
1288
- },
1289
- {
1290
- name: 'settings.section',
1291
- id: '@goodandready/dsh-image-gen',
1292
- order: 34,
1293
- locale: NS,
1294
- label: () => t('settings.navLabel'),
1295
- inject: () => cardOnce().inject(),
1296
- },
1297
- ], FalSettingsCard)
1286
+ registerSlotWhenReady('settings.plugin.item', () =>
1287
+ ctx.slots.register(
1288
+ {
1289
+ name: 'settings.plugin.item',
1290
+ key: SETTINGS_NS,
1291
+ locale: NS,
1292
+ inject: () => cardOnce().inject(),
1293
+ },
1294
+ FalSettingsCard,
1295
+ ),
1296
+ )
1298
1297
  }
1299
1298
  exports.apply = apply
1300
1299
  exports.inject = inject
package/lib/index.js CHANGED
@@ -1092,7 +1092,7 @@ export function apply(ctx, config) {
1092
1092
  }
1093
1093
 
1094
1094
  if (!cfg.cacheBySeed && !cfg.cacheByPrompt) return undefined
1095
- const h = computeGenerationHash({
1095
+ const hPrompt = computeGenerationHash({
1096
1096
  provider,
1097
1097
  model: cfg.model,
1098
1098
  prompt: promptVal,
@@ -1100,7 +1100,7 @@ export function apply(ctx, config) {
1100
1100
  size: args.image_size || cfg.defaultSize,
1101
1101
  style: args.style || cfg.stylePreset,
1102
1102
  })
1103
- const found = findCachedGeneration(historyEntries, h)
1103
+ const found = findCachedGeneration(historyEntries, hPrompt)
1104
1104
  if (found) return await cachedResult(found)
1105
1105
  if (cfg.cacheBySeed) {
1106
1106
  const bySeed = await findCached(historyEntries, seedVal, promptVal)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-image-gen",
3
- "version": "0.10.11",
3
+ "version": "0.10.13",
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",