@sogni-ai/sogni-creative-agent-skill 3.17.0 → 3.17.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.17.0",
3
+ "version": "3.17.1",
4
4
  "description": "Sogni Creative Agent: image, video, and music generation via Sogni AI's decentralized GPU network. Supports personas, persistent memories, style transfer, and multi-step creative workflows.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.17.0",
3
+ "version": "3.17.1",
4
4
  "description": "Create images, generative video, music, and polished image-folder loops with Sogni AI.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [3.17.1](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.17.0...v3.17.1) (2026-07-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **scripts:** refuse runtime sync on intelligence-client version mismatch ([247da8c](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/247da8c9cb7b6f0575a25543847ca00f44929c0a))
7
+ * **video:** stop discarding i2v resolution on sparse aspect ratios ([23125f7](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/23125f780d394ec988012aabd4db7a9e49c63341))
8
+
9
+ ## [3.17.1](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.17.0...v3.17.1) (2026-07-26)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **scripts:** refuse runtime sync on intelligence-client version mismatch ([247da8c](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/247da8c9cb7b6f0575a25543847ca00f44929c0a))
15
+ * **video:** stop discarding i2v resolution on sparse aspect ratios ([23125f7](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/23125f780d394ec988012aabd4db7a9e49c63341))
16
+
1
17
  ## [3.17.0] - 2026-07-26
2
18
 
3
19
  ### Added
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 one-click image-folder loop reels, 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\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
4
4
  metadata:
5
- version: "3.17.0"
5
+ version: "3.17.1"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -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.17.0",
5
+ "version": "3.17.1",
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",
@@ -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.17.0",
5
+ "version": "3.17.1",
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.17.0",
3
+ "version": "3.17.1",
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",
@@ -73,6 +73,45 @@ if (!existsSync(upstreamSyncScript)) {
73
73
  process.exit(1);
74
74
  }
75
75
 
76
+ const INTELLIGENCE_CLIENT = '@sogni-ai/sogni-intelligence-client';
77
+
78
+ function installedClientVersion(fromDir) {
79
+ const manifest = join(fromDir, 'node_modules', INTELLIGENCE_CLIENT, 'package.json');
80
+ if (!existsSync(manifest)) return null;
81
+ try {
82
+ return JSON.parse(readFileSync(manifest, 'utf8')).version || null;
83
+ } catch {
84
+ return null;
85
+ }
86
+ }
87
+
88
+ // The upstream sync script generates the prompt contracts from ITS OWN copy of the
89
+ // intelligence client, not ours. If that copy is older than the version this repo pins, the
90
+ // sync silently regenerates the runtime from stale contracts and DELETES everything added
91
+ // since — an easy change to land unnoticed, because it looks like a routine "runtime is
92
+ // stale" diff. Fail loudly on a version mismatch instead of emitting a downgrade.
93
+ const upstreamRoot = dirname(dirname(upstreamSyncScript));
94
+ const ourClientVersion = installedClientVersion(repoRoot);
95
+ const upstreamClientVersion = installedClientVersion(upstreamRoot);
96
+
97
+ if (ourClientVersion && upstreamClientVersion && ourClientVersion !== upstreamClientVersion) {
98
+ console.error(`Refusing to sync: ${INTELLIGENCE_CLIENT} version mismatch.`);
99
+ console.error(` this repo: ${ourClientVersion}`);
100
+ console.error(` ${upstreamRoot}: ${upstreamClientVersion}`);
101
+ console.error('');
102
+ console.error('The upstream sync script builds the prompt contracts from its own node_modules,');
103
+ console.error('so syncing now would regenerate generated/creative-agent-runtime.mjs from the');
104
+ console.error('older contract set and drop anything added since that version.');
105
+ console.error('');
106
+ console.error(`Fix: npm install --prefix ${upstreamRoot}`);
107
+ process.exit(1);
108
+ }
109
+
110
+ if (!upstreamClientVersion) {
111
+ console.warn(`Warning: could not resolve ${INTELLIGENCE_CLIENT} in ${upstreamRoot};`);
112
+ console.warn('skipping version-parity check. Verify the generated diff before committing.');
113
+ }
114
+
76
115
  const syncResult = run(process.execPath, [upstreamSyncScript], {
77
116
  env: {
78
117
  ...process.env,
package/sogni-agent.mjs CHANGED
@@ -1406,8 +1406,23 @@ const DEFAULT_VIDEO_DIMENSION_RULES = {
1406
1406
  };
1407
1407
  const WRAPPER_MAX_VIDEO_DIMENSION = 2048;
1408
1408
  const WRAPPER_MAX_WAN_VIDEO_DIMENSION = 1536;
1409
+
1410
+ // SogniClientWrapper.normalizeVideoDimensions in @sogni-ai/sogni-intelligence-client clamps to
1411
+ // MAX_VIDEO_DIMENSION = 1536 for every model before it resizes a reference image and overwrites
1412
+ // the project dimensions with the resized reference's. So on any reference-bearing workflow a
1413
+ // larger ceiling is not reachable: the CLI waves 1600x896 through as "valid", the wrapper then
1414
+ // clamps to 1536x848 and hands the model a 1514x848 reference that is off-divisor — the exact
1415
+ // failure the i2v sizing logic exists to prevent. Applied only to reference-bearing workflows;
1416
+ // t2v never goes through the reference resize. Keep in sync with the pinned client version.
1417
+ const WRAPPER_MAX_REF_VIDEO_DIMENSION = 1536;
1409
1418
  const VIDEO_DIMENSION_MULTIPLE = DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple;
1410
1419
 
1420
+ // i2v reference sizing: when an exact-aspect bounding box would cost more than this share of
1421
+ // the pixel budget, pre-resize the reference to the model cap instead. The aspect ceiling keeps
1422
+ // the swap invisible — a 25:14 source becoming 16:9 drifts 0.44%, far under the limit.
1423
+ const VIDEO_REF_PRERESIZE_MIN_AREA_GAIN = 1.1;
1424
+ const VIDEO_REF_PRERESIZE_MAX_ASPECT_DRIFT = 0.02;
1425
+
1411
1426
  function isWanVideoModelId(modelId) {
1412
1427
  return typeof modelId === 'string' && modelId.startsWith('wan_');
1413
1428
  }
@@ -1563,33 +1578,48 @@ function videoDimensionRulesFromDefaults(modelDefaults, modelId) {
1563
1578
  }
1564
1579
 
1565
1580
  /**
1566
- * Resizes an image buffer to model-compatible dimensions while maintaining aspect ratio.
1567
- * Uses sharp's fit:inside to preserve aspect, then rounds to the model divisor.
1581
+ * Predicts the dimensions `resizeImageBufferForVideo` will produce for a reference image.
1582
+ *
1583
+ * Scales the reference up to the model's max dimension (preserving aspect via fit:inside),
1584
+ * then rounds each side to the nearest model divisor. Unlike an exact-aspect bounding box,
1585
+ * this always reaches the model cap — at the cost of a sub-pixel-percent aspect adjustment.
1586
+ *
1587
+ * `resizeImageBufferForVideo` delegates to this so the prediction can never drift from the
1588
+ * actual resize.
1568
1589
  */
1569
- async function resizeImageBufferForVideo(buffer, originalWidth, originalHeight, rules = DEFAULT_VIDEO_DIMENSION_RULES) {
1590
+ function predictVideoRefPreResizeDims(refWidth, refHeight, rules = DEFAULT_VIDEO_DIMENSION_RULES) {
1591
+ const rw = Number(refWidth);
1592
+ const rh = Number(refHeight);
1593
+ if (!Number.isFinite(rw) || !Number.isFinite(rh) || rw <= 0 || rh <= 0) return null;
1594
+
1570
1595
  const multiple = rules.dimensionMultiple || VIDEO_DIMENSION_MULTIPLE;
1596
+ const minDimension = rules.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension;
1597
+ const maxDimension = rules.maxDimension || DEFAULT_VIDEO_DIMENSION_RULES.maxDimension;
1571
1598
  const roundToMultiple = (n) => Math.max(multiple, Math.round(n / multiple) * multiple);
1572
- const targetWidth = Math.max(rules.minDimension, Math.min(rules.maxDimension, roundToMultiple(originalWidth)));
1573
- const targetHeight = Math.max(rules.minDimension, Math.min(rules.maxDimension, roundToMultiple(originalHeight)));
1599
+ // Never round past the model's hard limits.
1600
+ const floorMultiple = Math.floor(maxDimension / multiple) * multiple;
1601
+ const ceilMultiple = Math.ceil(minDimension / multiple) * multiple;
1602
+ const clamp = (n) => Math.min(floorMultiple, Math.max(ceilMultiple, roundToMultiple(n)));
1574
1603
 
1575
- // Resize using sharp with fit:inside (maintains aspect ratio)
1576
- const resizedBuffer = await sharp(buffer)
1577
- .resize(targetWidth, targetHeight, { fit: 'inside', withoutEnlargement: false })
1578
- .toBuffer();
1604
+ const boxWidth = Math.max(minDimension, Math.min(maxDimension, roundToMultiple(rw)));
1605
+ const boxHeight = Math.max(minDimension, Math.min(maxDimension, roundToMultiple(rh)));
1606
+ const fitted = predictSharpInsideResizeDims(rw, rh, boxWidth, boxHeight);
1607
+ if (!fitted) return null;
1579
1608
 
1580
- // Get actual dimensions after resize
1581
- const metadata = await sharp(resizedBuffer).metadata();
1582
- const actualWidth = roundToMultiple(metadata.width);
1583
- const actualHeight = roundToMultiple(metadata.height);
1609
+ return { width: clamp(fitted.width), height: clamp(fitted.height) };
1610
+ }
1584
1611
 
1585
- // If dimensions aren't exactly model-compatible, do a final resize/crop.
1586
- if (metadata.width !== actualWidth || metadata.height !== actualHeight) {
1587
- return await sharp(resizedBuffer)
1588
- .resize(actualWidth, actualHeight, { fit: 'cover' })
1589
- .toBuffer();
1590
- }
1612
+ /**
1613
+ * Resizes an image buffer to model-compatible dimensions while maintaining aspect ratio.
1614
+ * Uses sharp's fit:inside to preserve aspect, then rounds to the model divisor.
1615
+ */
1616
+ async function resizeImageBufferForVideo(buffer, originalWidth, originalHeight, rules = DEFAULT_VIDEO_DIMENSION_RULES) {
1617
+ const target = predictVideoRefPreResizeDims(originalWidth, originalHeight, rules);
1618
+ if (!target) return buffer;
1591
1619
 
1592
- return resizedBuffer;
1620
+ return await sharp(buffer)
1621
+ .resize(target.width, target.height, { fit: 'cover', withoutEnlargement: false })
1622
+ .toBuffer();
1593
1623
  }
1594
1624
 
1595
1625
  function normalizeVideoDimensionsLikeWrapper(width, height, rules = DEFAULT_VIDEO_DIMENSION_RULES) {
@@ -4483,7 +4513,17 @@ if (options.video && !options.frames) {
4483
4513
  // with sharp `fit: inside` and then override the project width/height with the resized reference dims.
4484
4514
  // That means a "valid" requested size can still fail if the resized ref lands off the model divisor.
4485
4515
  if (options.video) {
4486
- const videoDimensionRules = videoDimensionRulesFromDefaults(getModelDefaults(options.model, openclawConfig), options.model);
4516
+ const baseVideoDimensionRules = videoDimensionRulesFromDefaults(getModelDefaults(options.model, openclawConfig), options.model);
4517
+ // A reference image routes through the wrapper's resize, which caps at 1536 for every model
4518
+ // and then adopts the resized reference's dimensions as the project's. Honour that ceiling up
4519
+ // front so the CLI picks a divisor-valid size instead of letting the wrapper clamp blindly.
4520
+ const hasVideoReference = Boolean(options.refImage || options.refImageEnd);
4521
+ const videoDimensionRules = hasVideoReference
4522
+ ? {
4523
+ ...baseVideoDimensionRules,
4524
+ maxDimension: Math.min(baseVideoDimensionRules.maxDimension, WRAPPER_MAX_REF_VIDEO_DIMENSION)
4525
+ }
4526
+ : baseVideoDimensionRules;
4487
4527
  if (!Number.isFinite(options.width) || options.width <= 0 || !Number.isFinite(options.height) || options.height <= 0) {
4488
4528
  fatalCliError('Video width/height must be positive numbers.', {
4489
4529
  code: 'INVALID_ARGUMENT',
@@ -4569,6 +4609,46 @@ if (options.video) {
4569
4609
 
4570
4610
  const beforeW = options.width;
4571
4611
  const beforeH = options.height;
4612
+
4613
+ // An exact-aspect bounding box can only land on sizes where BOTH sides are divisor-valid.
4614
+ // For aspect ratios with sparse valid sizes (e.g. 25:14 on a /16 model, which tops out at
4615
+ // 1200x672 under a 1536 cap) that forfeits a large share of the model's pixel budget.
4616
+ // Pre-resizing the reference reaches the cap instead, trading a tiny aspect adjustment for
4617
+ // the resolution — so prefer it when it wins materially on pixels and barely moves the aspect.
4618
+ const preResize = predictVideoRefPreResizeDims(dims.width, dims.height, videoDimensionRules);
4619
+ const candidateArea = candidate.output ? candidate.output.width * candidate.output.height : 0;
4620
+ const preResizeArea = preResize ? preResize.width * preResize.height : 0;
4621
+ const refAspect = dims.width / dims.height;
4622
+ const aspectDrift = preResize
4623
+ ? Math.abs((preResize.width / preResize.height) - refAspect) / refAspect
4624
+ : Infinity;
4625
+
4626
+ if (preResizeArea > candidateArea * VIDEO_REF_PRERESIZE_MIN_AREA_GAIN
4627
+ && aspectDrift <= VIDEO_REF_PRERESIZE_MAX_ASPECT_DRIFT) {
4628
+ options.width = preResize.width;
4629
+ options.height = preResize.height;
4630
+ options[ref.resizeFlag] = true;
4631
+ options._adjustedVideoDims = {
4632
+ reason: 'i2v-ref-pre-resize',
4633
+ referenceType: ref.key,
4634
+ requested: { width: beforeW, height: beforeH },
4635
+ adjusted: { width: options.width, height: options.height },
4636
+ resizedFrom: predicted,
4637
+ resizedTo: { width: preResize.width, height: preResize.height },
4638
+ insteadOf: candidate.output
4639
+ ? { width: candidate.output.width, height: candidate.output.height }
4640
+ : null
4641
+ };
4642
+ if (!options.quiet) {
4643
+ console.error(
4644
+ `Pre-resizing ${ref.label.toLowerCase()} to ${preResize.width}x${preResize.height} ` +
4645
+ `instead of shrinking the video to ${candidate.output.width}x${candidate.output.height} ` +
4646
+ `(keeps ${Math.round((preResizeArea / candidateArea - 1) * 100)}% more pixels).`
4647
+ );
4648
+ }
4649
+ continue;
4650
+ }
4651
+
4572
4652
  options.width = candidate.width;
4573
4653
  options.height = candidate.height;
4574
4654
 
@@ -4601,12 +4681,17 @@ if (options.video) {
4601
4681
 
4602
4682
  const effectiveDimsSource = localRefDims.get('refImage') || localRefDims.get('refImageEnd') || null;
4603
4683
  if (effectiveDimsSource) {
4604
- const predicted = predictSharpInsideResizeDims(
4605
- effectiveDimsSource.width,
4606
- effectiveDimsSource.height,
4607
- options.width,
4608
- options.height
4609
- );
4684
+ const effectiveResizeFlag = localRefDims.has('refImage') ? '_needsRefResize' : '_needsRefEndResize';
4685
+ // A pre-resized reference reaches the wrapper already divisor-valid, so the video lands on
4686
+ // the pre-resize dims rather than the fit:inside prediction of the original.
4687
+ const predicted = options[effectiveResizeFlag]
4688
+ ? predictVideoRefPreResizeDims(effectiveDimsSource.width, effectiveDimsSource.height, videoDimensionRules)
4689
+ : predictSharpInsideResizeDims(
4690
+ effectiveDimsSource.width,
4691
+ effectiveDimsSource.height,
4692
+ options.width,
4693
+ options.height
4694
+ );
4610
4695
  if (predicted) {
4611
4696
  options._effectiveVideoDims = {
4612
4697
  width: predicted.width,
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.17.0';
1
+ export const PACKAGE_VERSION = '3.17.1';