@sogni-ai/sogni-creative-agent-skill 3.63.0 → 3.65.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/sogni-agent.mjs CHANGED
@@ -16,6 +16,7 @@ import { readFileSync, writeFileSync, existsSync, mkdirSync, mkdtempSync, statSy
16
16
  import { join, dirname, basename, extname, sep, resolve } from 'path';
17
17
  import { homedir, tmpdir } from 'os';
18
18
  import sharp from 'sharp';
19
+ import { importAccountPersona } from './account-personas.mjs';
19
20
  import { getEnv, hasEnv } from './env.mjs';
20
21
  import { claimSogniAppIdSlot, getOrCreateSogniAppId } from './sogni-app-id.mjs';
21
22
  import { PACKAGE_VERSION } from './version.mjs';
@@ -101,6 +102,7 @@ import {
101
102
  normalizeGptImageModelAlias,
102
103
  normalizeGptImageQuality,
103
104
  getGptImageRequestOptions,
105
+ gptImageGifDimensions,
104
106
  isGptImageModel,
105
107
  isKreaIdentityEditModel,
106
108
  // Seedream 5.0 Pro Uncensored: external-API image model (text-to-image and
@@ -170,8 +172,14 @@ const KNOWN_MODEL_CATALOG_TAGS = new Set([
170
172
  // message). Mirrors the `insufficient_credits` enrichment below: it adds an
171
173
  // actionable hint/category so an agent responds correctly instead of looping a
172
174
  // covered job that cannot bill. Codes are the source of truth in
173
- // sogni-socket/constants/errorCodes.js (4078-4081).
174
- const SUBSCRIPTION_BILLING_ERROR_CODES = new Set(['4078', '4079', '4080', '4081']);
175
+ // sogni-socket/constants/errorCodes.js (4078-4081, 4087, 4089).
176
+ const SUBSCRIPTION_BILLING_ERROR_CODES = new Set(['4078', '4079', '4080', '4081', '4087', '4089']);
177
+ // The socket's refusal for a model with no place on Relaxed. Its wording is the
178
+ // only marker: the jobError carries just 4004, which also covers disabled models
179
+ // and a catalog that is still updating, where retrying is right.
180
+ const RELAXED_UNAVAILABLE_MESSAGE = /not currently available on the Relaxed Supernet|only available on the Fast Supernet/i;
181
+ const RELAXED_UNAVAILABLE_HINT =
182
+ 'This model does not run on Relaxed right now. Run --list-models --model-network relaxed to see what does, or rerun with --network fast.';
175
183
  const APP_ID_LIMIT_ERROR_CODE = '4061';
176
184
  const APP_ID_LIMIT_HINT =
177
185
  'This CLI persists and reuses one installation app ID. Keep ~/.config/sogni/app-id between sessions; for ephemeral/container homes, set one stable SOGNI_APP_ID or persist SOGNI_APP_ID_PATH. If the address is already blocked, preserve the stable ID and wait before retrying.';
@@ -182,6 +190,10 @@ function subscriptionBillingFallback(code) {
182
190
  if (!SUBSCRIPTION_BILLING_ERROR_CODES.has(key)) return null;
183
191
  switch (key) {
184
192
  case '4078':
193
+ if (options.priorityMode) return {
194
+ retryable: false,
195
+ hint: 'The server could not admit this Priority Fast generation. Submit again without --priority for standard Fast, or choose --network relaxed.',
196
+ };
185
197
  // Vendor model the subscription never covers, or no verified entitlement.
186
198
  return {
187
199
  retryable: false,
@@ -210,6 +222,13 @@ function subscriptionBillingFallback(code) {
210
222
  purchaseLabel: 'Upgrade to Unlimited Pro',
211
223
  purchaseUrl: UNLIMITED_PLAN_URL,
212
224
  };
225
+ case '4087':
226
+ case '4089':
227
+ // The plan's Fast capacity is used up until it resets (daily or monthly).
228
+ return {
229
+ retryable: false,
230
+ hint: 'Fast rendering on this plan is paused until it resets, so retrying on Fast will keep failing. Relaxed stays included: rerun with --network relaxed, or set defaultNetwork to relaxed in the plugin config until the reset. Not every model runs there (see --list-models --model-network relaxed) and the queue can take hours, so add --detach and collect the result with --result <id> --wait. To stay on Fast now, pay with Premium Spark using --billing-mode tokens.',
231
+ };
213
232
  default:
214
233
  return null;
215
234
  }
@@ -703,6 +722,7 @@ function buildCliErrorPayload({ message, code, details, hint, prompt }) {
703
722
  };
704
723
  if (classified.metadata) payload.metadata = classified.metadata;
705
724
  if (classified.metadata?.consentInstructions && !hint) payload.hint = classified.metadata.consentInstructions;
725
+ if (classified.hint && !hint) payload.hint = classified.hint;
706
726
  if (classified.technicalError && classified.technicalError !== payload.error) {
707
727
  payload.technicalError = classified.technicalError;
708
728
  }
@@ -710,7 +730,7 @@ function buildCliErrorPayload({ message, code, details, hint, prompt }) {
710
730
  if (details) payload.errorDetails = details;
711
731
  if (hint) payload.hint = hint;
712
732
  if (applySubscriptionBillingEnrichment(payload, code)) {
713
- // Subscription-billing code (4078-4081) — handled with subscription-specific
733
+ // Subscription-billing code (4078-4081, 4087, 4089) — handled with subscription-specific
714
734
  // guidance; skip the generic "Buy Spark Packs" credits branch.
715
735
  } else if (classified.category === 'insufficient_credits') {
716
736
  payload.purchaseAction = true;
@@ -804,6 +824,16 @@ function classifyCliError(error, context = {}) {
804
824
  error = unwrapGenericProjectError(error);
805
825
  const rawMessage = cliErrorMessage(error);
806
826
 
827
+ if (RELAXED_UNAVAILABLE_MESSAGE.test(rawMessage)) {
828
+ return {
829
+ error_type: 'MODEL_UNAVAILABLE',
830
+ category: 'model_unavailable',
831
+ message: rawMessage,
832
+ retryable: false,
833
+ hint: RELAXED_UNAVAILABLE_HINT
834
+ };
835
+ }
836
+
807
837
  // HTTP 429: Sogni limits requests per network, and the browser of whoever runs
808
838
  // this shares that budget. Say how long to wait, never "try again".
809
839
  const rateLimit = rateLimitFromError(error);
@@ -966,12 +996,13 @@ function addCanonicalErrorFields(payload, error, context = {}) {
966
996
  payload.retryable = classified.retryable;
967
997
  if (classified.metadata) payload.metadata = classified.metadata;
968
998
  if (classified.metadata?.consentInstructions && !payload.hint) payload.hint = classified.metadata.consentInstructions;
999
+ if (classified.hint && !payload.hint) payload.hint = classified.hint;
969
1000
  if (classified.technicalError && classified.technicalError !== classified.message) {
970
1001
  payload.technicalError = classified.technicalError;
971
1002
  }
972
1003
  const subscriptionCode = subscriptionBillingCodeFromError(error);
973
1004
  if (applySubscriptionBillingEnrichment(payload, subscriptionCode)) {
974
- // Subscription-billing code (4078-4081) — handled with subscription-specific
1005
+ // Subscription-billing code (4078-4081, 4087, 4089) — handled with subscription-specific
975
1006
  // guidance; skip the generic "Buy Spark Packs" credits branch.
976
1007
  } else if (classified.category === 'insufficient_credits') {
977
1008
  payload.purchaseAction = true;
@@ -986,6 +1017,13 @@ function addCanonicalErrorFields(payload, error, context = {}) {
986
1017
  // Human-facing twin of addCanonicalErrorFields: print the classified, friendly
987
1018
  // message (with the raw message as a detail line when it differs) so human
988
1019
  // users get the same quality of error JSON consumers already receive.
1020
+ // Only these two: the other subscription hints stay in the JSON payload, because
1021
+ // their generic wording can contradict the socket's more specific message.
1022
+ function fastCapacityHint(error) {
1023
+ const code = String(subscriptionBillingCodeFromError(unwrapGenericProjectError(error)) ?? '');
1024
+ return code === '4087' || code === '4089' ? subscriptionBillingFallback(code).hint : null;
1025
+ }
1026
+
989
1027
  function printHumanError(error, context = {}) {
990
1028
  let classified = null;
991
1029
  try { classified = classifyCliError(error, context); } catch { /* fall back to raw */ }
@@ -996,6 +1034,8 @@ function printHumanError(error, context = {}) {
996
1034
  }
997
1035
  const hint = error?.hint
998
1036
  || classified?.metadata?.consentInstructions
1037
+ || classified?.hint
1038
+ || fastCapacityHint(error)
999
1039
  || (classified?.category === 'insufficient_credits' ? SPARK_PACKS_PURCHASE_HINT : null);
1000
1040
  if (hint) console.error(`Hint: ${hint}`);
1001
1041
  }
@@ -1097,7 +1137,7 @@ function createSkillSogniClient(creds, appId) {
1097
1137
  appSource: SOGNI_APP_SOURCE,
1098
1138
  appId,
1099
1139
  attribution: clientAttribution(AGENT_ATTRIBUTION),
1100
- network: openclawConfig?.defaultNetwork || 'fast',
1140
+ network: renderNetwork,
1101
1141
  autoConnect: false,
1102
1142
  apiKey: creds.SOGNI_API_KEY,
1103
1143
  authType: 'apiKey'
@@ -2037,6 +2077,10 @@ function imageOptionsFromCli() {
2037
2077
  if (!isGptImage2ModelSelection(options.model)) return {};
2038
2078
  return {
2039
2079
  ...getGptImageRequestOptions({
2080
+ gptImageComplexity: options.imageComplexity,
2081
+ gptImageFrameCount: options.imageFrameCount,
2082
+ gptImageFrameDurationMs: options.imageFrameDurationMs,
2083
+ gptImageMarkupUrl: options.imageMarkupUrl,
2040
2084
  gptImageBackground: options.imageBackground ?? undefined,
2041
2085
  gptImageOutputCompression: options.imageOutputCompression ?? undefined,
2042
2086
  outputFormat: options.outputFormat ?? 'png'
@@ -2323,9 +2367,19 @@ function requiresSparkOnlyToken(modelId) {
2323
2367
  || isWan3ModelSelectionLocal(modelId);
2324
2368
  }
2325
2369
 
2370
+ // Vendor models run on neither worker pool and the socket refuses them on
2371
+ // Relaxed, so a configured default leaves them on Fast. An explicit --network is
2372
+ // sent as asked, and the refusal says why.
2373
+ function projectNetwork(modelId) {
2374
+ if (renderNetwork === 'relaxed' && !options.network && requiresSparkOnlyToken(modelId)) return 'fast';
2375
+ return renderNetwork;
2376
+ }
2377
+
2326
2378
  // Attach the user's explicit --billing-mode to a project config. Omitted by
2327
2379
  // default so the server keeps deciding coverage (Unlimited members get 'auto'
2328
- // coverage server-side; token payers are unaffected).
2380
+ // coverage server-side; token payers are unaffected). The render network always
2381
+ // goes on the project: the socket routes on this field over the connection's
2382
+ // network, and the client wrapper fills in 'fast' when it is missing.
2329
2383
  function nextSemanticWorkloadAttribution(options = {}) {
2330
2384
  return semanticWorkloadAttribution(AGENT_ATTRIBUTION, INVOCATION_LINEAGE.next(options));
2331
2385
  }
@@ -2336,6 +2390,8 @@ function withBillingMode(config, attributionOptions = {}) {
2336
2390
  ...(!options.video && !options.upscaleVideo && !options.music && !options.speech && !options.imageTo3d && options.embedPromptMetadata !== undefined
2337
2391
  ? { embedPromptMetadata: options.embedPromptMetadata } : {}),
2338
2392
  ...(options.billingMode ? { billingMode: options.billingMode } : {}),
2393
+ ...(options.priorityMode ? { priorityMode: true, billingMode: 'subscription' } : {}),
2394
+ network: projectNetwork(config.modelId),
2339
2395
  attribution: nextSemanticWorkloadAttribution(attributionOptions),
2340
2396
  };
2341
2397
  }
@@ -3780,6 +3836,8 @@ const options = {
3780
3836
  quality: null, // Quality tier: fast|hq|pro — auto-selects model, steps, dimensions
3781
3837
  tokenType: null,
3782
3838
  billingMode: null, // auto|subscription|tokens — omitted by default so the server decides coverage
3839
+ network: null, // fast|relaxed; defaults to the configured network, then fast
3840
+ priorityMode: false, // explicit per-run Unlimited Fast queue opt-in
3783
3841
  steps: null,
3784
3842
  guidance: null,
3785
3843
  outputFormat: null,
@@ -3935,6 +3993,7 @@ const options = {
3935
3993
  personaTags: null,
3936
3994
  personaVoice: null,
3937
3995
  personaVoiceClip: null,
3996
+ personaAccountAfter: null,
3938
3997
  personaPhoto: null, // alias for --ref when used with --persona-add
3939
3998
  apiChat: false,
3940
3999
  durableChat: false,
@@ -4154,6 +4213,18 @@ for (let i = 0; i < args.length; i++) {
4154
4213
  i++;
4155
4214
  options.billingMode = raw;
4156
4215
  cliSet.billingMode = true;
4216
+ } else if (arg === '--network') {
4217
+ const raw = requireFlagValue(args, i, arg);
4218
+ i++;
4219
+ if (!['fast', 'relaxed'].includes(raw)) {
4220
+ fatalCliError('--network must be fast or relaxed.', {
4221
+ code: 'INVALID_ARGUMENT',
4222
+ details: { flag: '--network', value: raw }
4223
+ });
4224
+ }
4225
+ options.network = raw;
4226
+ } else if (arg === '--priority') {
4227
+ options.priorityMode = true;
4157
4228
  } else if (arg === '--steps') {
4158
4229
  const raw = requireFlagValue(args, i, arg);
4159
4230
  i++;
@@ -4177,6 +4248,14 @@ for (let i = 0; i < args.length; i++) {
4177
4248
  i++;
4178
4249
  options.outputFormat = raw;
4179
4250
  cliSet.outputFormat = true;
4251
+ } else if (arg === '--image-complexity') {
4252
+ options.imageComplexity = requireFlagValue(args, i++, arg);
4253
+ } else if (arg === '--image-frame-count') {
4254
+ options.imageFrameCount = parseNumberValue(requireFlagValue(args, i++, arg), arg);
4255
+ } else if (arg === '--image-frame-duration-ms') {
4256
+ options.imageFrameDurationMs = parseNumberValue(requireFlagValue(args, i++, arg), arg);
4257
+ } else if (arg === '--image-markup-url') {
4258
+ options.imageMarkupUrl = requireFlagValue(args, i++, arg);
4180
4259
  } else if (arg === '--image-quality') {
4181
4260
  options.imageQuality = requireFlagValue(args, i++, arg);
4182
4261
  } else if (arg === '--image-background') {
@@ -5077,6 +5156,13 @@ for (let i = 0; i < args.length; i++) {
5077
5156
  } else if (arg === '--persona-add') {
5078
5157
  options.personaAction = 'add';
5079
5158
  options.personaName = requireFlagValue(args, i, arg); i++;
5159
+ } else if (arg === '--persona-account-after') {
5160
+ options.personaAccountAfter = requireFlagValue(args, i, arg); i++;
5161
+ } else if (arg === '--persona-list-account') {
5162
+ options.personaAction = 'list-account';
5163
+ } else if (arg === '--persona-import-account') {
5164
+ options.personaAction = 'import-account';
5165
+ options.personaName = requireFlagValue(args, i, arg); i++;
5080
5166
  } else if (arg === '--persona-list') {
5081
5167
  options.personaAction = 'list';
5082
5168
  } else if (arg === '--persona-remove' || arg === '--persona-delete') {
@@ -5210,11 +5296,15 @@ Image Options:
5210
5296
  --distance <key> close-up|medium|wide
5211
5297
  --angle-strength <n> LoRA strength for multiple_angles (default: 0.9)
5212
5298
  --angle-description <text> Optional subject description
5213
- --output-format <f> Images: png|jpg|webp; video: mp4|mov (MOV: Seedance 2.5)
5299
+ --output-format <f> Images: png|jpg|webp|gif (GIF: GPT Image 2.6); video: mp4|mov (MOV: Seedance 2.5)
5214
5300
  --no-prompt-metadata Omit prompt/settings metadata from worker image outputs
5215
5301
  --return-last-frame Export the final video frame as an image (Seedance 2.5)
5216
- --image-quality <q> GPT Image: low|medium|high; 2.5 also xhigh|max
5217
- --image-background <b> auto|opaque; 2.5 also transparent (PNG/WebP)
5302
+ --image-complexity <q> GPT Image 2.6: low|medium|high planning effort
5303
+ --image-frame-count <n> GIF: 2-16 frames (default 9), use --output-format gif
5304
+ --image-frame-duration-ms <n> GIF: 20-2000 ms per frame (default 200)
5305
+ --image-markup-url <url> Transparent annotation PNG for the first edit reference
5306
+ --image-quality <q> GPT Image: low|medium|high; 2.5 and 2.6 also xhigh|max
5307
+ --image-background <b> auto|opaque; 2.5/2.6 also transparent (PNG/WebP)
5218
5308
  --image-output-compression <n> JPEG/WebP compression, integer 0–100
5219
5309
  --image-mask <path|url> PNG alpha mask of first --context image, same size
5220
5310
  --sampler <name> Sampler (images/music; H3 LightX2V Turbo: euler|er_sde|sa_solver; FastH3: euler)
@@ -5412,7 +5502,8 @@ Hosted API Modes:
5412
5502
  --api-base-url <url> Sogni API base URL (default: ${DEFAULT_API_BASE_URL})
5413
5503
 
5414
5504
  General:
5415
- -t, --timeout <sec> Stop waiting after this many seconds (default: 30, video: 1800, music: 600).
5505
+ -t, --timeout <sec> Stop waiting after this many seconds (default: 30, video: 1800, music: 600;
5506
+ at least 1800 on Relaxed).
5416
5507
  Counted from submission; time the account's own plan concurrency limit
5417
5508
  holds the project is not counted. The project is NOT cancelled; fetch it
5418
5509
  later with --result
@@ -5434,6 +5525,9 @@ General:
5434
5525
  --token-type <type> Token type: spark|sogni|auto (default: spark, auto retries with alternate)
5435
5526
  --billing-mode <mode> Billing: auto|subscription|tokens (default: server decides; "subscription"
5436
5527
  requires Sogni Unlimited coverage, "tokens" opts out of it)
5528
+ --network <n> Render on this Supernet: fast|relaxed (default: configured defaultNetwork, else fast).
5529
+ --priority Opt in to Priority Fast on paid Unlimited: earlier queue placement, 1.5x fair-use consumption. Worker models only.
5530
+ Relaxed queues can take hours; pair long renders with --detach
5437
5531
  --balance, --balances Show account, plan, and SPARK/SOGNI balances and exit
5438
5532
  --list-models [query] List live Supernet media models; optionally filter by query
5439
5533
  --search-models <q> Search live models by ID or name (separator-insensitive)
@@ -5503,7 +5597,10 @@ Personality (custom agent instructions):
5503
5597
 
5504
5598
  Personas (named people with reference photos):
5505
5599
  --persona-add <name> Add a persona (combine with --ref, --relationship, --description, --voice-clip)
5506
- --persona-list List all saved personas
5600
+ --persona-list List local personas
5601
+ --persona-list-account List one page of Personas saved in your Sogni account
5602
+ --persona-account-after <cursor> Read the next account Persona page
5603
+ --persona-import-account <id> Copy an account Persona and its original references into the local library (never overwrites)
5507
5604
  --persona-remove <name> Remove a persona and its files
5508
5605
  --persona-resolve <name> Show persona details and file paths
5509
5606
  --persona <name> Generate using a persona's reference photo (image context, video ref frame)
@@ -5842,6 +5939,17 @@ if (options.billingMode) {
5842
5939
  options.billingMode = mode;
5843
5940
  }
5844
5941
 
5942
+ // --network wins, then the configured default, then Fast.
5943
+ function resolveRenderNetwork() {
5944
+ if (options.network) return options.network;
5945
+ const configured = openclawConfig?.defaultNetwork;
5946
+ if (!configured) return 'fast';
5947
+ if (configured === 'fast' || configured === 'relaxed') return configured;
5948
+ console.error(`Warning: defaultNetwork must be "fast" or "relaxed" (got ${JSON.stringify(configured)}); using fast.`);
5949
+ return 'fast';
5950
+ }
5951
+ const renderNetwork = resolveRenderNetwork();
5952
+
5845
5953
  if (options.apiTaskProfile) {
5846
5954
  const profile = String(options.apiTaskProfile).trim().toLowerCase();
5847
5955
  if (!VALID_API_TASK_PROFILES.has(profile)) {
@@ -6062,7 +6170,7 @@ if (options.outputFormat) {
6062
6170
  details: { outputFormat: options.outputFormat }
6063
6171
  });
6064
6172
  }
6065
- } else if (!['png', 'jpg', 'webp'].includes(options.outputFormat)) {
6173
+ } else if (!['png', 'jpg', 'webp', 'gif'].includes(options.outputFormat)) {
6066
6174
  fatalCliError('Image output format must be "png", "jpg", or "webp".', {
6067
6175
  code: 'INVALID_ARGUMENT',
6068
6176
  details: { outputFormat: options.outputFormat }
@@ -6074,7 +6182,7 @@ if (options.returnLastFrame && (!options.video || !isSeedance25ModelSelectionLoc
6074
6182
  fatalCliError('--return-last-frame requires Seedance 2.5 video.', { code: 'INVALID_ARGUMENT' });
6075
6183
  }
6076
6184
 
6077
- if (options.imageQuality !== null || options.imageBackground !== null || options.imageOutputCompression !== null || options.imageMask !== null) {
6185
+ if (options.imageQuality !== null || options.imageBackground !== null || options.imageOutputCompression !== null || options.imageMask !== null || [options.imageComplexity, options.imageFrameCount, options.imageFrameDurationMs, options.imageMarkupUrl].some(value => value !== undefined) || options.outputFormat === 'gif') {
6078
6186
  try {
6079
6187
  if (options.video || options.music || !isGptImage2ModelSelection(options.model)) {
6080
6188
  throw new Error('Image quality, background, compression and mask options require a GPT Image model.');
@@ -6768,12 +6876,23 @@ if (options.music) {
6768
6876
 
6769
6877
  if (!options.video && !options.music && isGptImage2ModelSelection(options.model)) {
6770
6878
  options.model = normalizeGptImageModelAlias(options.model);
6879
+ if (options.outputFormat === 'gif') {
6880
+ if (options.contextImages.length || options.imageMask || options.imageMarkupUrl) fatalCliError('GIF output requires text-to-image generation without references, mask or markup.', { code: 'INVALID_ARGUMENT' });
6881
+ try {
6882
+ Object.assign(options, gptImageGifDimensions(
6883
+ cliSet.width || widthFromConfig || widthFromPrompt ? options.width : undefined,
6884
+ cliSet.height || heightFromConfig || heightFromPrompt ? options.height : undefined,
6885
+ options.imageFrameCount
6886
+ ));
6887
+ } catch (error) { fatalCliError(error.message, { code: 'INVALID_ARGUMENT' }); }
6888
+ } else {
6771
6889
  if (!cliSet.width && !widthFromConfig && !widthFromPrompt) options.width = 1024;
6772
6890
  if (!cliSet.height && !heightFromConfig && !heightFromPrompt) options.height = 1024;
6773
6891
  const { width, height } = options;
6774
6892
  if (width % 16 || height % 16 || Math.max(width, height) > 3840 || Math.max(width, height) / Math.min(width, height) > 3 || width * height < 655360 || width * height > 8294400) {
6775
6893
  fatalCliError('GPT Image dimensions must be multiples of 16, at most 3840 per edge, within 3:1 and 655360–8294400 pixels.', { code: 'INVALID_ARGUMENT' });
6776
6894
  }
6895
+ }
6777
6896
  if (!cliSet.timeout && !timeoutFromConfig) options.timeout = 600000;
6778
6897
  }
6779
6898
 
@@ -6904,6 +7023,32 @@ if (apiWorkflowStartAction && apiWorkflowTemplate === 'generated_keyframe_video'
6904
7023
  if (apiWorkflowStartAction && apiWorkflowTemplate === 'storyboard_video' && !options.prompt && !apiWorkflowStartHasExternalInput) {
6905
7024
  fatalCliError('--api-workflow storyboard-video preset requires a prompt or --workflow-input JSON.', { code: 'INVALID_ARGUMENT' });
6906
7025
  }
7026
+ if (options.network || options.priorityMode) {
7027
+ const flag = options.priorityMode ? '--priority' : '--network';
7028
+ const unrouted = [
7029
+ ['--api-chat, which runs on hosted Fast', options.apiChat],
7030
+ ['hosted workflows, which run on hosted Fast', options.apiWorkflowAction],
7031
+ ['--list-models or --search-models (use --model-network)', liveModelUtilityAction]
7032
+ ].find(([, applies]) => applies);
7033
+ if (unrouted) {
7034
+ fatalCliError(`${flag} cannot be combined with ${unrouted[0]}.`, {
7035
+ code: 'INVALID_ARGUMENT',
7036
+ details: { flag, conflictsWith: unrouted[0] }
7037
+ });
7038
+ }
7039
+ }
7040
+ if (options.priorityMode && (projectNetwork(options.model) !== 'fast'
7041
+ || requiresSparkOnlyToken(options.model) || options.billingMode === 'tokens' || options.tokenType === 'sogni')) {
7042
+ fatalCliError('--priority requires a Sogni worker model on Fast paid with Unlimited. Use --network fast, Spark and subscription billing, or omit --priority.', {
7043
+ code: 'INVALID_ARGUMENT', details: { flag: '--priority' }
7044
+ });
7045
+ }
7046
+ // Relaxed queues run far longer than Fast, so its renders get at least the wait a
7047
+ // queued video gets, unless the caller or the config chose one. Timing out leaves
7048
+ // the project running; --result <id> --wait collects it.
7049
+ if (!cliSet.timeout && !timeoutFromConfig && projectNetwork(options.model) === 'relaxed') {
7050
+ options.timeout = Math.max(options.timeout, 1800000);
7051
+ }
6907
7052
  if (!liveModelUtilityAction && (options.liveModelMedia !== 'all' || options.liveModelNetwork || options.liveModelTags.length > 0)) {
6908
7053
  fatalCliError('--model-media, --model-network, and --model-tag require --list-models or --search-models.', {
6909
7054
  code: 'INVALID_ARGUMENT'
@@ -10072,7 +10217,7 @@ async function fetchLiveModelCatalog(network, media) {
10072
10217
  }
10073
10218
 
10074
10219
  async function runLiveModels() {
10075
- const network = options.liveModelNetwork || openclawConfig?.defaultNetwork || 'fast';
10220
+ const network = options.liveModelNetwork || renderNetwork;
10076
10221
  const media = options.liveModelMedia || 'all';
10077
10222
  const query = options.liveModelQuery?.trim() || null;
10078
10223
  const normalizedQuery = normalizeLiveModelSearch(query);
@@ -11065,6 +11210,7 @@ function applyPersonaAndVoiceReferences() {
11065
11210
  options.referenceAudioIdentity = voicePersona.voiceClipPath;
11066
11211
  cliSet.referenceAudioIdentity = true;
11067
11212
  }
11213
+ if (!options.voiceTranscript && voicePersona.voiceTranscript) options.voiceTranscript = voicePersona.voiceTranscript;
11068
11214
  options._voicePersonaResolvedName = voicePersona.name;
11069
11215
  }
11070
11216
 
@@ -11084,8 +11230,12 @@ function applyPersonaAndVoiceReferences() {
11084
11230
  if (!options.refImage) {
11085
11231
  options.refImage = persona.photoPath;
11086
11232
  }
11233
+ if (persona.photoPaths?.length > 1 && (options.videoWorkflow === 'r2v' || inferVideoWorkflowFromModel(options.model) === 'r2v')) {
11234
+ options.contextImages.push(...persona.photoPaths.slice(1));
11235
+ }
11087
11236
  } else {
11088
- options.contextImages.push(persona.photoPath);
11237
+ options.contextImages.push(...(persona.photoPaths ?? [persona.photoPath]));
11238
+
11089
11239
  }
11090
11240
  }
11091
11241
 
@@ -12916,6 +13066,8 @@ function sourceReelChildArgs(baseArgs, outputPath, prompt, plan, duration) {
12916
13066
  ...baseArgs
12917
13067
  ];
12918
13068
  if (options.tokenType) args.push('--token-type', options.tokenType);
13069
+ if (options.network) args.push('--network', options.network);
13070
+ if (options.priorityMode) args.push('--priority');
12919
13071
  if (options.steps !== null && options.steps !== undefined) args.push('--steps', String(options.steps));
12920
13072
  if (options.guidance !== null && options.guidance !== undefined) args.push('--guidance', String(options.guidance));
12921
13073
  if (options.noFilter) args.push('--no-filter');
@@ -14202,6 +14354,8 @@ async function buildVideoEstimateParams({ tokenType, steps }) {
14202
14354
  fps: options.fps,
14203
14355
  numberOfMedia: options.count,
14204
14356
  tokenType,
14357
+ network: projectNetwork(options.model),
14358
+ ...(options.priorityMode ? { priorityMode: true, billingMode: 'subscription' } : {}),
14205
14359
  ...(Number.isFinite(steps) && steps > 0 ? { steps } : {}),
14206
14360
  ...(options.frames ? { frames: options.frames } : { duration: options.duration }),
14207
14361
  ...(referenceImageCount !== undefined ? { referenceImageCount } : {}),
@@ -14412,7 +14566,7 @@ async function runDoctor() {
14412
14566
  appSource: SOGNI_APP_SOURCE,
14413
14567
  appId: getOrCreateSogniAppId(),
14414
14568
  attribution: clientAttribution(AGENT_ATTRIBUTION),
14415
- network: openclawConfig?.defaultNetwork || 'fast',
14569
+ network: renderNetwork,
14416
14570
  autoConnect: false,
14417
14571
  apiKey: creds.SOGNI_API_KEY,
14418
14572
  authType: 'apiKey'
@@ -14599,7 +14753,31 @@ async function main() {
14599
14753
  // Persona commands (non-generate)
14600
14754
  if (options.personaAction && options.personaAction !== 'generate') {
14601
14755
  const jsonOut = options.json || JSON_ERROR_MODE;
14602
- if (options.personaAction === 'list') {
14756
+ if (['list-account', 'import-account'].includes(options.personaAction)) {
14757
+ const apiKey = requireApiKeyCredentials(loadCredentials(), 'Account Personas');
14758
+ const requestJson = (path) => fetchApiJson(path, { apiKey });
14759
+ if (options.personaAction === 'list-account') {
14760
+ const payload = await requestJson('/v1/personas' + (options.personaAccountAfter ? '?after=' + encodeURIComponent(options.personaAccountAfter) : ''));
14761
+ if (jsonOut) console.log(JSON.stringify({ success: true, type: 'persona-list-account', ...payload.data }));
14762
+ else {
14763
+ for (const persona of payload.data.items ?? []) console.log(`${persona.name} (${persona.id})`);
14764
+ if (payload.data.nextCursor) console.log(`Next page: --persona-list-account --persona-account-after ${JSON.stringify(payload.data.nextCursor)}`);
14765
+ }
14766
+ } else {
14767
+ const persona = await importAccountPersona({
14768
+ id: options.personaName, directory: PERSONAS_DIR, existingPersonas: loadPersonas(), requestJson,
14769
+ requestBytes: async (path) => {
14770
+ const url = await buildSafeApiUrl(path);
14771
+ const response = await fetch(url, { headers: apiRequestHeaders(apiKey), redirect: 'error', signal: AbortSignal.timeout(DEFAULT_HTTP_TIMEOUT_MS) });
14772
+ if (!response.ok) throw new Error(`Could not download an original persona reference (HTTP ${response.status}).`);
14773
+ return Buffer.from(await response.arrayBuffer());
14774
+ },
14775
+ });
14776
+ savePersonasIndex([...loadPersonas(), persona]);
14777
+ if (jsonOut) console.log(JSON.stringify({ success: true, type: 'persona-import-account', persona }));
14778
+ else console.log(`Imported ${persona.name} with ${persona.references.length} original references. Use --persona ${JSON.stringify(persona.name)} to generate.`);
14779
+ }
14780
+ } else if (options.personaAction === 'list') {
14603
14781
  const personas = loadPersonas();
14604
14782
  if (jsonOut) {
14605
14783
  console.log(JSON.stringify({ success: true, type: 'persona-list', personas, timestamp: new Date().toISOString() }));
@@ -15097,6 +15275,7 @@ async function main() {
15097
15275
  success: true,
15098
15276
  type: 'video-cost',
15099
15277
  model: options.model,
15278
+ network: estimateParams.network,
15100
15279
  width: options.width,
15101
15280
  height: options.height,
15102
15281
  fps: options.fps,
@@ -16501,7 +16680,7 @@ async function main() {
16501
16680
  appSource: SOGNI_APP_SOURCE,
16502
16681
  appId: getOrCreateSogniAppId(),
16503
16682
  attribution: clientAttribution(AGENT_ATTRIBUTION),
16504
- network: openclawConfig?.defaultNetwork || 'fast',
16683
+ network: renderNetwork,
16505
16684
  autoConnect: false,
16506
16685
  apiKey: creds.SOGNI_API_KEY,
16507
16686
  authType: 'apiKey'
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.63.0';
1
+ export const PACKAGE_VERSION = '3.65.0';