@goodandready/dsh-image-gen 0.11.24 → 0.11.26
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/attachment-helper.js +5 -1
- package/lib/commands.js +9 -3
- package/lib/config-schema.js +2 -2
- package/lib/frontend-assets.js +218 -43
- package/lib/generation-helpers.js +16 -10
- package/lib/history.js +55 -5
- package/lib/pattern-helpers.js +17 -0
- package/lib/provider-utils.js +79 -15
- package/lib/providers/backends/custom.js +17 -4
- package/lib/providers/backends/gemini.js +45 -4
- package/lib/providers/shared-helpers.js +64 -2
- package/lib/providers.js +256 -42
- package/lib/quality-gate.js +6 -5
- package/lib/resolve-image.js +1 -1
- package/lib/tools/frontend.js +29 -12
- package/lib/tools/generation.js +52 -28
- package/lib/tools/inspect.js +2 -2
- package/lib/tools/pattern.js +9 -5
- package/lib/tools/processing-basic.js +7 -2
- package/lib/vault.js +19 -17
- package/package.json +2 -2
|
@@ -193,7 +193,7 @@ export function registerProcessingTools(ctx, deps) {
|
|
|
193
193
|
const source = await resolveSource(ctx, exec, args.image)
|
|
194
194
|
if (!source || !source.bytes) throw new Error('Source image not found: ' + args.image)
|
|
195
195
|
const cfg = live()
|
|
196
|
-
const res = traceToSvg(source.bytes, { colorMode: args.color_mode })
|
|
196
|
+
const res = await traceToSvg(source.bytes, { colorMode: args.color_mode })
|
|
197
197
|
const stem = `${slugify(args.output_name || 'vector')}-${Date.now().toString(36)}`
|
|
198
198
|
const name = `${stem}.svg`
|
|
199
199
|
const sessionCwd = exec.agent?.session?.header?.cwd
|
|
@@ -255,12 +255,17 @@ export function registerProcessingTools(ctx, deps) {
|
|
|
255
255
|
trackAndAssertLoopGuard(exec?.agent?.session?.id || 'default', { limit: cfg.loopGuardLimit })
|
|
256
256
|
assertBudgetAvailable(0.05, cfg.dailyBudgetUsd)
|
|
257
257
|
const refs = Array.isArray(args.images) ? args.images : [args.images].filter(Boolean)
|
|
258
|
+
if (refs.length < 2) {
|
|
259
|
+
throw new Error('At least two images are required for blending')
|
|
260
|
+
}
|
|
258
261
|
const sources = []
|
|
259
262
|
for (const r of refs) {
|
|
260
263
|
const s = await resolveSource(ctx, exec, r)
|
|
261
264
|
if (s && s.bytes) sources.push(s)
|
|
262
265
|
}
|
|
263
|
-
if (sources.length
|
|
266
|
+
if (sources.length < 2) {
|
|
267
|
+
throw new Error('At least two valid images are required to blend')
|
|
268
|
+
}
|
|
264
269
|
const res = await blendImagesFal(
|
|
265
270
|
{ fetchImpl: fetch, resolveKey: (ref) => resolveApiKey(ctx, ref), cfg },
|
|
266
271
|
{ images: sources, weights: args.weights, prompt: args.prompt, signal: exec.signal }
|
package/lib/vault.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, unlinkSync } from 'node:fs'
|
|
2
|
-
import { readHistory, writeHistory } from './history.js'
|
|
2
|
+
import { readHistory, writeHistory, withHistoryLock } from './history.js'
|
|
3
3
|
import { isTrustedLocalRequest } from './security.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -133,24 +133,26 @@ export async function readBoundedRequestBody(req, maxBytes = MAX_VAULT_BODY_BYTE
|
|
|
133
133
|
|
|
134
134
|
export async function deleteVaultEntry(id) {
|
|
135
135
|
if (!id) return { success: false, error: 'Missing entry id' }
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
return await withHistoryLock(async () => {
|
|
137
|
+
const entries = await readHistory()
|
|
138
|
+
const idx = entries.findIndex((e) => e.id === id || e.attachmentId === id)
|
|
139
|
+
if (idx === -1) {
|
|
140
|
+
return { success: false, error: 'Vault entry not found' }
|
|
141
|
+
}
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
const [entry] = entries.splice(idx, 1)
|
|
144
|
+
if (entry && entry.path) {
|
|
145
|
+
try {
|
|
146
|
+
unlinkSync(entry.path)
|
|
147
|
+
} catch (_err) { /* ignore missing file */ }
|
|
148
|
+
try {
|
|
149
|
+
unlinkSync(entry.path.replace(/\.[^.]+$/, '.json'))
|
|
150
|
+
} catch (_err) { /* ignore missing sidecar */ }
|
|
151
|
+
}
|
|
151
152
|
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
await writeHistory(entries)
|
|
154
|
+
return { success: true, id }
|
|
155
|
+
})
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-image-gen",
|
|
3
|
-
"version": "0.11.
|
|
4
|
-
"description": "Image generation for DeepSeek Harness: a generate_image tool with pluggable providers
|
|
3
|
+
"version": "0.11.26",
|
|
4
|
+
"description": "Image generation for DeepSeek Harness: a generate_image tool with pluggable providers \u2014 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",
|
|
7
7
|
"dsh",
|