@lingjingai/lj-awb-cli-pre 0.3.15 → 0.3.16

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.
@@ -47,6 +47,7 @@ function requestSummary(request = {}) {
47
47
  const promptParams = request.promptParams || {};
48
48
  return compactRecord({
49
49
  requestSource: request.requestSource,
50
+ modelCode: request.modelCode,
50
51
  modelGroupCode: request.modelGroupCode,
51
52
  projectGroupNo: request.projectGroupNo,
52
53
  customBizId: request.customBizId,
@@ -159,6 +160,9 @@ function normalizeDryRun(data = {}) {
159
160
  localFiles,
160
161
  results: Array.isArray(data.results) ? data.results.map((row) => normalizeDryRunResult(row)) : data.results,
161
162
  nextRefSubject: data.nextRefSubject,
163
+ resolvedModelCode: data.resolvedModelCode,
164
+ resolvedFrom: data.resolvedFrom,
165
+ resolvedFromValue: data.resolvedFromValue,
162
166
  });
163
167
  }
164
168
 
@@ -185,8 +189,17 @@ function normalizeTaskSubmission(data = {}) {
185
189
  function normalizeSubtitleSubmission(data = {}) {
186
190
  return compactRecord({
187
191
  submitted: data.submitted,
188
- remoteTaskId: data.remoteTaskId,
189
- publicId: data.publicId,
192
+ taskId: data.taskId,
193
+ taskType: data.taskType,
194
+ sourceTaskId: data.sourceTaskId,
195
+ projectGroupNo: data.projectGroupNo,
196
+ pointCost: data.pointCost,
197
+ billingPointBalance: data.billingPointBalance ?? data.teamPointBalance,
198
+ billingPointRemainingAfter: data.billingPointRemainingAfter ?? data.teamPointRemainingAfter,
199
+ projectBudgetBalance: data.projectBudgetBalance ?? data.projectPointBalance,
200
+ projectBudgetMax: data.projectBudgetMax ?? data.projectPointMax,
201
+ projectBudgetRemainingAfter: data.projectBudgetRemainingAfter ?? data.projectPointRemainingAfter,
202
+ nextCommand: rewriteCommandPrefix(data.nextCommand),
190
203
  });
191
204
  }
192
205
 
@@ -293,11 +306,31 @@ function normalizeSubject(data = {}) {
293
306
  elementId: data.elementId,
294
307
  subjectId: data.subjectId,
295
308
  externalId: data.externalId,
309
+ modelCode: data.modelCode ?? data.request?.modelCode ?? data.subject?.modelCode,
296
310
  status: data.status,
311
+ taskStatus: data.taskStatus ?? data.subject?.taskStatus,
312
+ errorMessage: data.errorMessage ?? data.subject?.errorMessage,
313
+ isTerminal: data.isTerminal ?? data.subject?.isTerminal,
297
314
  nextRefSubject: data.nextRefSubject,
298
315
  });
299
316
  }
300
317
 
318
+ function normalizeSubjectVoice(data = {}) {
319
+ return compactRecord({
320
+ created: data.created,
321
+ name: data.name,
322
+ voiceRecordId: data.voiceRecordId,
323
+ reqTaskId: data.reqTaskId,
324
+ voiceId: data.voiceId ?? data.externalId,
325
+ externalId: data.externalId,
326
+ status: data.status,
327
+ taskStatus: data.taskStatus ?? data.voice?.taskStatus,
328
+ errorMessage: data.errorMessage ?? data.voice?.errorMessage,
329
+ isTerminal: data.isTerminal ?? data.voice?.isTerminal,
330
+ nextVoiceArg: data.nextVoiceArg,
331
+ });
332
+ }
333
+
301
334
  function normalizeAsset(data = {}) {
302
335
  return compactRecord({
303
336
  created: data.created,
@@ -466,13 +499,13 @@ export function normalizeOutputData(commandName, data) {
466
499
  }
467
500
  if (data.dryRun) return normalizeDryRun(data);
468
501
  switch (commandName) {
469
- case 'image create':
470
- case 'video create':
502
+ case 'create image':
503
+ case 'create video':
471
504
  return normalizeTaskSubmission(data);
472
- case 'video subtitle-remove':
505
+ case 'create video-subtitle-removal':
473
506
  return normalizeSubtitleSubmission(data);
474
- case 'image fee':
475
- case 'video fee':
507
+ case 'create image-fee':
508
+ case 'create video-fee':
476
509
  return normalizeFee(data);
477
510
  case 'account info':
478
511
  return normalizeAccountInfo(data);
@@ -486,17 +519,20 @@ export function normalizeOutputData(commandName, data) {
486
519
  return normalizeProjectSummary(data);
487
520
  case 'credits usage':
488
521
  return normalizeCreditsUsage(data);
489
- case 'image status':
490
- case 'video status':
522
+ case 'task image-status':
523
+ case 'task video-status':
491
524
  case 'task wait':
492
- case 'video subtitle-status':
525
+ case 'task video-subtitle-status':
493
526
  return normalizeTaskStatus(data);
494
- case 'subject publish':
495
- case 'subject wait':
527
+ case 'create subject':
528
+ case 'create subject-wait':
496
529
  return normalizeSubject(data);
497
- case 'asset group-create':
498
- case 'asset group-update':
499
- case 'asset register':
530
+ case 'create subject-voice':
531
+ case 'create subject-voice-wait':
532
+ return normalizeSubjectVoice(data);
533
+ case 'create asset-group':
534
+ case 'create asset-group-update':
535
+ case 'create asset':
500
536
  return normalizeAsset(data);
501
537
  case 'model image-models':
502
538
  case 'model video-models':
@@ -511,12 +547,14 @@ export function normalizeOutputData(commandName, data) {
511
547
  return normalizeList(data, ['tasks']);
512
548
  case 'task records':
513
549
  return normalizeList(data, ['records']);
514
- case 'asset groups':
550
+ case 'create asset-groups':
515
551
  return normalizeList(data, ['groups']);
516
- case 'asset match-actor':
552
+ case 'create asset-match-actor':
517
553
  return normalizeList(data, ['matches']);
518
- case 'subject list':
554
+ case 'create subject-list':
519
555
  return normalizeList(data, ['subjects']);
556
+ case 'create subject-voice-list':
557
+ return normalizeList(data, ['voices']);
520
558
  default:
521
559
  break;
522
560
  }
@@ -663,6 +701,7 @@ function rowSummary(row) {
663
701
  'modelGroupCode',
664
702
  'provider',
665
703
  'displayName',
704
+ 'modelDesc',
666
705
  'modelStatus',
667
706
  'taskQueueNum',
668
707
  'feeCalcType',
@@ -721,7 +760,10 @@ function rowSummary(row) {
721
760
  'imageUrl',
722
761
  'subjectId',
723
762
  'elementId',
763
+ 'voiceRecordId',
764
+ 'voiceId',
724
765
  'externalId',
766
+ 'nextVoiceArg',
725
767
  'label',
726
768
  'assetPath',
727
769
  'isPrimary',
@@ -797,7 +839,7 @@ function rowSummary(row) {
797
839
  .join(' ');
798
840
  }
799
841
 
800
- function textSources(values = []) {
842
+ function textValueShapes(values = []) {
801
843
  const names = {
802
844
  local_file: 'file',
803
845
  http_url: 'url',
@@ -905,7 +947,7 @@ function formatModelOptionsOutput(data = {}) {
905
947
  mode: item.mode,
906
948
  media: item.mediaType,
907
949
  usage: item.usage,
908
- sources: textSources(item.sources),
950
+ valueShapes: textValueShapes(item.valueShapes),
909
951
  formats: textResourceFormats(item),
910
952
  webpInput: textWebpInput(item),
911
953
  autoConvert: textResourceAutoConvert(item),
@@ -920,7 +962,7 @@ function formatModelOptionsOutput(data = {}) {
920
962
  'mode',
921
963
  'media',
922
964
  'usage',
923
- 'sources',
965
+ 'valueShapes',
924
966
  'formats',
925
967
  'webpInput',
926
968
  'autoConvert',
@@ -1035,14 +1077,17 @@ function modelListNextCommand(commandName) {
1035
1077
 
1036
1078
  function statusNextCommand(commandName, normalized) {
1037
1079
  if (!isPlainObject(normalized) || normalized.isTerminal !== false || !normalized.taskId) return null;
1038
- const taskType = normalized.taskType || (commandName === 'video status' ? 'VIDEO_GROUP' : 'IMAGE_CREATE');
1080
+ const taskType = normalized.taskType || (commandName === 'task video-status' ? 'VIDEO_GROUP' : 'IMAGE_CREATE');
1039
1081
  return `${commandPrefix()} task wait --task-id ${normalized.taskId} --task-type ${taskType} --wait-seconds 180`;
1040
1082
  }
1041
1083
 
1042
1084
  function subtitleRemoveNextCommand(commandName, normalized) {
1043
- if (commandName !== 'video status' && commandName !== 'task wait') return null;
1044
- if (!Array.isArray(normalized.originUrls) || !normalized.originUrls.length) return null;
1045
- return `${commandPrefix()} video subtitle-remove --video-url <originUrl[0]> --dry-run`;
1085
+ if (commandName !== 'task video-status' && commandName !== 'task wait') return null;
1086
+ if (!normalized.taskId || normalized.taskStatus !== 'SUCCESS') return null;
1087
+ const taskType = String(normalized.taskType || '');
1088
+ if (taskType && taskType !== 'VIDEO_GROUP' && !taskType.startsWith('VIDEO_') && !taskType.startsWith('LIP_SYNC')) return null;
1089
+ const projectGroupPart = normalized.projectGroupNo ? ` --project-group-no ${normalized.projectGroupNo}` : '';
1090
+ return `${commandPrefix()} create video-subtitle-removal --source-task-id ${normalized.taskId}${projectGroupPart} --dry-run`;
1046
1091
  }
1047
1092
 
1048
1093
  export function formatTextOutput(commandName, data, context = {}) {
@@ -1071,6 +1116,10 @@ export function formatTextOutput(commandName, data, context = {}) {
1071
1116
  'pointNo',
1072
1117
  'taskType',
1073
1118
  'taskStatus',
1119
+ 'modelCode',
1120
+ 'resolvedModelCode',
1121
+ 'resolvedFrom',
1122
+ 'resolvedFromValue',
1074
1123
  'modelGroupCode',
1075
1124
  'projectGroupNo',
1076
1125
  'projectId',
@@ -1078,6 +1127,8 @@ export function formatTextOutput(commandName, data, context = {}) {
1078
1127
  'groupName',
1079
1128
  'assetId',
1080
1129
  'elementId',
1130
+ 'voiceRecordId',
1131
+ 'voiceId',
1081
1132
  'externalId',
1082
1133
  'status',
1083
1134
  'imported',