@lingjingai/lj-awb-cli 0.4.6 → 0.5.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.
Files changed (39) hide show
  1. package/README.md +14 -7
  2. package/build/volta-pre.mjs +64 -0
  3. package/install.mjs +11 -3
  4. package/package.json +4 -3
  5. package/packages/awb-cli/package.json +2 -2
  6. package/packages/awb-core/package.json +1 -2
  7. package/packages/awb-core/src/api.js +14 -12
  8. package/packages/awb-core/src/commands.js +55 -506
  9. package/packages/awb-core/src/common.js +3 -5
  10. package/packages/awb-core/src/output.js +92 -306
  11. package/packages/awb-core/src/services.js +263 -64
  12. package/packages/awb-core/src/standalone.js +33 -207
  13. package/packages/awb-core/src/update.js +74 -3
  14. package/skills/lj-awb/SKILL.md +15 -8
  15. package/skills/lj-awb/VERSION +1 -1
  16. package/skills/lj-awb/compat.json +3 -3
  17. package/skills/lj-awb/modules/account.md +5 -3
  18. package/skills/lj-awb/modules/asset.md +1 -1
  19. package/skills/lj-awb/modules/create-contract.md +10 -8
  20. package/skills/lj-awb/modules/create.md +1 -1
  21. package/skills/lj-awb/modules/credits.md +18 -1
  22. package/skills/lj-awb/modules/driver.md +4 -10
  23. package/skills/lj-awb/modules/evals.md +2 -2
  24. package/skills/lj-awb/modules/image.md +6 -6
  25. package/skills/lj-awb/modules/model.md +50 -1
  26. package/skills/lj-awb/modules/project.md +2 -2
  27. package/skills/lj-awb/modules/task-manual.md +3 -3
  28. package/skills/lj-awb/modules/task.md +6 -5
  29. package/skills/lj-awb/modules/upload.md +10 -10
  30. package/skills/lj-awb/modules/video.md +11 -13
  31. package/skills/lj-awb/modules/workflows.md +2 -77
  32. package/skills/lj-awb/references/error-codes.md +2 -2
  33. package/skills/lj-awb/references/output-fields.md +11 -15
  34. package/packages/awb-core/src/artifact.js +0 -936
  35. package/skills/lj-awb/modules/artifact/asset.md +0 -64
  36. package/skills/lj-awb/modules/artifact/clip.md +0 -65
  37. package/skills/lj-awb/modules/artifact/script.md +0 -37
  38. package/skills/lj-awb/modules/artifact/video.md +0 -65
  39. package/skills/lj-awb/modules/artifact.md +0 -65
@@ -36,6 +36,9 @@ export const TASK_UPLOAD_SCENE = {
36
36
  ASSET_REVIEW: 'asset-review',
37
37
  DEFAULT: 'material-image-draw',
38
38
  };
39
+ // upload files(用户手动上传)专用场景:仅此命令走临时隔离区,后端据此下发独立、可定期清理的 tmp/cli-upload/ 路径。
40
+ // create 系列(生图 / 生视频 / 主体 / 素材加白)的自动上传不使用本场景,走上面各自的业务场景、长期保留。
41
+ export const CLI_TEMP_UPLOAD_SCENE = 'cli-upload-temp';
39
42
  export const TERMINAL_TASK_STATES = new Set([
40
43
  'SUCCESS',
41
44
  'COMPLETED',
@@ -316,11 +319,6 @@ export function isSuccessTaskStatus(value) {
316
319
  return SUCCESS_TASK_STATES.has(taskStatusText(value));
317
320
  }
318
321
 
319
- export function taskTypeToStatusKind(taskType) {
320
- const normalized = normalizeFeedTaskType(taskType);
321
- return normalized.startsWith('VIDEO') ? 'video' : 'image';
322
- }
323
-
324
322
  export function guessMimeType(filePath) {
325
323
  const ext = path.extname(String(filePath ?? '')).toLowerCase();
326
324
  switch (ext) {
@@ -213,8 +213,9 @@ function normalizeDryRun(data = {}) {
213
213
 
214
214
  function submissionStatusCommand(commandName, data = {}) {
215
215
  if (!data?.taskId) return null;
216
- if (commandName === 'create image') return `${commandPrefix()} task image-status --task-id ${data.taskId}`;
217
- if (commandName === 'create video') return `${commandPrefix()} task video-status --task-id ${data.taskId}`;
216
+ if (commandName === 'create image' || commandName === 'create video') {
217
+ return `${commandPrefix()} task status --task-id ${data.taskId}`;
218
+ }
218
219
  return null;
219
220
  }
220
221
 
@@ -296,6 +297,44 @@ function normalizeCredits(data = {}) {
296
297
  });
297
298
  }
298
299
 
300
+ function normalizeCreditsRecords(data = {}) {
301
+ const rows = Array.isArray(data.creditRecords)
302
+ ? data.creditRecords
303
+ : (Array.isArray(data.records) ? data.records : []);
304
+ return compactRecord({
305
+ remainPoint: data.remainPoint,
306
+ dataPlanPoint: data.dataPlanPoint,
307
+ topUpPoint: data.topUpPoint,
308
+ queryType: data.queryType,
309
+ total: data.total,
310
+ page: data.page,
311
+ size: data.size,
312
+ pages: data.pages,
313
+ creditRecords: rows.map((row) => compactRecord({
314
+ operationTime: row.operationTime,
315
+ title: row.title,
316
+ point: row.point,
317
+ projectGroupName: row.projectGroupName,
318
+ projectGroupNo: row.projectGroupNo,
319
+ userName: row.userName,
320
+ })),
321
+ });
322
+ }
323
+
324
+ function normalizeCreditDetailStatus(data = {}) {
325
+ return compactRecord({
326
+ detailId: data.detailId,
327
+ status: data.status,
328
+ statusText: data.statusText,
329
+ lockTime: data.lockTime,
330
+ lockPoint: data.lockPoint,
331
+ useTime: data.useTime,
332
+ usePoint: data.usePoint,
333
+ regetTime: data.regetTime,
334
+ regetPoint: data.regetPoint,
335
+ });
336
+ }
337
+
299
338
  function normalizeProjectSummary(data = {}) {
300
339
  return compactRecord({
301
340
  selected: data.selected,
@@ -345,6 +384,7 @@ function normalizeTaskStatus(data = {}) {
345
384
  modelGroupCode: data.modelGroupCode,
346
385
  projectGroupNo: data.projectGroupNo,
347
386
  pointNo: data.pointNo,
387
+ benefitsId: data.benefitsId,
348
388
  gmtCreate: data.gmtCreate,
349
389
  resultCount: data.resultCount,
350
390
  resultUrls: data.resultUrls,
@@ -435,136 +475,6 @@ function normalizeList(data = {}, keys) {
435
475
  });
436
476
  }
437
477
 
438
- function normalizeArtifactList(commandName, data) {
439
- if (Array.isArray(data)) {
440
- return compactRecord({ count: data.length, items: cleanNested(data) });
441
- }
442
- if (!isPlainObject(data)) return cleanNested(data);
443
- const arrayKey = Object.keys(data).find((key) => Array.isArray(data[key]));
444
- if (arrayKey) {
445
- return compactRecord({
446
- count: data.count ?? data[arrayKey].length,
447
- [arrayKey]: cleanNested(data[arrayKey]),
448
- ...Object.fromEntries(
449
- Object.entries(data)
450
- .filter(([key]) => key !== arrayKey && key !== 'raw')
451
- .map(([key, value]) => [key, cleanNested(value)]),
452
- ),
453
- });
454
- }
455
- return cleanNested(data);
456
- }
457
-
458
- function normalizeArtifactRecord(data) {
459
- if (!isPlainObject(data)) return cleanNested(data);
460
- const out = compactRecord({
461
- id: data.id,
462
- projectId: data.projectId,
463
- rowKind: data.rowKind,
464
- entityKey: data.entityKey,
465
- parentKey: data.parentKey,
466
- sortOrder: data.sortOrder,
467
- actorKey: data.actorKey,
468
- propKey: data.propKey,
469
- locationKey: data.locationKey,
470
- stateKey: data.stateKey,
471
- episodeId: data.episodeId,
472
- sceneId: data.sceneId,
473
- clipId: data.clipId,
474
- videoEpisodeId: data.videoEpisodeId,
475
- status: data.status,
476
- title: data.title,
477
- name: data.name,
478
- displayName: data.displayName,
479
- description: data.description,
480
- });
481
- for (const [key, value] of Object.entries(data)) {
482
- if (key in out) continue;
483
- if (Array.isArray(value)) out[`${key}Count`] = value.length;
484
- else if (!isPlainObject(value)) out[key] = value;
485
- }
486
- return cleanNested(out);
487
- }
488
-
489
- function normalizeArtifactFull(data) {
490
- if (!isPlainObject(data)) return cleanNested(data);
491
- const out = compactRecord({
492
- projectId: data.projectId,
493
- id: data.id,
494
- title: data.title,
495
- status: data.status,
496
- });
497
- for (const [key, value] of Object.entries(data)) {
498
- if (Array.isArray(value)) out[`${key}Count`] = value.length;
499
- else if (isPlainObject(value)) {
500
- const innerKey = Object.keys(value).find((k) => Array.isArray(value[k]));
501
- if (innerKey) out[`${key}.${innerKey}Count`] = value[innerKey].length;
502
- } else if (!(key in out)) out[key] = value;
503
- }
504
- return out;
505
- }
506
-
507
- function normalizeArtifactImport(data = {}) {
508
- if (!isPlainObject(data)) return cleanNested(data);
509
- return compactRecord({
510
- imported: data.imported,
511
- dryRun: data.dryRun,
512
- action: data.action,
513
- projectId: data.projectId,
514
- sourceFile: data.sourceFile,
515
- inputDir: data.inputDir,
516
- inputFile: data.inputFile,
517
- rowCount: data.rowCount,
518
- actorCount: data.actorCount,
519
- propCount: data.propCount,
520
- locationCount: data.locationCount,
521
- episodeCount: data.episodeCount,
522
- sceneCount: data.sceneCount,
523
- clipCount: data.clipCount,
524
- batchCount: Array.isArray(data.batch) ? data.batch.length : undefined,
525
- rowsByKind: data.rowsByKind,
526
- files: isPlainObject(data.files)
527
- ? compactRecord({
528
- actors: data.files.actorsFile,
529
- props: data.files.propsFile,
530
- locations: data.files.locationsFile,
531
- })
532
- : undefined,
533
- });
534
- }
535
-
536
- function normalizeArtifactWrite(data) {
537
- if (!isPlainObject(data)) return cleanNested(data);
538
- return normalizeArtifactRecord(data);
539
- }
540
-
541
- function normalizeArtifactDelete(data) {
542
- if (!isPlainObject(data)) return cleanNested(data);
543
- return compactRecord({
544
- deleted: data.deleted ?? true,
545
- action: data.action,
546
- projectId: data.projectId,
547
- key: data.key,
548
- stateKey: data.stateKey,
549
- episodeId: data.episodeId,
550
- sceneId: data.sceneId,
551
- clipId: data.clipId,
552
- videoEpisodeId: data.videoEpisodeId,
553
- rowKind: data.rowKind,
554
- entityKey: data.entityKey,
555
- });
556
- }
557
-
558
- function normalizeArtifactStatus(data) {
559
- if (!isPlainObject(data)) return cleanNested(data);
560
- return compactRecord({
561
- updated: data.updated ?? true,
562
- videoEpisodeId: data.videoEpisodeId ?? data.id,
563
- status: data.status,
564
- messageCount: Array.isArray(data.messages) ? data.messages.length : undefined,
565
- });
566
- }
567
-
568
478
  export function normalizeOutputData(commandName, data) {
569
479
  if (!isPlainObject(data)) return cleanNested(data);
570
480
  switch (commandName) {
@@ -594,19 +504,20 @@ export function normalizeOutputData(commandName, data) {
594
504
  return normalizeAccountInfo(data);
595
505
  case 'credits balance':
596
506
  return normalizeCredits(data);
507
+ case 'credits records':
508
+ return normalizeCreditsRecords(data);
509
+ case 'credits detail-status':
510
+ return normalizeCreditDetailStatus(data);
597
511
  case 'project current':
598
- case 'project use':
512
+ case 'project switch':
599
513
  case 'project create':
600
514
  case 'project update':
601
515
  case 'project ensure':
602
516
  return normalizeProjectSummary(data);
603
517
  case 'credits usage':
604
518
  return normalizeCreditsUsage(data);
605
- case 'task image-status':
606
- case 'task video-status':
519
+ case 'task status':
607
520
  case 'task wait':
608
- case 'task video-subtitle-status':
609
- case 'task video-super-resolution-status':
610
521
  return normalizeTaskStatus(data);
611
522
  case 'create subject':
612
523
  case 'create subject-wait':
@@ -645,88 +556,6 @@ export function normalizeOutputData(commandName, data) {
645
556
  default:
646
557
  break;
647
558
  }
648
- if (commandName?.startsWith('artifact ')) {
649
- return normalizeArtifactByCommand(commandName, data);
650
- }
651
- return cleanNested(data);
652
- }
653
-
654
- const ARTIFACT_LIST_COMMANDS = new Set([
655
- 'artifact script rows',
656
- 'artifact script children',
657
- 'artifact asset actors',
658
- 'artifact asset props',
659
- 'artifact asset locations',
660
- 'artifact video episodes',
661
- 'artifact video scenes',
662
- 'artifact video clips',
663
- 'artifact clip episodes',
664
- ]);
665
-
666
- const ARTIFACT_RECORD_COMMANDS = new Set([
667
- 'artifact script document',
668
- 'artifact script row',
669
- 'artifact asset actor',
670
- 'artifact asset prop',
671
- 'artifact asset location',
672
- 'artifact video episode',
673
- 'artifact video scene',
674
- 'artifact video clip',
675
- 'artifact clip episode',
676
- 'artifact clip episode-by-id',
677
- ]);
678
-
679
- const ARTIFACT_FULL_COMMANDS = new Set([
680
- 'artifact script get',
681
- 'artifact asset get',
682
- 'artifact video get',
683
- 'artifact clip get',
684
- ]);
685
-
686
- const ARTIFACT_IMPORT_COMMANDS = new Set([
687
- 'artifact script import',
688
- 'artifact asset import',
689
- 'artifact video import-storyboard',
690
- 'artifact clip upsert-batch',
691
- ]);
692
-
693
- const ARTIFACT_WRITE_COMMANDS = new Set([
694
- 'artifact script upsert-row',
695
- 'artifact asset upsert-actor',
696
- 'artifact asset upsert-prop',
697
- 'artifact asset upsert-location',
698
- 'artifact asset upsert-actor-state',
699
- 'artifact asset upsert-prop-state',
700
- 'artifact asset upsert-location-state',
701
- 'artifact video upsert-episode',
702
- 'artifact video upsert-scene',
703
- 'artifact video upsert-clip',
704
- 'artifact video update-clip-urls',
705
- 'artifact clip upsert-episode',
706
- ]);
707
-
708
- const ARTIFACT_DELETE_COMMANDS = new Set([
709
- 'artifact script delete-row',
710
- 'artifact asset delete-actor',
711
- 'artifact asset delete-prop',
712
- 'artifact asset delete-location',
713
- 'artifact asset delete-actor-state',
714
- 'artifact asset delete-prop-state',
715
- 'artifact asset delete-location-state',
716
- 'artifact video delete-episode',
717
- 'artifact video delete-scene',
718
- 'artifact video delete-clip',
719
- 'artifact clip delete-episode',
720
- ]);
721
-
722
- function normalizeArtifactByCommand(commandName, data) {
723
- if (ARTIFACT_LIST_COMMANDS.has(commandName)) return normalizeArtifactList(commandName, data);
724
- if (ARTIFACT_RECORD_COMMANDS.has(commandName)) return normalizeArtifactRecord(data);
725
- if (ARTIFACT_FULL_COMMANDS.has(commandName)) return normalizeArtifactFull(data);
726
- if (ARTIFACT_IMPORT_COMMANDS.has(commandName)) return normalizeArtifactImport(data);
727
- if (ARTIFACT_WRITE_COMMANDS.has(commandName)) return normalizeArtifactWrite(data);
728
- if (ARTIFACT_DELETE_COMMANDS.has(commandName)) return normalizeArtifactDelete(data);
729
- if (commandName === 'artifact clip update-status') return normalizeArtifactStatus(data);
730
559
  return cleanNested(data);
731
560
  }
732
561
 
@@ -867,6 +696,7 @@ function rowSummary(row) {
867
696
  'status',
868
697
  'message',
869
698
  'title',
699
+ 'point',
870
700
  'description',
871
701
  'groupId',
872
702
  'groupName',
@@ -1368,12 +1198,11 @@ function modelListAgentHint(commandName) {
1368
1198
 
1369
1199
  function statusNextCommand(commandName, normalized) {
1370
1200
  if (!isPlainObject(normalized) || normalized.isTerminal !== false || !normalized.taskId) return null;
1371
- const taskType = normalized.taskType || (commandName === 'task video-status' ? 'VIDEO_GROUP' : 'IMAGE_CREATE');
1372
- return `${commandPrefix()} task wait --task-id ${normalized.taskId} --task-type ${taskType} --wait-seconds 180`;
1201
+ return `${commandPrefix()} task wait --task-id ${normalized.taskId} --wait-seconds 180`;
1373
1202
  }
1374
1203
 
1375
1204
  function subtitleRemoveNextCommand(commandName, normalized) {
1376
- if (commandName !== 'task video-status' && commandName !== 'task wait') return null;
1205
+ if (commandName !== 'task status' && commandName !== 'task wait') return null;
1377
1206
  if (!normalized.taskId || normalized.taskStatus !== 'SUCCESS') return null;
1378
1207
  const taskType = String(normalized.taskType || '');
1379
1208
  if (taskType && taskType !== 'VIDEO_GROUP' && !taskType.startsWith('VIDEO_') && !taskType.startsWith('LIP_SYNC')) return null;
@@ -1393,12 +1222,14 @@ const OUTPUT_KIND_BY_COMMAND = {
1393
1222
  'account switch-team': 'generic',
1394
1223
  'project list': 'project_list',
1395
1224
  'project current': 'project_summary',
1396
- 'project use': 'generic',
1225
+ 'project switch': 'generic',
1397
1226
  'project users': 'project_user_list',
1398
1227
  'project create': 'generic',
1399
1228
  'project update': 'generic',
1400
1229
  'project ensure': 'generic',
1401
1230
  'credits balance': 'credits_balance',
1231
+ 'credits records': 'credits_records',
1232
+ 'credits detail-status': 'credit_detail_status',
1402
1233
  'credits usage': 'credits_usage',
1403
1234
  'credits buy': 'purchase_guide',
1404
1235
  'credits redeem': 'redeem_result',
@@ -1412,16 +1243,13 @@ const OUTPUT_KIND_BY_COMMAND = {
1412
1243
  'create image-fee': 'fee_estimate',
1413
1244
  'create image': 'task_submission',
1414
1245
  'create image-batch': 'batch_task_submission',
1415
- 'task image-status': 'task_status',
1416
1246
  'create video-fee': 'fee_estimate',
1417
1247
  'create video': 'task_submission',
1418
1248
  'create video-batch': 'batch_task_submission',
1419
1249
  'create video-super-resolution-fee': 'fee_estimate',
1420
1250
  'create video-super-resolution': 'task_submission',
1421
- 'task video-status': 'task_status',
1422
1251
  'create video-subtitle-removal': 'subtitle_task_submission',
1423
- 'task video-subtitle-status': 'subtitle_task_status',
1424
- 'task video-super-resolution-status': 'task_status',
1252
+ 'task status': 'task_status',
1425
1253
  'task list': 'task_list',
1426
1254
  'task wait': 'task_status',
1427
1255
  'task records': 'local_task_records',
@@ -1432,57 +1260,6 @@ const OUTPUT_KIND_BY_COMMAND = {
1432
1260
  'create asset-group': 'asset_group_write_result',
1433
1261
  'create asset-group-update': 'asset_group_write_result',
1434
1262
  'create asset': 'asset_register_result',
1435
- 'artifact script get': 'artifact_full',
1436
- 'artifact script document': 'artifact_record',
1437
- 'artifact script rows': 'artifact_list',
1438
- 'artifact script row': 'artifact_record',
1439
- 'artifact script children': 'artifact_list',
1440
- 'artifact script upsert-row': 'artifact_write_result',
1441
- 'artifact script delete-row': 'artifact_delete_result',
1442
- 'artifact script import': 'artifact_import_result',
1443
- 'artifact asset get': 'artifact_full',
1444
- 'artifact asset actors': 'artifact_list',
1445
- 'artifact asset actor': 'artifact_record',
1446
- 'artifact asset props': 'artifact_list',
1447
- 'artifact asset prop': 'artifact_record',
1448
- 'artifact asset locations': 'artifact_list',
1449
- 'artifact asset location': 'artifact_record',
1450
- 'artifact asset upsert-actor': 'artifact_write_result',
1451
- 'artifact asset upsert-prop': 'artifact_write_result',
1452
- 'artifact asset upsert-location': 'artifact_write_result',
1453
- 'artifact asset upsert-actor-state': 'artifact_write_result',
1454
- 'artifact asset upsert-prop-state': 'artifact_write_result',
1455
- 'artifact asset upsert-location-state': 'artifact_write_result',
1456
- 'artifact asset delete-actor': 'artifact_delete_result',
1457
- 'artifact asset delete-prop': 'artifact_delete_result',
1458
- 'artifact asset delete-location': 'artifact_delete_result',
1459
- 'artifact asset delete-actor-state': 'artifact_delete_result',
1460
- 'artifact asset delete-prop-state': 'artifact_delete_result',
1461
- 'artifact asset delete-location-state': 'artifact_delete_result',
1462
- 'artifact asset import': 'artifact_import_result',
1463
- 'artifact video get': 'artifact_full',
1464
- 'artifact video episodes': 'artifact_list',
1465
- 'artifact video episode': 'artifact_record',
1466
- 'artifact video scenes': 'artifact_list',
1467
- 'artifact video scene': 'artifact_record',
1468
- 'artifact video clips': 'artifact_list',
1469
- 'artifact video clip': 'artifact_record',
1470
- 'artifact video upsert-episode': 'artifact_write_result',
1471
- 'artifact video upsert-scene': 'artifact_write_result',
1472
- 'artifact video upsert-clip': 'artifact_write_result',
1473
- 'artifact video update-clip-urls': 'artifact_write_result',
1474
- 'artifact video delete-episode': 'artifact_delete_result',
1475
- 'artifact video delete-scene': 'artifact_delete_result',
1476
- 'artifact video delete-clip': 'artifact_delete_result',
1477
- 'artifact video import-storyboard': 'artifact_import_result',
1478
- 'artifact clip get': 'artifact_full',
1479
- 'artifact clip episodes': 'artifact_list',
1480
- 'artifact clip episode': 'artifact_record',
1481
- 'artifact clip episode-by-id': 'artifact_record',
1482
- 'artifact clip upsert-episode': 'artifact_write_result',
1483
- 'artifact clip upsert-batch': 'artifact_import_result',
1484
- 'artifact clip update-status': 'artifact_status_update',
1485
- 'artifact clip delete-episode': 'artifact_delete_result',
1486
1263
  'create subject-list': 'subject_list',
1487
1264
  'create subject': 'subject_publish_result',
1488
1265
  'create subject-wait': 'subject_status',
@@ -1495,13 +1272,6 @@ const OUTPUT_KIND_BY_COMMAND = {
1495
1272
 
1496
1273
  const KIND_TITLES = {
1497
1274
  account_summary: '账号概览',
1498
- artifact_delete_result: '最终产物删除结果',
1499
- artifact_full: '最终产物详情',
1500
- artifact_import_result: '最终产物导入结果',
1501
- artifact_list: '最终产物列表',
1502
- artifact_record: '最终产物记录',
1503
- artifact_status_update: '剪辑状态更新结果',
1504
- artifact_write_result: '最终产物写入结果',
1505
1275
  asset_group_detail: '素材组详情',
1506
1276
  asset_group_list: '素材组列表',
1507
1277
  asset_group_write_result: '素材组写入结果',
@@ -1514,7 +1284,9 @@ const KIND_TITLES = {
1514
1284
  batch_task_status: '批量任务状态',
1515
1285
  batch_task_submission: '批量任务提交结果',
1516
1286
  command_schema: '命令 Schema',
1287
+ credit_detail_status: '积分明细状态',
1517
1288
  credits_balance: '积分余额',
1289
+ credits_records: '积分明细',
1518
1290
  credits_usage: '积分用量',
1519
1291
  environment_report: '环境体检',
1520
1292
  fee_estimate: '费用预估',
@@ -1552,7 +1324,7 @@ const COMMAND_TITLES = {
1552
1324
  'auth clear': '清空认证结果',
1553
1325
  'auth logout': '退出登录结果',
1554
1326
  'account switch-team': '团队切换结果',
1555
- 'project use': '项目组切换结果',
1327
+ 'project switch': '项目组切换结果',
1556
1328
  'project create': '项目组创建结果',
1557
1329
  'project update': '项目组更新结果',
1558
1330
  'project ensure': '项目组确保结果',
@@ -1663,6 +1435,7 @@ const FIELD_LABELS = {
1663
1435
  point: '预算点数',
1664
1436
  pointCost: '预计消耗积分',
1665
1437
  pointNo: '积分规格',
1438
+ benefitsId: '积分明细 ID',
1666
1439
  pointTotal: '积分合计',
1667
1440
  projectBudgetBalance: '项目预算余额',
1668
1441
  projectBudgetMax: '项目预算上限',
@@ -1757,12 +1530,6 @@ const FIELD_LABELS = {
1757
1530
 
1758
1531
  const DETAIL_FIELDS_BY_KIND = {
1759
1532
  account_summary: ['userId', 'userName', 'groupId', 'groupName', 'currentProjectGroupNo', 'currentProjectGroupName', 'billingPointBalance', 'projectBudgetBalance', 'projectBudgetMax'],
1760
- artifact_delete_result: ['deleted', 'action', 'projectId', 'rowKind', 'entityKey', 'key', 'stateKey', 'episodeId', 'sceneId', 'clipId', 'videoEpisodeId'],
1761
- artifact_full: ['projectId', 'id', 'title', 'status', 'rowCount', 'actorCount', 'propCount', 'locationCount', 'episodeCount', 'sceneCount', 'clipCount'],
1762
- artifact_import_result: ['imported', 'dryRun', 'action', 'projectId', 'sourceFile', 'inputDir', 'inputFile', 'rowCount', 'actorCount', 'propCount', 'locationCount', 'episodeCount', 'sceneCount', 'clipCount', 'batchCount'],
1763
- artifact_record: ['id', 'projectId', 'rowKind', 'entityKey', 'parentKey', 'actorKey', 'propKey', 'locationKey', 'stateKey', 'episodeId', 'sceneId', 'clipId', 'videoEpisodeId', 'status', 'title', 'name', 'displayName', 'description'],
1764
- artifact_status_update: ['updated', 'videoEpisodeId', 'status', 'messageCount'],
1765
- artifact_write_result: ['id', 'projectId', 'rowKind', 'entityKey', 'parentKey', 'actorKey', 'propKey', 'locationKey', 'stateKey', 'episodeId', 'sceneId', 'clipId', 'videoEpisodeId', 'status', 'title', 'name', 'displayName'],
1766
1533
  asset_group_detail: ['groupId', 'platform', 'name', 'projectName', 'description', 'status', 'assetCount'],
1767
1534
  asset_group_write_result: ['created', 'updated', 'groupId', 'platform', 'name', 'projectName', 'assetPath'],
1768
1535
  asset_register_result: ['created', 'updated', 'registered', 'assetId', 'groupId', 'platform', 'assetType', 'name', 'projectName', 'assetPath', 'validationLegal', 'conversionRequired', 'converted', 'conversionReason', 'conversionTargetFormat', 'conversionTargetWidth', 'conversionTargetHeight', 'conversionTargetPixels', 'conversionTargetFps', 'conversionTargetDuration', 'uploadBackendPath', 'uploadUrl'],
@@ -1771,7 +1538,9 @@ const DETAIL_FIELDS_BY_KIND = {
1771
1538
  batch_subject_publish_result: ['dryRun', 'submitted', 'count', 'successCount', 'failureCount', 'modelCode', 'projectGroupNo'],
1772
1539
  batch_task_status: ['count', 'taskCount', 'successTaskCount', 'resultCount', 'pointTotal', 'timedOut', 'waitedMs'],
1773
1540
  batch_task_submission: ['dryRun', 'submitted', 'count', 'taskCount', 'successCount', 'failureCount', 'modelGroupCode', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'projectBudgetBalance'],
1541
+ credit_detail_status: ['detailId', 'status', 'statusText', 'lockTime', 'lockPoint', 'useTime', 'usePoint', 'regetTime', 'regetPoint'],
1774
1542
  credits_balance: ['billingPointBalance', 'currentProjectGroupNo', 'currentProjectGroupName', 'projectBudgetBalance', 'projectBudgetMax'],
1543
+ credits_records: ['remainPoint', 'dataPlanPoint', 'topUpPoint', 'queryType', 'total', 'page', 'size', 'pages'],
1775
1544
  credits_usage: ['projectGroupNo', 'sinceText', 'untilText', 'scannedTaskCount', 'pointTotal'],
1776
1545
  environment_report: ['doctorStatus', 'verify'],
1777
1546
  fee_estimate: ['objectName', 'modelGroupCode', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter'],
@@ -1786,9 +1555,9 @@ const DETAIL_FIELDS_BY_KIND = {
1786
1555
  subject_voice_status: ['name', 'voiceRecordId', 'reqTaskId', 'voiceId', 'externalId', 'status', 'taskStatus', 'errorMessage', 'isTerminal', 'nextVoiceArg'],
1787
1556
  subtitle_task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'projectGroupNo', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
1788
1557
  subtitle_task_submission: ['submitted', 'taskId', 'taskType', 'sourceTaskId', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'nextCommand'],
1789
- task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'gmtCreate', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
1558
+ task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'benefitsId', 'gmtCreate', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
1790
1559
  task_submission: ['taskId', 'taskType', 'objectName', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'points', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'uploadCount', 'nextCommand', 'statusCommand'],
1791
- update_result: ['checked', 'updated', 'updateAvailable', 'packageName', 'previousVersion', 'currentVersion', 'latestVersion', 'command', 'skillUpdated', 'restartRecommended', 'message'],
1560
+ update_result: ['checked', 'updated', 'updateAvailable', 'packageName', 'installer', 'previousVersion', 'currentVersion', 'latestVersion', 'command', 'skillUpdated', 'restartRecommended', 'message'],
1792
1561
  upload_result: ['dryRun', 'fileCount', 'assetCount', 'localFileCount', 'resourceConversionCount'],
1793
1562
  };
1794
1563
 
@@ -1796,7 +1565,7 @@ const DRY_RUN_FIELDS_BY_COMMAND = {
1796
1565
  'auth login': ['dryRun', 'saved', 'verified', 'accessKey'],
1797
1566
  'auth clear': ['dryRun', 'action', 'cleared'],
1798
1567
  'account switch-team': ['dryRun', 'action', 'groupId', 'selected'],
1799
- 'project use': ['dryRun', 'action', 'projectGroupNo', 'selected'],
1568
+ 'project switch': ['dryRun', 'action', 'projectGroupNo', 'selected'],
1800
1569
  'project create': ['dryRun', 'action', 'projectGroupName', 'point', 'memberCount', 'note'],
1801
1570
  'project update': ['dryRun', 'action', 'projectGroupNo', 'projectGroupName', 'point', 'memberCount'],
1802
1571
  'project ensure': ['dryRun', 'action', 'projectGroupName', 'point', 'memberCount', 'note'],
@@ -1815,15 +1584,9 @@ const DRY_RUN_FIELDS_BY_COMMAND = {
1815
1584
  'create subject': ['dryRun', 'action', 'name', 'modelCode', 'elementFrontalImage', 'assetCount', 'localFileCount', 'nextRefSubject'],
1816
1585
  'create subject-voice': ['dryRun', 'action', 'name', 'voiceName', 'voiceUrl', 'remoteUrl', 'remoteUpload', 'localFileCount', 'nextVoiceArg'],
1817
1586
  'create subject-batch': ['dryRun', 'count', 'modelCode'],
1818
- 'artifact script import': ['dryRun', 'action', 'projectId', 'sourceFile', 'inputFile', 'rowCount', 'actorCount', 'episodeCount', 'sceneCount', 'clipCount'],
1819
- 'artifact asset import': ['dryRun', 'action', 'projectId', 'inputDir', 'actorCount', 'propCount', 'locationCount'],
1820
- 'artifact video import-storyboard': ['dryRun', 'action', 'projectId', 'inputFile', 'episodeId', 'sceneCount', 'clipCount'],
1821
- 'artifact clip upsert-batch': ['dryRun', 'action', 'projectId', 'episodeCount'],
1822
- 'artifact clip update-status': ['dryRun', 'action', 'projectId', 'videoEpisodeId', 'status', 'messageCount'],
1823
1587
  };
1824
1588
 
1825
1589
  const LIST_KEY_BY_KIND = {
1826
- artifact_list: 'items',
1827
1590
  asset_group_list: 'groups',
1828
1591
  asset_match_list: 'matches',
1829
1592
  asset_review_model_list: 'models',
@@ -1831,6 +1594,7 @@ const LIST_KEY_BY_KIND = {
1831
1594
  batch_task_status: 'records',
1832
1595
  batch_task_submission: 'results',
1833
1596
  command_schema: 'commands',
1597
+ credits_records: 'creditRecords',
1834
1598
  credits_usage: 'buckets',
1835
1599
  local_task_records: 'records',
1836
1600
  model_list: 'models',
@@ -1851,8 +1615,13 @@ const PRETTY_KIND_PROFILES = Object.fromEntries(Object.keys(KIND_TITLES).map((ki
1851
1615
 
1852
1616
  export const PRETTY_OUTPUT_KIND_COVERAGE = Object.freeze(Object.keys(PRETTY_KIND_PROFILES));
1853
1617
 
1854
- function outputKindForCommand(commandName, context = {}) {
1855
- return context.outputKind || OUTPUT_KIND_BY_COMMAND[commandName] || 'generic';
1618
+ function outputKindForCommand(commandName, context = {}, data = null) {
1619
+ if (context.outputKind) return context.outputKind;
1620
+ if (commandName === 'task status') {
1621
+ const taskType = String(data?.taskType || '').trim().toUpperCase();
1622
+ return taskType === 'VIDEO_SUBTITLE_REMOVAL' ? 'subtitle_task_status' : 'task_status';
1623
+ }
1624
+ return OUTPUT_KIND_BY_COMMAND[commandName] || 'generic';
1856
1625
  }
1857
1626
 
1858
1627
  function prettyTitle(commandName, kind, data) {
@@ -2150,6 +1919,13 @@ const TABLE_COLUMNS = {
2150
1919
  column('安全', (row) => (row.safety?.safeToAutoRun ? '可自动运行' : '需确认/写入'), { maxWidth: 14 }),
2151
1920
  column('说明', 'summary', { maxWidth: 44 }),
2152
1921
  ],
1922
+ creditRecords: [
1923
+ column('时间', 'operationTime', { maxWidth: 20 }),
1924
+ column('标题', 'title', { maxWidth: 18 }),
1925
+ column('积分', 'point', { maxWidth: 10 }),
1926
+ column('项目组', 'projectGroupName', { maxWidth: 20 }),
1927
+ column('用户', 'userName', { maxWidth: 16 }),
1928
+ ],
2153
1929
  domains: [
2154
1930
  column('领域', 'name', { maxWidth: 14 }),
2155
1931
  column('命令数', 'commandCount', { maxWidth: 10 }),
@@ -3053,7 +2829,7 @@ function formatPrettyModelInputGuide(data = {}, context = {}) {
3053
2829
 
3054
2830
  function formatPrettyGeneric(commandName, data, context = {}) {
3055
2831
  const normalized = normalizeOutputData(commandName, data);
3056
- const kind = outputKindForCommand(commandName, context);
2832
+ const kind = outputKindForCommand(commandName, context, normalized);
3057
2833
  if (!isPlainObject(normalized)) {
3058
2834
  const lines = [prettyTitle(commandName, kind, data), ''];
3059
2835
  renderDetails(lines, '结果', { value: normalized }, ['value']);
@@ -3143,7 +2919,7 @@ function csvColumnsForRows(rows = []) {
3143
2919
 
3144
2920
  export function formatCsvOutput(commandName, data, context = {}) {
3145
2921
  const normalized = normalizeJsonData(commandName, data);
3146
- const kind = outputKindForCommand(commandName, context);
2922
+ const kind = outputKindForCommand(commandName, context, normalized);
3147
2923
  const primaryKey = LIST_KEY_BY_KIND[kind];
3148
2924
  const list = primaryKey && Array.isArray(normalized?.[primaryKey])
3149
2925
  ? { key: primaryKey, rows: normalized[primaryKey] }
@@ -3203,6 +2979,7 @@ export function formatTextOutput(commandName, data, context = {}) {
3203
2979
  'publicId',
3204
2980
  'remoteTaskId',
3205
2981
  'pointNo',
2982
+ 'benefitsId',
3206
2983
  'taskType',
3207
2984
  'taskStatus',
3208
2985
  'modelCode',
@@ -3265,7 +3042,15 @@ export function formatTextOutput(commandName, data, context = {}) {
3265
3042
  'projectBudgetBalance',
3266
3043
  'projectBudgetMax',
3267
3044
  'projectBudgetRemainingAfter',
3045
+ 'remainPoint',
3046
+ 'dataPlanPoint',
3047
+ 'topUpPoint',
3048
+ 'queryType',
3268
3049
  'pointTotal',
3050
+ 'total',
3051
+ 'page',
3052
+ 'pages',
3053
+ 'size',
3269
3054
  'dryRun',
3270
3055
  'action',
3271
3056
  ],
@@ -3275,9 +3060,10 @@ export function formatTextOutput(commandName, data, context = {}) {
3275
3060
  if (list) {
3276
3061
  const total = list.rows.length;
3277
3062
  lines.push(`${list.key}.count=${total}`);
3063
+ const defaultListLimit = commandName === 'credits records' ? list.rows.length : 8;
3278
3064
  const configuredLimit = context.listLimit === Number.POSITIVE_INFINITY
3279
3065
  ? list.rows.length
3280
- : (Number.isFinite(context.listLimit) ? context.listLimit : 8);
3066
+ : (Number.isFinite(context.listLimit) ? context.listLimit : defaultListLimit);
3281
3067
  const visibleLimit = Math.max(0, configuredLimit);
3282
3068
  const visibleRows = list.rows.slice(0, visibleLimit);
3283
3069
  for (const [index, row] of visibleRows.entries()) {