@lingjingai/lj-awb-cli 0.4.5 → 0.4.8

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.
@@ -344,7 +344,7 @@ const VIRTUAL_COMMANDS = [
344
344
  ].join('\n'),
345
345
  args: [
346
346
  { name: 'brief', description: '输出面向 Agent 的轻量能力摘要,不展开每个参数' },
347
- { name: 'domain', valueName: 'name', description: '按命令域过滤,如 create / task / artifact / system' },
347
+ { name: 'domain', valueName: 'name', description: '按命令域过滤,如 create / task / system' },
348
348
  { name: 'command', valueName: 'name', description: '按子命令过滤,如 image / video / wait / doctor' },
349
349
  ],
350
350
  },
@@ -386,7 +386,8 @@ const RENAMED_COMMAND_HINTS = {
386
386
  'workspace team-select': 'account switch-team',
387
387
  'workspace project-groups': 'project list',
388
388
  'workspace project-group-current': 'project current',
389
- 'workspace project-group-select': 'project use',
389
+ 'workspace project-group-select': 'project switch',
390
+ 'project use': 'project switch',
390
391
  'workspace project-group-users': 'project users',
391
392
  'workspace project-group-create': 'project create',
392
393
  'workspace project-group-update': 'project update',
@@ -464,40 +465,11 @@ const GROUP_DESCRIPTIONS = {
464
465
  create: '创建:统一提交图片、视频、主体、音色、素材和视频去字幕任务',
465
466
  upload: '上传:把本地文件上传为平台可访问素材',
466
467
  task: '任务:任务列表、等待和本地任务台账',
467
- artifact: '最终产物:剧本、资产、视频、剪辑 CRUD 与本地 JSON 导入',
468
468
  };
469
469
 
470
- const SUBGROUP_DESCRIPTIONS = {
471
- artifact: {
472
- script: '剧本:document / asset / state / speaker / episode / scene / action 行 CRUD 与 script.json 批量导入',
473
- asset: '资产:角色 / 道具 / 场景 及其状态 CRUD,actors/props/locations JSON 批量导入',
474
- video: '视频:集 / 场 / clip 三级最终产物 CRUD 与 storyboard 批量导入',
475
- clip: '剪辑:按集组织的剪辑宽表 CRUD 与状态更新',
476
- },
477
- };
470
+ const SUBGROUP_DESCRIPTIONS = {};
478
471
 
479
- const SUBGROUP_EXAMPLES = {
480
- 'artifact script': [
481
- 'lj-awb artifact script import --project-id <projectId> --input-file 1_script/output/script.json --dry-run',
482
- 'lj-awb artifact script get --project-id <projectId>',
483
- 'lj-awb artifact script rows --project-id <projectId> --row-kind scene',
484
- ],
485
- 'artifact asset': [
486
- 'lj-awb artifact asset import --project-id <projectId> --input-dir 2_asset/output --dry-run',
487
- 'lj-awb artifact asset actors --project-id <projectId> --include-states true',
488
- 'lj-awb artifact asset props --project-id <projectId>',
489
- ],
490
- 'artifact video': [
491
- 'lj-awb artifact video import-storyboard --project-id <projectId> --input-file 3_footage/output/ep001/ep001_storyboard.json --dry-run',
492
- 'lj-awb artifact video episodes --project-id <projectId>',
493
- 'lj-awb artifact video clips --project-id <projectId> --episode-id ep_001 --scene-id scn_001',
494
- ],
495
- 'artifact clip': [
496
- 'lj-awb artifact clip upsert-episode --project-id <projectId> --input-file 4_clip/output/ep001_clip_output.json --dry-run',
497
- 'lj-awb artifact clip episodes --project-id <projectId>',
498
- 'lj-awb artifact clip episode-by-id --project-id <projectId> --episode-id ep_001',
499
- ],
500
- };
472
+ const SUBGROUP_EXAMPLES = {};
501
473
 
502
474
  const GROUP_EXAMPLES = {
503
475
  system: [
@@ -528,12 +500,15 @@ const GROUP_EXAMPLES = {
528
500
  project: [
529
501
  'lj-awb project list',
530
502
  'lj-awb project current',
531
- 'lj-awb project use --project-group-no <no> --yes',
503
+ 'lj-awb project switch --project-group-no <no> --yes',
532
504
  'lj-awb project create --name "CLI 测试项目" --point 1000 --yes',
533
505
  ],
534
506
  credits: [
535
507
  'lj-awb credits balance',
536
508
  'lj-awb credits usage --project-group-no <no> --last-hours 24',
509
+ 'lj-awb credits buy',
510
+ 'lj-awb credits redeem',
511
+ 'lj-awb credits redeem --code <code>',
537
512
  ],
538
513
  model: [
539
514
  'lj-awb model image-models --model Banana',
@@ -566,12 +541,6 @@ const GROUP_EXAMPLES = {
566
541
  'lj-awb task wait --task-id <id> --task-type IMAGE_CREATE --wait-seconds 180',
567
542
  'lj-awb task records --task-record-file .awb/tasks.jsonl',
568
543
  ],
569
- artifact: [
570
- 'lj-awb artifact script import --project-id <projectId> --input-file 1_script/output/script.json --dry-run',
571
- 'lj-awb artifact asset import --project-id <projectId> --input-dir 2_asset/output --dry-run',
572
- 'lj-awb artifact video import-storyboard --project-id <projectId> --input-file 3_footage/output/ep001/ep001_storyboard.json --dry-run',
573
- 'lj-awb artifact clip upsert-episode --project-id <projectId> --input-file 4_clip/output/ep001_clip_output.json --dry-run',
574
- ],
575
544
  };
576
545
 
577
546
  const COMMAND_REQUIRED_OPTIONS = {
@@ -599,37 +568,6 @@ const COMMAND_REQUIRED_OPTIONS = {
599
568
  'create asset-group': ['name', 'platform'],
600
569
  'create asset-group-update': ['groupId', 'platform'],
601
570
  'create asset': ['groupId', 'name', 'platform'],
602
- 'artifact script row': ['rowKind', 'entityKey'],
603
- 'artifact script children': ['parentKey'],
604
- 'artifact script delete-row': ['rowKind', 'entityKey'],
605
- 'artifact asset actor': ['actorKey'],
606
- 'artifact asset prop': ['propKey'],
607
- 'artifact asset location': ['locationKey'],
608
- 'artifact asset upsert-actor-state': ['actorKey'],
609
- 'artifact asset upsert-prop-state': ['propKey'],
610
- 'artifact asset upsert-location-state': ['locationKey'],
611
- 'artifact asset delete-actor': ['actorKey'],
612
- 'artifact asset delete-prop': ['propKey'],
613
- 'artifact asset delete-location': ['locationKey'],
614
- 'artifact asset delete-actor-state': ['actorKey', 'stateKey'],
615
- 'artifact asset delete-prop-state': ['propKey', 'stateKey'],
616
- 'artifact asset delete-location-state': ['locationKey', 'stateKey'],
617
- 'artifact video episode': ['episodeId'],
618
- 'artifact video scenes': ['episodeId'],
619
- 'artifact video scene': ['episodeId', 'sceneId'],
620
- 'artifact video clips': ['episodeId', 'sceneId'],
621
- 'artifact video clip': ['episodeId', 'sceneId', 'clipId'],
622
- 'artifact video upsert-scene': ['episodeId'],
623
- 'artifact video upsert-clip': ['episodeId', 'sceneId'],
624
- 'artifact video update-clip-urls': ['episodeId', 'sceneId', 'clipId', 'videoUrlsJson'],
625
- 'artifact video delete-episode': ['episodeId'],
626
- 'artifact video delete-scene': ['episodeId', 'sceneId'],
627
- 'artifact video delete-clip': ['episodeId', 'sceneId', 'clipId'],
628
- 'artifact video import-storyboard': ['inputFile'],
629
- 'artifact clip episode': ['videoEpisodeId'],
630
- 'artifact clip episode-by-id': ['episodeId'],
631
- 'artifact clip update-status': ['videoEpisodeId', 'status'],
632
- 'artifact clip delete-episode': ['videoEpisodeId'],
633
571
  'create subject': ['name'],
634
572
  'create subject-wait': ['elementId'],
635
573
  'create subject-voice': ['name'],
@@ -646,61 +584,16 @@ const COMMAND_REQUIRED_ANY_OPTIONS = {
646
584
  'create video-subtitle-removal': [['sourceTaskId']],
647
585
  'create asset-group-update': [['name', 'description', 'projectName']],
648
586
  'create asset': [['file', 'url', 'backendPath']],
649
- 'artifact script upsert-row': [['bodyJson', 'inputFile']],
650
- 'artifact asset upsert-actor': [['bodyJson', 'inputFile']],
651
- 'artifact asset upsert-prop': [['bodyJson', 'inputFile']],
652
- 'artifact asset upsert-location': [['bodyJson', 'inputFile']],
653
- 'artifact asset upsert-actor-state': [['bodyJson', 'inputFile']],
654
- 'artifact asset upsert-prop-state': [['bodyJson', 'inputFile']],
655
- 'artifact asset upsert-location-state': [['bodyJson', 'inputFile']],
656
- 'artifact video upsert-episode': [['bodyJson', 'inputFile']],
657
- 'artifact video upsert-scene': [['bodyJson', 'inputFile']],
658
- 'artifact video upsert-clip': [['bodyJson', 'inputFile']],
659
- 'artifact clip upsert-episode': [['bodyJson', 'inputFile']],
660
- 'artifact clip upsert-batch': [['bodyJson', 'inputFile']],
661
587
  'create subject': [['resource'], ['modelCode']],
662
588
  'create subject-batch': [['modelCode']],
663
589
  'create subject-voice': [['file', 'voiceUrl', 'audioUrl', 'videoId']],
664
590
  'create subject-voice-wait': [['voiceRecordId', 'reqTaskId']],
665
591
  };
666
592
 
667
- const ARTIFACT_WRITE_COMMANDS = [
668
- 'artifact script upsert-row',
669
- 'artifact script delete-row',
670
- 'artifact script import',
671
- 'artifact asset upsert-actor',
672
- 'artifact asset upsert-prop',
673
- 'artifact asset upsert-location',
674
- 'artifact asset upsert-actor-state',
675
- 'artifact asset upsert-prop-state',
676
- 'artifact asset upsert-location-state',
677
- 'artifact asset delete-actor',
678
- 'artifact asset delete-prop',
679
- 'artifact asset delete-location',
680
- 'artifact asset delete-actor-state',
681
- 'artifact asset delete-prop-state',
682
- 'artifact asset delete-location-state',
683
- 'artifact asset import',
684
- 'artifact video upsert-episode',
685
- 'artifact video upsert-scene',
686
- 'artifact video upsert-clip',
687
- 'artifact video update-clip-urls',
688
- 'artifact video delete-episode',
689
- 'artifact video delete-scene',
690
- 'artifact video delete-clip',
691
- 'artifact video import-storyboard',
692
- 'artifact clip upsert-episode',
693
- 'artifact clip upsert-batch',
694
- 'artifact clip update-status',
695
- 'artifact clip delete-episode',
696
- ];
697
-
698
- const ARTIFACT_DELETE_COMMANDS = ARTIFACT_WRITE_COMMANDS.filter((name) => name.includes(' delete-'));
699
-
700
593
  const CONFIRMATION_COMMANDS = new Set([
701
594
  'auth clear',
702
595
  'account switch-team',
703
- 'project use',
596
+ 'project switch',
704
597
  'project create',
705
598
  'project update',
706
599
  'project ensure',
@@ -713,7 +606,6 @@ const CONFIRMATION_COMMANDS = new Set([
713
606
  'create asset-group',
714
607
  'create asset-group-update',
715
608
  'create asset',
716
- ...ARTIFACT_WRITE_COMMANDS,
717
609
  'create subject',
718
610
  'create subject-voice',
719
611
  'create subject-batch',
@@ -730,10 +622,11 @@ const COST_COMMANDS = new Set([
730
622
 
731
623
  const REMOTE_WRITE_COMMANDS = new Set([
732
624
  'account switch-team',
733
- 'project use',
625
+ 'project switch',
734
626
  'project create',
735
627
  'project update',
736
628
  'project ensure',
629
+ 'credits redeem',
737
630
  'upload files',
738
631
  'create image',
739
632
  'create image-batch',
@@ -744,7 +637,6 @@ const REMOTE_WRITE_COMMANDS = new Set([
744
637
  'create asset-group',
745
638
  'create asset-group-update',
746
639
  'create asset',
747
- ...ARTIFACT_WRITE_COMMANDS,
748
640
  'create subject',
749
641
  'create subject-voice',
750
642
  'create subject-batch',
@@ -755,14 +647,14 @@ const LOCAL_STATE_WRITE_COMMANDS = new Set([
755
647
  'auth login',
756
648
  'auth clear',
757
649
  'auth logout',
758
- 'project use',
650
+ 'project switch',
759
651
  'project create',
760
652
  'project ensure',
761
653
  ]);
762
654
 
763
- const DESTRUCTIVE_COMMANDS = new Set(['auth clear', ...ARTIFACT_DELETE_COMMANDS]);
764
- const LONG_RUNNING_COMMANDS = new Set(['auth login', 'task wait', 'task record-poll', 'create subject-wait', 'create subject-voice-wait']);
765
- const NETWORK_NONE_COMMANDS = new Set(['schema', 'auth status', 'auth clear', 'auth logout', 'model input-guide', 'task records']);
655
+ const DESTRUCTIVE_COMMANDS = new Set(['auth clear']);
656
+ const LONG_RUNNING_COMMANDS = new Set(['auth login', 'credits redeem', 'task wait', 'task record-poll', 'create subject-wait', 'create subject-voice-wait']);
657
+ const NETWORK_NONE_COMMANDS = new Set(['schema', 'auth status', 'auth clear', 'auth logout', 'credits buy', 'model input-guide', 'task records']);
766
658
  const NETWORK_CONDITIONAL_COMMANDS = new Set(['doctor', 'auth login']);
767
659
 
768
660
  const OUTPUT_KIND_BY_COMMAND = {
@@ -780,6 +672,8 @@ const OUTPUT_KIND_BY_COMMAND = {
780
672
  'project users': 'project_user_list',
781
673
  'credits balance': 'credits_balance',
782
674
  'credits usage': 'credits_usage',
675
+ 'credits buy': 'purchase_guide',
676
+ 'credits redeem': 'redeem_result',
783
677
  'model image-models': 'model_list',
784
678
  'model video-models': 'model_list',
785
679
  'model asset-review-models': 'asset_review_model_list',
@@ -817,57 +711,6 @@ const OUTPUT_KIND_BY_COMMAND = {
817
711
  'create subject-voice': 'subject_voice_create_result',
818
712
  'create subject-voice-wait': 'subject_voice_status',
819
713
  'create subject-batch': 'batch_subject_publish_result',
820
- 'artifact script get': 'artifact_full',
821
- 'artifact script document': 'artifact_record',
822
- 'artifact script rows': 'artifact_list',
823
- 'artifact script row': 'artifact_record',
824
- 'artifact script children': 'artifact_list',
825
- 'artifact script upsert-row': 'artifact_write_result',
826
- 'artifact script delete-row': 'artifact_delete_result',
827
- 'artifact script import': 'artifact_import_result',
828
- 'artifact asset get': 'artifact_full',
829
- 'artifact asset actors': 'artifact_list',
830
- 'artifact asset actor': 'artifact_record',
831
- 'artifact asset props': 'artifact_list',
832
- 'artifact asset prop': 'artifact_record',
833
- 'artifact asset locations': 'artifact_list',
834
- 'artifact asset location': 'artifact_record',
835
- 'artifact asset upsert-actor': 'artifact_write_result',
836
- 'artifact asset upsert-prop': 'artifact_write_result',
837
- 'artifact asset upsert-location': 'artifact_write_result',
838
- 'artifact asset upsert-actor-state': 'artifact_write_result',
839
- 'artifact asset upsert-prop-state': 'artifact_write_result',
840
- 'artifact asset upsert-location-state': 'artifact_write_result',
841
- 'artifact asset delete-actor': 'artifact_delete_result',
842
- 'artifact asset delete-prop': 'artifact_delete_result',
843
- 'artifact asset delete-location': 'artifact_delete_result',
844
- 'artifact asset delete-actor-state': 'artifact_delete_result',
845
- 'artifact asset delete-prop-state': 'artifact_delete_result',
846
- 'artifact asset delete-location-state': 'artifact_delete_result',
847
- 'artifact asset import': 'artifact_import_result',
848
- 'artifact video get': 'artifact_full',
849
- 'artifact video episodes': 'artifact_list',
850
- 'artifact video episode': 'artifact_record',
851
- 'artifact video scenes': 'artifact_list',
852
- 'artifact video scene': 'artifact_record',
853
- 'artifact video clips': 'artifact_list',
854
- 'artifact video clip': 'artifact_record',
855
- 'artifact video upsert-episode': 'artifact_write_result',
856
- 'artifact video upsert-scene': 'artifact_write_result',
857
- 'artifact video upsert-clip': 'artifact_write_result',
858
- 'artifact video update-clip-urls': 'artifact_write_result',
859
- 'artifact video delete-episode': 'artifact_delete_result',
860
- 'artifact video delete-scene': 'artifact_delete_result',
861
- 'artifact video delete-clip': 'artifact_delete_result',
862
- 'artifact video import-storyboard': 'artifact_import_result',
863
- 'artifact clip get': 'artifact_full',
864
- 'artifact clip episodes': 'artifact_list',
865
- 'artifact clip episode': 'artifact_record',
866
- 'artifact clip episode-by-id': 'artifact_record',
867
- 'artifact clip upsert-episode': 'artifact_write_result',
868
- 'artifact clip upsert-batch': 'artifact_import_result',
869
- 'artifact clip update-status': 'artifact_status_update',
870
- 'artifact clip delete-episode': 'artifact_delete_result',
871
714
  };
872
715
 
873
716
  const PREFLIGHTS_BY_COMMAND = {
@@ -1001,7 +844,7 @@ function buildCommandWorkflow(command) {
1001
844
  }
1002
845
  return {
1003
846
  outputKind,
1004
- recommendedPreflight: PREFLIGHTS_BY_COMMAND[command.name] || (ARTIFACT_WRITE_COMMANDS.includes(command.name) ? [`${command.name} --dry-run`] : []),
847
+ recommendedPreflight: PREFLIGHTS_BY_COMMAND[command.name] || [],
1005
848
  nextActions: next,
1006
849
  };
1007
850
  }
@@ -1021,7 +864,6 @@ function buildDomainSummaries(commands) {
1021
864
 
1022
865
  function requiredOptionsForCommand(command) {
1023
866
  const requiredOptions = new Set();
1024
- if (commandGroup(command) === 'artifact') requiredOptions.add('projectId');
1025
867
  for (const key of COMMAND_REQUIRED_OPTIONS[command.name] || []) requiredOptions.add(key);
1026
868
  return [...requiredOptions];
1027
869
  }
@@ -1134,11 +976,6 @@ function buildAgentBrief(commands, version = 'unknown') {
1134
976
  start: ['task wait', 'task record-poll', 'task records'],
1135
977
  rule: '优先复用 create 返回的 nextCommand;批量任务使用 task-record-file,失败项单独重试。',
1136
978
  },
1137
- {
1138
- intent: '最终产物 artifact',
1139
- start: ['artifact script', 'artifact asset', 'artifact video', 'artifact clip'],
1140
- rule: 'artifact 使用 project-id,不是 project-group-no;写入/删除/导入先 dry-run,再一次性确认写入面。',
1141
- },
1142
979
  ],
1143
980
  lookup: {
1144
981
  preciseSchema: `${commandPrefix()} schema --domain <domain> --command <command> -f json`,
@@ -1179,7 +1016,6 @@ function buildAgentContract() {
1179
1016
  'taskId -> taskType / projectGroupNo / resultUrls / errorMessage',
1180
1017
  'subject name + modelCode -> elementId / externalId / nextRefSubject',
1181
1018
  'subject voice name + source -> voiceRecordId / externalId / nextVoiceArg',
1182
- 'artifact projectId and imported file paths',
1183
1019
  ],
1184
1020
  invalidation: '用户切换账号、团队、项目组、模型、素材、prompt 或关键参数后,只刷新受影响的缓存;不要重复跑未变化的 model options / create-spec / fee。',
1185
1021
  },
@@ -1191,7 +1027,7 @@ function buildAgentContract() {
1191
1027
  '用户给出多条同模型同参数任务时优先 batch + task-record-file,不要单条循环 create。',
1192
1028
  '命令返回 nextCommand / nextRefSubject / nextVoiceArg 时优先复用返回值,不手拼等价命令。',
1193
1029
  '素材加白平台先通过 model asset-review-models 或用户明确输入确定;create asset-* 必须显式传 --platform,不要依赖默认平台。create asset 会自动判断 assetType=Image/Video/Audio,本地文件会用 ffprobe 校验图片/视频尺寸、视频时长/FPS/像素数和音频时长;不合法素材正式执行时会询问是否转码,非交互场景可追加 --auto-convert;macOS + Homebrew 环境缺失时 CLI 会自动安装 ffmpeg。',
1194
- '旧根域 image / video / asset / subject 已移除;只使用 create / task / artifact 等 schema 暴露的 domain。',
1030
+ '旧根域 image / video / asset / subject 已移除;只使用 create / task 等 schema 暴露的 domain。',
1195
1031
  ],
1196
1032
  canonicalFields: {
1197
1033
  purpose: 'CLI 输出对上游平台多版本字段做了归一化。Agent 只识别 canonical 列,遇到 aliases 列出的旧字段名时说明是上游原始返回,CLI 已在 text / 归一化层做了 fallback。不要把旧名当成独立新字段对外报告。',
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: lj-awb
3
- version: 0.4.5
4
- description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分、模型发现、上传、统一 create 创建域、任务查询、视频超分、最终产物 artifact CRUD 与本地 JSON 导入。用户说生图、生视频、视频超分、主体、音色、素材加白、去字幕、artifact 写入或查询时使用。正式生成、切换项目组、清空认证、artifact 写入等写入或扣费动作前必须确认。"
3
+ version: 0.4.8
4
+ description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分(含充值购买与兑换码兑换)、模型发现、上传、统一 create 创建域、任务查询、视频超分。用户说生图、生视频、视频超分、主体、音色、素材加白、去字幕、充值、购买积分、兑换码时使用。正式生成、切换项目组、清空认证、兑换码等写入或扣费动作前必须确认。"
5
5
  metadata:
6
6
  bootstrap:
7
7
  package: "@lingjingai/lj-awb-cli"
8
- version: "0.4.5"
8
+ version: "0.4.8"
9
9
  bin: "lj-awb"
10
10
  cliHelp: "lj-awb --help"
11
11
  ---
@@ -21,7 +21,7 @@ metadata:
21
21
 
22
22
  - CLI 全部能力域和业务边界。
23
23
  - Agent 状态账本,避免重复跑 `model options`、`model create-spec`、`fee`、`upload`。
24
- - 创作、批量、主体、音色、素材加白、artifact 的最短链条。
24
+ - 创作、批量、主体、音色、素材加白的最短链条。
25
25
  - 禁止清单:旧命令域、默认参数代决策、单条循环批量任务、直连后端等。
26
26
 
27
27
  只在驱动器把你引到某个细节模块时才继续读该模块。不要为了“掌握全部功能”一次性加载所有模块。
@@ -77,13 +77,13 @@ schema 查询必须先返回,再组织业务命令;不要把 schema 查询
77
77
  | 本地文件上传为 backendPath | `upload` | [`modules/upload.md`](modules/upload.md) |
78
78
  | 图片 / 视频 / 去字幕 / 主体 / 音色 / 素材创建 | `create` | [`modules/create.md`](modules/create.md)、[`modules/create-contract.md`](modules/create-contract.md) |
79
79
  | 异步任务等待与本地台账 | `task` | [`modules/task.md`](modules/task.md) |
80
- | 剧本、资产、视频、剪辑最终产物 | `artifact` | [`modules/artifact.md`](modules/artifact.md) |
81
80
 
82
81
  ## 触发分流
83
82
 
84
83
  | 用户意图 | 先走 |
85
84
  |----------|------|
86
85
  | “能不能跑 / 认证 / 当前项目 / 余额” | `doctor --verify`,再按需 `account` / `project` / `credits` |
86
+ | “充值 / 购买积分 / 积分不够了 / 兑换码” | [`modules/credits.md`](modules/credits.md):购买走 `credits buy` 给链接,兑换走 `credits redeem`(非交互用 `--code <code>`)|
87
87
  | “有哪些模型 / 推荐模型 / 用某某模型” | [`modules/model.md`](modules/model.md),模型口语名默认是平台模型,不是本地工具 |
88
88
  | “生图 / 生成图片 / 参考图生图” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/create-contract.md`](modules/create-contract.md) |
89
89
  | “生视频 / 首帧 / 首尾帧 / 音频参考 / 让图动起来” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/task-manual.md`](modules/task-manual.md) |
@@ -94,9 +94,8 @@ schema 查询必须先返回,再组织业务命令;不要把 schema 查询
94
94
  | “去字幕 / 擦掉英文字幕” | [`modules/video.md`](modules/video.md),只走 material 任务体系 |
95
95
  | “批量 / 多镜头 / 分镜 / JSONL / 并行” | [`modules/workflows.md`](modules/workflows.md) 的批量链条 |
96
96
  | “任务好了没 / 继续等 / 查状态” | [`modules/task.md`](modules/task.md) |
97
- | “写入 AWB / 最终产物 / script / actor / storyboard / clip” | [`modules/artifact.md`](modules/artifact.md) |
98
97
 
99
- 歧义词先一句话澄清:`加白` 是素材审核还是视觉白边;`存一下` 是 artifact 哪个子域;`角色一致` 是主体还是一次性参考图。
98
+ 歧义词先一句话澄清:`加白` 是素材审核还是视觉白边;`角色一致` 是主体还是一次性参考图。
100
99
 
101
100
  ## 全局硬规则
102
101
 
@@ -1 +1 @@
1
- 0.4.5
1
+ 0.4.8
@@ -1,6 +1,6 @@
1
1
  {
2
- "skillVersion": "0.4.5",
3
- "minCliVersion": "0.4.5",
2
+ "skillVersion": "0.4.8",
3
+ "minCliVersion": "0.4.8",
4
4
  "preferredCommand": "lj-awb",
5
- "updatedAt": "2026-06-10"
5
+ "updatedAt": "2026-06-13"
6
6
  }
@@ -9,7 +9,7 @@
9
9
  | `lj-awb account info` | 当前用户、团队、项目组、积分摘要(启动后第一条信息) |
10
10
  | `lj-awb account teams` | 列出当前账号可访问的团队 |
11
11
  | `lj-awb account switch-team --group-id <id> --dry-run` | 预览切换团队 |
12
- | `lj-awb account switch-team --group-id <id> --yes` | 切换团队(云端写入) |
12
+ | `lj-awb account switch-team --group-id <id> --yes` | 切换团队(换取该团队 accessKey 并刷新本地登录态) |
13
13
 
14
14
  ## 什么时候切团队
15
15
 
@@ -19,12 +19,14 @@
19
19
 
20
20
  不该切换的场景:
21
21
 
22
- - 用户只是要换"项目"——那是 [`project use`](project.md),**不是 switch-team**。
22
+ - 用户只是要换"项目"——那是 [`project switch`](project.md),**不是 switch-team**。
23
23
  - 用户没明确说要切——`account teams` 列出来给用户挑就够,别擅自切。
24
24
 
25
25
  ## 规则
26
26
 
27
27
  - `account switch-team` 改变团队上下文,**必须确认**后追加 `--yes`。
28
- - 切换团队会**重置项目组上下文**:之后跑 `project current` 必然为空,需要让用户重新 `project use --project-group-no <no>` 选一个。
28
+ - 切换原理:用当前用户 `userId` + 目标 `groupId` 调 `groupAccessKey` 换到该团队的 accessKey,再**写回本地认证文件**(等同重新登录到该团队)。
29
+ - 若用户是通过 `LINGJING_AWB_ACCESS_KEY` 环境变量登录的,写回文件**不生效**(env key 优先级高于文件);这种情况下要么 `unset LINGJING_AWB_ACCESS_KEY` 后再切,要么直接换该团队的 access key。
30
+ - 切换团队会**重置项目组上下文**:之后跑 `project current` 必然为空,需要让用户重新 `project switch --project-group-no <no>` 选一个。
29
31
  - 不要把 `account info.groupName`(团队名)当作项目组名报告给用户。
30
32
  - 输出字段速查见 [`../references/output-fields.md`](../references/output-fields.md) 的"账号与项目组"小节。
@@ -1,6 +1,6 @@
1
1
  # Credits Module
2
2
 
3
- 积分模块用于预算确认和项目用量统计。
3
+ 积分模块用于预算确认、项目用量统计,以及积分的购买(充值)与兑换码兑换。
4
4
 
5
5
  ## 命令
6
6
 
@@ -10,6 +10,23 @@
10
10
  | `lj-awb credits balance --project-group-no <no>` | 查看可扣积分余额和指定项目组预算 |
11
11
  | `lj-awb credits usage --project-group-no <no> --last-hours 24` | 汇总最近任务消耗 |
12
12
  | `lj-awb credits usage --project-group-no <no> --task-types IMAGE_CREATE,VIDEO_GROUP --include-tasks` | 汇总并附带任务明细 |
13
+ | `lj-awb credits buy` | 引导购买 / 充值:输出充值页面链接,让用户在浏览器打开完成购买(链接已自动匹配当前环境,无需告知用户环境)|
14
+ | `lj-awb credits redeem` | 兑换码兑换:交互式等待用户输入兑换码,兑换成功后展示最新积分余额 |
15
+ | `lj-awb credits redeem --code <code>` | 直接用 `--code` 传入兑换码,跳过交互(脚本 / 非交互终端必须这样用)|
16
+
17
+ ## 购买(充值)
18
+
19
+ - `credits buy` **只输出链接、不发起网络请求**,输出里只有一个 `purchaseUrl`,已自动匹配当前 CLI 所在环境。
20
+ - **直接把 `purchaseUrl` 给用户即可**:不要向用户提及 / 区分"预发""正式"环境,不要主动追问或提供"另一个环境的链接",也不要展示 API 地址等环境细节——对用户而言只有"充值链接"这一个概念。
21
+ - CLI 无法代用户完成支付,把链接交给用户在浏览器打开即可;不要承诺"已充值"。完成后可建议 `credits balance` 查看余额。
22
+
23
+ ## 兑换码
24
+
25
+ - 不传 `--code` 时进入交互模式,最长等待约 **10 分钟**(可用 `--wait-seconds` 调)读取用户输入;输入会**自动去除空格 / 换行 / 制表符**,避免粘贴时带上多余字符。
26
+ - **非交互终端 / AI agent 不会挂起**:未提供 `--code` 时直接报 `argument_error`,必须用 `--code <兑换码>` 传入。
27
+ - 兑换是会改账户积分的远端写操作(`safeToAutoRun=false`):执行前向用户确认兑换码;支持 `--dry-run` 预览将要提交的兑换码。
28
+ - 平台接口 `code != 200` 即视为失败,CLI 抛 `redeem_failed`(保留平台原始 `msg`),提示用户确认兑换码或联系平台处理。
29
+ - 兑换成功后会顺带调用 `account info` 拉取并展示最新 `billingPointBalance`,无需再单独跑 `credits balance`。
13
30
 
14
31
  ## 规则
15
32
 
@@ -25,4 +42,4 @@
25
42
  ## 下一步
26
43
 
27
44
  - 积分够 → 进 [`model.md`](model.md) 选模型,或直接 [`image.md`](image.md) / [`video.md`](video.md) 估价。
28
- - 积分不够 → 提示用户充值;不要默认换更便宜模型,先问用户偏好。
45
+ - 积分不够 → 用 `credits buy` 给出充值链接,或 `credits redeem` 走兑换码;不要默认换更便宜模型,先问用户偏好。
@@ -30,7 +30,6 @@ Agent 在当前任务中记录这些值,后续直接复用:
30
30
  | `task` | create 返回的 `taskId` / `nextCommand` / wait 结果 | 任务终态后只追加结果 |
31
31
  | `subject` | `create subject-list` / `create subject` / `create subject-wait` | 主体名或 `modelCode` 变化 |
32
32
  | `voice` | `create subject-voice-list` / `create subject-voice-wait` | 音色名或来源变化 |
33
- | `artifactProjectId` | 用户给定或 artifact 查询 | 项目切换 |
34
33
 
35
34
  不要为了“保险”重复跑 `schema --brief`、精确 schema、`doctor --verify`、`project current`、`model options`、`model create-spec`、`fee`、`upload files`。缓存值不够时只补缺的那一步。
36
35
 
@@ -44,9 +43,8 @@ CLI 当前能力分为:
44
43
  - `upload`:把本地文件转成平台 `backendPath`。
45
44
  - `create`:图片、视频、视频去字幕、主体、主体音色、素材组和素材注册。
46
45
  - `task`:图片 / 视频 / 去字幕等异步任务状态、等待和本地台账。
47
- - `artifact`:剧本、资产、视频、剪辑最终产物 CRUD 与本地 JSON 导入。
48
46
 
49
- 不要把概念名当 command domain。图片、视频、主体、素材是业务对象;命令入口是 `create` / `task` / `artifact`。
47
+ 不要把概念名当 command domain。图片、视频、主体、素材是业务对象;命令入口是 `create` / `task`。
50
48
 
51
49
  ## 驱动链条
52
50
 
@@ -97,12 +95,6 @@ CLI 当前能力分为:
97
95
  - `create asset --file` 会在正式阶段自动上传并注册;同一文件多任务复用时,先 `upload files` 缓存 `backendPath`。
98
96
  - 注册成功后优先使用 `assetPath`,不要重新上传同一文件。
99
97
 
100
- ### Artifact
101
-
102
- - `artifact` 使用 `project-id`,不是 `project-group-no`。
103
- - 批量导入先把涉及的 script / asset / video / clip dry-run 全部跑完,再让用户一次性确认写入面。
104
- - 部分失败后只针对失败的 row / actor / episode / clip 重试,不删除或重导整批。
105
-
106
98
  ## 何时加载其它模块
107
99
 
108
100
  - 模型候选、参数字段解释:[`model.md`](model.md)。
@@ -111,7 +103,6 @@ CLI 当前能力分为:
111
103
  - 主体 / 音色:[`subject.md`](subject.md)。
112
104
  - 素材库 / 加白:[`asset.md`](asset.md)。
113
105
  - 等待、台账、失败状态:[`task.md`](task.md)、[`../references/error-codes.md`](../references/error-codes.md)。
114
- - 最终产物:[`artifact.md`](artifact.md) 及其子模块。
115
106
 
116
107
  ## 禁止清单
117
108
 
@@ -73,5 +73,5 @@ lj-awb create image \
73
73
 
74
74
  - `create image` 返回 `taskId` + `nextCommand`(通常 = `task wait`)→ **立刻接着跑** `task wait --task-id <id> --task-type IMAGE_CREATE --wait-seconds 180`,不要让用户再问"好了没"。
75
75
  - `create image-batch` 写入 `.awb/tasks.jsonl`,用 [`task.md`](task.md) → `task record-poll` 批量等。
76
- - 任务终态拿到 `resultUrls` → 视场景决定:① 直接交付给用户;② 用作下一轮生图 / 生视频的参考图(直接以 result URL 喂 `--resource image:reference=<url>`);③ 写回 [`artifact/asset.md`](artifact/asset.md) 的角色 / 道具 / 场景产物。
76
+ - 任务终态拿到 `resultUrls` → 视场景决定:① 直接交付给用户;② 用作下一轮生图 / 生视频的参考图(直接以 result URL 喂 `--resource image:reference=<url>`)。
77
77
  - 任务 `SUCCESS` 后**立刻**查素材库可能查不到——后端 `saveResourceToMaterial` 是事务提交后异步执行,详见 [`task.md`](task.md) 规则。优先用 `resultUrls` 直接消费;非要列素材库时先 sleep 2-3 秒。
@@ -9,7 +9,7 @@
9
9
  | `lj-awb project list` | 列出项目组 |
10
10
  | `lj-awb project list --name "<keyword>"` | 按名称过滤项目组 |
11
11
  | `lj-awb project current` | 查看云端当前项目组和项目预算 |
12
- | `lj-awb project use --project-group-no <no> --yes` | 切换项目组 |
12
+ | `lj-awb project switch --project-group-no <no> --yes` | 切换项目组 |
13
13
  | `lj-awb project users` | 列出创建项目组可选成员 |
14
14
  | `lj-awb project create --name "<name>" --point 1000 --yes` | 创建并切换项目组 |
15
15
  | `lj-awb project update --project-group-no <no> --name "<name>" --yes` | 修改项目组 |
@@ -21,7 +21,7 @@
21
21
  - 如果项目组不明显匹配用户意图,先询问用户,不要静默选择。
22
22
  - 联网场景下以 `project current` / `project list` 返回的云端当前项目组为准,不要把本地 `state.json` 当成权威来源。
23
23
  - 如果多个查询结果不一致,先重新运行 `account info` 和 `project list` 收敛结论,再继续估价或创建任务。
24
- - `project use`、`project create`、`project update`、`project ensure` 都会改变云端或本地上下文,必须确认后追加 `--yes`。
24
+ - `project switch`、`project create`、`project update`、`project ensure` 都会改变云端或本地上下文,必须确认后追加 `--yes`。
25
25
  - 输出字段速查见 [`../references/output-fields.md`](../references/output-fields.md) 的"账号与项目组"小节。
26
26
 
27
27
  ## 下一步
@@ -80,5 +80,5 @@ CLI 当前**不暴露 task cancel**;用户问"能不能停掉这个任务"时
80
80
 
81
81
  ## 下一步
82
82
 
83
- - 任务终态 + `resultUrls` 非空 → 视具体场景写回 [`artifact/video.md`](artifact/video.md) (`update-clip-urls`) 或交付给用户。
83
+ - 任务终态 + `resultUrls` 非空 → 交付给用户或用作后续生成的参考。
84
84
  - 任务 `FAILED` → 看 `errorMessage`;常见原因(积分 / 模型 / 资源)按 [`../references/error-codes.md`](../references/error-codes.md) 场景 7 处理。
@@ -97,7 +97,7 @@ lj-awb create video \
97
97
  - `create video` 返回 `taskId` + `nextCommand` → 立刻 `task wait --task-id <id> --task-type VIDEO_GROUP --wait-seconds 300`。
98
98
  - `create video-super-resolution` 返回 `taskId` + `nextCommand` → 立刻运行返回的 `task video-super-resolution-status --task-id <id>`。
99
99
  - `create video-batch` 写 `.awb/tasks.jsonl`,用 [`task.md`](task.md) → `task record-poll` 批量等。
100
- - 任务终态 `resultUrls` → 通常按集 / 场 / 镜头回写到 [`artifact/video.md`](artifact/video.md):`artifact video update-clip-urls --project-id <id> --episode-id ... --scene-id ... --clip-id ... --video-urls-json '[...]'`。
100
+ - 任务终态 `resultUrls` → 按集 / 场 / 镜头交付给用户,或用作后续生成的参考。
101
101
  - 任务 `SUCCESS` 后**立刻**用素材库接口找这条视频时可能查不到——后端 `saveResourceToMaterial` 是事务提交后异步执行,详见 [`task.md`](task.md) 规则。优先用 `resultUrls` 直接消费;非要列素材库时先 sleep 2-3 秒。
102
102
  - Seedance 原始视频带英文字幕 → 对成功的视频任务运行 `create video-subtitle-removal --source-task-id <videoTaskId> --yes` → `task video-subtitle-status --task-id <subtitleTaskId>`。
103
103
  - 需要对现有视频做清晰度提升 → 先确认 `objectName`(material backendPath 或 COS 对象路径),再 `create video-super-resolution-fee` 和 `create video-super-resolution`。