@lingjingai/lj-awb-cli 0.5.21 → 0.5.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/lj-awb-cli",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "build:pre-publish": "node build/pre-publish.mjs",
26
26
  "build:prod": "node build/prod.mjs",
27
27
  "check": "npm run check:local && npm run check:real",
28
- "check:local": "node --check install.mjs && node --check packages/awb-core/src/common.js && node --check packages/awb-core/src/api.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.js && node --check packages/awb-core/src/update.js && node --check packages/awb-core/src/services.js && node --check packages/awb-core/src/commands.js && node --check packages/awb-core/src/standalone.js && sh -n packages/awb-cli/bin/lj-awb && bash -n skills/lj-awb/scripts/resolve-lj-awb-cmd.sh && node --check packages/awb-cli/bin/lj-awb.js && node --check build/build.mjs && node --check build/_shared.mjs && node --check build/pre.mjs && node --check build/volta-pre.mjs && node --check build/pre-publish.mjs && node --check build/prod.mjs && node --check scripts/run-openapi-cli-examples-real.mjs && node --check scripts/validate-cli-schema.mjs && node --check scripts/validate-cli-output-contract.mjs && node --check scripts/validate-cli-command-coverage.mjs && node --check tests/test-api.mjs && node --check tests/test-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node --check tests/test-project-members.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-api.mjs tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs tests/test-project-members.mjs",
28
+ "check:local": "node --check install.mjs && node --check packages/awb-core/src/common.js && node --check packages/awb-core/src/api.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.js && node --check packages/awb-core/src/update.js && node --check packages/awb-core/src/services.js && node --check packages/awb-core/src/commands.js && node --check packages/awb-core/src/standalone.js && sh -n packages/awb-cli/bin/lj-awb && bash -n skills/lj-awb/scripts/resolve-lj-awb-cmd.sh && node --check packages/awb-cli/bin/lj-awb.js && node --check build/build.mjs && node --check build/_shared.mjs && node --check build/pre.mjs && node --check build/volta-pre.mjs && node --check build/pre-publish.mjs && node --check build/prod.mjs && node --check scripts/run-openapi-cli-examples-real.mjs && node --check scripts/validate-cli-schema.mjs && node --check scripts/validate-cli-output-contract.mjs && node --check scripts/validate-cli-command-coverage.mjs && node --check tests/test-api.mjs && node --check tests/test-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node --check tests/test-project-members.mjs && node --check tests/test-video-auto-convert.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-api.mjs tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs tests/test-project-members.mjs tests/test-video-auto-convert.mjs",
29
29
  "check:real": "node scripts/validate-cli-output-contract.mjs && node scripts/validate-openapi-cli-examples.mjs",
30
30
  "test:openapi-real": "node scripts/run-openapi-cli-examples-real.mjs",
31
31
  "smoke": "packages/awb-cli/bin/lj-awb --help && packages/awb-cli/bin/lj-awb auth status -f json && packages/awb-cli/bin/lj-awb system && packages/awb-cli/bin/lj-awb auth && packages/awb-cli/bin/lj-awb account && packages/awb-cli/bin/lj-awb project && packages/awb-cli/bin/lj-awb credits && packages/awb-cli/bin/lj-awb upload && packages/awb-cli/bin/lj-awb model && packages/awb-cli/bin/lj-awb create && packages/awb-cli/bin/lj-awb task && packages/awb-cli/bin/lj-awb schema -f json >/dev/null",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-cli-bin",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
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.21"
16
+ "@lingjingai/awb-core": "0.5.22"
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-core",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "description": "Shared core runtime for Lingjing AWB CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -112,11 +112,11 @@ const MODEL_PARAMS_JSON_ARG = { name: 'model-params-json', valueName: 'json|path
112
112
  const MODEL_PARAM_ARGS = [MODEL_PARAM_ARG, MODEL_PARAMS_JSON_ARG];
113
113
  const CREATE_WAIT_ARGS = [
114
114
  { name: 'wait-seconds', valueName: 'seconds', description: '提交后顺带等待结果的秒数;默认 0 不等待' },
115
- { name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认 5000' },
115
+ { name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认 30000' },
116
116
  ];
117
117
  const TASK_WAIT_ARGS = [
118
118
  { name: 'wait-seconds', valueName: 'seconds', description: '最长等待秒数;默认 300,传 0 只查询一次' },
119
- { name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认 5000' },
119
+ { name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认 30000' },
120
120
  ];
121
121
  const RECORD_POLL_ARGS = [
122
122
  { name: 'wait-seconds', valueName: 'seconds', description: '最长轮询秒数;默认 0 只轮询一次本地台账' },
@@ -688,7 +688,7 @@ export function registerAwbCommands(cli) {
688
688
  'lj-awb create video --model-group-code <code> --prompt "首尾帧过渡" --duration 5 --resources-json \'[{"type":"image","usage":"first_frame","source":{"kind":"url","value":"./first.png"}},{"type":"image","usage":"last_frame","source":{"kind":"url","value":"./last.png"}}]\' --dry-run',
689
689
  'lj-awb create video --model-group-code <code> --prompt "让 <<<hero>>> 跟随音乐节奏转身" --resource image:reference:hero=./actor.png --resource audio:reference=./music.mp3 --duration 5 --dry-run',
690
690
  ],
691
- hint: '--prompt / --resource / --resources-json 至少传一个;fee / --dry-run 之前先确认 quality、duration、ratio 等关键参数。',
691
+ hint: '--prompt / --resource / --resources-json 至少传一个;自动加白 Seedance 的参考图在正式提交前自动检查尺寸,超限时转码上传;fee / --dry-run 之前先确认 quality、duration、ratio 等关键参数。',
692
692
  }),
693
693
  args: [
694
694
  MODEL_GROUP_ARG,
@@ -717,7 +717,7 @@ export function registerAwbCommands(cli) {
717
717
  'lj-awb create video-batch --input-file ./prompts.txt --model-group-code <code> --dry-run',
718
718
  'lj-awb create video-batch --input-file ./video-input.jsonl --model-group-code <code> --concurrency 2 --yes',
719
719
  ],
720
- hint: 'JSON/JSONL 每项只写任务差异字段:prompt、ratio、quality、duration、need_audio、resources、resource、model_params;提交后默认用 results[].taskId / statusCommand 查询本批次;需要中断恢复时可显式传 --task-record-file。',
720
+ hint: 'JSON/JSONL 每项只写任务差异字段:prompt、ratio、quality、duration、need_audio、resources、resource、model_params;自动加白 Seedance 的参考图逐项检查并在超限时转码;提交后用 results[].taskId / statusCommand 查询,需要中断恢复可传 --task-record-file。',
721
721
  }),
722
722
  args: [
723
723
  { name: 'input-file', valueName: 'path', description: '批量输入文件' },
@@ -56,12 +56,15 @@ const REMOTE_IMAGE_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
56
56
  const REMOTE_IMAGE_MIME_TYPES = new Set([
57
57
  'image/bmp',
58
58
  'image/gif',
59
+ 'image/heic',
60
+ 'image/heif',
59
61
  'image/jpeg',
60
62
  'image/jpg',
61
63
  'image/png',
64
+ 'image/tiff',
62
65
  'image/webp',
63
66
  ]);
64
- const REMOTE_IMAGE_EXTENSIONS = new Set(['.bmp', '.gif', '.jfif', '.jpg', '.jpeg', '.png', '.webp']);
67
+ const REMOTE_IMAGE_EXTENSIONS = new Set(['.bmp', '.gif', '.heic', '.heif', '.jfif', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.webp']);
65
68
  const REMOTE_VOICE_DOWNLOAD_TIMEOUT_MS = 30_000;
66
69
  const REMOTE_VOICE_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
67
70
  const REMOTE_VOICE_MIME_TYPES = new Set([
@@ -4014,8 +4017,11 @@ async function confirmAssetConversion(validation) {
4014
4017
  }
4015
4018
  }
4016
4019
 
4017
- async function convertAssetLocalFile(validation) {
4018
- const plan = validation.conversionPlan;
4020
+ async function convertAssetLocalFile(validation, options = {}) {
4021
+ const plan = validation.conversionPlan && {
4022
+ ...validation.conversionPlan,
4023
+ toFormat: options.toFormat ?? validation.conversionPlan.toFormat,
4024
+ };
4019
4025
  if (!plan) throw assetConversionUnavailableError(validation);
4020
4026
  let converted;
4021
4027
  if (validation.assetType === ASSET_TYPE_CODES.Image) {
@@ -4225,8 +4231,11 @@ function extensionFromContentType(contentType = '') {
4225
4231
  const normalized = String(contentType || '').split(';')[0].trim().toLowerCase();
4226
4232
  if (normalized === 'image/bmp') return '.bmp';
4227
4233
  if (normalized === 'image/gif') return '.gif';
4234
+ if (normalized === 'image/heic') return '.heic';
4235
+ if (normalized === 'image/heif') return '.heif';
4228
4236
  if (normalized === 'image/jpeg' || normalized === 'image/jpg') return '.jpg';
4229
4237
  if (normalized === 'image/png') return '.png';
4238
+ if (normalized === 'image/tiff') return '.tiff';
4230
4239
  if (normalized === 'image/webp') return '.webp';
4231
4240
  if (normalized === 'audio/mpeg') return '.mp3';
4232
4241
  if (normalized === 'audio/wav' || normalized === 'audio/x-wav') return '.wav';
@@ -4797,6 +4806,59 @@ function conversionOutputExtension(format) {
4797
4806
  return normalized || 'jpg';
4798
4807
  }
4799
4808
 
4809
+ async function resolveAutoAssetVideoImage(resource, base, options) {
4810
+ if (!options.autoConvertAssetImages || resource.type !== 'image') return null;
4811
+ const value = resource._source.value;
4812
+ const remote = isRemoteOrBackendPath(value);
4813
+ // Dry-run does not download remote material; the formal submission checks it before creating a task.
4814
+ if (remote && options.dryRun) return null;
4815
+ const downloaded = remote
4816
+ ? await downloadRemoteImageFileToTemp(value, {
4817
+ fallbackName: resourceText(base).replace(/[^0-9A-Za-z._-]+/g, '-'),
4818
+ })
4819
+ : null;
4820
+ try {
4821
+ const original = await inspectAssetLocalFile(downloaded?.filePath ?? value);
4822
+ if (original.legal) return null;
4823
+ if (!original.conversionPlan) throw assetConversionUnavailableError(original);
4824
+ const source = { kind: 'url', value };
4825
+ const rule = options.resourceRules?.find((item) => resourceRuleMatches(item, { ...base, source }));
4826
+ const toFormat = rule && !fileTypeAllowedByRule(rule, 'jpg')
4827
+ ? preferredImageConversionTarget(rule.fileTypes)
4828
+ : 'jpg';
4829
+ const plan = { ...original.conversionPlan, toFormat };
4830
+ const conversion = compactRecord({
4831
+ resource: resourceText(base),
4832
+ ...plan,
4833
+ ...(remote ? { sourceValue: displayResourceSourceValue(value) } : { sourceFile: original.localFile.filePath }),
4834
+ dryRun: options.dryRun || undefined,
4835
+ });
4836
+ const convertedName = forceFileExtension(remoteImageFileNameFromValue(value), extensionForImageFormat(toFormat));
4837
+ if (options.dryRun) {
4838
+ return {
4839
+ resource: { ...base, source: { kind: 'url', value: dryRunBackendPath(convertedName, options.sceneType) } },
4840
+ upload: null,
4841
+ localFile: original.localFile,
4842
+ conversion,
4843
+ };
4844
+ }
4845
+ const converted = await convertAssetLocalFile(original, { toFormat });
4846
+ try {
4847
+ const upload = await uploadLocalFile(converted.localFile.filePath, { sceneType: options.sceneType });
4848
+ return {
4849
+ resource: { ...base, source: { kind: 'url', value: upload.backendPath } },
4850
+ upload,
4851
+ localFile: remote ? null : original.localFile,
4852
+ conversion: { ...conversion, convertedSize: converted.localFile.size },
4853
+ };
4854
+ } finally {
4855
+ await fs.rm(converted.localFile.filePath, { force: true }).catch(() => {});
4856
+ }
4857
+ } finally {
4858
+ if (downloaded) await fs.rm(downloaded.dir, { recursive: true, force: true }).catch(() => {});
4859
+ }
4860
+ }
4861
+
4800
4862
  async function resolveResourceFileValue(resource, options = {}) {
4801
4863
  if (resource.type === 'subject') {
4802
4864
  if (resource._source.kind !== 'asset_id') throw argumentError('subject resource 必须使用 asset_id,例如 subject:reference:hero=asset:element_123');
@@ -4822,6 +4884,8 @@ async function resolveResourceFileValue(resource, options = {}) {
4822
4884
  if (resource._source.kind === 'asset_id') {
4823
4885
  return { resource: { ...base, source: resource._source }, upload: null, localFile: null };
4824
4886
  }
4887
+ const preparedImage = await resolveAutoAssetVideoImage(resource, base, options);
4888
+ if (preparedImage) return preparedImage;
4825
4889
  const value = resource._source.value;
4826
4890
  if (isRemoteOrBackendPath(value)) {
4827
4891
  const source = { kind: 'url', value };
@@ -5176,6 +5240,11 @@ function isAutoAssetSeedanceModel(code) {
5176
5240
  return /^Auto_(JiMeng|BytePlus)_Seedance_(2|2_Fast|2_Mini|2_5)_VideoCreate_Group$/.test(code || '');
5177
5241
  }
5178
5242
 
5243
+ function needsAutoAssetVideoImageConversion(code) {
5244
+ return isAutoAssetSeedanceModel(code)
5245
+ || LEGACY_ASSET_REVIEW_MODELS.some((model) => model.modelGroupCode === code);
5246
+ }
5247
+
5179
5248
  async function buildVideoRequest(kwargs = {}, options = {}) {
5180
5249
  const dryRun = Boolean(options.dryRun);
5181
5250
  const model = resolveTaskModel('video', kwargs);
@@ -5217,6 +5286,8 @@ async function buildVideoRequest(kwargs = {}, options = {}) {
5217
5286
  kind: 'video',
5218
5287
  sceneType: TASK_UPLOAD_SCENE.VIDEO_CREATE,
5219
5288
  resourceRules: validation.resourceRules,
5289
+ autoConvertAssetImages: options.autoConvertAssetImages === true
5290
+ && needsAutoAssetVideoImageConversion(model.modelGroupCode),
5220
5291
  });
5221
5292
  const requestPromptParams = normalizeUnifiedPromptParams({ ...defaultParams, resources: resolvedResources.resources });
5222
5293
  const projectGroupNo = await resolveProjectGroupNo(kwargs.projectGroupNo, { allowNull: dryRun, noNetwork: dryRun, noSave: dryRun });
@@ -5255,7 +5326,7 @@ export async function videoFee(kwargs = {}) {
5255
5326
 
5256
5327
  export async function videoCreate(kwargs = {}) {
5257
5328
  if (toBool(kwargs.dryRun)) {
5258
- const built = await buildVideoRequest(kwargs, { dryRun: true });
5329
+ const built = await buildVideoRequest(kwargs, { dryRun: true, autoConvertAssetImages: true });
5259
5330
  return compactRecord({
5260
5331
  dryRun: true,
5261
5332
  action: 'create video',
@@ -5265,7 +5336,7 @@ export async function videoCreate(kwargs = {}) {
5265
5336
  });
5266
5337
  }
5267
5338
  ensureConfirmed(kwargs, '正式生视频会消耗积分,需要确认', { action: 'create video' });
5268
- const built = await buildVideoRequest(kwargs);
5339
+ const built = await buildVideoRequest(kwargs, { autoConvertAssetImages: true });
5269
5340
  const feePayload = await awbApi.fetchVideoFee(built.request).catch(() => null);
5270
5341
  const estimate = await pointEstimate(feePayload, built.projectGroupNo).catch(() => ({}));
5271
5342
  const payload = await awbApi.createVideoTask(built.request);
@@ -5785,7 +5856,7 @@ export async function taskList(kwargs = {}) {
5785
5856
  export async function waitTask(kwargs = {}) {
5786
5857
  const taskId = requireValue(kwargs, 'taskId', 'task-id');
5787
5858
  const waitSeconds = Math.max(0, toInt(kwargs.waitSeconds, 300));
5788
- const pollIntervalMs = Math.max(500, toInt(kwargs.pollIntervalMs, 5000));
5859
+ const pollIntervalMs = Math.max(500, toInt(kwargs.pollIntervalMs, 30_000));
5789
5860
  const deadline = Date.now() + waitSeconds * 1000;
5790
5861
  let last = null;
5791
5862
  while (true) {
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: lj-awb
3
- version: 0.5.21
3
+ version: 0.5.22
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.21"
8
+ version: "0.5.22"
9
9
  bin: "lj-awb"
10
10
  cliHelp: "lj-awb --help"
11
11
  ---
@@ -1 +1 @@
1
- 0.5.21
1
+ 0.5.22
@@ -1,6 +1,6 @@
1
1
  {
2
- "skillVersion": "0.5.21",
3
- "minCliVersion": "0.5.21",
2
+ "skillVersion": "0.5.22",
3
+ "minCliVersion": "0.5.22",
4
4
  "preferredCommand": "lj-awb",
5
- "updatedAt": "2026-10-20"
5
+ "updatedAt": "2026-10-27"
6
6
  }
@@ -38,6 +38,7 @@
38
38
  - 音频创建必须传 `prompt` 和 `duration`;默认 `audio-format=mp3`,最多 3 个参考音频或 1 张参考图,两类不能混用。
39
39
  - 状态和等待仍在查询域:`task status` / `task wait` 按 `taskId` 查询统一任务状态;主体 / 音色使用 `create subject-wait` / `create subject-voice-wait`。
40
40
  - 所有 `create` 写入或扣费命令正式执行前必须先 `--dry-run`,用户确认后再 `--yes`。
41
+ - `create video` 和 `create video-batch` 使用自动加白 Seedance 模型时,正式提交前会检查本地文件和远程 URL / 平台路径中的图片;超出加白规格会在 CLI 本机转码并上传处理后的图片。`--dry-run` 会展示本地图片的转换计划,不下载远程图片;远程图片在正式提交时检查。
41
42
  - 查询型 create 子命令(`subject-list`、`subject-voice-list`、`asset-groups`、`asset-group-get`、`asset-match-actor`)是为了避免重复创建;创建前优先查重。
42
43
  - `asset-groups` / `asset-group-get` / `asset-group` / `asset-group-update` / `asset` 都必须显式传 `--platform`;平台先由 `model asset-review-models` 或用户选择确定。
43
44