@lingjingai/lj-awb-cli 0.4.8 → 0.5.1

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
@@ -250,8 +250,6 @@ lj-awb create video \
250
250
 
251
251
  lj-awb task wait \
252
252
  --task-id <taskId> \
253
- --task-type VIDEO_GROUP \
254
- --project-group-no <projectGroupNo> \
255
253
  --wait-seconds 300
256
254
  ```
257
255
 
@@ -365,6 +363,19 @@ npm run version:sync -- 0.3.5
365
363
 
366
364
  `npm run check:local` 会做 Node 语法检查、shell wrapper 检查、skill 元数据和 schema 校验,不需要 access key。`npm run check` 会额外执行真实平台契约校验,需要本地或环境变量中有可用 access key。`npm run build:pre` / `npm run build:prod` 发布构建只自动执行 `check:local`,避免被本机过期平台凭据阻断;需要真实平台回归时单独运行 `npm run check:real`。`npm run smoke` 会运行帮助命令和无网络写入风险的认证状态检查。
367
365
 
366
+ ### 用 Volta 管理 Node 的机器
367
+
368
+ `lj-awb update` 会检测当前 CLI 是否由 [Volta](https://volta.sh) 管理;如果是,会使用 `volta install` 更新包并刷新 shim,否则沿用 `npm install -g`。
369
+
370
+ `npm run build:pre` 走的是 `npm install -g`。在用 Volta 管理 Node/npm 的机器上,`npm install -g` **不会**在 `~/.volta/bin` 生成 shim(软链接只落在 `~/.volta/tools/image/node/<ver>/bin/`,该目录不在 `PATH` 中),安装后会出现 `lj-awb: command not found`。这类机器请改用:
371
+
372
+ ```bash
373
+ npm run build:volta-pre # 用 volta install 安装本地 pre 构建,正确生成 shim
374
+ npm run build:volta-pre -- --dry-run # 只查看安装计划,不实际安装
375
+ ```
376
+
377
+ `build:volta-pre` 缺少 volta 时会直接报错退出。其余环境变量(`SKIP_CHECK=1` 等)与 `build:pre` 一致。
378
+
368
379
  ## 文档索引
369
380
 
370
381
  - [`docs/TECHNICAL.md`](docs/TECHNICAL.md):架构、运行时、数据契约、发布维护说明。
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env node
2
+ import { mkdtempSync, rmSync } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import path from 'node:path';
5
+ import {
6
+ capture,
7
+ copyPackageFiles,
8
+ packTarball,
9
+ patchDefaultApiOrigin,
10
+ run,
11
+ } from './_shared.mjs';
12
+
13
+ const PRE_API_ORIGIN = 'https://animeworkbench-pre.lingjingai.cn';
14
+ const PACKAGE_NAME = '@lingjingai/lj-awb-cli';
15
+ const dryRun = process.env.NPM_INSTALL_DRY_RUN === '1' || process.argv.slice(2).includes('--dry-run');
16
+
17
+ function ensureVolta() {
18
+ if (!process.env.VOLTA_HOME) {
19
+ process.stderr.write(
20
+ 'Volta is required for this script but VOLTA_HOME is not set.\n'
21
+ + 'Install Volta (https://volta.sh) or use `npm run build:pre` instead.\n',
22
+ );
23
+ process.exit(1);
24
+ }
25
+ const result = capture('volta', ['--version']);
26
+ if (result.status !== 0) {
27
+ process.stderr.write(
28
+ 'Volta is required for this script but the `volta` command is not available.\n'
29
+ + 'Install Volta (https://volta.sh) or use `npm run build:pre` instead.\n',
30
+ );
31
+ process.exit(1);
32
+ }
33
+ process.stderr.write(`Using Volta ${result.stdout.trim()} for global install.\n`);
34
+ }
35
+
36
+ function installTarball(tarballPath) {
37
+ const spec = `${PACKAGE_NAME}@file:${tarballPath}`;
38
+ if (dryRun) {
39
+ process.stderr.write(`$ volta install ${spec} (dry-run)\n`);
40
+ process.stderr.write('Validated local pre build Volta install plan from packed tarball.\n');
41
+ return;
42
+ }
43
+
44
+ run('volta', ['install', spec]);
45
+ run('lj-awb', ['--version']);
46
+ process.stderr.write('Installed local pre build with Volta from packed tarball.\n');
47
+ }
48
+
49
+ ensureVolta();
50
+
51
+ if (process.env.SKIP_CHECK !== '1') {
52
+ run('npm', ['run', 'check:local']);
53
+ }
54
+
55
+ const stageDir = mkdtempSync(path.join(tmpdir(), 'lj-awb-pre-src-'));
56
+ try {
57
+ process.stderr.write(`Preparing local pre build with default API origin ${PRE_API_ORIGIN}.\n`);
58
+ copyPackageFiles(stageDir);
59
+ patchDefaultApiOrigin(stageDir, PRE_API_ORIGIN);
60
+ const tarballPath = packTarball(stageDir);
61
+ installTarball(tarballPath);
62
+ } finally {
63
+ rmSync(stageDir, { recursive: true, force: true });
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/lj-awb-cli",
3
- "version": "0.4.8",
3
+ "version": "0.5.1",
4
4
  "description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,7 +8,6 @@
8
8
  "lj-awb": "packages/awb-cli/bin/lj-awb"
9
9
  },
10
10
  "dependencies": {
11
- "@lingjingai/lj-awb-cli-pre": "^0.4.8",
12
11
  "chalk": "^5.6.2",
13
12
  "cli-table3": "^0.6.5"
14
13
  },
@@ -21,10 +20,11 @@
21
20
  "scripts": {
22
21
  "build": "node build/build.mjs",
23
22
  "build:pre": "node build/pre.mjs",
23
+ "build:volta-pre": "node build/volta-pre.mjs",
24
24
  "build:pre-publish": "node build/pre-publish.mjs",
25
25
  "build:prod": "node build/prod.mjs",
26
26
  "check": "npm run check:local && npm run check:real",
27
- "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/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 scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs",
27
+ "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-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs",
28
28
  "check:real": "node scripts/validate-cli-output-contract.mjs && node scripts/validate-openapi-cli-examples.mjs",
29
29
  "test:openapi-real": "node scripts/run-openapi-cli-examples-real.mjs",
30
30
  "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.4.8",
3
+ "version": "0.5.1",
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.4.8"
16
+ "@lingjingai/awb-core": "0.5.1"
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-core",
3
- "version": "0.4.8",
3
+ "version": "0.5.1",
4
4
  "description": "Shared core runtime for Lingjing AWB CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -133,6 +133,14 @@ export async function fetchPoints() {
133
133
  return await apiFetch('/api/anime/member/benefits/queryGroupPoint', { body: {} });
134
134
  }
135
135
 
136
+ export async function fetchPointRecords(payload = {}) {
137
+ return await apiFetch('/api/anime/member/benefits/queryPointRecord', { body: payload });
138
+ }
139
+
140
+ export async function fetchPointDetailStatus(payload = {}) {
141
+ return await apiFetch('/api/anime/member/benefits/queryPointDetailStatus', { body: payload });
142
+ }
143
+
136
144
  export async function redeemCode(code) {
137
145
  // 后端 redeemCode 的 code 是无注解 Spring 参数(按 query / form 绑定,不读 JSON body),
138
146
  // 且必须带 userId / groupId 请求头(由 buildHeaders 从环境变量注入)。
@@ -218,13 +226,6 @@ export async function createImageTask(payload = {}) {
218
226
  return await apiFetch('/api/material/creation/imageCreate', { body: payload });
219
227
  }
220
228
 
221
- export async function fetchImageTask(taskId) {
222
- return await apiFetch('/api/material/creation/imageCreateGet', {
223
- method: 'GET',
224
- query: { taskId },
225
- });
226
- }
227
-
228
229
  export async function fetchVideoFee(payload = {}) {
229
230
  return await apiFetch('/api/material/creation/videoCreateFeeCalc', { body: payload });
230
231
  }
@@ -233,8 +234,8 @@ export async function createVideoTask(payload = {}) {
233
234
  return await apiFetch('/api/material/creation/videoCreate', { body: payload });
234
235
  }
235
236
 
236
- export async function fetchVideoTask(taskId) {
237
- return await apiFetch('/api/material/creation/videoCreateGet', {
237
+ export async function fetchTaskInfo(taskId) {
238
+ return await apiFetch('/api/material/creation/task/info', {
238
239
  method: 'GET',
239
240
  query: { taskId },
240
241
  });
@@ -13,7 +13,9 @@ import {
13
13
  authLogin,
14
14
  authLogout,
15
15
  creditsBalance,
16
- creditsBuy,
16
+ creditsRecharge,
17
+ creditsDetailStatus,
18
+ creditsRecords,
17
19
  creditsRedeem,
18
20
  creditsUsageSummary,
19
21
  createProjectGroupCommand,
@@ -42,10 +44,8 @@ import {
42
44
  subjectVoiceWait,
43
45
  subjectWait,
44
46
  subtitleRemove,
45
- subtitleStatus,
46
47
  videoSuperResolution,
47
48
  videoSuperResolutionFee,
48
- videoSuperResolutionStatus,
49
49
  taskList,
50
50
  taskRecordPoll,
51
51
  taskRecords,
@@ -85,6 +85,14 @@ const MODEL_GROUP_ARG = { name: 'model-group-code', valueName: 'code', descripti
85
85
  const ASSET_PLATFORM_ARG = { name: 'platform', valueName: 'platform', description: '素材加白平台,必须显式传 JIMENG 或 BYTEPLUS,不做别名推断' };
86
86
  const MODEL_LIST_ARGS = [
87
87
  { name: 'model', valueName: 'keyword', description: '按模型名、编码、供应商或输入方式过滤;不传时查询全部' },
88
+ { name: 'usage', valueName: 'usage', description: '模型用途:image 可选 IMAGE_CREATE(默认)/IMAGE_EDIT;video 为 VIDEO_CREATE。取值大小写不敏感' },
89
+ { name: 'provider', valueName: 'keyword', description: '按厂商过滤(大小写不敏感子串,如 字节 / GPT / Google)' },
90
+ { name: 'input-mode', valueName: 'mode', description: '按输入方式过滤(对模型 inputModes 做成员匹配,如 reference / prompt_only / frames)' },
91
+ { name: 'supports', valueName: 'param', description: '按支持的可调参数过滤(对 params 做成员匹配,如 quality / ratio / duration / needAudio)' },
92
+ { name: 'quality', valueName: 'value', description: '按分辨率取值过滤(模型真实支持该 quality 才返回,如 4k / 2k / 1080;大小写不敏感)' },
93
+ { name: 'ratio', valueName: 'value', description: '按画面比例取值过滤(模型真实支持该 ratio 才返回,如 9:16 / 16:9 / 1:1)' },
94
+ { name: 'duration', valueName: 'sec', description: '按时长取值过滤(video,模型真实支持该秒数才返回,如 10 / 15)' },
95
+ { name: 'need-audio', description: '只返回支持音效 / 音频的模型(video,按 audio 能力)' },
88
96
  { name: 'limit', valueName: 'n', description: '默认文本最多展示 N 条,默认 8;JSON 输出始终返回全部匹配' },
89
97
  { name: 'all', description: '默认文本展示全部匹配模型(覆盖 --limit)' },
90
98
  INCLUDE_RAW_ARG,
@@ -399,13 +407,45 @@ export function registerAwbCommands(cli) {
399
407
  });
400
408
 
401
409
  cli({
402
- name: 'credits buy',
410
+ name: 'credits records',
411
+ description: commandHelp('查询当前用户积分明细,默认按时间倒序展示精简字段', {
412
+ examples: [
413
+ 'lj-awb credits records',
414
+ 'lj-awb credits records --query-type 2 --page 1 --size 20',
415
+ 'lj-awb credits records --query-type 3',
416
+ ],
417
+ hint: 'query-type:1=全部明细,2=支出明细,3=收入明细;输出默认只保留时间、标题、操作、积分、项目组和用户。',
418
+ }),
419
+ args: [
420
+ { name: 'query-type', valueName: '1|2|3', description: '明细类型:1=全部,2=支出,3=收入;默认 1' },
421
+ { name: 'page', valueName: 'n', description: '页码,默认 1' },
422
+ { name: 'size', valueName: 'n', description: '每页条数,默认 10,最大 100' },
423
+ ],
424
+ func: async (_ctx, kwargs) => creditsRecords(kwargs),
425
+ });
426
+
427
+ cli({
428
+ name: 'credits detail-status',
429
+ description: commandHelp('查询单个积分明细的最终状态、锁定 / 核销 / 返还时间和积分', {
430
+ examples: [
431
+ 'lj-awb credits detail-status --detail-id <detailId>',
432
+ ],
433
+ hint: '只返回精简字段:detailId、状态、锁定 / 核销 / 返还时间与积分;statusText 会把 lock/use/reget 映射为 锁定/核销/返还。',
434
+ }),
435
+ args: [
436
+ { name: 'detail-id', valueName: 'id', description: '积分明细 detailId' },
437
+ ],
438
+ func: async (_ctx, kwargs) => creditsDetailStatus(kwargs),
439
+ });
440
+
441
+ cli({
442
+ name: 'credits recharge',
403
443
  description: commandHelp('引导购买 / 充值:按当前环境(预发 / 正式)输出充值页面链接', {
404
- examples: ['lj-awb credits buy'],
444
+ examples: ['lj-awb credits recharge'],
405
445
  hint: '只输出充值链接,不发起网络请求;请在浏览器中打开链接完成购买。链接随构建环境写死,预发与正式各自指向对应工作台域名。',
406
446
  }),
407
447
  args: [],
408
- func: async () => creditsBuy(),
448
+ func: async () => creditsRecharge(),
409
449
  });
410
450
 
411
451
  cli({
@@ -511,7 +551,6 @@ export function registerAwbCommands(cli) {
511
551
  examples: [
512
552
  'lj-awb upload files --files ./a.png,./b.mp4 --dry-run',
513
553
  'lj-awb upload files --file ./ref.png',
514
- 'lj-awb upload files --file ./first-frame.png --scene-type material-video-create',
515
554
  ],
516
555
  hint: '不会暴露 COS 临时密钥;skill 只使用返回的 backendPath / url。',
517
556
  }),
@@ -519,7 +558,7 @@ export function registerAwbCommands(cli) {
519
558
  { name: 'file', valueName: 'path', description: '单个文件路径' },
520
559
  { name: 'files', valueName: 'paths', description: '多个文件路径,逗号分隔' },
521
560
  { name: 'files-json', valueName: 'path|json', description: '文件数组 JSON 或 JSON 文件路径' },
522
- { name: 'scene-type', valueName: 'scene', description: '上传场景;未传时图片默认 material-image-draw,音视频默认 material-video-create;图片用于视频 / 主体复用时显式传 material-video-create' },
561
+ { name: 'scene-type', valueName: 'scene', description: '(保留向后兼容)已无作用;upload files 一律走临时隔离场景 cli-upload-temp' },
523
562
  { name: 'project-no', valueName: 'no', description: '可选项目组编号;不传时读取当前项目组 / 环境变量 / 本地状态' },
524
563
  DRY_RUN_ARG,
525
564
  ],
@@ -600,17 +639,6 @@ export function registerAwbCommands(cli) {
600
639
  func: async (_ctx, kwargs) => imageCreateBatch(kwargs),
601
640
  });
602
641
 
603
- cli({
604
- name: 'task image-status',
605
- description: commandHelp('查询生图任务状态', {
606
- examples: ['lj-awb task image-status --task-id <id>'],
607
- }),
608
- args: [
609
- { name: 'task-id', valueName: 'id', description: '任务 ID' },
610
- ],
611
- func: async (_ctx, kwargs) => taskStatus({ ...kwargs, taskType: 'IMAGE_CREATE' }),
612
- });
613
-
614
642
  cli({
615
643
  name: 'create video-fee',
616
644
  description: commandHelp('计算生视频预计积分(--prompt / --resource / --resources-json 至少传一个)', {
@@ -689,15 +717,6 @@ export function registerAwbCommands(cli) {
689
717
  func: async (_ctx, kwargs) => videoCreateBatch(kwargs),
690
718
  });
691
719
 
692
- cli({
693
- name: 'task video-status',
694
- description: commandHelp('查询生视频任务状态', {
695
- examples: ['lj-awb task video-status --task-id <id>'],
696
- }),
697
- args: [{ name: 'task-id', valueName: 'id', description: '任务 ID' }],
698
- func: async (_ctx, kwargs) => taskStatus({ ...kwargs, taskType: 'VIDEO_GROUP' }),
699
- });
700
-
701
720
  cli({
702
721
  name: 'create video-subtitle-removal',
703
722
  description: commandHelp('基于 material 来源视频任务提交去字幕任务', {
@@ -744,27 +763,17 @@ export function registerAwbCommands(cli) {
744
763
  });
745
764
 
746
765
  cli({
747
- name: 'task video-subtitle-status',
748
- description: commandHelp('查询 material 去字幕任务状态', {
749
- examples: ['lj-awb task video-subtitle-status --task-id <subtitleTaskId>'],
750
- }),
751
- args: [
752
- { name: 'task-id', valueName: 'id', description: 'material 去字幕任务 ID' },
753
- PROJECT_GROUP_ARG,
754
- ],
755
- func: async (_ctx, kwargs) => subtitleStatus(kwargs),
756
- });
757
-
758
- cli({
759
- name: 'task video-super-resolution-status',
760
- description: commandHelp('查询 material 视频超分任务状态', {
761
- examples: ['lj-awb task video-super-resolution-status --task-id <superResolutionTaskId>'],
766
+ name: 'task status',
767
+ description: commandHelp('根据 taskId 查询任务状态(生图 / 生视频 / 去字幕 / 视频超分统一返回结构)', {
768
+ examples: [
769
+ 'lj-awb task status --task-id <taskId>',
770
+ ],
771
+ hint: '状态查询只依赖 taskId。',
762
772
  }),
763
773
  args: [
764
- { name: 'task-id', valueName: 'id', description: 'material 视频超分任务 ID' },
765
- PROJECT_GROUP_ARG,
774
+ { name: 'task-id', valueName: 'id', description: '任务 ID' },
766
775
  ],
767
- func: async (_ctx, kwargs) => videoSuperResolutionStatus(kwargs),
776
+ func: async (_ctx, kwargs) => taskStatus(kwargs),
768
777
  });
769
778
 
770
779
  cli({
@@ -783,14 +792,12 @@ export function registerAwbCommands(cli) {
783
792
 
784
793
  cli({
785
794
  name: 'task wait',
786
- description: commandHelp('等待图片或视频任务进入终态', {
787
- examples: ['lj-awb task wait --task-id <id> --task-type IMAGE_CREATE --wait-seconds 180'],
795
+ description: commandHelp('等待任务进入终态', {
796
+ examples: ['lj-awb task wait --task-id <id> --wait-seconds 180'],
788
797
  hint: '超时返回 task_still_running / exit code 20,不代表远端失败。',
789
798
  }),
790
799
  args: [
791
800
  { name: 'task-id', valueName: 'id', description: '任务 ID' },
792
- { name: 'task-type', valueName: 'type', description: 'IMAGE_CREATE / VIDEO_GROUP;material 扩展任务优先用 task video-subtitle-status / task video-super-resolution-status' },
793
- PROJECT_GROUP_ARG,
794
801
  ...TASK_WAIT_ARGS,
795
802
  ],
796
803
  func: async (_ctx, kwargs) => waitTask(kwargs),
@@ -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) {