@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.
@@ -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 === 0) throw new Error('No valid images found to blend')
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
- const entries = await readHistory()
137
- const idx = entries.findIndex((e) => e.id === id || e.attachmentId === id)
138
- if (idx === -1) {
139
- return { success: false, error: 'Vault entry not found' }
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
- const [entry] = entries.splice(idx, 1)
143
- if (entry && entry.path) {
144
- try {
145
- unlinkSync(entry.path)
146
- } catch { /* ignore missing file */ }
147
- try {
148
- unlinkSync(entry.path.replace(/\.[^.]+$/, '.json'))
149
- } catch { /* ignore missing sidecar */ }
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
- await writeHistory(entries)
153
- return { success: true, id }
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.24",
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).",
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",