@goodandready/dsh-image-gen 0.11.36 → 0.11.37
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/index.js +18 -5
- package/lib/tools/frontend.js +1 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import { resolveConversationImage, analyzeImageWithVision, validateImageSignatur
|
|
|
43
43
|
import { registerImageCommand } from './commands.js'
|
|
44
44
|
import { registerAllTools } from './register-tools.js'
|
|
45
45
|
import { registerPluginUpdater } from './updater.js'
|
|
46
|
-
import { registerVaultRoutes } from './vault.js'
|
|
46
|
+
import { registerVaultRoutes, readBoundedRequestBody } from './vault.js'
|
|
47
47
|
import { registerLiveProgressRoutes } from './live-progress.js'
|
|
48
48
|
import { registerSettingsRoutes } from './settings-route.js'
|
|
49
49
|
import { clearAllAnchors } from './anchor-helpers.js'
|
|
@@ -349,14 +349,14 @@ export function apply(ctx, rawConfig) {
|
|
|
349
349
|
manifestUrl: new URL('../package.json', import.meta.url),
|
|
350
350
|
}), 'dsh-image-gen: plugin updater route')
|
|
351
351
|
|
|
352
|
-
// Provider connection diagnostics probe
|
|
352
|
+
// Provider connection diagnostics probe (#419)
|
|
353
353
|
ctx.effect(() => ctx.webServer.register({
|
|
354
354
|
kind: 'exact',
|
|
355
355
|
path: '/dsh-image-gen/diagnostics/test',
|
|
356
356
|
handler: async (req, res) => {
|
|
357
|
-
if (req.method !== 'GET') {
|
|
357
|
+
if (req.method !== 'GET' && req.method !== 'POST') {
|
|
358
358
|
res.writeHead(405, { 'Content-Type': 'application/json' })
|
|
359
|
-
res.end(JSON.stringify({ error: 'GET only' }))
|
|
359
|
+
res.end(JSON.stringify({ error: 'GET or POST only' }))
|
|
360
360
|
return
|
|
361
361
|
}
|
|
362
362
|
if (!isTrustedLocalRequest(req)) {
|
|
@@ -366,7 +366,20 @@ export function apply(ctx, rawConfig) {
|
|
|
366
366
|
}
|
|
367
367
|
try {
|
|
368
368
|
const u = new URL(req.url, 'http://localhost')
|
|
369
|
-
|
|
369
|
+
let qProvider = u.searchParams.get('provider')
|
|
370
|
+
if (!qProvider && req.method === 'POST') {
|
|
371
|
+
try {
|
|
372
|
+
const buf = await readBoundedRequestBody(req, 16 * 1024)
|
|
373
|
+
if (buf && buf.length > 0) {
|
|
374
|
+
const body = JSON.parse(buf.toString('utf8'))
|
|
375
|
+
if (body && typeof body.provider === 'string') {
|
|
376
|
+
qProvider = body.provider
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
} catch (_err) {
|
|
380
|
+
/* ignore JSON body parse errors, fallback to URL query or live config */
|
|
381
|
+
}
|
|
382
|
+
}
|
|
370
383
|
const effectiveCfg = live()
|
|
371
384
|
const provider = (typeof qProvider === 'string' && qProvider.trim())
|
|
372
385
|
|| (typeof effectiveCfg?.provider === 'string' && effectiveCfg.provider.trim())
|
package/lib/tools/frontend.js
CHANGED
|
@@ -192,6 +192,7 @@ export function registerFrontendTools(ctx, deps) {
|
|
|
192
192
|
theme_color: { type: 'string', description: 'Theme color hex (e.g. #0f172a).' },
|
|
193
193
|
background_color: { type: 'string', description: 'Background color hex (e.g. #ffffff).' },
|
|
194
194
|
icons_dir: { type: 'string', description: 'Directory for icons relative to webroot (default: icons).' },
|
|
195
|
+
out_dir: { type: 'string', description: 'Output root directory to write manifest.json and icons into (defaults to current directory).' },
|
|
195
196
|
},
|
|
196
197
|
output: {
|
|
197
198
|
render: (_args, value) => renderToolOutput(value),
|
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.37",
|
|
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",
|