@sogni-ai/sogni-creative-agent-skill 3.10.0 → 3.11.0
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/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/desktop-extension/README.md +10 -0
- package/desktop-extension/manifest.json +1 -1
- package/desktop-extension/server/index.mjs +16 -2
- package/desktop-extension/server/inline-images.mjs +123 -0
- package/desktop-extension/server/tools.mjs +6 -3
- package/generated/creative-agent-runtime.mjs +7 -4
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# [3.11.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.10.0...v3.11.0) (2026-07-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **desktop:** bound inline image fetches with a 20s abort timeout ([f20f42b](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/f20f42ba6138eeb1f1c07ed8f02a5feb79c9f1fd))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **desktop:** add inline-image collection module for MCP results ([422043f](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/422043f0cdef1bcd36f168fb95ab3e3bf6450962))
|
|
12
|
+
* **desktop:** attach inline image blocks to successful tool results ([617bd5b](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/617bd5b63f3f0437cd81df3f6b59da8a587dcf16))
|
|
13
|
+
|
|
1
14
|
# [3.10.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.9.0...v3.10.0) (2026-07-04)
|
|
2
15
|
|
|
3
16
|
|
package/README.md
CHANGED
|
@@ -275,7 +275,7 @@ Claude Desktop can't run skills against your local files, so Sogni ships as a lo
|
|
|
275
275
|
|
|
276
276
|
npx setup-sogni-agent-skill
|
|
277
277
|
|
|
278
|
-
This registers the Sogni tools in `claude_desktop_config.json`. Fully quit and reopen Claude Desktop afterwards.
|
|
278
|
+
This registers the Sogni tools in `claude_desktop_config.json`. Fully quit and reopen Claude Desktop afterwards. Generated images display inline in the chat automatically.
|
|
279
279
|
|
|
280
280
|
**Manual — drag-and-drop bundle:** download `sogni-creative-agent.mcpb` from the GitHub Releases page and drop it onto Claude Desktop's Settings → Extensions page. You'll be prompted for your Sogni API key (stored in the OS keychain) unless you've already run the installer.
|
|
281
281
|
|
package/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: sogni-creative-agent-skill
|
|
3
3
|
description: "Sogni Creative Agent Skill: agent skill and CLI for image, video, and music generation using Sogni AI's decentralized GPU network. Supports personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"make a video/animate\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
|
|
4
4
|
metadata:
|
|
5
|
-
version: "3.
|
|
5
|
+
version: "3.10.0"
|
|
6
6
|
homepage: https://sogni.ai
|
|
7
7
|
openclaw:
|
|
8
8
|
emoji: "🎨"
|
|
@@ -10,6 +10,16 @@ A dependency-free MCP stdio server that wraps the globally installed
|
|
|
10
10
|
- `server/resolve.mjs` — absolute-path resolution (agent, ffmpeg, child env);
|
|
11
11
|
Claude Desktop's GUI environment has a minimal PATH, so nothing here relies on PATH lookup
|
|
12
12
|
|
|
13
|
+
## Inline images
|
|
14
|
+
|
|
15
|
+
Successful `generate_image`, `photobooth`, and frame-extraction calls attach
|
|
16
|
+
the rendered image(s) to the tool result as MCP image content blocks, which
|
|
17
|
+
Claude Desktop displays inline (up to 4 per call, full resolution; images
|
|
18
|
+
that would exceed the ~3.5MB content ceiling are downscaled via `sharp`, or
|
|
19
|
+
skipped with a note if that fails). The text block always keeps the hosted
|
|
20
|
+
URL / saved path. Set `SOGNI_MCP_NO_INLINE_IMAGES=1` in the server env to
|
|
21
|
+
disable.
|
|
22
|
+
|
|
13
23
|
## Build the .mcpb bundle
|
|
14
24
|
|
|
15
25
|
npm run build:mcpb # → dist/sogni-creative-agent.mcpb
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "sogni-creative-agent",
|
|
4
4
|
"display_name": "Sogni Creative Agent",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.10.0",
|
|
6
6
|
"description": "Generate images, video, and music on Sogni AI's decentralized GPU network — with personas, memories, and safe video editing tools.",
|
|
7
7
|
"author": { "name": "Sogni AI", "url": "https://sogni.ai" },
|
|
8
8
|
"homepage": "https://sogni.ai",
|
|
@@ -10,6 +10,7 @@ import { dirname, join } from 'node:path';
|
|
|
10
10
|
import { fileURLToPath } from 'node:url';
|
|
11
11
|
import { TOOLS, getTool } from './tools.mjs';
|
|
12
12
|
import { buildChildEnv, resolveAgentPath, resolveFfmpegPath } from './resolve.mjs';
|
|
13
|
+
import { collectInlineImages } from './inline-images.mjs';
|
|
13
14
|
|
|
14
15
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
15
16
|
const PROTOCOL_FALLBACK = '2025-06-18';
|
|
@@ -86,13 +87,26 @@ async function callTool(name, input, progressToken) {
|
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
child.on('error', (err) => finish(textResult(`Failed to launch sogni-agent: ${err.message}`, true)));
|
|
89
|
-
child.on('close', (code) => {
|
|
90
|
+
child.on('close', async (code) => {
|
|
90
91
|
const text = [stdout.trim(), code === 0 ? '' : stderr.trim()].filter(Boolean).join('\n')
|
|
91
92
|
|| `sogni-agent exited with code ${code}`;
|
|
92
93
|
// Success output is front-loaded (e.g. result JSON) so keep the head; on
|
|
93
94
|
// failure the actionable error is at the tail, so keep the tail instead.
|
|
94
95
|
const clipped = code === 0 ? text.slice(0, MAX_RESULT_CHARS) : text.slice(-MAX_RESULT_CHARS);
|
|
95
|
-
|
|
96
|
+
if (code !== 0) {
|
|
97
|
+
finish(textResult(clipped, true));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Inline images: best-effort. Any failure here must not degrade the
|
|
101
|
+
// text result, so the whole step is fenced.
|
|
102
|
+
let inline = { blocks: [], notes: [] };
|
|
103
|
+
try {
|
|
104
|
+
inline = await collectInlineImages({ toolName: name, input: input ?? {}, stdout });
|
|
105
|
+
} catch {
|
|
106
|
+
inline = { blocks: [], notes: [] };
|
|
107
|
+
}
|
|
108
|
+
const finalText = [clipped, ...inline.notes].join('\n');
|
|
109
|
+
finish({ content: [...inline.blocks, { type: 'text', text: finalText }], isError: false });
|
|
96
110
|
});
|
|
97
111
|
});
|
|
98
112
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// desktop-extension/server/inline-images.mjs
|
|
2
|
+
// Turns a successful CLI run into MCP image content blocks so Claude Desktop
|
|
3
|
+
// renders results inline. Pure of protocol concerns: index.mjs decides when
|
|
4
|
+
// to call this and how to compose the result. Every expected failure (bad
|
|
5
|
+
// JSON, missing file, failed fetch, oversized bytes) degrades silently —
|
|
6
|
+
// callers must never end up worse off than the text-only result.
|
|
7
|
+
import { readFile } from 'node:fs/promises';
|
|
8
|
+
import { extname } from 'node:path';
|
|
9
|
+
|
|
10
|
+
const INLINE_TOOLS = new Set(['generate_image', 'photobooth']);
|
|
11
|
+
const FRAME_ACTIONS = new Set(['extract_first_frame', 'extract_last_frame']);
|
|
12
|
+
const MAX_INLINE_IMAGES = 4;
|
|
13
|
+
const MAX_RAW_BYTES = 3.5 * 1024 * 1024; // ≈5MB once base64-encoded — the practical content ceiling
|
|
14
|
+
const DOWNSCALE_MAX_DIM = 2048;
|
|
15
|
+
const DOWNSCALE_JPEG_QUALITY = 85;
|
|
16
|
+
const FETCH_TIMEOUT_MS = 20_000; // inline fetch must never meaningfully delay the text result
|
|
17
|
+
const TOO_LARGE_NOTE = 'One image was too large to display inline; use the link above.';
|
|
18
|
+
|
|
19
|
+
const MIME_BY_EXT = {
|
|
20
|
+
'.png': 'image/png',
|
|
21
|
+
'.jpg': 'image/jpeg',
|
|
22
|
+
'.jpeg': 'image/jpeg',
|
|
23
|
+
'.webp': 'image/webp',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function mimeFromPath(p) {
|
|
27
|
+
return MIME_BY_EXT[extname(String(p).split('?')[0]).toLowerCase()] ?? null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function isInlineScoped(toolName, input) {
|
|
31
|
+
if (INLINE_TOOLS.has(toolName)) return true;
|
|
32
|
+
return toolName === 'edit_video' && FRAME_ACTIONS.has(input?.action);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// The CLI's --json output is a single JSON document, but be tolerant of any
|
|
36
|
+
// stray wrapper lines: fall back to the outermost {...} span.
|
|
37
|
+
function parseDescriptor(stdout) {
|
|
38
|
+
const raw = String(stdout ?? '').trim();
|
|
39
|
+
for (const candidate of [raw, raw.slice(raw.indexOf('{'), raw.lastIndexOf('}') + 1)]) {
|
|
40
|
+
if (!candidate) continue;
|
|
41
|
+
try {
|
|
42
|
+
const parsed = JSON.parse(candidate);
|
|
43
|
+
if (parsed && typeof parsed === 'object') return parsed;
|
|
44
|
+
} catch {
|
|
45
|
+
// try next candidate
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function sourceCandidates(toolName, input, stdout) {
|
|
52
|
+
if (toolName === 'edit_video') {
|
|
53
|
+
// Frame extractions write straight to the caller-provided output path and
|
|
54
|
+
// emit no --json descriptor.
|
|
55
|
+
return input?.output ? [{ kind: 'file', ref: String(input.output) }] : [];
|
|
56
|
+
}
|
|
57
|
+
const desc = parseDescriptor(stdout);
|
|
58
|
+
if (!desc) return [];
|
|
59
|
+
if (desc.localPath) return [{ kind: 'file', ref: String(desc.localPath) }];
|
|
60
|
+
if (Array.isArray(desc.urls)) {
|
|
61
|
+
return desc.urls
|
|
62
|
+
.filter((u) => typeof u === 'string' && /^https?:\/\//.test(u))
|
|
63
|
+
.slice(0, MAX_INLINE_IMAGES)
|
|
64
|
+
.map((u) => ({ kind: 'url', ref: u }));
|
|
65
|
+
}
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function obtainBytes(candidate, fetchImpl, fetchTimeoutMs) {
|
|
70
|
+
if (candidate.kind === 'file') {
|
|
71
|
+
return { data: await readFile(candidate.ref), mime: mimeFromPath(candidate.ref) ?? 'image/png' };
|
|
72
|
+
}
|
|
73
|
+
// AbortSignal.timeout bounds headers AND body for undici fetch; an abort
|
|
74
|
+
// rejects the await, which the caller's per-image try/catch degrades silently.
|
|
75
|
+
const res = await fetchImpl(candidate.ref, { signal: AbortSignal.timeout(fetchTimeoutMs) });
|
|
76
|
+
if (!res.ok) throw new Error(`fetch failed: ${res.status}`);
|
|
77
|
+
const headerMime = (res.headers.get('content-type') ?? '').split(';')[0].trim();
|
|
78
|
+
const mime = headerMime.startsWith('image/') ? headerMime : (mimeFromPath(candidate.ref) ?? 'image/png');
|
|
79
|
+
return { data: Buffer.from(await res.arrayBuffer()), mime };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Full-resolution by default; only an image that would blow the content
|
|
83
|
+
// ceiling gets downscaled (sharp ships with the package), and if that is
|
|
84
|
+
// impossible the image is skipped with a note rather than breaking the call.
|
|
85
|
+
async function fitBytes(entry) {
|
|
86
|
+
if (entry.data.length <= MAX_RAW_BYTES) return entry;
|
|
87
|
+
try {
|
|
88
|
+
const { default: sharp } = await import('sharp');
|
|
89
|
+
const data = await sharp(entry.data)
|
|
90
|
+
.resize({ width: DOWNSCALE_MAX_DIM, height: DOWNSCALE_MAX_DIM, fit: 'inside', withoutEnlargement: true })
|
|
91
|
+
.jpeg({ quality: DOWNSCALE_JPEG_QUALITY })
|
|
92
|
+
.toBuffer();
|
|
93
|
+
if (data.length <= MAX_RAW_BYTES) return { data, mime: 'image/jpeg' };
|
|
94
|
+
return null;
|
|
95
|
+
} catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export async function collectInlineImages({
|
|
101
|
+
toolName, input, stdout, env = process.env, fetchImpl = fetch, fetchTimeoutMs = FETCH_TIMEOUT_MS,
|
|
102
|
+
}) {
|
|
103
|
+
const empty = { blocks: [], notes: [] };
|
|
104
|
+
if (env.SOGNI_MCP_NO_INLINE_IMAGES === '1') return empty;
|
|
105
|
+
if (!isInlineScoped(toolName, input)) return empty;
|
|
106
|
+
|
|
107
|
+
const blocks = [];
|
|
108
|
+
const notes = [];
|
|
109
|
+
for (const candidate of sourceCandidates(toolName, input, stdout)) {
|
|
110
|
+
if (blocks.length >= MAX_INLINE_IMAGES) break;
|
|
111
|
+
try {
|
|
112
|
+
const fitted = await fitBytes(await obtainBytes(candidate, fetchImpl, fetchTimeoutMs));
|
|
113
|
+
if (!fitted) {
|
|
114
|
+
if (!notes.includes(TOO_LARGE_NOTE)) notes.push(TOO_LARGE_NOTE);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
blocks.push({ type: 'image', data: fitted.data.toString('base64'), mimeType: fitted.mime });
|
|
118
|
+
} catch {
|
|
119
|
+
// Silent per-image degradation: the text block still carries the link.
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { blocks, notes };
|
|
123
|
+
}
|
|
@@ -26,7 +26,8 @@ export const TOOLS = [
|
|
|
26
26
|
description:
|
|
27
27
|
'Generate one or more images from a text prompt on the Sogni GPU network. ' +
|
|
28
28
|
'Pass output_path (absolute, .png/.jpg) to save locally; otherwise a hosted URL is returned. ' +
|
|
29
|
-
'Use context_images for image editing ("make the background a beach") and persona to include a saved person.'
|
|
29
|
+
'Use context_images for image editing ("make the background a beach") and persona to include a saved person. ' +
|
|
30
|
+
'Image results are attached inline in the tool result.',
|
|
30
31
|
inputSchema: {
|
|
31
32
|
type: 'object',
|
|
32
33
|
properties: {
|
|
@@ -142,7 +143,8 @@ export const TOOLS = [
|
|
|
142
143
|
name: 'photobooth',
|
|
143
144
|
description:
|
|
144
145
|
'Face-transfer portrait generation: renders the person in the ref photo into a new scene ' +
|
|
145
|
-
'(e.g. "LinkedIn professional headshot", "80s fashion portrait").'
|
|
146
|
+
'(e.g. "LinkedIn professional headshot", "80s fashion portrait"). ' +
|
|
147
|
+
'Image results are attached inline in the tool result.',
|
|
146
148
|
inputSchema: {
|
|
147
149
|
type: 'object',
|
|
148
150
|
properties: {
|
|
@@ -167,7 +169,8 @@ export const TOOLS = [
|
|
|
167
169
|
name: 'edit_video',
|
|
168
170
|
description:
|
|
169
171
|
'Safe local video utilities (ffmpeg wrappers): extract the first/last frame, ' +
|
|
170
|
-
'concatenate clips (with optional soundtrack), or remix the audio of an existing video.'
|
|
172
|
+
'concatenate clips (with optional soundtrack), or remix the audio of an existing video. ' +
|
|
173
|
+
'Extracted frames are attached inline in the tool result.',
|
|
171
174
|
inputSchema: {
|
|
172
175
|
type: 'object',
|
|
173
176
|
properties: {
|
|
@@ -2216,12 +2216,15 @@ const PROMPT_CONTRACTS = [
|
|
|
2216
2216
|
"contractId": "video_to_video_v1",
|
|
2217
2217
|
"version": "1.0.0",
|
|
2218
2218
|
"toolName": "video_to_video",
|
|
2219
|
-
"baseDescription": "video_to_video transforms an uploaded video. Use for uploaded-video restyling, enhancement,\nupscaling/remastering, motion transfer from video to image, subject replacement, edge/pose/\ndepth-guided restyle, or explicit Seedance V2V transforms.\n\nThis tool requires an uploaded video source. Do not use it for generated video indices. For\ngenerated or uploaded partial edits use replace_video_segment; for appended time use\nextend_video; for logos/text overlays use overlay_video; for stitching use stitch_video.\n\nChoose controlMode by intent. Use detailer for quality-only enhancement without restyling.\nUse seedance-v2v only when the user asks to transform/enhance/remaster an uploaded video\nwith Seedance, including Seedance-fast uploaded-video upscale/remaster requests. For detailer,\ndescribe the original scene plus quality terms, not new content.",
|
|
2219
|
+
"baseDescription": "video_to_video transforms an uploaded video. Use for uploaded-video restyling, enhancement,\nupscaling/remastering, motion transfer from video to image, subject replacement, edge/pose/\ndepth-guided restyle, or explicit Seedance V2V transforms.\n\nThis tool requires an uploaded video source. Do not use it for generated video indices. For\ngenerated or uploaded partial edits use replace_video_segment; for appended time use\nextend_video; for logos/text overlays use overlay_video; for stitching use stitch_video.\n\nChoose controlMode by intent. Use detailer for quality-only enhancement without restyling.\nUse seedance-v2v only when the user asks to transform/enhance/remaster an uploaded video\nwith Seedance, including Seedance-fast uploaded-video upscale/remaster requests. For detailer,\ndescribe the original scene plus quality terms, not new content.\nUse outpaint to extend/expand the frame or change aspect ratio (positional, mask-free); set\noutpaintPosition and optionally outpaintAspectRatio. Use inpaint to regenerate a region\nwhile preserving the rest. If the user supplied a mask, set maskImageIndex; otherwise\nomit maskImageIndex so execution derives one from the source video and prompt.",
|
|
2220
2220
|
"parameterDocs": {
|
|
2221
|
-
"prompt": "Describe the target appearance in present tense. For detailer, describe the original content plus quality qualifiers only.",
|
|
2221
|
+
"prompt": "Describe the target appearance in present tense. For detailer, describe the original content plus quality qualifiers only. For outpaint, describe what fills the new area; for inpaint, describe only the masked region.",
|
|
2222
2222
|
"videoSourceIndex": "Uploaded video index. Omit when there is one uploaded video; use 0 for first uploaded video or -1 if using negative upload notation.",
|
|
2223
|
-
"controlMode": "Pick from intent: detailer for enhance, seedance-v2v for explicit Seedance V2V, canny/depth/pose for control-net restyles, animate-move/replace for WAN Animate.",
|
|
2224
|
-
"sourceImageIndex": "Required for animate-move and animate-replace. Ignored by canny, depth, and
|
|
2223
|
+
"controlMode": "Pick from intent: detailer for enhance, seedance-v2v for explicit Seedance V2V, canny/depth/pose for control-net restyles, animate-move/replace for WAN Animate, outpaint to extend/expand the canvas, inpaint to regenerate a masked region.",
|
|
2224
|
+
"sourceImageIndex": "Required for animate-move and animate-replace. Ignored by canny, depth, detailer, outpaint, and inpaint.",
|
|
2225
|
+
"outpaintPosition": "outpaint only. Where the original frame sits in the expanded canvas (center/top/bottom/left/right); determines grow direction. Default center.",
|
|
2226
|
+
"outpaintAspectRatio": "outpaint only, optional. Target aspect ratio (e.g. 16:9) for the expanded canvas; the canvas only grows, never crops. Set only when the user names a target shape/orientation.",
|
|
2227
|
+
"maskImageIndex": "inpaint only, optional. 0-based index of an uploaded mask image (white = regenerate, black = preserve). Omit when the user did not provide a mask.",
|
|
2225
2228
|
"duration": "Set only when the user requests a different output length; otherwise let the tool match/cap the source duration."
|
|
2226
2229
|
}
|
|
2227
2230
|
},
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "sogni-creative-agent-skill",
|
|
3
3
|
"name": "Sogni Creative Agent Skill — Image, Video & Music Generation",
|
|
4
4
|
"description": "Agent skill and CLI for Sogni AI image, video, and music generation.",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.10.0",
|
|
6
6
|
"skills": [
|
|
7
7
|
"."
|
|
8
8
|
],
|
package/package.json
CHANGED
package/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '3.
|
|
1
|
+
export const PACKAGE_VERSION = '3.10.0';
|