@goodandready/dsh-image-gen 0.11.17 → 0.11.18

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.
@@ -1,3 +1,4 @@
1
+ import { sanitizeErrorAndLogs } from '../security.js'
1
2
  import { renderToolOutput } from "../attachment-helper.js"
2
3
  // inspect — image-gen tools (compare_images, inspect_image_quality). Extracted from apply() (#216).
3
4
 
@@ -31,9 +32,13 @@ export function registerInspectTools(ctx, deps, options = {}) {
31
32
  },
32
33
  },
33
34
  async execute(args, exec) {
34
- const a = await resolveSource(ctx, exec, args.image_a)
35
- const b = await resolveSource(ctx, exec, args.image_b)
36
- return pixelDiff(a && a.bytes, b && b.bytes)
35
+ try {
36
+ const a = await resolveSource(ctx, exec, args.image_a)
37
+ const b = await resolveSource(ctx, exec, args.image_b)
38
+ return pixelDiff(a && a.bytes, b && b.bytes)
39
+ } catch (err) {
40
+ throw new Error(sanitizeErrorAndLogs(err.message || err))
41
+ }
37
42
  },
38
43
  }),
39
44
  )
@@ -61,14 +66,18 @@ export function registerInspectTools(ctx, deps, options = {}) {
61
66
  },
62
67
  },
63
68
  async execute(args, exec) {
64
- const source = await resolveSource(ctx, exec, args.image)
65
- if (!source || !source.bytes) throw new Error('Image not found: ' + args.image)
66
- const analysis = estimateSharpnessAndVariance(source.bytes)
67
- const elementNote = args.expected_elements ? ` Verified presence of: ${args.expected_elements}.` : ''
68
- return {
69
- qualityScore: analysis.score,
70
- passed: analysis.passed,
71
- notes: analysis.isBlank ? `Defect detected: ${analysis.reason}` : `Image clarity and variance verified (score ${analysis.score}).${elementNote}`,
69
+ try {
70
+ const source = await resolveSource(ctx, exec, args.image)
71
+ if (!source || !source.bytes) throw new Error('Image not found: ' + args.image)
72
+ const analysis = estimateSharpnessAndVariance(source.bytes)
73
+ const elementNote = args.expected_elements ? ` Verified presence of: ${args.expected_elements}.` : ''
74
+ return {
75
+ qualityScore: analysis.score,
76
+ passed: analysis.passed,
77
+ notes: analysis.isBlank ? `Defect detected: ${analysis.reason}` : `Image clarity and variance verified (score ${analysis.score}).${elementNote}`,
78
+ }
79
+ } catch (err) {
80
+ throw new Error(sanitizeErrorAndLogs(err.message || err))
72
81
  }
73
82
  },
74
83
  }),
@@ -1,3 +1,4 @@
1
+ import { sanitizeErrorAndLogs } from '../security.js'
1
2
  // style-matrix.js — generate_style_matrix tool (#286).
2
3
  // Parallel 2×2 style matrix explorer with blind A/B compare and one-click preset selection.
3
4
 
@@ -1,3 +1,4 @@
1
+ import { sanitizeErrorAndLogs } from '../security.js'
1
2
  // theme-pair.js — generate_theme_pair tool (#189).
2
3
  // Synchronized dual generation of light and dark theme visuals with adaptive CSS snippets.
3
4
 
@@ -1,3 +1,4 @@
1
+ import { sanitizeErrorAndLogs } from '../security.js'
1
2
  // ui-asset.js — generate_ui_asset tool (#284).
2
3
  // Specialized generator for UI icons, stickers, illustrations, and layout-aware banners with negative space.
3
4
 
@@ -1,3 +1,4 @@
1
+ import { sanitizeErrorAndLogs } from '../security.js'
1
2
  // vision-ocr.js — replace_image_text tool (#180).
2
3
  // Seamless text replacement and OCR localization via dsh-vision-bridge & inpainting.
3
4
 
package/lib/updater.js CHANGED
@@ -288,10 +288,10 @@ async function installExact(target, packageSpec, options) {
288
288
  try {
289
289
  child.kill('SIGTERM')
290
290
  setTimeout(() => {
291
- try { child.kill('SIGKILL') } catch (_err) {}
291
+ try { child.kill('SIGKILL') } catch (_err) { /* ignore: process may have already exited */ }
292
292
  checkAndCleanProfileLock(target.profileDir)
293
293
  }, 1500)
294
- } catch (_err) {}
294
+ } catch (_err) { /* ignore: process may have already exited */ }
295
295
  reject(new Error('Update timed out; use the normal DSH update flow.'))
296
296
  }, options.timeoutMs ?? UPDATE_TIMEOUT_MS)
297
297
  child.once('error', (error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-image-gen",
3
- "version": "0.11.17",
3
+ "version": "0.11.18",
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",