@sogni-ai/sogni-creative-agent-skill 3.9.0 → 3.10.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 CHANGED
@@ -1,3 +1,19 @@
1
+ # [3.10.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.9.0...v3.10.0) (2026-07-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **cli:** recognize semantic-release h1 changelog entries in whats-new ([067bb65](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/067bb651e1ab924fb32d1b15585c80deeeb79d84))
7
+ * **desktop:** keep head of large success output, tail of errors ([394e1e1](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/394e1e131f5f75c4f01205a37286609ed7a59c99))
8
+
9
+
10
+ ### Features
11
+
12
+ * **desktop:** add MCP tool registry mapping tools to sogni-agent argv ([cb951a7](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/cb951a79fcc5ef859ef3135f46b8aab81945305d))
13
+ * **desktop:** add MCPB manifest, npm packaging, and build script ([d464627](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/d4646273bcb4c2c8cfd7d08e7b6928e218f15e6f))
14
+ * **desktop:** add path resolution for the Claude Desktop MCP wrapper ([8cd5832](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/8cd58323982d63a756e75264441d0dd33feb1acc))
15
+ * **desktop:** implement dependency-free MCP stdio server for Claude Desktop ([de26cda](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/de26cda9f433a8da62dcc24c7b2b49e6c13e892a))
16
+
1
17
  # [3.9.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.8.0...v3.9.0) (2026-06-30)
2
18
 
3
19
 
package/README.md CHANGED
@@ -267,6 +267,24 @@ If the checkout is missing, use the npm install path above or explicitly approve
267
267
 
268
268
  ---
269
269
 
270
+ ## Claude Desktop
271
+
272
+ Claude Desktop can't run skills against your local files, so Sogni ships as a local MCP server instead. Two ways to install:
273
+
274
+ **Recommended — one command (also installs the CLI, saves your API key, and offers to install ffmpeg):**
275
+
276
+ npx setup-sogni-agent-skill
277
+
278
+ This registers the Sogni tools in `claude_desktop_config.json`. Fully quit and reopen Claude Desktop afterwards.
279
+
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
+
282
+ Don't use both — you'd get duplicate Sogni tools. The extension wraps the same globally installed `sogni-agent` CLI used by Claude Code, so personas, memories, and credentials are shared.
283
+
284
+ Video/audio editing features need ffmpeg on your machine; the `npx` installer offers to install it for you.
285
+
286
+ ---
287
+
270
288
  ## Setup (Sogni API key)
271
289
 
272
290
  1. Get your API key from [dashboard.sogni.ai](https://dashboard.sogni.ai) (open the account menu).
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.8.0"
5
+ version: "3.9.0"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -0,0 +1,29 @@
1
+ # Sogni Creative Agent — Claude Desktop extension
2
+
3
+ A dependency-free MCP stdio server that wraps the globally installed
4
+ `sogni-agent` CLI. `manifest.json` follows the MCPB spec (v0.3).
5
+
6
+ ## Layout
7
+
8
+ - `server/index.mjs` — JSON-RPC 2.0 stdio loop (initialize, tools/list, tools/call)
9
+ - `server/tools.mjs` — tool schemas + pure argv builders
10
+ - `server/resolve.mjs` — absolute-path resolution (agent, ffmpeg, child env);
11
+ Claude Desktop's GUI environment has a minimal PATH, so nothing here relies on PATH lookup
12
+
13
+ ## Build the .mcpb bundle
14
+
15
+ npm run build:mcpb # → dist/sogni-creative-agent.mcpb
16
+
17
+ ## Install paths
18
+
19
+ 1. `npx setup-sogni-agent-skill` writes a `claude_desktop_config.json` entry
20
+ pointing at this server inside the global npm package (preferred).
21
+ 2. The packed `.mcpb` is the manual drag-and-drop alternative
22
+ (Claude Desktop → Settings → Extensions).
23
+
24
+ The server needs the CLI installed globally (`npm i -g @sogni-ai/sogni-creative-agent-skill`);
25
+ when missing, every tool returns a hint to run `npx setup-sogni-agent-skill`.
26
+
27
+ ## Testing
28
+
29
+ node --test test/desktop-extension.test.mjs
@@ -0,0 +1,32 @@
1
+ {
2
+ "manifest_version": "0.3",
3
+ "name": "sogni-creative-agent",
4
+ "display_name": "Sogni Creative Agent",
5
+ "version": "3.9.0",
6
+ "description": "Generate images, video, and music on Sogni AI's decentralized GPU network — with personas, memories, and safe video editing tools.",
7
+ "author": { "name": "Sogni AI", "url": "https://sogni.ai" },
8
+ "homepage": "https://sogni.ai",
9
+ "server": {
10
+ "type": "node",
11
+ "entry_point": "server/index.mjs",
12
+ "mcp_config": {
13
+ "command": "node",
14
+ "args": ["${__dirname}/server/index.mjs"],
15
+ "env": {
16
+ "SOGNI_API_KEY": "${user_config.api_key}"
17
+ }
18
+ }
19
+ },
20
+ "user_config": {
21
+ "api_key": {
22
+ "type": "string",
23
+ "title": "Sogni API key",
24
+ "description": "Optional if you've already run `npx setup-sogni-agent-skill` (which saves ~/.config/sogni/credentials). Get a key at https://dashboard.sogni.ai.",
25
+ "sensitive": true,
26
+ "required": false
27
+ }
28
+ },
29
+ "compatibility": {
30
+ "platforms": ["darwin", "win32", "linux"]
31
+ }
32
+ }
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env node
2
+ // desktop-extension/server/index.mjs
3
+ // Dependency-free MCP stdio server for Claude Desktop. Translates tool calls
4
+ // into sogni-agent CLI invocations. Protocol: JSON-RPC 2.0, one message per
5
+ // line over stdio. IMPORTANT: stdout is protocol-only — log to stderr.
6
+ import { spawn } from 'node:child_process';
7
+ import { readFileSync } from 'node:fs';
8
+ import { createInterface } from 'node:readline';
9
+ import { dirname, join } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { TOOLS, getTool } from './tools.mjs';
12
+ import { buildChildEnv, resolveAgentPath, resolveFfmpegPath } from './resolve.mjs';
13
+
14
+ const HERE = dirname(fileURLToPath(import.meta.url));
15
+ const PROTOCOL_FALLBACK = '2025-06-18';
16
+ const HARD_KILL_MS = 15 * 60 * 1000; // generation ceiling; CLI enforces its own -t timeouts sooner
17
+ const PROGRESS_INTERVAL_MS = 10_000;
18
+ const MAX_RESULT_CHARS = 20_000;
19
+
20
+ let VERSION = '0.0.0';
21
+ try {
22
+ VERSION = JSON.parse(readFileSync(join(HERE, '..', 'manifest.json'), 'utf8')).version;
23
+ } catch {
24
+ // Running outside a packaged layout (e.g. unit tests before Task 4); harmless.
25
+ }
26
+
27
+ function send(msg) {
28
+ process.stdout.write(JSON.stringify(msg) + '\n');
29
+ }
30
+
31
+ function textResult(text, isError = false) {
32
+ return { content: [{ type: 'text', text }], isError };
33
+ }
34
+
35
+ async function callTool(name, input, progressToken) {
36
+ const tool = getTool(name);
37
+ if (!tool) return textResult(`Unknown tool: ${name}`, true);
38
+
39
+ const agentPath = resolveAgentPath();
40
+ if (!agentPath) {
41
+ return textResult(
42
+ 'The sogni-agent CLI is not installed. Open a terminal, run `npx setup-sogni-agent-skill`, then retry.',
43
+ true,
44
+ );
45
+ }
46
+
47
+ let args;
48
+ try {
49
+ args = tool.buildArgs(input ?? {});
50
+ } catch (err) {
51
+ return textResult(err.message, true);
52
+ }
53
+
54
+ const env = buildChildEnv({ agentPath, ffmpegPath: resolveFfmpegPath() });
55
+
56
+ return await new Promise((resolve) => {
57
+ const child = spawn(process.execPath, [agentPath, ...args], {
58
+ env,
59
+ stdio: ['ignore', 'pipe', 'pipe'],
60
+ });
61
+ let stdout = '';
62
+ let stderr = '';
63
+ child.stdout.on('data', (d) => { stdout += d; });
64
+ child.stderr.on('data', (d) => { stderr += d; });
65
+
66
+ const started = Date.now();
67
+ const ticker = progressToken == null
68
+ ? null
69
+ : setInterval(() => {
70
+ send({
71
+ jsonrpc: '2.0',
72
+ method: 'notifications/progress',
73
+ params: {
74
+ progressToken,
75
+ progress: Math.round((Date.now() - started) / 1000),
76
+ message: `sogni-agent ${name} running…`,
77
+ },
78
+ });
79
+ }, PROGRESS_INTERVAL_MS);
80
+ const killer = setTimeout(() => child.kill('SIGKILL'), HARD_KILL_MS);
81
+
82
+ const finish = (result) => {
83
+ if (ticker) clearInterval(ticker);
84
+ clearTimeout(killer);
85
+ resolve(result);
86
+ };
87
+
88
+ child.on('error', (err) => finish(textResult(`Failed to launch sogni-agent: ${err.message}`, true)));
89
+ child.on('close', (code) => {
90
+ const text = [stdout.trim(), code === 0 ? '' : stderr.trim()].filter(Boolean).join('\n')
91
+ || `sogni-agent exited with code ${code}`;
92
+ // Success output is front-loaded (e.g. result JSON) so keep the head; on
93
+ // failure the actionable error is at the tail, so keep the tail instead.
94
+ const clipped = code === 0 ? text.slice(0, MAX_RESULT_CHARS) : text.slice(-MAX_RESULT_CHARS);
95
+ finish(textResult(clipped, code !== 0));
96
+ });
97
+ });
98
+ }
99
+
100
+ async function dispatch(msg) {
101
+ const { id, method, params } = msg;
102
+ const isRequest = id !== undefined && id !== null;
103
+
104
+ if (method === 'initialize') {
105
+ send({
106
+ jsonrpc: '2.0',
107
+ id,
108
+ result: {
109
+ protocolVersion: params?.protocolVersion ?? PROTOCOL_FALLBACK,
110
+ capabilities: { tools: {} },
111
+ serverInfo: { name: 'sogni-creative-agent', version: VERSION },
112
+ },
113
+ });
114
+ return;
115
+ }
116
+ if (method === 'ping') {
117
+ send({ jsonrpc: '2.0', id, result: {} });
118
+ return;
119
+ }
120
+ if (method === 'tools/list') {
121
+ send({
122
+ jsonrpc: '2.0',
123
+ id,
124
+ result: {
125
+ tools: TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
126
+ },
127
+ });
128
+ return;
129
+ }
130
+ if (method === 'tools/call') {
131
+ const result = await callTool(params?.name, params?.arguments, params?._meta?.progressToken);
132
+ send({ jsonrpc: '2.0', id, result });
133
+ return;
134
+ }
135
+ if (!isRequest || method?.startsWith('notifications/')) {
136
+ return; // notifications need no response
137
+ }
138
+ send({ jsonrpc: '2.0', id, error: { code: -32601, message: `Method not found: ${method}` } });
139
+ }
140
+
141
+ const rl = createInterface({ input: process.stdin, terminal: false });
142
+ rl.on('line', (line) => {
143
+ if (!line.trim()) return;
144
+ let msg;
145
+ try {
146
+ msg = JSON.parse(line);
147
+ } catch {
148
+ send({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } });
149
+ return;
150
+ }
151
+ dispatch(msg).catch((err) => {
152
+ if (msg.id !== undefined && msg.id !== null) {
153
+ send({ jsonrpc: '2.0', id: msg.id, error: { code: -32603, message: err.message } });
154
+ } else {
155
+ process.stderr.write(`sogni desktop server error: ${err.stack}\n`);
156
+ }
157
+ });
158
+ });
159
+ rl.on('close', () => process.exit(0));
@@ -0,0 +1,64 @@
1
+ // desktop-extension/server/resolve.mjs
2
+ // Claude Desktop launches MCP servers with a minimal GUI environment: no
3
+ // /opt/homebrew/bin, no npm global bin dir. Everything here resolves to
4
+ // absolute paths so the wrapper never depends on PATH lookup.
5
+ import { existsSync, readdirSync } from 'node:fs';
6
+ import { homedir } from 'node:os';
7
+ import { delimiter, dirname, join } from 'node:path';
8
+
9
+ const PKG_REL = join('@sogni-ai', 'sogni-creative-agent-skill');
10
+
11
+ // System-wide npm global roots. Injectable (`roots`) so tests on machines that
12
+ // really have the skill installed globally can sandbox resolution.
13
+ const DEFAULT_GLOBAL_ROOTS = [
14
+ '/opt/homebrew/lib/node_modules',
15
+ '/usr/local/lib/node_modules',
16
+ '/usr/lib/node_modules',
17
+ ];
18
+
19
+ function nvmCandidates(home) {
20
+ const base = join(home, '.nvm', 'versions', 'node');
21
+ let versions;
22
+ try {
23
+ versions = readdirSync(base);
24
+ } catch {
25
+ return [];
26
+ }
27
+ return versions
28
+ .sort()
29
+ .reverse()
30
+ .map((v) => join(base, v, 'lib', 'node_modules', PKG_REL, 'sogni-agent.mjs'));
31
+ }
32
+
33
+ export function resolveAgentPath({ env = process.env, home = homedir(), roots = DEFAULT_GLOBAL_ROOTS } = {}) {
34
+ if (env.SOGNI_AGENT_PATH) {
35
+ return existsSync(env.SOGNI_AGENT_PATH) ? env.SOGNI_AGENT_PATH : null;
36
+ }
37
+ const candidates = [
38
+ ...roots.map((root) => join(root, PKG_REL, 'sogni-agent.mjs')),
39
+ join(home, '.npm-global', 'lib', 'node_modules', PKG_REL, 'sogni-agent.mjs'),
40
+ ...(env.APPDATA ? [join(env.APPDATA, 'npm', 'node_modules', PKG_REL, 'sogni-agent.mjs')] : []),
41
+ ...nvmCandidates(home),
42
+ ];
43
+ return candidates.find((p) => existsSync(p)) ?? null;
44
+ }
45
+
46
+ export function resolveFfmpegPath({ env = process.env } = {}) {
47
+ if (env.FFMPEG_PATH) return env.FFMPEG_PATH;
48
+ const candidates = ['/opt/homebrew/bin/ffmpeg', '/usr/local/bin/ffmpeg', '/usr/bin/ffmpeg'];
49
+ return candidates.find((p) => existsSync(p)) ?? null;
50
+ }
51
+
52
+ export function buildChildEnv({ env = process.env, agentPath, ffmpegPath = null } = {}) {
53
+ const extraBins = ['/opt/homebrew/bin', '/usr/local/bin'];
54
+ if (agentPath) extraBins.push(dirname(agentPath));
55
+ const child = {
56
+ ...env,
57
+ PATH: [...extraBins, env.PATH ?? ''].filter(Boolean).join(delimiter),
58
+ };
59
+ if (ffmpegPath) child.FFMPEG_PATH = ffmpegPath;
60
+ // The .mcpb user_config template injects "" when the API-key field is left
61
+ // blank; an empty env var would shadow ~/.config/sogni/credentials.
62
+ if (child.SOGNI_API_KEY === '') delete child.SOGNI_API_KEY;
63
+ return child;
64
+ }
@@ -0,0 +1,306 @@
1
+ // desktop-extension/server/tools.mjs
2
+ // MCP tool registry: JSON Schemas shown to Claude Desktop plus pure
3
+ // buildArgs() functions that translate tool input into sogni-agent argv.
4
+ // buildArgs never spawns anything — index.mjs owns process execution.
5
+
6
+ const GEN_BASE = ['--json', '-q', '--no-update-check'];
7
+
8
+ function push(args, flag, value) {
9
+ if (value !== undefined && value !== null && value !== '') args.push(flag, String(value));
10
+ }
11
+
12
+ function required(input, field, hint) {
13
+ const v = input[field];
14
+ if (v === undefined || v === null || v === '') {
15
+ throw new Error(`${field} is required${hint ? ` — ${hint}` : ''}.`);
16
+ }
17
+ return v;
18
+ }
19
+
20
+ const str = (description) => ({ type: 'string', description });
21
+ const num = (description) => ({ type: 'number', description });
22
+
23
+ export const TOOLS = [
24
+ {
25
+ name: 'generate_image',
26
+ description:
27
+ 'Generate one or more images from a text prompt on the Sogni GPU network. ' +
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.',
30
+ inputSchema: {
31
+ type: 'object',
32
+ properties: {
33
+ prompt: str('What to generate'),
34
+ output_path: str('Absolute file path to save the image (optional)'),
35
+ quality: { type: 'string', enum: ['fast', 'hq', 'pro'], description: 'Quality preset' },
36
+ model: str('Model id (optional; overrides quality preset)'),
37
+ width: num('Width in px (default 512)'),
38
+ height: num('Height in px (default 512)'),
39
+ count: num('Number of images (default 1)'),
40
+ seed: num('Fixed seed for reproducibility'),
41
+ context_images: { type: 'array', items: { type: 'string' }, description: 'Absolute paths of context/edit images' },
42
+ persona: str('Saved persona name to use as reference'),
43
+ timeout_seconds: num('Generation timeout override'),
44
+ },
45
+ required: ['prompt'],
46
+ },
47
+ buildArgs(input) {
48
+ const prompt = required(input, 'prompt');
49
+ const args = [...GEN_BASE];
50
+ push(args, '-o', input.output_path);
51
+ push(args, '-Q', input.quality);
52
+ push(args, '-m', input.model);
53
+ push(args, '-w', input.width);
54
+ push(args, '-h', input.height);
55
+ push(args, '-n', input.count);
56
+ push(args, '-s', input.seed);
57
+ for (const c of input.context_images ?? []) push(args, '-c', c);
58
+ push(args, '--persona', input.persona);
59
+ push(args, '-t', input.timeout_seconds);
60
+ args.push(prompt);
61
+ return args;
62
+ },
63
+ },
64
+ {
65
+ name: 'generate_video',
66
+ description:
67
+ 'Generate a video from a text prompt, optionally driven by reference media. ' +
68
+ 'ref = start frame image, ref_end = end frame, ref_audio = soundtrack/lip-sync audio, ref_video = motion reference. ' +
69
+ 'Rendering takes minutes; prefer output_path (absolute .mp4).',
70
+ inputSchema: {
71
+ type: 'object',
72
+ properties: {
73
+ prompt: str('Motion/scene description'),
74
+ output_path: str('Absolute .mp4 path to save (optional)'),
75
+ model: str('Video model id (optional)'),
76
+ workflow: { type: 'string', enum: ['t2v', 'i2v', 's2v', 'ia2v', 'a2v', 'v2v', 'animate-move', 'animate-replace'] },
77
+ duration: num('Duration in seconds (default 5)'),
78
+ ref: str('Absolute path or URL of the start-frame image'),
79
+ ref_end: str('Absolute path or URL of the end-frame image'),
80
+ ref_audio: str('Absolute path or URL of reference audio'),
81
+ ref_video: str('Absolute path or URL of reference video'),
82
+ persona: str('Saved persona name (reference frame)'),
83
+ target_resolution: num('Short-side target in px, preserves aspect'),
84
+ timeout_seconds: num('Generation timeout override (default 300)'),
85
+ },
86
+ required: ['prompt'],
87
+ },
88
+ buildArgs(input) {
89
+ const prompt = required(input, 'prompt');
90
+ const args = [...GEN_BASE, '--video'];
91
+ push(args, '-o', input.output_path);
92
+ push(args, '-m', input.model);
93
+ push(args, '--workflow', input.workflow);
94
+ push(args, '--duration', input.duration);
95
+ push(args, '--ref', input.ref);
96
+ push(args, '--ref-end', input.ref_end);
97
+ push(args, '--ref-audio', input.ref_audio);
98
+ push(args, '--ref-video', input.ref_video);
99
+ push(args, '--persona', input.persona);
100
+ push(args, '--target-resolution', input.target_resolution);
101
+ push(args, '-t', input.timeout_seconds);
102
+ args.push(prompt);
103
+ return args;
104
+ },
105
+ },
106
+ {
107
+ name: 'generate_music',
108
+ description:
109
+ 'Generate music/audio from a text prompt. Omit lyrics for an instrumental. ' +
110
+ 'Duration 10-600 seconds. Prefer output_path (absolute .mp3/.wav/.flac).',
111
+ inputSchema: {
112
+ type: 'object',
113
+ properties: {
114
+ prompt: str('Style/mood description'),
115
+ output_path: str('Absolute audio file path to save (optional)'),
116
+ lyrics: str('Song lyrics (optional)'),
117
+ duration: num('Seconds, 10-600 (default 30)'),
118
+ bpm: num('Beats per minute (30-300)'),
119
+ keyscale: str('Key/scale, e.g. "C major"'),
120
+ music_model: str('turbo | sft | ace_step_1.5_turbo | ace_step_1.5_sft'),
121
+ audio_format: { type: 'string', enum: ['mp3', 'flac', 'wav'] },
122
+ timeout_seconds: num('Generation timeout override (default 600)'),
123
+ },
124
+ required: ['prompt'],
125
+ },
126
+ buildArgs(input) {
127
+ const prompt = required(input, 'prompt');
128
+ const args = [...GEN_BASE, '--music'];
129
+ push(args, '-o', input.output_path);
130
+ push(args, '--music-model', input.music_model);
131
+ push(args, '--lyrics', input.lyrics);
132
+ push(args, '--duration', input.duration);
133
+ push(args, '--bpm', input.bpm);
134
+ push(args, '--keyscale', input.keyscale);
135
+ push(args, '--output-format', input.audio_format);
136
+ push(args, '-t', input.timeout_seconds);
137
+ args.push(prompt);
138
+ return args;
139
+ },
140
+ },
141
+ {
142
+ name: 'photobooth',
143
+ description:
144
+ '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
+ inputSchema: {
147
+ type: 'object',
148
+ properties: {
149
+ prompt: str('Scene/style description'),
150
+ ref: str('Absolute path or URL of the face photo'),
151
+ output_path: str('Absolute image path to save (optional)'),
152
+ count: num('Number of variations (default 1)'),
153
+ },
154
+ required: ['prompt', 'ref'],
155
+ },
156
+ buildArgs(input) {
157
+ const prompt = required(input, 'prompt');
158
+ const ref = required(input, 'ref', 'a face photo path or URL');
159
+ const args = [...GEN_BASE, '--photobooth', '--ref', String(ref)];
160
+ push(args, '-n', input.count);
161
+ push(args, '-o', input.output_path);
162
+ args.push(prompt);
163
+ return args;
164
+ },
165
+ },
166
+ {
167
+ name: 'edit_video',
168
+ description:
169
+ '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.',
171
+ inputSchema: {
172
+ type: 'object',
173
+ properties: {
174
+ action: { type: 'string', enum: ['extract_first_frame', 'extract_last_frame', 'concat_videos', 'remix_audio'] },
175
+ input: str('Input video path (extract/remix actions)'),
176
+ output: str('Output file path'),
177
+ clips: { type: 'array', items: { type: 'string' }, description: 'Clip paths for concat_videos (min 2)' },
178
+ audio_path: str('Soundtrack to mux over concat_videos output'),
179
+ bed_audio: str('Audio bed for remix_audio'),
180
+ audio_loop: { type: 'boolean', description: 'Loop the bed to cover the video (remix_audio)' },
181
+ },
182
+ required: ['action', 'output'],
183
+ },
184
+ buildArgs(input) {
185
+ const action = required(input, 'action');
186
+ if (action === 'extract_first_frame' || action === 'extract_last_frame') {
187
+ const src = required(input, 'input', 'the source video');
188
+ const output = required(input, 'output');
189
+ return ['--no-update-check', `--${action.replaceAll('_', '-')}`, String(src), String(output)];
190
+ }
191
+ if (action === 'concat_videos') {
192
+ const output = required(input, 'output');
193
+ const clips = input.clips ?? [];
194
+ if (clips.length < 2) throw new Error('concat_videos needs at least two clips.');
195
+ const args = ['--no-update-check', '--concat-videos', String(output), ...clips.map(String)];
196
+ push(args, '--concat-audio', input.audio_path);
197
+ return args;
198
+ }
199
+ if (action === 'remix_audio') {
200
+ const src = required(input, 'input', 'the source video');
201
+ const output = required(input, 'output');
202
+ const args = ['--no-update-check', '--remix-audio', String(src), String(output)];
203
+ push(args, '--bed-audio', input.bed_audio);
204
+ if (input.audio_loop) args.push('--audio-loop');
205
+ return args;
206
+ }
207
+ throw new Error(`Unknown action "${action}".`);
208
+ },
209
+ },
210
+ {
211
+ name: 'list_media',
212
+ description: 'List recent inbound media files the user sent to Sogni (images, audio, or all).',
213
+ inputSchema: {
214
+ type: 'object',
215
+ properties: { type: { type: 'string', enum: ['images', 'audio', 'all'] } },
216
+ },
217
+ buildArgs(input) {
218
+ return ['--json', '--no-update-check', '--list-media', input.type ?? 'images'];
219
+ },
220
+ },
221
+ {
222
+ name: 'manage_personas',
223
+ description:
224
+ 'Manage saved personas (named people with reference photos and optional voice clips). ' +
225
+ 'Actions: list, add (needs name + ref photo), remove, resolve (show details).',
226
+ inputSchema: {
227
+ type: 'object',
228
+ properties: {
229
+ action: { type: 'string', enum: ['list', 'add', 'remove', 'resolve'] },
230
+ name: str('Persona name (add/remove/resolve)'),
231
+ ref: str('Reference photo path or URL (add)'),
232
+ relationship: { type: 'string', enum: ['self', 'partner', 'child', 'friend', 'pet'] },
233
+ description: str('Appearance description (add)'),
234
+ voice_clip: str('Voice clip audio path (add)'),
235
+ },
236
+ required: ['action'],
237
+ },
238
+ buildArgs(input) {
239
+ const action = required(input, 'action');
240
+ if (action === 'list') return ['--json', '--no-update-check', '--persona-list'];
241
+ const name = required(input, 'name');
242
+ if (action === 'remove') return ['--no-update-check', '--persona-remove', String(name)];
243
+ if (action === 'resolve') return ['--json', '--no-update-check', '--persona-resolve', String(name)];
244
+ if (action === 'add') {
245
+ const ref = required(input, 'ref', 'a reference photo for the persona');
246
+ const args = ['--no-update-check', '--persona-add', String(name), '--ref', String(ref)];
247
+ push(args, '--relationship', input.relationship);
248
+ push(args, '--description', input.description);
249
+ push(args, '--voice-clip', input.voice_clip);
250
+ return args;
251
+ }
252
+ throw new Error(`Unknown action "${action}".`);
253
+ },
254
+ },
255
+ {
256
+ name: 'manage_memories',
257
+ description:
258
+ 'Manage persistent user preferences (e.g. preferred_style). Actions: list, get, set, remove.',
259
+ inputSchema: {
260
+ type: 'object',
261
+ properties: {
262
+ action: { type: 'string', enum: ['list', 'get', 'set', 'remove'] },
263
+ key: str('Memory key (get/set/remove)'),
264
+ value: str('Memory value (set)'),
265
+ category: { type: 'string', enum: ['preference', 'fact', 'context'] },
266
+ },
267
+ required: ['action'],
268
+ },
269
+ buildArgs(input) {
270
+ const action = required(input, 'action');
271
+ if (action === 'list') return ['--json', '--no-update-check', '--memory-list'];
272
+ const key = required(input, 'key');
273
+ if (action === 'get') return ['--json', '--no-update-check', '--memory-get', String(key)];
274
+ if (action === 'remove') return ['--no-update-check', '--memory-remove', String(key)];
275
+ if (action === 'set') {
276
+ const value = required(input, 'value');
277
+ const args = ['--no-update-check', '--memory-set', String(key), String(value)];
278
+ push(args, '--memory-category', input.category);
279
+ return args;
280
+ }
281
+ throw new Error(`Unknown action "${action}".`);
282
+ },
283
+ },
284
+ {
285
+ name: 'sogni_doctor',
286
+ description:
287
+ 'Health check for the Sogni install: Node, credentials, ffmpeg, live auth, version. ' +
288
+ 'Run only after another tool fails — not as a routine preflight.',
289
+ inputSchema: { type: 'object', properties: {} },
290
+ buildArgs() {
291
+ return ['--doctor', '--json', '--no-update-check'];
292
+ },
293
+ },
294
+ {
295
+ name: 'account_balance',
296
+ description: 'Show the SPARK/SOGNI token balances for the configured Sogni account.',
297
+ inputSchema: { type: 'object', properties: {} },
298
+ buildArgs() {
299
+ return ['--balances', '--json', '--no-update-check'];
300
+ },
301
+ },
302
+ ];
303
+
304
+ export function getTool(name) {
305
+ return TOOLS.find((t) => t.name === name);
306
+ }
@@ -2216,15 +2216,12 @@ 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.\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.",
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.",
2220
2220
  "parameterDocs": {
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.",
2221
+ "prompt": "Describe the target appearance in present tense. For detailer, describe the original content plus quality qualifiers only.",
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, 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.",
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 detailer.",
2228
2225
  "duration": "Set only when the user requests a different output length; otherwise let the tool match/cap the source duration."
2229
2226
  }
2230
2227
  },
@@ -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.8.0",
5
+ "version": "3.9.0",
6
6
  "skills": [
7
7
  "."
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sogni-ai/sogni-creative-agent-skill",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, video, and music generation.",
5
5
  "type": "module",
6
6
  "main": "sogni-agent.mjs",
@@ -19,6 +19,7 @@
19
19
  "test:all": "npm run test && npm run test:integration",
20
20
  "test:coverage": "npm run check:creative-agent-runtime && node --test --experimental-test-coverage --test-coverage-include=sogni-agent.mjs --test-coverage-lines=50 --test-coverage-branches=35 --test-coverage-functions=50 test/sogni-agent.test.mjs",
21
21
  "test:coverage:full": "npm run check:creative-agent-runtime && node --test --experimental-test-coverage --test-coverage-include=sogni-agent.mjs --test-coverage-lines=50 --test-coverage-branches=35 --test-coverage-functions=50 test/*.test.mjs test/*.integration.mjs",
22
+ "build:mcpb": "npx -y @anthropic-ai/mcpb pack desktop-extension dist/sogni-creative-agent.mcpb",
22
23
  "prepack": "npm run check:creative-agent-source:strict && SOGNI_REQUIRE_RUNTIME_SYNC=1 npm run check:creative-agent-runtime",
23
24
  "prepare": "husky",
24
25
  "release": "semantic-release"
@@ -56,6 +57,7 @@
56
57
  "CHANGELOG.md",
57
58
  "SKILL.md",
58
59
  "references/",
60
+ "desktop-extension/",
59
61
  "skills/",
60
62
  "llm.txt",
61
63
  "skill-package.json",
package/sogni-agent.mjs CHANGED
@@ -6100,10 +6100,11 @@ async function runApiWorkflow() {
6100
6100
  await streamApiWorkflowEvents(apiKey, id);
6101
6101
  return;
6102
6102
  }
6103
- // Prefer SDK transport when opted-in. `resume` has no SDK
6104
- // equivalent yet (it lives on the API; the SDK exposes
6105
- // cancel/get/events/streamEvents). For resume we fall through to
6106
- // the legacy fetch path.
6103
+ // Prefer SDK transport when opted-in. `resume` exists in the SDK
6104
+ // (sogni-client CreativeWorkflows.resume) since 5.1.0-alpha.16 but
6105
+ // is not wired here yet, so resume still falls through to the
6106
+ // legacy fetch path. Wiring it (plus reseed, which the SDK also
6107
+ // ships) is tracked in the workflows MASTER plan, Phase 4.4.
6107
6108
  let sdkPayload = null;
6108
6109
  if (
6109
6110
  options.apiWorkflowAction === 'get'
package/update-check.mjs CHANGED
@@ -371,12 +371,15 @@ export function snoozeUpdate({
371
371
  // ---------- what's new (CHANGELOG summaries) ----------
372
372
 
373
373
  // Parses keep-a-changelog style sections: `## [x.y.z] - date` headings.
374
+ // semantic-release writes minor/major entries as h1 (`# [x.y.z](compare-url)`)
375
+ // and patches as h2, so both heading levels are version entries; the file's
376
+ // `# Changelog` title never matches because a semver must follow the hash.
374
377
  export function extractChangelogEntries(changelogText) {
375
378
  const entries = [];
376
379
  const lines = String(changelogText || '').split('\n');
377
380
  let current = null;
378
381
  for (const line of lines) {
379
- const heading = line.match(/^##\s+\[?(\d+\.\d+\.\d+)\]?(.*)$/);
382
+ const heading = line.match(/^##?\s+\[?(\d+\.\d+\.\d+)\]?(.*)$/);
380
383
  if (heading) {
381
384
  if (current) entries.push(current);
382
385
  current = { version: heading[1], heading: line.trim(), body: [] };
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.8.0';
1
+ export const PACKAGE_VERSION = '3.9.0';