maoda-commander-tt 0.0.44 → 0.0.46

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/dist/main.js CHANGED
@@ -3277,11 +3277,21 @@ var XYQ_ORIGIN = "https://xyq.jianying.com";
3277
3277
  var XYQ_SESSION_COOKIE_NAME = "sessionid_pippitcn_web";
3278
3278
  var SEEDANCE_PPE_CONFIG_KEY = "seedance.ppe";
3279
3279
  var XYQ_TASK_ID_PREFIX = "xyq:";
3280
- var XYQ_VIDEO_MODELS = [
3281
- "seedance2.0_vision",
3282
- "seedance2.0_fast_vision",
3283
- "Seedance_2.5"
3284
- ];
3280
+ var XYQ_VIDEO_MODEL_ID_MAP = {
3281
+ "seedance2.0": "seedance2.0_vision",
3282
+ "seedance2.0_fast": "seedance2.0_fast_vision",
3283
+ "seedance2.5": "Seedance_2.5",
3284
+ "wan3.0": "wan3.0",
3285
+ "minimax-h3": "MiniMax-H3"
3286
+ };
3287
+ var XYQ_VIDEO_MODEL_IDS = Object.freeze(
3288
+ Object.keys(XYQ_VIDEO_MODEL_ID_MAP)
3289
+ );
3290
+ var XYQ_VIDEO_MODELS = Object.freeze(
3291
+ Object.values(XYQ_VIDEO_MODEL_ID_MAP)
3292
+ );
3293
+ var XYQ_DEFAULT_VIDEO_MODEL_ID = "seedance2.5";
3294
+ var XYQ_DEFAULT_VIDEO_MODEL = XYQ_VIDEO_MODEL_ID_MAP[XYQ_DEFAULT_VIDEO_MODEL_ID];
3285
3295
 
3286
3296
  // src/modules/xyq/xyq-session.ts
3287
3297
  var ASSET_TYPE = {
@@ -3503,19 +3513,26 @@ var XyqSession = class {
3503
3513
  const normalizedInput = normalizedInputResult.value;
3504
3514
  const threadId = randomUUID3();
3505
3515
  const clientRunId = `canvas_run_${randomUUID3()}`;
3516
+ const messageId = randomUUID3();
3506
3517
  const requestId = randomUUID3();
3507
3518
  const submittedAt = this._now();
3519
+ const runExtra = buildVideoPartRunExtra(clientRunId, messageId);
3508
3520
  const body = buildSubmitVideoPartBody({
3509
3521
  ...normalizedInput,
3510
3522
  threadId,
3511
3523
  clientRunId,
3524
+ messageId,
3512
3525
  requestId,
3513
3526
  submittedAt,
3514
- context: this.context
3527
+ context: this.context,
3528
+ runExtra
3515
3529
  });
3530
+ const submitUrl = new URL(`${XYQ_ORIGIN}/api/biz/v1/agent/submit_run`);
3531
+ const { generate_id: _generateId, ...queryBabiParam } = runExtra.babi_param;
3532
+ submitUrl.searchParams.set("babi_param", JSON.stringify(queryBabiParam));
3516
3533
  const responseResult = await requestXyqJson(
3517
3534
  this._fetcher,
3518
- `${XYQ_ORIGIN}/api/biz/v1/agent/submit_run`,
3535
+ submitUrl.toString(),
3519
3536
  {
3520
3537
  method: "POST",
3521
3538
  headers: {
@@ -3903,11 +3920,11 @@ function normalizeVideoPartInput(input) {
3903
3920
  "XYQ \u89C6\u9891\u6BD4\u4F8B\u548C\u5206\u8FA8\u7387\u4E0D\u80FD\u4E3A\u7A7A"
3904
3921
  );
3905
3922
  }
3906
- const model = input.model ?? XYQ_VIDEO_MODELS[0];
3907
- if (!XYQ_VIDEO_MODELS.includes(model)) {
3923
+ const model = input.model === void 0 ? XYQ_DEFAULT_VIDEO_MODEL : input.model.trim();
3924
+ if (!model) {
3908
3925
  return xyqError(
3909
3926
  XyqErrorCode.InvalidVideoRequest,
3910
- `XYQ \u89C6\u9891\u6A21\u578B\u4E0D\u53D7\u652F\u6301: ${model}`
3927
+ "XYQ \u89C6\u9891\u6A21\u578B\u4E0D\u80FD\u4E3A\u7A7A"
3911
3928
  );
3912
3929
  }
3913
3930
  const imagesResult = normalizeVideoAssetReferences(input.images ?? [], "\u56FE\u7247");
@@ -3948,27 +3965,32 @@ function normalizeVideoAssetReferences(assets, label) {
3948
3965
  }
3949
3966
  return ok19(normalized);
3950
3967
  }
3951
- function buildSubmitVideoPartBody(input) {
3952
- const babiParam = {
3968
+ function buildVideoPartRunExtra(clientRunId, messageId) {
3969
+ return {
3953
3970
  babi_param: {
3954
- generate_id: input.clientRunId,
3955
- section_id: input.clientRunId,
3971
+ generate_id: clientRunId,
3972
+ user_message_id: messageId,
3973
+ section_id: clientRunId,
3956
3974
  scene_lv1: "ai_agent",
3957
3975
  scene_lv2: "front_tool",
3958
- tool_id: "pippit_novel_video_part_agent",
3976
+ tool_id: "novel_canvas",
3959
3977
  tab_name: "canvas",
3960
- edit_type: "video_part",
3978
+ edit_type: "novel",
3961
3979
  enter_from: "web"
3962
3980
  },
3963
3981
  client_extra: {
3964
- edit_type: "video_part",
3982
+ edit_type: "novel",
3983
+ canvas_type: "novel",
3965
3984
  position: "canvas",
3966
3985
  entrance_from: "web",
3967
3986
  tab_name: "canvas",
3968
3987
  target: "video",
3969
- run_source: "video_part"
3988
+ run_source: "video_part",
3989
+ placement_name: "canvas"
3970
3990
  }
3971
3991
  };
3992
+ }
3993
+ function buildSubmitVideoPartBody(input) {
3972
3994
  const contentDataParam = {
3973
3995
  prompt: input.prompt,
3974
3996
  images: input.images,
@@ -3998,7 +4020,7 @@ function buildSubmitVideoPartBody(input) {
3998
4020
  thread_id: input.threadId,
3999
4021
  run_id: input.clientRunId,
4000
4022
  created_at: input.submittedAt,
4001
- message_id: ""
4023
+ message_id: input.messageId
4002
4024
  },
4003
4025
  user_info: {
4004
4026
  consumer_uid: input.context.uid,
@@ -4008,7 +4030,7 @@ function buildSubmitVideoPartBody(input) {
4008
4030
  },
4009
4031
  agent_name: "pippit_novel_video_part_agent",
4010
4032
  entrance_from: "web",
4011
- run_extra: JSON.stringify(babiParam),
4033
+ run_extra: JSON.stringify(input.runExtra),
4012
4034
  request_id: input.requestId
4013
4035
  };
4014
4036
  }
@@ -5387,7 +5409,7 @@ var XyqVideoGenerationProvider = class {
5387
5409
  );
5388
5410
  }
5389
5411
  const model = resolveModel(request.modelId);
5390
- const resolution = resolveResolution(request.resolution);
5412
+ const resolution = resolveResolution(request.resolution, model.applied);
5391
5413
  const adjustments = [
5392
5414
  ...model.adjustments,
5393
5415
  ...resolution.adjustments,
@@ -5407,14 +5429,14 @@ var XyqVideoGenerationProvider = class {
5407
5429
  videos: videosResult.value,
5408
5430
  audios: audiosResult.value,
5409
5431
  aspectRatio: request.aspectRatio,
5410
- resolution: resolution.applied,
5432
+ resolution: resolution.submitted,
5411
5433
  durationSeconds: request.durationSeconds,
5412
5434
  model: model.internal
5413
5435
  });
5414
5436
  if (!submitResult.ok) {
5415
5437
  return this._error(
5416
5438
  "submit_generation",
5417
- submitResult.msg,
5439
+ model.known ? submitResult.msg : `${submitResult.msg}\uFF1B\u53EF\u80FD\u7684\u5931\u8D25\u56E0\u7D20\uFF1A\u6A21\u578B\u672A\u77E5`,
5418
5440
  submitResult,
5419
5441
  "\u4FDD\u7559\u8F93\u5165\u5E76\u7A0D\u540E\u91CD\u65B0\u63D0\u4EA4"
5420
5442
  );
@@ -5435,7 +5457,7 @@ var XyqVideoGenerationProvider = class {
5435
5457
  modelId: model.applied,
5436
5458
  internalModelId: model.internal,
5437
5459
  aspectRatio: request.aspectRatio,
5438
- resolution: resolution.applied,
5460
+ ...resolution.reported !== void 0 ? { resolution: resolution.reported } : {},
5439
5461
  durationSeconds: request.durationSeconds,
5440
5462
  outputCount: 1,
5441
5463
  references: {
@@ -5511,48 +5533,36 @@ function uploadReference(session, filePath, assetType) {
5511
5533
  return assetType === "video" ? session.uploadVideo(filePath) : session.uploadAudio(filePath);
5512
5534
  }
5513
5535
  function resolveModel(modelId) {
5514
- const requested = modelId?.trim();
5515
- if (requested === "seedance2.5") {
5516
- return {
5517
- applied: "seedance2.5",
5518
- internal: "Seedance_2.5",
5519
- adjustments: []
5520
- };
5521
- }
5522
- if (requested === "seedance2.0_fast") {
5523
- return {
5524
- applied: "seedance2.0_fast",
5525
- internal: "seedance2.0_fast_vision",
5526
- adjustments: []
5527
- };
5528
- }
5529
- if (requested === "seedance2.0") {
5530
- return {
5531
- applied: "seedance2.0",
5532
- internal: "seedance2.0_vision",
5533
- adjustments: []
5534
- };
5535
- }
5536
5536
  const wasSpecified = modelId !== void 0;
5537
- const reason = wasSpecified ? "fallback" : "default";
5537
+ const applied = wasSpecified ? modelId.trim() : XYQ_DEFAULT_VIDEO_MODEL_ID;
5538
+ const known = isKnownModelId(applied);
5539
+ const internal = known ? XYQ_VIDEO_MODEL_ID_MAP[applied] : applied;
5538
5540
  return {
5539
- applied: "seedance2.0",
5540
- internal: "seedance2.0_vision",
5541
- adjustments: [
5541
+ applied,
5542
+ internal,
5543
+ known,
5544
+ adjustments: wasSpecified ? [] : [
5542
5545
  {
5543
5546
  field: "modelId",
5544
- requested: wasSpecified ? requested ?? "" : null,
5545
- applied: "seedance2.0",
5546
- reason,
5547
- message: wasSpecified ? `XYQ \u4E0D\u652F\u6301\u6A21\u578B ${requested || "<empty>"}\uFF0C\u5DF2\u515C\u5E95\u4E3A seedance2.0` : "\u672A\u6307\u5B9A\u6A21\u578B\uFF0CXYQ \u4F7F\u7528\u7F3A\u7701\u6A21\u578B seedance2.0"
5547
+ requested: null,
5548
+ applied: XYQ_DEFAULT_VIDEO_MODEL_ID,
5549
+ reason: "default",
5550
+ message: `\u672A\u6307\u5B9A\u6A21\u578B\uFF0CXYQ \u4F7F\u7528\u7F3A\u7701\u6A21\u578B ${XYQ_DEFAULT_VIDEO_MODEL_ID}`
5548
5551
  }
5549
5552
  ]
5550
5553
  };
5551
5554
  }
5552
- function resolveResolution(resolution) {
5555
+ function isKnownModelId(modelId) {
5556
+ return Object.prototype.hasOwnProperty.call(XYQ_VIDEO_MODEL_ID_MAP, modelId);
5557
+ }
5558
+ function resolveResolution(resolution, modelId) {
5559
+ if (modelId === "minimax-h3") {
5560
+ return { submitted: "2k", adjustments: [] };
5561
+ }
5553
5562
  if (resolution === "2k" || resolution === "4k") {
5554
5563
  return {
5555
- applied: "1080p",
5564
+ submitted: "1080p",
5565
+ reported: "1080p",
5556
5566
  adjustments: [
5557
5567
  {
5558
5568
  field: "resolution",
@@ -5565,7 +5575,8 @@ function resolveResolution(resolution) {
5565
5575
  };
5566
5576
  }
5567
5577
  return {
5568
- applied: resolution,
5578
+ submitted: resolution,
5579
+ reported: resolution,
5569
5580
  adjustments: []
5570
5581
  };
5571
5582
  }
@@ -5998,7 +6009,7 @@ var AiVideoCommand = class extends BaseSubcommandHost {
5998
6009
  cmd.addOption(
5999
6010
  new Option11(
6000
6011
  "--model-id <model-id>",
6001
- "\u6A21\u578B ID\uFF0C\u652F\u6301 seedance2.0\u3001seedance2.0_fast\u3001seedance2.5"
6012
+ `\u6A21\u578B ID\uFF0C\u9ED8\u8BA4 seedance2.5\uFF1B\u5DF2\u77E5\u6A21\u578B ${XYQ_VIDEO_MODEL_IDS.join("\u3001")}\uFF1B\u5176\u4ED6\u503C\u539F\u6837\u4F20\u7ED9\u751F\u6210\u94FE\u8DEF`
6002
6013
  )
6003
6014
  );
6004
6015
  cmd.addOption(