@lingjingai/lj-awb-cli 0.5.22 → 0.5.24

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/README.md CHANGED
@@ -255,6 +255,9 @@ lj-awb create video \
255
255
  lj-awb task wait \
256
256
  --task-id <taskId> \
257
257
  --wait-seconds 300
258
+
259
+ lj-awb task batch-status --task-id <taskId1>,<taskId2> -f json
260
+ lj-awb task batch-wait --task-id <taskId1>,<taskId2> --wait-seconds 180 -f json
258
261
  ```
259
262
 
260
263
  帧素材也可以直接使用平台资产 ID;是否可传尾帧以 `model options.resources[].usage` 是否包含 `last_frame` 为准:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/lj-awb-cli",
3
- "version": "0.5.22",
3
+ "version": "0.5.24",
4
4
  "description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-cli-bin",
3
- "version": "0.5.22",
3
+ "version": "0.5.24",
4
4
  "description": "Standalone CLI for Lingjing AWB",
5
5
  "private": true,
6
6
  "license": "MIT",
@@ -13,6 +13,6 @@
13
13
  "README.md"
14
14
  ],
15
15
  "dependencies": {
16
- "@lingjingai/awb-core": "0.5.22"
16
+ "@lingjingai/awb-core": "0.5.24"
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-core",
3
- "version": "0.5.22",
3
+ "version": "0.5.24",
4
4
  "description": "Shared core runtime for Lingjing AWB CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -347,6 +347,13 @@ export async function fetchTaskInfo(taskId) {
347
347
  });
348
348
  }
349
349
 
350
+ export async function fetchTaskBatchInfo(taskIds) {
351
+ return await apiFetch('/api/material/creation/task/batch-info', {
352
+ body: { taskIds },
353
+ timeoutMs: 60_000,
354
+ });
355
+ }
356
+
350
357
  export async function fetchVideoSubtitleRemovalFee(payload = {}) {
351
358
  return await apiFetch('/api/material/creation/videoSubtitleRemovalFeeCalc', { body: payload });
352
359
  }
@@ -49,6 +49,8 @@ import {
49
49
  videoSuperResolution,
50
50
  videoSuperResolutionFee,
51
51
  taskList,
52
+ taskBatchStatus,
53
+ taskBatchWait,
52
54
  taskRecordPoll,
53
55
  taskRecords,
54
56
  taskStatus,
@@ -850,7 +852,7 @@ export function registerAwbCommands(cli) {
850
852
  examples: [
851
853
  'lj-awb task status --task-id <taskId>',
852
854
  ],
853
- hint: '状态查询只依赖 taskId。',
855
+ hint: '单个任务使用本命令;多个任务使用 task batch-status。',
854
856
  }),
855
857
  args: [
856
858
  { name: 'task-id', valueName: 'id', description: '任务 ID' },
@@ -858,6 +860,18 @@ export function registerAwbCommands(cli) {
858
860
  func: async (_ctx, kwargs) => taskStatus(kwargs),
859
861
  });
860
862
 
863
+ cli({
864
+ name: 'task batch-status',
865
+ description: commandHelp('按逗号分隔的任务 ID 一次查询多个任务状态', {
866
+ examples: ['lj-awb task batch-status --task-id 任务ID_A,任务ID_B'],
867
+ hint: '只查询一次;单项未找到会在该项返回错误,不影响其他任务。',
868
+ }),
869
+ args: [
870
+ { name: 'task-id', valueName: 'id1,id2', description: '逗号分隔的任务 ID,最多 5000 个;逗号后可留空格' },
871
+ ],
872
+ func: async (_ctx, kwargs) => taskBatchStatus(kwargs),
873
+ });
874
+
861
875
  cli({
862
876
  name: 'task list',
863
877
  description: commandHelp('查询项目组近期任务流', {
@@ -874,9 +888,9 @@ export function registerAwbCommands(cli) {
874
888
 
875
889
  cli({
876
890
  name: 'task wait',
877
- description: commandHelp('等待任务进入终态', {
891
+ description: commandHelp('等待单个任务进入终态', {
878
892
  examples: ['lj-awb task wait --task-id <id> --wait-seconds 180'],
879
- hint: '超时返回 task_still_running / exit code 20,不代表远端失败。',
893
+ hint: '多个任务使用 task batch-wait;超时返回 task_still_running / exit code 20,不代表远端失败。',
880
894
  }),
881
895
  args: [
882
896
  { name: 'task-id', valueName: 'id', description: '任务 ID' },
@@ -885,6 +899,19 @@ export function registerAwbCommands(cli) {
885
899
  func: async (_ctx, kwargs) => waitTask(kwargs),
886
900
  });
887
901
 
902
+ cli({
903
+ name: 'task batch-wait',
904
+ description: commandHelp('批量等待任务进入终态', {
905
+ examples: ['lj-awb task batch-wait --task-id <id1>,<id2> --wait-seconds 180'],
906
+ hint: '每轮一次批量查询,只续查未完成任务;超时返回 task_still_running / exit code 20。',
907
+ }),
908
+ args: [
909
+ { name: 'task-id', valueName: 'id1,id2', description: '逗号分隔的任务 ID,最多 5000 个;逗号后可留空格' },
910
+ ...TASK_WAIT_ARGS,
911
+ ],
912
+ func: async (_ctx, kwargs) => taskBatchWait(kwargs),
913
+ });
914
+
888
915
  cli({
889
916
  name: 'task records',
890
917
  description: commandHelp('读取本地任务台账 JSONL', {
@@ -614,6 +614,8 @@ export function normalizeOutputData(commandName, data) {
614
614
  case 'task list':
615
615
  return normalizeList(data, ['tasks']);
616
616
  case 'task records':
617
+ case 'task batch-status':
618
+ case 'task batch-wait':
617
619
  return normalizeList(data, ['records']);
618
620
  case 'create asset-groups':
619
621
  return normalizeList(data, ['groups']);
@@ -1353,6 +1355,8 @@ const OUTPUT_KIND_BY_COMMAND = {
1353
1355
  'create video-super-resolution': 'task_submission',
1354
1356
  'create video-subtitle-removal': 'subtitle_task_submission',
1355
1357
  'task status': 'task_status',
1358
+ 'task batch-status': 'batch_task_status',
1359
+ 'task batch-wait': 'batch_task_status',
1356
1360
  'task list': 'task_list',
1357
1361
  'task wait': 'task_status',
1358
1362
  'task records': 'local_task_records',
@@ -1535,6 +1535,7 @@ export function shouldDefaultNeedAudioForVideoModel(model = {}, params = [], pro
1535
1535
  }
1536
1536
 
1537
1537
  async function fetchModelConstraintSchema(rawModel = {}, modelGroupCode) {
1538
+ if (Array.isArray(rawModel?.constraintSchema) && rawModel.constraintSchema.length) return rawModel.constraintSchema;
1538
1539
  const usage = trimToNull(rawModel?.usage);
1539
1540
  if (!usage) return [];
1540
1541
  const payload = await awbApi.fetchModelsByUsage(usage, { includeConstraintSchema: true }).catch(() => null);
@@ -2147,13 +2148,22 @@ async function loadModelOptionContext(modelGroupCode, options = {}) {
2147
2148
  }
2148
2149
 
2149
2150
  function restrictAutoAssetInputModes(modelGroupCode, inputModes) {
2150
- if (isAutoAssetSeedanceModel(modelGroupCode)) {
2151
+ if (isGoogleFlowVideoModel(modelGroupCode)) {
2152
+ const promptOnly = inputModes.find((mode) => mode.mode === 'prompt_only');
2153
+ if (promptOnly) {
2154
+ promptOnly.supported = true;
2155
+ delete promptOnly.unsupportedReason;
2156
+ }
2157
+ }
2158
+ if (isAutoAssetSeedanceModel(modelGroupCode) || isGoogleFlowVideoModel(modelGroupCode)) {
2151
2159
  for (const mode of inputModes) {
2152
2160
  if (mode.sourceKinds) mode.sourceKinds = mode.sourceKinds.filter((kind) => kind !== 'asset_id');
2153
2161
  if (mode.resourceSyntax) mode.resourceSyntax = mode.resourceSyntax.filter((example) => !example.includes('asset:'));
2154
2162
  if (mode.mode === 'subject_reference') {
2155
2163
  mode.supported = false;
2156
- mode.unsupportedReason = '自动加白模型只接受原素材,不接受主体或素材 ID。';
2164
+ mode.unsupportedReason = isGoogleFlowVideoModel(modelGroupCode)
2165
+ ? '此模型只接受原素材,不接受主体或素材 ID。'
2166
+ : '自动加白模型只接受原素材,不接受主体或素材 ID。';
2157
2167
  }
2158
2168
  }
2159
2169
  }
@@ -5240,6 +5250,10 @@ function isAutoAssetSeedanceModel(code) {
5240
5250
  return /^Auto_(JiMeng|BytePlus)_Seedance_(2|2_Fast|2_Mini|2_5)_VideoCreate_Group$/.test(code || '');
5241
5251
  }
5242
5252
 
5253
+ function isGoogleFlowVideoModel(code) {
5254
+ return code === 'Google_Flow_Omni_1_2_Flash_VideoCreate_Group';
5255
+ }
5256
+
5243
5257
  function needsAutoAssetVideoImageConversion(code) {
5244
5258
  return isAutoAssetSeedanceModel(code)
5245
5259
  || LEGACY_ASSET_REVIEW_MODELS.some((model) => model.modelGroupCode === code);
@@ -5257,6 +5271,14 @@ async function buildVideoRequest(kwargs = {}, options = {}) {
5257
5271
  && validationResources.resources.some((resource) => resource.source?.kind === 'asset_id')) {
5258
5272
  throw argumentError('自动加白模型不接受素材 ID', '请传本地文件、HTTP(S) 地址或平台文件路径,由服务端自动加白。');
5259
5273
  }
5274
+ if (isGoogleFlowVideoModel(model.modelGroupCode)) {
5275
+ if (validationResources.resources.some((resource) => resource.source?.kind === 'asset_id')) {
5276
+ throw argumentError('此模型不接受素材 ID', '请传本地图片/视频、HTTP(S) 地址或平台文件路径。');
5277
+ }
5278
+ if (validationResources.resources.some((resource) => !['image', 'video'].includes(resource.type) || resource.usage !== 'reference')) {
5279
+ throw argumentError('此模型仅支持图片或视频参考素材', '请使用 image:reference 或 video:reference,不支持首尾帧或参考音频。');
5280
+ }
5281
+ }
5260
5282
  const prompt = trimToNull(kwargs.prompt) ?? '';
5261
5283
  if (!prompt && !validationResources.resources.length) {
5262
5284
  throw argumentError('缺少视频生成输入', '至少传 --prompt 或 --resource。');
@@ -5272,7 +5294,10 @@ async function buildVideoRequest(kwargs = {}, options = {}) {
5272
5294
  defaultParams.duration = parseIntegerParam(kwargs.duration, '--duration', 0);
5273
5295
  }
5274
5296
  if (kwargs.ratio != null && kwargs.ratio !== '') defaultParams.ratio = kwargs.ratio;
5275
- if (kwargs.quality != null && kwargs.quality !== '') defaultParams.quality = kwargs.quality;
5297
+ if (kwargs.quality != null && kwargs.quality !== '') {
5298
+ defaultParams.quality = isGoogleFlowVideoModel(model.modelGroupCode) && String(kwargs.quality).toLowerCase() === '4k'
5299
+ ? '4k' : kwargs.quality;
5300
+ }
5276
5301
  if (kwargs.needAudio != null && kwargs.needAudio !== '') defaultParams.need_audio = toBool(kwargs.needAudio);
5277
5302
  let promptParams = normalizeUnifiedPromptParams(defaultParams);
5278
5303
  const validation = await validateCreateRequestAgainstModel('video', model.modelGroupCode, promptParams, validationResources.resourceDetails);
@@ -5825,12 +5850,39 @@ export function normalizeTaskPayload(payload, taskType = null, extra = {}) {
5825
5850
 
5826
5851
  export async function taskStatus(kwargs = {}) {
5827
5852
  const taskId = requireValue(kwargs, 'taskId', 'task-id');
5853
+ if (parseListArg(taskId).length > 1) {
5854
+ throw argumentError('查询多个任务请使用 task batch-status');
5855
+ }
5828
5856
  const payload = await awbApi.fetchTaskInfo(taskId);
5829
5857
  return normalizeTaskPayload(payload, null, {
5830
5858
  taskId,
5831
5859
  });
5832
5860
  }
5833
5861
 
5862
+ /** 一次查询多项任务;查询失败项与任务自身失败状态分别呈现。 */
5863
+ export async function taskBatchStatus(kwargs = {}) {
5864
+ const taskIds = uniqueNonEmpty(parseListArg(kwargs.taskId));
5865
+ if (!taskIds.length || taskIds.length > 5000) {
5866
+ throw argumentError('请通过 --task-id 传入 1 到 5000 个逗号分隔的任务 ID');
5867
+ }
5868
+ const payload = await awbApi.fetchTaskBatchInfo(taskIds);
5869
+ if (!Array.isArray(payload)) {
5870
+ throw new LingjingAwbCliError('批量任务查询接口返回格式不正确', {
5871
+ type: 'invalid_response',
5872
+ exitCode: 30,
5873
+ });
5874
+ }
5875
+ const records = payload.map((item) => item?.task
5876
+ ? normalizeTaskPayload(item.task, null, { taskId: item.taskId })
5877
+ : compactRecord({
5878
+ taskId: item?.taskId,
5879
+ status: item?.errorCode || 'QUERY_ERROR',
5880
+ errorCode: item?.errorCode,
5881
+ errorMessage: item?.errorMessage,
5882
+ }));
5883
+ return { count: records.length, records };
5884
+ }
5885
+
5834
5886
  export async function taskList(kwargs = {}) {
5835
5887
  const taskType = normalizeFeedTaskType(kwargs.taskType ?? 'IMAGE_CREATE');
5836
5888
  const projectGroupNo = await resolveProjectGroupNo(kwargs.projectGroupNo);
@@ -5855,6 +5907,9 @@ export async function taskList(kwargs = {}) {
5855
5907
 
5856
5908
  export async function waitTask(kwargs = {}) {
5857
5909
  const taskId = requireValue(kwargs, 'taskId', 'task-id');
5910
+ if (parseListArg(taskId).length > 1) {
5911
+ throw argumentError('等待多个任务请使用 task batch-wait');
5912
+ }
5858
5913
  const waitSeconds = Math.max(0, toInt(kwargs.waitSeconds, 300));
5859
5914
  const pollIntervalMs = Math.max(500, toInt(kwargs.pollIntervalMs, 30_000));
5860
5915
  const deadline = Date.now() + waitSeconds * 1000;
@@ -5879,6 +5934,43 @@ export async function waitTask(kwargs = {}) {
5879
5934
  });
5880
5935
  }
5881
5936
 
5937
+ /** 批量等待只续查未完成项;单项查询错误保留在结果中。 */
5938
+ export async function taskBatchWait(kwargs = {}) {
5939
+ const taskIds = uniqueNonEmpty(parseListArg(kwargs.taskId));
5940
+ if (!taskIds.length || taskIds.length > 5000) {
5941
+ throw argumentError('请通过 --task-id 传入 1 到 5000 个逗号分隔的任务 ID');
5942
+ }
5943
+ const waitSeconds = Math.max(0, toInt(kwargs.waitSeconds, 300));
5944
+ const pollIntervalMs = Math.max(500, toInt(kwargs.pollIntervalMs, 30_000));
5945
+ const deadline = Date.now() + waitSeconds * 1000;
5946
+ const taskIdSet = new Set(taskIds);
5947
+ const latest = new Map();
5948
+ let pendingTaskIds = taskIds;
5949
+ while (true) {
5950
+ const batch = await taskBatchStatus({ taskId: pendingTaskIds.join(',') });
5951
+ for (const record of batch.records) {
5952
+ if (taskIdSet.has(record?.taskId)) latest.set(record.taskId, record);
5953
+ }
5954
+ pendingTaskIds = taskIds.filter((id) => {
5955
+ const record = latest.get(id);
5956
+ return !record?.isTerminal && !record?.errorCode;
5957
+ });
5958
+ const last = { count: taskIds.length, records: taskIds.map((id) => latest.get(id) ?? { taskId: id }) };
5959
+ if (!pendingTaskIds.length) {
5960
+ return { ...last, timedOut: false, waitedMs: waitSeconds * 1000 - Math.max(0, deadline - Date.now()) };
5961
+ }
5962
+ if (Date.now() >= deadline || waitSeconds === 0) {
5963
+ throw new LingjingAwbCliError('部分任务仍在运行,当前等待窗口已结束', {
5964
+ type: 'task_still_running',
5965
+ exitCode: 20,
5966
+ hint: '稍后再次运行 task batch-wait,或增大 --wait-seconds。',
5967
+ details: { taskIds, pendingTaskIds, waitSeconds, last },
5968
+ });
5969
+ }
5970
+ await sleep(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
5971
+ }
5972
+ }
5973
+
5882
5974
  export async function taskRecords(kwargs = {}) {
5883
5975
  const filePath = resolveTaskRecordFile(kwargs);
5884
5976
  if (!filePath) throw argumentError('缺少任务台账文件', '传 --task-record-file <path>,或设置 LINGJING_AWB_TASK_RECORD_FILE。');
@@ -326,6 +326,19 @@ function parseArgv(argv) {
326
326
  return { commandName: commandParts.join(' '), kwargs, kwargRawFlags, format };
327
327
  }
328
328
 
329
+ function normalizeTaskIdListArgv(argv) {
330
+ if (argv[0] !== 'task' || !['batch-status', 'batch-wait'].includes(argv[1])) return argv;
331
+ const tokens = [...argv];
332
+ const taskIdIndex = tokens.indexOf('--task-id');
333
+ if (taskIdIndex < 0 || !tokens[taskIdIndex + 1]) return tokens;
334
+ while (tokens[taskIdIndex + 1].trimEnd().endsWith(',')
335
+ && tokens[taskIdIndex + 2] && !tokens[taskIdIndex + 2].startsWith('-')) {
336
+ tokens[taskIdIndex + 1] += tokens[taskIdIndex + 2];
337
+ tokens.splice(taskIdIndex + 2, 1);
338
+ }
339
+ return tokens;
340
+ }
341
+
329
342
  async function readVersion() {
330
343
  const currentDir = path.dirname(fileURLToPath(import.meta.url));
331
344
  const packagePath = path.join(currentDir, '..', 'package.json');
@@ -567,7 +580,9 @@ const COMMAND_REQUIRED_OPTIONS = {
567
580
  'create video-super-resolution-fee': ['objectName', 'targetResolution'],
568
581
  'create video-super-resolution': ['objectName', 'targetResolution'],
569
582
  'task status': ['taskId'],
583
+ 'task batch-status': ['taskId'],
570
584
  'task wait': ['taskId'],
585
+ 'task batch-wait': ['taskId'],
571
586
  'create asset-match-actor': ['description'],
572
587
  'create asset-groups': ['platform'],
573
588
  'create asset-group-get': ['groupId', 'platform'],
@@ -662,7 +677,7 @@ const LOCAL_STATE_WRITE_COMMANDS = new Set([
662
677
  ]);
663
678
 
664
679
  const DESTRUCTIVE_COMMANDS = new Set(['auth clear']);
665
- const LONG_RUNNING_COMMANDS = new Set(['auth login', 'credits redeem', 'task wait', 'task record-poll', 'create subject-wait', 'create subject-voice-wait']);
680
+ const LONG_RUNNING_COMMANDS = new Set(['auth login', 'credits redeem', 'task wait', 'task batch-wait', 'task record-poll', 'create subject-wait', 'create subject-voice-wait']);
666
681
  const NETWORK_NONE_COMMANDS = new Set(['schema', 'auth status', 'auth clear', 'auth logout', 'credits recharge', 'model input-guide', 'task records']);
667
682
  const NETWORK_CONDITIONAL_COMMANDS = new Set(['doctor', 'auth login']);
668
683
 
@@ -705,6 +720,8 @@ const OUTPUT_KIND_BY_COMMAND = {
705
720
  'create video-super-resolution': 'task_submission',
706
721
  'create video-subtitle-removal': 'subtitle_task_submission',
707
722
  'task status': 'task_status',
723
+ 'task batch-status': 'batch_task_status',
724
+ 'task batch-wait': 'batch_task_status',
708
725
  'task list': 'task_list',
709
726
  'task wait': 'task_status',
710
727
  'task records': 'local_task_records',
@@ -999,7 +1016,7 @@ function buildAgentBrief(commands, version = 'unknown') {
999
1016
  },
1000
1017
  {
1001
1018
  intent: '异步任务和批量恢复',
1002
- start: ['task wait', 'task record-poll', 'task records'],
1019
+ start: ['task wait', 'task batch-wait', 'task record-poll', 'task records'],
1003
1020
  rule: '优先复用 create 返回的 nextCommand;批量创建默认用 results[].taskId / statusCommand 查本批次,只有显式传 task-record-file 时才用 record-poll,失败项单独重试。',
1004
1021
  },
1005
1022
  ],
@@ -1484,6 +1501,7 @@ function printError(error, format, meta = {}) {
1484
1501
  }
1485
1502
 
1486
1503
  export async function runStandaloneCli(argv = process.argv.slice(2)) {
1504
+ argv = normalizeTaskIdListArgv(argv);
1487
1505
  process.env.LINGJING_AWB_COMMAND_PREFIX ??= 'lj-awb';
1488
1506
  const commands = buildRegistry();
1489
1507
  const version = await readVersion().catch(() => 'unknown');
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: lj-awb
3
- version: 0.5.22
3
+ version: 0.5.24
4
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.5.22"
8
+ version: "0.5.24"
9
9
  bin: "lj-awb"
10
10
  cliHelp: "lj-awb --help"
11
11
  ---
@@ -1 +1 @@
1
- 0.5.22
1
+ 0.5.24
@@ -1,6 +1,6 @@
1
1
  {
2
- "skillVersion": "0.5.22",
3
- "minCliVersion": "0.5.22",
2
+ "skillVersion": "0.5.24",
3
+ "minCliVersion": "0.5.24",
4
4
  "preferredCommand": "lj-awb",
5
- "updatedAt": "2026-10-27"
5
+ "updatedAt": "2026-11-13"
6
6
  }
@@ -7,8 +7,10 @@
7
7
  | 命令 | 用途 |
8
8
  |------|------|
9
9
  | `lj-awb task list --task-type IMAGE_CREATE --project-group-no <no>` | 列出远端任务(按类型过滤) |
10
- | `lj-awb task status --task-id <id>` | 按 taskId 查询单个任务状态(生图 / 生视频 / 去字幕 / 超分统一返回结构) |
10
+ | `lj-awb task status --task-id <id>` | 查询单个任务状态 |
11
+ | `lj-awb task batch-status --task-id <id1,id2>` | 一次查询多个任务 ID 的状态;只查询一次,不等待 |
11
12
  | `lj-awb task wait --task-id <id> --wait-seconds 180` | 等待单个任务进入终态 |
13
+ | `lj-awb task batch-wait --task-id <id1,id2> --wait-seconds 180` | 批量等待任务进入终态;每轮只查询未完成项 |
12
14
  | `lj-awb task records --task-record-file .awb/tasks.jsonl` | 读本地任务台账 |
13
15
  | `lj-awb task records --pending-only --task-record-file .awb/tasks.jsonl` | 只看未终态记录 |
14
16
  | `lj-awb task record-poll --task-record-file .awb/tasks.jsonl --wait-seconds 180` | 一次性轮询台账里所有未终态任务 |
@@ -26,12 +28,22 @@ lj-awb task wait --task-id <id> --wait-seconds 180
26
28
 
27
29
  ### 批量查询
28
30
 
29
- `create image-batch` / `create video-batch` 返回每个子任务的 `taskId` / `statusCommand`。批量提交后优先直接用响应里的 `statusCommand` 逐条查询:
31
+ `create image-batch` / `create video-batch` 返回每个子任务的 `taskId` / `statusCommand`。收集本次的任务 ID 后可一次查询:
30
32
 
31
33
  ```bash
32
- lj-awb task status --task-id <taskId>
34
+ lj-awb task batch-status --task-id <taskId1>,<taskId2> -f json
33
35
  ```
34
36
 
37
+ 多个 ID 用逗号分隔,最多 5000 个;逗号后可以有空格。返回的每项包含任务状态或 `TASK_NOT_FOUND` 查询错误;命令不自动轮询,需要时由调用方再次执行。服务端与单任务查询共用缓存:运行中 10 秒、已结束 60 秒。
38
+
39
+ 需要等待整批任务时使用:
40
+
41
+ ```bash
42
+ lj-awb task batch-wait --task-id <taskId1>,<taskId2> --wait-seconds 180 -f json
43
+ ```
44
+
45
+ `batch-wait` 每轮调用一次批量接口,只续查未完成的任务;`wait` 和 `batch-wait` 默认均每 30 秒一轮,可用 `--poll-interval-ms` 覆盖。批量等待窗口结束时返回 `task_still_running`(exit 20),错误详情中的 `pendingTaskIds` 列出未完成的任务,`last.records` 保留本轮已知结果。
46
+
35
47
  `--task-record-file` / `task record-poll` 只作为高级恢复能力使用:如果调用方明确传了台账文件,且 batch 响应包含 `taskRecordFile` / `nextCommand`,才用台账续等;普通批量结果不要为了查询本批次去创建额外文件。
36
48
 
37
49
  ### 历史查询
@@ -70,7 +82,7 @@ CLI 当前**不暴露 task cancel**;用户问"能不能停掉这个任务"时
70
82
  - 输出字段只提取 `taskId / taskStatus / isTerminal / resultUrls / errorMessage`,详见 [`../references/output-fields.md`](../references/output-fields.md) 的"生图 / 生视频"和"任务台账"小节。
71
83
  - **交付链接必须逐条、完整、原样**:`resultUrls` / `originUrls` 里的每条 URL 都已带可访问凭证(腾讯云 COS 的 `?sign=...`、火山 TOS 的 `?X-Tos-*`)。给用户时把**整条**贴出去,**绝不能只贴 `.mp4` / `.png` 前的基础部分而吞掉 `?` 后面的签名查询串**——截掉签名 = 用户打不开(曾因此踩坑)。同理不要 URL 编码改写、不要换行截断、不要"省略号略过"。`resultUrls[0]` 是带签名的展示链接(CLI 已把 `resultFileDisplayList` 排在最前),必报;`originUrls` 是同一文件的另一存储源,作兜底一并附上。
72
84
  - `create video-subtitle-removal` / `create video-super-resolution` 返回 `nextCommand` 时直接执行该命令;不要把它改写成通用 `task wait`。
73
- - `task status` / `task wait` 只依赖 `taskId` 查询状态。
85
+ - `task status` / `task wait` 使用单个 ID;`task batch-status` / `task batch-wait` 使用逗号分隔的 ID。
74
86
  - 不要把大型 raw JSON 整段塞回上下文。
75
87
  - `task list` 是远端查询、`task records` 是本地台账;两者覆盖范围不同(台账只有本机创建的任务)。批量结果优先用本次返回的 taskId,不要用 `task list` 找本批次。
76
88
 
@@ -75,7 +75,7 @@
75
75
  |------------|------|-----------|--------------|--------|
76
76
  | `task_list` | `task list` | `count` + 简明摘要 | 每条 `taskId/taskType/taskStatus`(用于决定 wait 哪几条) | gmtCreate |
77
77
  | `local_task_records` | `task records` | 待终态条数 | 每条 `taskId/taskType`(用于补 wait) | — |
78
- | `batch_task_status` | `task record-poll` | 终态计数、失败原因汇总 | 失败列表(用于 retry) | 完整 records |
78
+ | `batch_task_status` | `task batch-status` / `task batch-wait` / `task record-poll` | `records[]` 中每项任务状态或查询错误 | `batch-wait` 超时错误的 `pendingTaskIds` | 完整 records |
79
79
 
80
80
  ## 主体
81
81