@nodaro/shared 3.25.0 → 3.27.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.
Files changed (45) hide show
  1. package/dist/index.cjs +778 -169
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +427 -75
  4. package/dist/index.d.ts +427 -75
  5. package/dist/index.js +749 -170
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/__tests__/auto-aspect-source.test.ts +372 -0
  9. package/src/__tests__/camera-switch-contract.test.ts +10 -0
  10. package/src/__tests__/collections.test.ts +10 -0
  11. package/src/__tests__/condition-variables.test.ts +12 -0
  12. package/src/__tests__/content-recipe-ideas.test.ts +9 -4
  13. package/src/__tests__/credit-identifiers.test.ts +12 -0
  14. package/src/__tests__/edl.test.ts +319 -4
  15. package/src/__tests__/image-model-roles.test.ts +57 -0
  16. package/src/__tests__/image-ref-limit.test.ts +1 -0
  17. package/src/__tests__/json-kinds.test.ts +11 -1
  18. package/src/__tests__/llm-models.test.ts +253 -42
  19. package/src/__tests__/lone-media-url.test.ts +78 -0
  20. package/src/__tests__/prompt-length-limits.test.ts +2 -0
  21. package/src/__tests__/render-nodes.test.ts +46 -1
  22. package/src/__tests__/transcribe-preflight.test.ts +5 -0
  23. package/src/camera-switch-contract.ts +9 -6
  24. package/src/collections.ts +72 -2
  25. package/src/condition-variables.ts +3 -1
  26. package/src/content-recipe-ideas.ts +5 -2
  27. package/src/credit-identifiers.ts +56 -13
  28. package/src/edl.ts +143 -23
  29. package/src/fan-out-rows.ts +1 -1
  30. package/src/i18n/camera-format.ko.ts +3 -3
  31. package/src/image-model-roles.ts +62 -0
  32. package/src/index.ts +42 -0
  33. package/src/json-kinds.ts +11 -6
  34. package/src/llm-models.ts +434 -24
  35. package/src/lone-media-url.ts +57 -0
  36. package/src/model-catalog.ts +145 -9
  37. package/src/model-constants.ts +13 -2
  38. package/src/node-default-mappings.ts +3 -0
  39. package/src/node-runtime-keys.ts +3 -0
  40. package/src/normalize-node-params.ts +47 -4
  41. package/src/pipeline-types.ts +16 -3
  42. package/src/producer-types.ts +4 -0
  43. package/src/render-nodes.ts +58 -2
  44. package/src/settings-input.ts +2 -1
  45. package/src/transcribe-preflight.ts +11 -10
package/src/index.ts CHANGED
@@ -295,6 +295,8 @@ export {
295
295
  buildCreditModelIdentifier,
296
296
  resolveImageGenCreditIdentifier,
297
297
  resolveNormalizedImageGen,
298
+ normalizedImageGenModelId,
299
+ imageGenAutoAspectNeedsSourceImage,
298
300
  buildVideoCreditModelIdentifier,
299
301
  seedanceVideoEditCreditId,
300
302
  pricedVideoSelection,
@@ -401,6 +403,8 @@ export {
401
403
  isVideoAnalysisMixedTier,
402
404
  resolveVideoAnalysisModel,
403
405
  LLM_FEATURE_DEFAULTS,
406
+ LLM_FEATURE_DEFAULT_EFFORTS,
407
+ defaultReasoningEffort,
404
408
  LLM_MODALITY_CAPS,
405
409
  LLM_REASONING_EFFORTS,
406
410
  EFFORT_TIER_BUMP,
@@ -410,6 +414,11 @@ export {
410
414
  buildLlmCreditIdentifier,
411
415
  resolveLlmCreditId,
412
416
  supportsAdvancedMode,
417
+ llmServesDirect,
418
+ LLM_CREDIT_RUNGS,
419
+ type LlmCreditRung,
420
+ llmCreditIdForRung,
421
+ llmTierCreditIds,
413
422
  availableReasoningEfforts,
414
423
  LLM_ROUTE_DEFAULTS,
415
424
  llmRouteDefaults,
@@ -762,6 +771,12 @@ export {
762
771
  isRenderNodeType,
763
772
  rendersLatestBatch,
764
773
  rendersTranscriptJson,
774
+ RENDER_JSON_HANDLE,
775
+ renderTranscriptOutputOf,
776
+ isRenderDataHandle,
777
+ renderSavedJsonOutputs,
778
+ type RenderTranscriptOutput,
779
+ type RenderSavedJsonOutput,
765
780
  type RenderNodeDescriptor,
766
781
  type RenderClockSource,
767
782
  type RenderJsonKind,
@@ -1080,6 +1095,17 @@ export {
1080
1095
  type CollectionDigestFormat,
1081
1096
  type CollectionReadWindowUnit,
1082
1097
  type CollectionReadOrder,
1098
+ COLLECTION_USAGES,
1099
+ type CollectionUsage,
1100
+ type SetCollectionRecordUsedInput,
1101
+ COLLECTION_RECORD_STATUSES,
1102
+ type CollectionRecordStatus,
1103
+ COLLECTION_BULK_MAX,
1104
+ COLLECTION_BULK_ACTIONS,
1105
+ COLLECTION_RECORDS_OFFSET_MAX,
1106
+ type CollectionBulkAction,
1107
+ type BulkCollectionRecordsInput,
1108
+ type BulkCollectionRecordsResult,
1083
1109
  type IngestedRecord,
1084
1110
  } from "./collections.js"
1085
1111
 
@@ -1286,6 +1312,9 @@ export {
1286
1312
  normalizeVideoRequestParams,
1287
1313
  fitAspectRatioToModel,
1288
1314
  defaultResolutionFor,
1315
+ nearestCatalogAspectRatio,
1316
+ autoAspectNeedsSourceImage,
1317
+ isAutoAspectToken,
1289
1318
  } from "./model-catalog.js"
1290
1319
  export type {
1291
1320
  NormalizedVideoRequest,
@@ -1300,6 +1329,8 @@ export type {
1300
1329
  ModelMenuOption,
1301
1330
  ModelInputAdjustment,
1302
1331
  NormalizedModelInput,
1332
+ ModelInputContext,
1333
+ SourceImageSize,
1303
1334
  TtsCapabilities,
1304
1335
  TtsSettingLever,
1305
1336
  } from "./model-catalog.js"
@@ -1336,6 +1367,13 @@ export {
1336
1367
  // Per-model safety-filter retry/fallback policy (derives from
1337
1368
  // `ModelCatalogEntry.safetyFilter` above).
1338
1369
  export { safetyRetryPolicy } from "./safety-retry-policy.js"
1370
+ export {
1371
+ IMAGE_MODEL_ROLE_DEFAULTS,
1372
+ IMAGE_MODEL_RATIO_FALLBACKS,
1373
+ defaultImageModel,
1374
+ imageModelDrawsRatio,
1375
+ } from "./image-model-roles.js"
1376
+ export type { ImageModelRole } from "./image-model-roles.js"
1339
1377
  export type { SafetyRetryPolicy } from "./safety-retry-policy.js"
1340
1378
 
1341
1379
  export {
@@ -1567,6 +1605,8 @@ export {
1567
1605
 
1568
1606
  export * from "./fan-out-meta.js"
1569
1607
 
1608
+ export { loneMediaUrlKind, isLoneMediaLinkSource } from "./lone-media-url.js"
1609
+ export type { LoneMediaUrlKind } from "./lone-media-url.js"
1570
1610
  export { SUNO_TRACK_SOURCE_TYPES } from "./suno-track-sources.js"
1571
1611
 
1572
1612
  export { isPrivateOrReservedIP, isLocalOrPrivateHostname } from "./private-host.js"
@@ -1624,6 +1664,8 @@ export type { ExecutionOutcome } from "./execution-outcome.js"
1624
1664
 
1625
1665
  export {
1626
1666
  MODEL_PARAM_NODE_TYPES,
1667
+ SOURCE_IMAGE_NODE_TYPES,
1668
+ AUTO_ASPECT_AT_RUN_NODE_TYPES,
1627
1669
  normalizeNodeModelParams,
1628
1670
  describeNodeAdjustments,
1629
1671
  } from "./normalize-node-params.js"
package/src/json-kinds.ts CHANGED
@@ -14,7 +14,8 @@
14
14
  * Output kinds are DATA, never a list of node names:
15
15
  * - a render node's `json` pip answers its registry `jsonKind`
16
16
  * (`RENDER_NODE_TYPES`), so a render registered later — Speaker View, whose
17
- * json is an EDL — is covered by its own registry entry;
17
+ * json is an EDL — is covered by its own registry entry; its transcript pip
18
+ * (`transcriptOutput`, Speaker View's `transcript`) is a Transcript;
18
19
  * - the other JSON producers declare a kind per output pip in
19
20
  * `JSON_OUTPUT_KINDS` below. EVERY node with a JSON output declares one
20
21
  * (decided 2026-10-08): `transcript`, `edl`, or `other` for JSON that is
@@ -26,7 +27,7 @@
26
27
  * Input kinds follow the platform's handle vocabulary: a `transcript` pip
27
28
  * expects a Transcript, an `edl` pip an EDL.
28
29
  */
29
- import { RENDER_NODE_TYPES, type RenderNodeDescriptor } from "./render-nodes.js"
30
+ import { RENDER_JSON_HANDLE, RENDER_NODE_TYPES, type RenderNodeDescriptor } from "./render-nodes.js"
30
31
 
31
32
  /** The two JSON shapes the platform's handle vocabulary tells apart. */
32
33
  export type JsonKind = "transcript" | "edl"
@@ -52,6 +53,9 @@ const JSON_OUTPUT_KINDS: Readonly<Record<string, JsonOutputs>> = Object.freeze({
52
53
  transcribe: { primary: "json", pips: { json: "transcript" } },
53
54
  // Camera Switch: the switched edit and the renamed (still a Transcript) transcript.
54
55
  "camera-switch": { primary: "edl", pips: { edl: "edl", transcript: "transcript" } },
56
+ // Speaker Frames: the stored track file's descriptor (P3-22) — neither a
57
+ // Transcript nor an EDL, read by Speaker View's `tracks` input (P3.9).
58
+ "speaker-frames": { primary: "tracks", pips: { tracks: "other" } },
55
59
  // Text to Dialogue: the Transcript built from the model's own word timings (its default read is the audio).
56
60
  "text-to-dialogue": { pips: { json: "transcript" } },
57
61
 
@@ -81,9 +85,6 @@ const JSON_OUTPUT_KINDS: Readonly<Record<string, JsonOutputs>> = Object.freeze({
81
85
  "describe-to-picker": { primary: "picker-json", pips: { "picker-json": "other" } },
82
86
  })
83
87
 
84
- /** The pip a render's order reads/writes its json on. */
85
- const RENDER_JSON_PIP = "json"
86
-
87
88
  /** The input pips whose kind is fixed by the handle vocabulary. */
88
89
  const JSON_INPUT_KINDS: Readonly<Record<string, JsonKind>> = Object.freeze({
89
90
  transcript: "transcript",
@@ -107,7 +108,11 @@ export function declaredJsonOutput(
107
108
  ): JsonOutputDeclaration | undefined {
108
109
  if (typeof nodeType !== "string") return undefined
109
110
  const render = own(renders, nodeType)
110
- if (render) return (sourceHandle ?? RENDER_JSON_PIP) === RENDER_JSON_PIP ? render.jsonKind : undefined
111
+ if (render) {
112
+ const pip = sourceHandle ?? RENDER_JSON_HANDLE
113
+ if (pip === RENDER_JSON_HANDLE) return render.jsonKind
114
+ return pip === render.transcriptOutput.handle ? "transcript" : undefined
115
+ }
111
116
  const outputs = own(JSON_OUTPUT_KINDS, nodeType)
112
117
  if (!outputs) return undefined
113
118
  const pip = sourceHandle ?? outputs.primary