@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.
- package/lib/generation-helpers.js +250 -0
- package/lib/provider-utils.js +4 -2
- package/lib/tools/anchor.js +5 -0
- package/lib/tools/character-sheet.js +1 -0
- package/lib/tools/diagram.js +1 -0
- package/lib/tools/generation-pack.js +1 -0
- package/lib/tools/generation.js +496 -651
- package/lib/tools/inspect.js +20 -11
- package/lib/tools/style-matrix.js +1 -0
- package/lib/tools/theme-pair.js +1 -0
- package/lib/tools/ui-asset.js +1 -0
- package/lib/tools/vision-ocr.js +1 -0
- package/lib/updater.js +2 -2
- package/package.json +1 -1
package/lib/tools/inspect.js
CHANGED
|
@@ -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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
}),
|
package/lib/tools/theme-pair.js
CHANGED
package/lib/tools/ui-asset.js
CHANGED
package/lib/tools/vision-ocr.js
CHANGED
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.
|
|
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",
|