@nodaro/shared 1.7.0 → 1.9.0

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/index.cjs CHANGED
@@ -2785,12 +2785,18 @@ var SEEDANCE_2_REF_LIMITS = {
2785
2785
  audio: 3
2786
2786
  };
2787
2787
  var SEEDANCE_2_EXTEND_STITCH = {
2788
- /** Frames dropped from the END of the source clip. */
2788
+ /** Frames dropped from the END of the source clip (smart-cut FALLBACK —
2789
+ * used only when the PSNR boundary matcher finds no genuine match). */
2789
2790
  trimTailFrames: 4,
2790
- /** Frames dropped from the START of the generated extension. */
2791
+ /** Frames dropped from the START of the generated extension (smart-cut
2792
+ * fallback, see above). */
2791
2793
  trimHeadFrames: 3,
2792
2794
  /** Boundary audio fade length (seconds), timeline-preserving. */
2793
- audioFadeSec: 0.15
2795
+ audioFadeSec: 0.15,
2796
+ /** Seconds of the source's TAIL passed as the @video_1 reference —
2797
+ * spike-validated: a short tail keeps the model focused on continuing
2798
+ * the boundary motion instead of re-staging the whole clip. */
2799
+ referenceTailSeconds: 1
2794
2800
  };
2795
2801
  var SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER = {
2796
2802
  "seedance-2-fast": 15.2
@@ -4134,6 +4140,9 @@ function isCollectInEdge(e) {
4134
4140
  }
4135
4141
 
4136
4142
  // src/llm-models.ts
4143
+ var LLM_REASONING_EFFORTS = ["none", "low", "medium", "high", "xhigh", "max"];
4144
+ var EFFORT_TIER_BUMP = /* @__PURE__ */ new Set(["xhigh", "max"]);
4145
+ var EFFORT_RANK = { none: 0, low: 1, medium: 2, high: 3, xhigh: 4, max: 5 };
4137
4146
  var LLM_MODELS = [
4138
4147
  {
4139
4148
  id: "gemini-3-flash",
@@ -4171,7 +4180,8 @@ var LLM_MODELS = [
4171
4180
  structuredOutputMode: "anthropic-tool",
4172
4181
  supportsImages: true,
4173
4182
  maxOutputTokens: 16384,
4174
- directFallbackModel: "claude-sonnet-4-6"
4183
+ directFallbackModel: "claude-sonnet-4-6",
4184
+ reasoningEfforts: ["low", "medium", "high", "max"]
4175
4185
  },
4176
4186
  {
4177
4187
  id: "gpt-5.2",
@@ -4207,7 +4217,10 @@ var LLM_MODELS = [
4207
4217
  structuredOutputMode: "anthropic-tool",
4208
4218
  supportsImages: true,
4209
4219
  maxOutputTokens: 16384,
4210
- directFallbackModel: "claude-opus-4-7"
4220
+ directFallbackModel: "claude-opus-4-7",
4221
+ reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
4222
+ supportsTemperature: false,
4223
+ preferKie: true
4211
4224
  },
4212
4225
  {
4213
4226
  id: "gpt-5.4",
@@ -4218,7 +4231,93 @@ var LLM_MODELS = [
4218
4231
  kieSlugOrModel: "gpt-5-4",
4219
4232
  vendor: "openai",
4220
4233
  supportsImages: true,
4221
- maxOutputTokens: 16384
4234
+ maxOutputTokens: 16384,
4235
+ reasoningEfforts: ["low", "medium", "high"]
4236
+ },
4237
+ {
4238
+ id: "gpt-5.5",
4239
+ displayName: "GPT-5.5",
4240
+ desc: "Previous flagship GPT, deep reasoning",
4241
+ tier: "premium",
4242
+ kieFormat: "responses",
4243
+ kieSlugOrModel: "gpt-5-5",
4244
+ vendor: "openai",
4245
+ supportsImages: true,
4246
+ maxOutputTokens: 16384,
4247
+ reasoningEfforts: ["none", "low", "medium", "high", "xhigh", "max"],
4248
+ supportsTemperature: false
4249
+ },
4250
+ {
4251
+ id: "gpt-5.6-luna",
4252
+ displayName: "GPT-5.6 Luna",
4253
+ desc: "Fastest GPT-5.6, high-volume workloads",
4254
+ tier: "economy",
4255
+ kieFormat: "responses",
4256
+ kieSlugOrModel: "gpt-5-6-luna",
4257
+ vendor: "openai",
4258
+ supportsImages: true,
4259
+ maxOutputTokens: 16384,
4260
+ reasoningEfforts: ["none", "low", "medium", "high", "xhigh", "max"],
4261
+ supportsTemperature: false
4262
+ },
4263
+ {
4264
+ id: "gpt-5.6-terra",
4265
+ displayName: "GPT-5.6 Terra",
4266
+ desc: "Balanced GPT-5.6 for production work",
4267
+ tier: "standard",
4268
+ kieFormat: "responses",
4269
+ kieSlugOrModel: "gpt-5-6-terra",
4270
+ vendor: "openai",
4271
+ supportsImages: true,
4272
+ maxOutputTokens: 16384,
4273
+ reasoningEfforts: ["none", "low", "medium", "high", "xhigh", "max"],
4274
+ supportsTemperature: false
4275
+ },
4276
+ {
4277
+ id: "gpt-5.6-sol",
4278
+ displayName: "GPT-5.6 Sol",
4279
+ desc: "Flagship GPT-5.6, deepest reasoning",
4280
+ tier: "premium",
4281
+ kieFormat: "responses",
4282
+ kieSlugOrModel: "gpt-5-6-sol",
4283
+ vendor: "openai",
4284
+ supportsImages: true,
4285
+ maxOutputTokens: 16384,
4286
+ reasoningEfforts: ["none", "low", "medium", "high", "xhigh", "max"],
4287
+ supportsTemperature: false
4288
+ },
4289
+ // grok-4.5 deferred — KIE chat endpoint not yet live (2026-07-13); add entry + rate row + docs when it activates.
4290
+ {
4291
+ id: "claude-sonnet-5",
4292
+ displayName: "Claude Sonnet 5",
4293
+ desc: "Near-Opus quality at Sonnet cost",
4294
+ tier: "standard",
4295
+ kieFormat: "messages",
4296
+ kieSlugOrModel: "claude-sonnet-5",
4297
+ vendor: "anthropic",
4298
+ structuredOutputMode: "anthropic-tool",
4299
+ supportsImages: true,
4300
+ maxOutputTokens: 16384,
4301
+ directFallbackModel: "claude-sonnet-5",
4302
+ reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
4303
+ supportsTemperature: false,
4304
+ preferKie: true
4305
+ },
4306
+ {
4307
+ id: "claude-opus-4.8",
4308
+ displayName: "Claude Opus 4.8",
4309
+ desc: "Most capable Claude, long-horizon work",
4310
+ tier: "premium",
4311
+ kieFormat: "messages",
4312
+ kieSlugOrModel: "claude-opus-4-8",
4313
+ vendor: "anthropic",
4314
+ structuredOutputMode: "anthropic-tool",
4315
+ supportsImages: true,
4316
+ maxOutputTokens: 16384,
4317
+ directFallbackModel: "claude-opus-4-8",
4318
+ reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
4319
+ supportsTemperature: false,
4320
+ preferKie: true
4222
4321
  }
4223
4322
  ];
4224
4323
  var LLM_MODEL_IDS = LLM_MODELS.map((m) => m.id);
@@ -4252,7 +4351,13 @@ var LLM_MODALITY_CAPS = {
4252
4351
  "claude-sonnet-4.6": { image: true, video: false, audio: false },
4253
4352
  "claude-opus-4.7": { image: true, video: false, audio: false },
4254
4353
  "gpt-5.2": { image: true, video: false, audio: false },
4255
- "gpt-5.4": { image: true, video: false, audio: false }
4354
+ "gpt-5.4": { image: true, video: false, audio: false },
4355
+ "gpt-5.5": { image: true, video: false, audio: false },
4356
+ "gpt-5.6-luna": { image: true, video: false, audio: false },
4357
+ "gpt-5.6-terra": { image: true, video: false, audio: false },
4358
+ "gpt-5.6-sol": { image: true, video: false, audio: false },
4359
+ "claude-sonnet-5": { image: true, video: false, audio: false },
4360
+ "claude-opus-4.8": { image: true, video: false, audio: false }
4256
4361
  };
4257
4362
  function getLlmModalityCaps(modelId) {
4258
4363
  if (!modelId) return { image: true, video: false, audio: false };
@@ -4264,15 +4369,31 @@ function getLlmModel(id) {
4264
4369
  function getLlmTier(id) {
4265
4370
  return getLlmModel(id)?.tier ?? "standard";
4266
4371
  }
4267
- function buildLlmCreditIdentifier(feature, modelId) {
4372
+ function effectiveReasoningEffort(modelId, requested) {
4373
+ if (!requested || !(requested in EFFORT_RANK)) return void 0;
4374
+ const levels = getLlmModel(modelId ?? "")?.reasoningEfforts;
4375
+ if (!levels || levels.length === 0) return void 0;
4376
+ const req = requested;
4377
+ let best;
4378
+ for (const l of levels) {
4379
+ if (EFFORT_RANK[l] <= EFFORT_RANK[req] && (best === void 0 || EFFORT_RANK[l] > EFFORT_RANK[best])) best = l;
4380
+ }
4381
+ return best;
4382
+ }
4383
+ function buildLlmCreditIdentifier(feature, modelId, reasoningEffort) {
4268
4384
  if (!modelId) return feature;
4269
- const tier = getLlmTier(modelId);
4385
+ let tier = getLlmTier(modelId);
4386
+ const eff = effectiveReasoningEffort(modelId, reasoningEffort);
4387
+ if (eff !== void 0 && EFFORT_TIER_BUMP.has(eff)) {
4388
+ if (tier === "economy") tier = "standard";
4389
+ else if (tier === "standard") tier = "premium";
4390
+ }
4270
4391
  if (tier === "standard") return feature;
4271
4392
  return `${feature}:${tier}`;
4272
4393
  }
4273
4394
  function resolveLlmCreditId(feature, body) {
4274
- const llmModel = body?.llmModel;
4275
- return buildLlmCreditIdentifier(feature, llmModel);
4395
+ const b = body;
4396
+ return buildLlmCreditIdentifier(feature, b?.llmModel, b?.reasoningEffort);
4276
4397
  }
4277
4398
  var VIDEO_ANALYSIS_LLM_MODELS = LLM_MODELS.filter((m) => getLlmModalityCaps(m.id).video && getLlmModalityCaps(m.id).audio).map((m) => m.id);
4278
4399
 
@@ -6907,6 +7028,12 @@ var NODE_MAPPABLE_FIELDS = {
6907
7028
  // for back-compat with un-migrated workflow JSON). Mirrors text-to-video so
6908
7029
  // fieldMappings/{} injection AND missing-ref detection work on the live node.
6909
7030
  "generate-video": ["prompt", "negativePrompt"],
7031
+ // Trimmed multi-segment stitch variant of generate-video — prompt only, no
7032
+ // negativePrompt field on the node.
7033
+ "generate-video-pro": ["prompt"],
7034
+ // Span-replace sibling of generate-video-pro — prompt only, no
7035
+ // negativePrompt field on the node.
7036
+ "edit-video-pro": ["prompt"],
6910
7037
  "video-analysis": ["analysisFocus", "youtubeUrl"],
6911
7038
  "video-to-video": ["prompt"],
6912
7039
  "text-to-speech": ["directText"],
@@ -10858,6 +10985,16 @@ var VIDEO_PRODUCER_TYPES = /* @__PURE__ */ new Set([
10858
10985
  // through to the imageUrl/videoUrl/audioUrl/text default and downstream consumers
10859
10986
  // could silently misroute the output.
10860
10987
  "generate-video",
10988
+ // Generate Video Pro — Seedance-2-family multi-segment stitch variant of
10989
+ // generate-video (same "emits videoUrl" contract; a trimmed provider +
10990
+ // handle set). Must mirror generate-video here or its output can't connect
10991
+ // downstream (the recurring "cannot connect the outputs" bug class).
10992
+ "generate-video-pro",
10993
+ // Edit Video Pro — Seedance-2-family span-replace sibling of generate-
10994
+ // video-pro (same "emits videoUrl" contract; source video + prompt in,
10995
+ // ONE video out). Must mirror generate-video-pro here or its output can't
10996
+ // connect downstream (the recurring "cannot connect the outputs" bug class).
10997
+ "edit-video-pro",
10861
10998
  "upload-video",
10862
10999
  "youtube-video",
10863
11000
  "combine-videos",
@@ -11995,6 +12132,7 @@ exports.DETAIL_VARIANTS = DETAIL_VARIANTS;
11995
12132
  exports.DURATION_PRICED_PROVIDERS = DURATION_PRICED_PROVIDERS;
11996
12133
  exports.DYNAMIC_PRODUCER_TYPES = DYNAMIC_PRODUCER_TYPES;
11997
12134
  exports.DetectionResultSchema = DetectionResultSchema;
12135
+ exports.EFFORT_TIER_BUMP = EFFORT_TIER_BUMP;
11998
12136
  exports.EMOTIONAL_BEAT = EMOTIONAL_BEAT;
11999
12137
  exports.ENTITY_ASPECT_DEFAULTS = ENTITY_ASPECT_DEFAULTS;
12000
12138
  exports.ENTITY_IMAGE_HANDLE_TYPES = ENTITY_IMAGE_HANDLE_TYPES;
@@ -12072,6 +12210,7 @@ exports.LLM_FEATURE_DEFAULTS = LLM_FEATURE_DEFAULTS;
12072
12210
  exports.LLM_MODALITY_CAPS = LLM_MODALITY_CAPS;
12073
12211
  exports.LLM_MODELS = LLM_MODELS;
12074
12212
  exports.LLM_MODEL_IDS = LLM_MODEL_IDS;
12213
+ exports.LLM_REASONING_EFFORTS = LLM_REASONING_EFFORTS;
12075
12214
  exports.LOCATION_ASSET_TYPES = LOCATION_ASSET_TYPES;
12076
12215
  exports.LOCATION_ASSET_VARIANTS = LOCATION_ASSET_VARIANTS;
12077
12216
  exports.LOCATION_ATMOSPHERE_PROVIDERS = LOCATION_ATMOSPHERE_PROVIDERS;
@@ -12186,6 +12325,7 @@ exports.SEASONS = SEASONS;
12186
12325
  exports.SECTION_BOARD = SECTION_BOARD;
12187
12326
  exports.SECTION_KINDS = SECTION_KINDS;
12188
12327
  exports.SEEDANCE_2_EXTEND_STITCH = SEEDANCE_2_EXTEND_STITCH;
12328
+ exports.SEEDANCE_2_PROVIDERS = SEEDANCE_2_PROVIDERS;
12189
12329
  exports.SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER = SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER;
12190
12330
  exports.SEEDANCE_2_REF_LIMITS = SEEDANCE_2_REF_LIMITS;
12191
12331
  exports.SEEDANCE_LIP_SYNC_PROVIDERS = SEEDANCE_LIP_SYNC_PROVIDERS;
@@ -12351,6 +12491,7 @@ exports.describeEdgeBehavior = describeEdgeBehavior;
12351
12491
  exports.describeMaskRegion = describeMaskRegion;
12352
12492
  exports.describeSlotControl = describeSlotControl;
12353
12493
  exports.durationsByMode = durationsByMode;
12494
+ exports.effectiveReasoningEffort = effectiveReasoningEffort;
12354
12495
  exports.encodeProviderItem = encodeProviderItem;
12355
12496
  exports.ensureLocaleCatalogLoaded = ensureLocaleCatalogLoaded;
12356
12497
  exports.entitySlotSchema = entitySlotSchema;