@nodaro/shared 3.37.0 → 3.38.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/{chunk-4XI6B4RU.js → chunk-2BHOAYZW.js} +17 -4
- package/dist/chunk-2BHOAYZW.js.map +1 -0
- package/dist/{chunk-M6JHRWVY.cjs → chunk-7VDPBFER.cjs} +19 -3
- package/dist/chunk-7VDPBFER.cjs.map +1 -0
- package/dist/{chunk-6Y66YM4M.cjs → chunk-AQA6YXY5.cjs} +39 -10
- package/dist/chunk-AQA6YXY5.cjs.map +1 -0
- package/dist/{chunk-YVKUCBY2.js → chunk-BDSFMY4X.js} +5 -18
- package/dist/chunk-BDSFMY4X.js.map +1 -0
- package/dist/chunk-BLZBDPZJ.js +16 -0
- package/dist/chunk-BLZBDPZJ.js.map +1 -0
- package/dist/{chunk-NARVPCWW.cjs → chunk-D33YBZ3B.cjs} +170 -143
- package/dist/chunk-D33YBZ3B.cjs.map +1 -0
- package/dist/{chunk-7Q75OZBL.cjs → chunk-HZ46RDLD.cjs} +9 -24
- package/dist/chunk-HZ46RDLD.cjs.map +1 -0
- package/dist/{chunk-WXNQMJ67.js → chunk-LOWOJN65.js} +100 -6
- package/dist/chunk-LOWOJN65.js.map +1 -0
- package/dist/chunk-M7G66F6H.js +17 -0
- package/dist/chunk-M7G66F6H.js.map +1 -0
- package/dist/chunk-PSAWDKO3.cjs +19 -0
- package/dist/chunk-PSAWDKO3.cjs.map +1 -0
- package/dist/{chunk-L6HS52BV.js → chunk-QLCSS6DK.js} +165 -141
- package/dist/chunk-QLCSS6DK.js.map +1 -0
- package/dist/chunk-T3TOSWVH.cjs +20 -0
- package/dist/chunk-T3TOSWVH.cjs.map +1 -0
- package/dist/{chunk-J65CAOUV.cjs → chunk-TGZJXCLL.cjs} +105 -5
- package/dist/chunk-TGZJXCLL.cjs.map +1 -0
- package/dist/{chunk-WD6AJ533.js → chunk-THGNDVVH.js} +29 -4
- package/dist/chunk-THGNDVVH.js.map +1 -0
- package/dist/entries/credits.cjs +135 -134
- package/dist/entries/credits.js +3 -2
- package/dist/entries/llm-models.cjs +72 -52
- package/dist/entries/llm-models.d.cts +50 -13
- package/dist/entries/llm-models.d.ts +50 -13
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +66 -42
- package/dist/entries/media.d.cts +145 -4
- package/dist/entries/media.d.ts +145 -4
- package/dist/entries/media.js +1 -1
- package/dist/entries/models.cjs +43 -27
- package/dist/entries/models.d.cts +53 -3
- package/dist/entries/models.d.ts +53 -3
- package/dist/entries/models.js +2 -2
- package/dist/entries/pipeline.d.cts +2 -2
- package/dist/entries/pipeline.d.ts +2 -2
- package/dist/entries/social.cjs +187 -174
- package/dist/entries/social.d.cts +26 -1
- package/dist/entries/social.d.ts +26 -1
- package/dist/entries/social.js +3 -2
- package/dist/index.cjs +499 -426
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +7 -6
- package/dist/{scene-node-types-Cvbtf-0a.d.cts → model-constants-C43YS07I.d.cts} +1 -497
- package/dist/{scene-node-types-Cvbtf-0a.d.ts → model-constants-C43YS07I.d.ts} +1 -497
- package/dist/scene-node-types-BSrTKnV7.d.cts +499 -0
- package/dist/scene-node-types-BSrTKnV7.d.ts +499 -0
- package/package.json +1 -1
- package/src/__tests__/cast-swap-limits.test.ts +40 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +6 -0
- package/src/__tests__/llm-models.test.ts +8 -8
- package/src/__tests__/llm-price-key.test.ts +55 -0
- package/src/__tests__/scrape-analysis-pricing.test.ts +41 -0
- package/src/__tests__/video-mask.test.ts +27 -0
- package/src/cast-swap-limits.ts +52 -0
- package/src/entries/llm-models.ts +4 -0
- package/src/entries/models.ts +7 -1
- package/src/entries/social.ts +1 -0
- package/src/llm-models.ts +61 -13
- package/src/mask-composite.ts +80 -3
- package/src/scrape-analysis-pricing.ts +73 -0
- package/src/script-model.ts +21 -0
- package/src/video-mask.ts +97 -0
- package/dist/chunk-4XI6B4RU.js.map +0 -1
- package/dist/chunk-6Y66YM4M.cjs.map +0 -1
- package/dist/chunk-7Q75OZBL.cjs.map +0 -1
- package/dist/chunk-FG4E7MTG.cjs +0 -4
- package/dist/chunk-FG4E7MTG.cjs.map +0 -1
- package/dist/chunk-J65CAOUV.cjs.map +0 -1
- package/dist/chunk-L6HS52BV.js.map +0 -1
- package/dist/chunk-M6JHRWVY.cjs.map +0 -1
- package/dist/chunk-NARVPCWW.cjs.map +0 -1
- package/dist/chunk-TZE673G6.js +0 -3
- package/dist/chunk-TZE673G6.js.map +0 -1
- package/dist/chunk-WD6AJ533.js.map +0 -1
- package/dist/chunk-WXNQMJ67.js.map +0 -1
- package/dist/chunk-YVKUCBY2.js.map +0 -1
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TransitionType — the set of allowed shot-to-shot transitions emitted by the
|
|
5
|
+
* Editor LLM stage. Single source of truth shared across:
|
|
6
|
+
* - ShotSpec.cut_decision.transition_to_next (this file)
|
|
7
|
+
* - backend/src/ee/pipelines/llms/editor.ts (LLM result schema)
|
|
8
|
+
* - backend/src/ee/pipelines/services/pipeline-final-merge.ts
|
|
9
|
+
* - backend/src/ee/pipelines/freecut-export.ts
|
|
10
|
+
*/
|
|
11
|
+
declare const TransitionTypeSchema: z.ZodEnum<{
|
|
12
|
+
dissolve: "dissolve";
|
|
13
|
+
hard_cut: "hard_cut";
|
|
14
|
+
match_cut: "match_cut";
|
|
15
|
+
overlap: "overlap";
|
|
16
|
+
}>;
|
|
17
|
+
type TransitionType = z.infer<typeof TransitionTypeSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Tags a ShotSpec field that only a render or the user writes — measured
|
|
20
|
+
* audio, the Editor LLM's cut, the dialogue no-cut zone, an accepted
|
|
21
|
+
* match-cut break — and never the plan. Fields named for a url or an asset id
|
|
22
|
+
* need no tag (their name already says so). A custom registry, not `.meta()`,
|
|
23
|
+
* so the tag never appears in a JSON schema rendered from ShotSpecSchema.
|
|
24
|
+
*/
|
|
25
|
+
declare const sceneRenderStateRegistry: z.core.$ZodRegistry<{
|
|
26
|
+
render_state: true;
|
|
27
|
+
}, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
28
|
+
/**
|
|
29
|
+
* ShotSpec — one shot inside a SceneNodeData.
|
|
30
|
+
* Mirrors Architecture §6.9.1 + v4.1 Method-2/3/5/7/8/10 field additions.
|
|
31
|
+
*/
|
|
32
|
+
declare const ShotSpecSchema: z.ZodObject<{
|
|
33
|
+
shot_id: z.ZodString;
|
|
34
|
+
camera: z.ZodObject<{
|
|
35
|
+
shot_type: z.ZodEnum<{
|
|
36
|
+
wide: "wide";
|
|
37
|
+
medium: "medium";
|
|
38
|
+
close_up: "close_up";
|
|
39
|
+
extreme_close_up: "extreme_close_up";
|
|
40
|
+
pov: "pov";
|
|
41
|
+
over_shoulder: "over_shoulder";
|
|
42
|
+
}>;
|
|
43
|
+
angle: z.ZodEnum<{
|
|
44
|
+
high: "high";
|
|
45
|
+
low: "low";
|
|
46
|
+
eye_level: "eye_level";
|
|
47
|
+
dutch: "dutch";
|
|
48
|
+
birds_eye: "birds_eye";
|
|
49
|
+
}>;
|
|
50
|
+
motion: z.ZodEnum<{
|
|
51
|
+
pan: "pan";
|
|
52
|
+
static: "static";
|
|
53
|
+
tilt: "tilt";
|
|
54
|
+
dolly: "dolly";
|
|
55
|
+
tracking: "tracking";
|
|
56
|
+
handheld: "handheld";
|
|
57
|
+
}>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
shot_intensity_kind: z.ZodEnum<{
|
|
60
|
+
establishing_shot: "establishing_shot";
|
|
61
|
+
action_shot: "action_shot";
|
|
62
|
+
dialogue_shot: "dialogue_shot";
|
|
63
|
+
reaction_shot: "reaction_shot";
|
|
64
|
+
climactic_shot: "climactic_shot";
|
|
65
|
+
transition_shot: "transition_shot";
|
|
66
|
+
}>;
|
|
67
|
+
action: z.ZodString;
|
|
68
|
+
dialogue_line: z.ZodNullable<z.ZodString>;
|
|
69
|
+
duration_seconds: z.ZodNumber;
|
|
70
|
+
motion_prompt: z.ZodString;
|
|
71
|
+
start_state: z.ZodString;
|
|
72
|
+
end_state: z.ZodString;
|
|
73
|
+
continuity_with_previous: z.ZodNullable<z.ZodString>;
|
|
74
|
+
shot_intent: z.ZodObject<{
|
|
75
|
+
needs_multishot_reference: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
is_loopable: z.ZodDefault<z.ZodBoolean>;
|
|
77
|
+
needs_music_suppression: z.ZodDefault<z.ZodBoolean>;
|
|
78
|
+
is_match_cut: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
visual_keyframe_prompt: z.ZodString;
|
|
81
|
+
end_keyframe_prompt: z.ZodOptional<z.ZodString>;
|
|
82
|
+
extends_shot_id: z.ZodOptional<z.ZodString>;
|
|
83
|
+
bridge_image_prompt: z.ZodOptional<z.ZodString>;
|
|
84
|
+
interpolation_keyframes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
85
|
+
timestamp_sec: z.ZodNumber;
|
|
86
|
+
prompt: z.ZodString;
|
|
87
|
+
}, z.core.$strip>>>;
|
|
88
|
+
interpolation_keyframe_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
camera_path_directive: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
path_kind: z.ZodEnum<{
|
|
91
|
+
dolly: "dolly";
|
|
92
|
+
orbit: "orbit";
|
|
93
|
+
crane: "crane";
|
|
94
|
+
arc: "arc";
|
|
95
|
+
reveal: "reveal";
|
|
96
|
+
}>;
|
|
97
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
keyframe_asset_id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
keyframe_url: z.ZodOptional<z.ZodString>;
|
|
101
|
+
video_asset_id: z.ZodOptional<z.ZodString>;
|
|
102
|
+
video_url: z.ZodOptional<z.ZodString>;
|
|
103
|
+
last_frame_asset_id: z.ZodOptional<z.ZodString>;
|
|
104
|
+
last_frame_url: z.ZodOptional<z.ZodString>;
|
|
105
|
+
audio_asset_id: z.ZodOptional<z.ZodString>;
|
|
106
|
+
audio_url: z.ZodOptional<z.ZodString>;
|
|
107
|
+
lipsynced_asset_id: z.ZodOptional<z.ZodString>;
|
|
108
|
+
lipsynced_url: z.ZodOptional<z.ZodString>;
|
|
109
|
+
bridged_frame_url: z.ZodOptional<z.ZodString>;
|
|
110
|
+
accepted_match_cut_break: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
has_dialogue: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
+
actual_audio_duration_sec: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
dialogue_no_cut_zone: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
114
|
+
start: z.ZodNumber;
|
|
115
|
+
end: z.ZodNumber;
|
|
116
|
+
}, z.core.$strip>>>;
|
|
117
|
+
cut_decision: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
in_offset_sec: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
out_offset_sec: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
transition_to_next: z.ZodEnum<{
|
|
121
|
+
dissolve: "dissolve";
|
|
122
|
+
hard_cut: "hard_cut";
|
|
123
|
+
match_cut: "match_cut";
|
|
124
|
+
overlap: "overlap";
|
|
125
|
+
}>;
|
|
126
|
+
transition_duration_sec: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
beat_snap_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
type ShotSpec = z.infer<typeof ShotSpecSchema>;
|
|
131
|
+
/**
|
|
132
|
+
* AssetRef — minimal asset reference shape for execution-state fields.
|
|
133
|
+
* Phase 1B.2 doesn't populate these (Stage 6+ work) but the schema must accept them
|
|
134
|
+
* for parse round-trips.
|
|
135
|
+
*/
|
|
136
|
+
declare const AssetRefSchema: z.ZodObject<{
|
|
137
|
+
asset_id: z.ZodString;
|
|
138
|
+
url: z.ZodString;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
type AssetRef = z.infer<typeof AssetRefSchema>;
|
|
141
|
+
/**
|
|
142
|
+
* SceneNodeData — what the Scene Director emits, what the SceneNode renders,
|
|
143
|
+
* what the engine persists on `pipeline_entities.metadata` (for entity_type='scene').
|
|
144
|
+
* Mirrors Architecture §6.9.1.
|
|
145
|
+
*/
|
|
146
|
+
declare const SceneNodeDataSchema: z.ZodObject<{
|
|
147
|
+
scene_index: z.ZodNumber;
|
|
148
|
+
description: z.ZodString;
|
|
149
|
+
emotional_beat: z.ZodString;
|
|
150
|
+
duration_seconds: z.ZodNumber;
|
|
151
|
+
shot_input_mode: z.ZodEnum<{
|
|
152
|
+
text: "text";
|
|
153
|
+
first_frame: "first_frame";
|
|
154
|
+
first_last_frame: "first_last_frame";
|
|
155
|
+
ref_images: "ref_images";
|
|
156
|
+
multi_shot: "multi_shot";
|
|
157
|
+
video_continuation: "video_continuation";
|
|
158
|
+
frame_interpolation: "frame_interpolation";
|
|
159
|
+
camera_path: "camera_path";
|
|
160
|
+
}>;
|
|
161
|
+
cast_keys: z.ZodArray<z.ZodString>;
|
|
162
|
+
location_key: z.ZodString;
|
|
163
|
+
object_keys: z.ZodArray<z.ZodString>;
|
|
164
|
+
continuity_from_prev: z.ZodEnum<{
|
|
165
|
+
dissolve: "dissolve";
|
|
166
|
+
hard_cut: "hard_cut";
|
|
167
|
+
match_last_frame: "match_last_frame";
|
|
168
|
+
}>;
|
|
169
|
+
image_model: z.ZodString;
|
|
170
|
+
video_model: z.ZodString;
|
|
171
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
172
|
+
shot_id: z.ZodString;
|
|
173
|
+
camera: z.ZodObject<{
|
|
174
|
+
shot_type: z.ZodEnum<{
|
|
175
|
+
wide: "wide";
|
|
176
|
+
medium: "medium";
|
|
177
|
+
close_up: "close_up";
|
|
178
|
+
extreme_close_up: "extreme_close_up";
|
|
179
|
+
pov: "pov";
|
|
180
|
+
over_shoulder: "over_shoulder";
|
|
181
|
+
}>;
|
|
182
|
+
angle: z.ZodEnum<{
|
|
183
|
+
high: "high";
|
|
184
|
+
low: "low";
|
|
185
|
+
eye_level: "eye_level";
|
|
186
|
+
dutch: "dutch";
|
|
187
|
+
birds_eye: "birds_eye";
|
|
188
|
+
}>;
|
|
189
|
+
motion: z.ZodEnum<{
|
|
190
|
+
pan: "pan";
|
|
191
|
+
static: "static";
|
|
192
|
+
tilt: "tilt";
|
|
193
|
+
dolly: "dolly";
|
|
194
|
+
tracking: "tracking";
|
|
195
|
+
handheld: "handheld";
|
|
196
|
+
}>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
shot_intensity_kind: z.ZodEnum<{
|
|
199
|
+
establishing_shot: "establishing_shot";
|
|
200
|
+
action_shot: "action_shot";
|
|
201
|
+
dialogue_shot: "dialogue_shot";
|
|
202
|
+
reaction_shot: "reaction_shot";
|
|
203
|
+
climactic_shot: "climactic_shot";
|
|
204
|
+
transition_shot: "transition_shot";
|
|
205
|
+
}>;
|
|
206
|
+
action: z.ZodString;
|
|
207
|
+
dialogue_line: z.ZodNullable<z.ZodString>;
|
|
208
|
+
duration_seconds: z.ZodNumber;
|
|
209
|
+
motion_prompt: z.ZodString;
|
|
210
|
+
start_state: z.ZodString;
|
|
211
|
+
end_state: z.ZodString;
|
|
212
|
+
continuity_with_previous: z.ZodNullable<z.ZodString>;
|
|
213
|
+
shot_intent: z.ZodObject<{
|
|
214
|
+
needs_multishot_reference: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
is_loopable: z.ZodDefault<z.ZodBoolean>;
|
|
216
|
+
needs_music_suppression: z.ZodDefault<z.ZodBoolean>;
|
|
217
|
+
is_match_cut: z.ZodDefault<z.ZodBoolean>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
visual_keyframe_prompt: z.ZodString;
|
|
220
|
+
end_keyframe_prompt: z.ZodOptional<z.ZodString>;
|
|
221
|
+
extends_shot_id: z.ZodOptional<z.ZodString>;
|
|
222
|
+
bridge_image_prompt: z.ZodOptional<z.ZodString>;
|
|
223
|
+
interpolation_keyframes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
224
|
+
timestamp_sec: z.ZodNumber;
|
|
225
|
+
prompt: z.ZodString;
|
|
226
|
+
}, z.core.$strip>>>;
|
|
227
|
+
interpolation_keyframe_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
228
|
+
camera_path_directive: z.ZodOptional<z.ZodObject<{
|
|
229
|
+
path_kind: z.ZodEnum<{
|
|
230
|
+
dolly: "dolly";
|
|
231
|
+
orbit: "orbit";
|
|
232
|
+
crane: "crane";
|
|
233
|
+
arc: "arc";
|
|
234
|
+
reveal: "reveal";
|
|
235
|
+
}>;
|
|
236
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
keyframe_asset_id: z.ZodOptional<z.ZodString>;
|
|
239
|
+
keyframe_url: z.ZodOptional<z.ZodString>;
|
|
240
|
+
video_asset_id: z.ZodOptional<z.ZodString>;
|
|
241
|
+
video_url: z.ZodOptional<z.ZodString>;
|
|
242
|
+
last_frame_asset_id: z.ZodOptional<z.ZodString>;
|
|
243
|
+
last_frame_url: z.ZodOptional<z.ZodString>;
|
|
244
|
+
audio_asset_id: z.ZodOptional<z.ZodString>;
|
|
245
|
+
audio_url: z.ZodOptional<z.ZodString>;
|
|
246
|
+
lipsynced_asset_id: z.ZodOptional<z.ZodString>;
|
|
247
|
+
lipsynced_url: z.ZodOptional<z.ZodString>;
|
|
248
|
+
bridged_frame_url: z.ZodOptional<z.ZodString>;
|
|
249
|
+
accepted_match_cut_break: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
has_dialogue: z.ZodDefault<z.ZodBoolean>;
|
|
251
|
+
actual_audio_duration_sec: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
dialogue_no_cut_zone: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
253
|
+
start: z.ZodNumber;
|
|
254
|
+
end: z.ZodNumber;
|
|
255
|
+
}, z.core.$strip>>>;
|
|
256
|
+
cut_decision: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
in_offset_sec: z.ZodDefault<z.ZodNumber>;
|
|
258
|
+
out_offset_sec: z.ZodDefault<z.ZodNumber>;
|
|
259
|
+
transition_to_next: z.ZodEnum<{
|
|
260
|
+
dissolve: "dissolve";
|
|
261
|
+
hard_cut: "hard_cut";
|
|
262
|
+
match_cut: "match_cut";
|
|
263
|
+
overlap: "overlap";
|
|
264
|
+
}>;
|
|
265
|
+
transition_duration_sec: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
beat_snap_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
267
|
+
}, z.core.$strip>>;
|
|
268
|
+
}, z.core.$strip>>;
|
|
269
|
+
scene_anchor_keyframe: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
270
|
+
asset_id: z.ZodString;
|
|
271
|
+
url: z.ZodString;
|
|
272
|
+
}, z.core.$strip>>>;
|
|
273
|
+
style_directives: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
visualStyle: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
275
|
+
colorPalette: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
276
|
+
lighting: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
277
|
+
cameraLanguage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
278
|
+
avoid: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
279
|
+
}, z.core.$strip>>;
|
|
280
|
+
generated_keyframes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
281
|
+
asset_id: z.ZodString;
|
|
282
|
+
url: z.ZodString;
|
|
283
|
+
}, z.core.$strip>>>;
|
|
284
|
+
generated_clips: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
285
|
+
asset_id: z.ZodString;
|
|
286
|
+
url: z.ZodString;
|
|
287
|
+
}, z.core.$strip>>>;
|
|
288
|
+
composite_video: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
289
|
+
asset_id: z.ZodString;
|
|
290
|
+
url: z.ZodString;
|
|
291
|
+
}, z.core.$strip>>>;
|
|
292
|
+
last_frame: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
293
|
+
asset_id: z.ZodString;
|
|
294
|
+
url: z.ZodString;
|
|
295
|
+
}, z.core.$strip>>>;
|
|
296
|
+
scene_audio_track: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
297
|
+
asset_id: z.ZodString;
|
|
298
|
+
url: z.ZodString;
|
|
299
|
+
}, z.core.$strip>>>;
|
|
300
|
+
composite_video_asset_id: z.ZodOptional<z.ZodString>;
|
|
301
|
+
composite_video_url: z.ZodOptional<z.ZodString>;
|
|
302
|
+
}, z.core.$strip>;
|
|
303
|
+
type SceneNodeData = z.infer<typeof SceneNodeDataSchema>;
|
|
304
|
+
/**
|
|
305
|
+
* SceneMetadataSchema — what gets persisted on `pipeline_entities.metadata`
|
|
306
|
+
* for entity_type='scene'. The discriminated union in pipeline-types.ts already has
|
|
307
|
+
* Character/Object/Location entries from 1A; this Phase 1B.2 task extends it.
|
|
308
|
+
*/
|
|
309
|
+
declare const SceneMetadataSchema: z.ZodObject<{
|
|
310
|
+
entity_type: z.ZodLiteral<"scene">;
|
|
311
|
+
scene_id: z.ZodString;
|
|
312
|
+
shot_ids: z.ZodArray<z.ZodString>;
|
|
313
|
+
emotional_beat: z.ZodString;
|
|
314
|
+
scene_node_id: z.ZodString;
|
|
315
|
+
exploded_to_workflow_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
316
|
+
scene_node_data: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
scene_index: z.ZodNumber;
|
|
318
|
+
description: z.ZodString;
|
|
319
|
+
emotional_beat: z.ZodString;
|
|
320
|
+
duration_seconds: z.ZodNumber;
|
|
321
|
+
shot_input_mode: z.ZodEnum<{
|
|
322
|
+
text: "text";
|
|
323
|
+
first_frame: "first_frame";
|
|
324
|
+
first_last_frame: "first_last_frame";
|
|
325
|
+
ref_images: "ref_images";
|
|
326
|
+
multi_shot: "multi_shot";
|
|
327
|
+
video_continuation: "video_continuation";
|
|
328
|
+
frame_interpolation: "frame_interpolation";
|
|
329
|
+
camera_path: "camera_path";
|
|
330
|
+
}>;
|
|
331
|
+
cast_keys: z.ZodArray<z.ZodString>;
|
|
332
|
+
location_key: z.ZodString;
|
|
333
|
+
object_keys: z.ZodArray<z.ZodString>;
|
|
334
|
+
continuity_from_prev: z.ZodEnum<{
|
|
335
|
+
dissolve: "dissolve";
|
|
336
|
+
hard_cut: "hard_cut";
|
|
337
|
+
match_last_frame: "match_last_frame";
|
|
338
|
+
}>;
|
|
339
|
+
image_model: z.ZodString;
|
|
340
|
+
video_model: z.ZodString;
|
|
341
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
342
|
+
shot_id: z.ZodString;
|
|
343
|
+
camera: z.ZodObject<{
|
|
344
|
+
shot_type: z.ZodEnum<{
|
|
345
|
+
wide: "wide";
|
|
346
|
+
medium: "medium";
|
|
347
|
+
close_up: "close_up";
|
|
348
|
+
extreme_close_up: "extreme_close_up";
|
|
349
|
+
pov: "pov";
|
|
350
|
+
over_shoulder: "over_shoulder";
|
|
351
|
+
}>;
|
|
352
|
+
angle: z.ZodEnum<{
|
|
353
|
+
high: "high";
|
|
354
|
+
low: "low";
|
|
355
|
+
eye_level: "eye_level";
|
|
356
|
+
dutch: "dutch";
|
|
357
|
+
birds_eye: "birds_eye";
|
|
358
|
+
}>;
|
|
359
|
+
motion: z.ZodEnum<{
|
|
360
|
+
pan: "pan";
|
|
361
|
+
static: "static";
|
|
362
|
+
tilt: "tilt";
|
|
363
|
+
dolly: "dolly";
|
|
364
|
+
tracking: "tracking";
|
|
365
|
+
handheld: "handheld";
|
|
366
|
+
}>;
|
|
367
|
+
}, z.core.$strip>;
|
|
368
|
+
shot_intensity_kind: z.ZodEnum<{
|
|
369
|
+
establishing_shot: "establishing_shot";
|
|
370
|
+
action_shot: "action_shot";
|
|
371
|
+
dialogue_shot: "dialogue_shot";
|
|
372
|
+
reaction_shot: "reaction_shot";
|
|
373
|
+
climactic_shot: "climactic_shot";
|
|
374
|
+
transition_shot: "transition_shot";
|
|
375
|
+
}>;
|
|
376
|
+
action: z.ZodString;
|
|
377
|
+
dialogue_line: z.ZodNullable<z.ZodString>;
|
|
378
|
+
duration_seconds: z.ZodNumber;
|
|
379
|
+
motion_prompt: z.ZodString;
|
|
380
|
+
start_state: z.ZodString;
|
|
381
|
+
end_state: z.ZodString;
|
|
382
|
+
continuity_with_previous: z.ZodNullable<z.ZodString>;
|
|
383
|
+
shot_intent: z.ZodObject<{
|
|
384
|
+
needs_multishot_reference: z.ZodDefault<z.ZodBoolean>;
|
|
385
|
+
is_loopable: z.ZodDefault<z.ZodBoolean>;
|
|
386
|
+
needs_music_suppression: z.ZodDefault<z.ZodBoolean>;
|
|
387
|
+
is_match_cut: z.ZodDefault<z.ZodBoolean>;
|
|
388
|
+
}, z.core.$strip>;
|
|
389
|
+
visual_keyframe_prompt: z.ZodString;
|
|
390
|
+
end_keyframe_prompt: z.ZodOptional<z.ZodString>;
|
|
391
|
+
extends_shot_id: z.ZodOptional<z.ZodString>;
|
|
392
|
+
bridge_image_prompt: z.ZodOptional<z.ZodString>;
|
|
393
|
+
interpolation_keyframes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
394
|
+
timestamp_sec: z.ZodNumber;
|
|
395
|
+
prompt: z.ZodString;
|
|
396
|
+
}, z.core.$strip>>>;
|
|
397
|
+
interpolation_keyframe_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
398
|
+
camera_path_directive: z.ZodOptional<z.ZodObject<{
|
|
399
|
+
path_kind: z.ZodEnum<{
|
|
400
|
+
dolly: "dolly";
|
|
401
|
+
orbit: "orbit";
|
|
402
|
+
crane: "crane";
|
|
403
|
+
arc: "arc";
|
|
404
|
+
reveal: "reveal";
|
|
405
|
+
}>;
|
|
406
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
407
|
+
}, z.core.$strip>>;
|
|
408
|
+
keyframe_asset_id: z.ZodOptional<z.ZodString>;
|
|
409
|
+
keyframe_url: z.ZodOptional<z.ZodString>;
|
|
410
|
+
video_asset_id: z.ZodOptional<z.ZodString>;
|
|
411
|
+
video_url: z.ZodOptional<z.ZodString>;
|
|
412
|
+
last_frame_asset_id: z.ZodOptional<z.ZodString>;
|
|
413
|
+
last_frame_url: z.ZodOptional<z.ZodString>;
|
|
414
|
+
audio_asset_id: z.ZodOptional<z.ZodString>;
|
|
415
|
+
audio_url: z.ZodOptional<z.ZodString>;
|
|
416
|
+
lipsynced_asset_id: z.ZodOptional<z.ZodString>;
|
|
417
|
+
lipsynced_url: z.ZodOptional<z.ZodString>;
|
|
418
|
+
bridged_frame_url: z.ZodOptional<z.ZodString>;
|
|
419
|
+
accepted_match_cut_break: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
+
has_dialogue: z.ZodDefault<z.ZodBoolean>;
|
|
421
|
+
actual_audio_duration_sec: z.ZodOptional<z.ZodNumber>;
|
|
422
|
+
dialogue_no_cut_zone: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
423
|
+
start: z.ZodNumber;
|
|
424
|
+
end: z.ZodNumber;
|
|
425
|
+
}, z.core.$strip>>>;
|
|
426
|
+
cut_decision: z.ZodOptional<z.ZodObject<{
|
|
427
|
+
in_offset_sec: z.ZodDefault<z.ZodNumber>;
|
|
428
|
+
out_offset_sec: z.ZodDefault<z.ZodNumber>;
|
|
429
|
+
transition_to_next: z.ZodEnum<{
|
|
430
|
+
dissolve: "dissolve";
|
|
431
|
+
hard_cut: "hard_cut";
|
|
432
|
+
match_cut: "match_cut";
|
|
433
|
+
overlap: "overlap";
|
|
434
|
+
}>;
|
|
435
|
+
transition_duration_sec: z.ZodOptional<z.ZodNumber>;
|
|
436
|
+
beat_snap_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
437
|
+
}, z.core.$strip>>;
|
|
438
|
+
}, z.core.$strip>>;
|
|
439
|
+
scene_anchor_keyframe: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
440
|
+
asset_id: z.ZodString;
|
|
441
|
+
url: z.ZodString;
|
|
442
|
+
}, z.core.$strip>>>;
|
|
443
|
+
style_directives: z.ZodOptional<z.ZodObject<{
|
|
444
|
+
visualStyle: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
445
|
+
colorPalette: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
446
|
+
lighting: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
447
|
+
cameraLanguage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
448
|
+
avoid: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
449
|
+
}, z.core.$strip>>;
|
|
450
|
+
generated_keyframes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
451
|
+
asset_id: z.ZodString;
|
|
452
|
+
url: z.ZodString;
|
|
453
|
+
}, z.core.$strip>>>;
|
|
454
|
+
generated_clips: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
455
|
+
asset_id: z.ZodString;
|
|
456
|
+
url: z.ZodString;
|
|
457
|
+
}, z.core.$strip>>>;
|
|
458
|
+
composite_video: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
459
|
+
asset_id: z.ZodString;
|
|
460
|
+
url: z.ZodString;
|
|
461
|
+
}, z.core.$strip>>>;
|
|
462
|
+
last_frame: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
463
|
+
asset_id: z.ZodString;
|
|
464
|
+
url: z.ZodString;
|
|
465
|
+
}, z.core.$strip>>>;
|
|
466
|
+
scene_audio_track: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
467
|
+
asset_id: z.ZodString;
|
|
468
|
+
url: z.ZodString;
|
|
469
|
+
}, z.core.$strip>>>;
|
|
470
|
+
composite_video_asset_id: z.ZodOptional<z.ZodString>;
|
|
471
|
+
composite_video_url: z.ZodOptional<z.ZodString>;
|
|
472
|
+
}, z.core.$strip>>;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
type SceneMetadata = z.infer<typeof SceneMetadataSchema>;
|
|
475
|
+
/**
|
|
476
|
+
* MatchCutVerdictSchema — Phase 1D.1 Method 7.
|
|
477
|
+
*
|
|
478
|
+
* What Stage 6 persists in `pipeline_stages.output.match_cut_verdicts` for
|
|
479
|
+
* each match-cut shot pair. Keyed by the TARGET shot_id (the shot with
|
|
480
|
+
* `shot_intent.is_match_cut=true`). The pair is [target, next-shot].
|
|
481
|
+
*
|
|
482
|
+
* Stage 6 runs `runValidateMatchCut` for every eligible target and stores
|
|
483
|
+
* one MatchCutVerdict per pair. The `pendingBreaks` list in the orchestrator
|
|
484
|
+
* result identifies shots the user must explicitly accept before Stage 7 runs.
|
|
485
|
+
*/
|
|
486
|
+
declare const MatchCutVerdictSchema: z.ZodObject<{
|
|
487
|
+
shot_pair: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
488
|
+
match_strength: z.ZodEnum<{
|
|
489
|
+
strong: "strong";
|
|
490
|
+
moderate: "moderate";
|
|
491
|
+
weak: "weak";
|
|
492
|
+
break: "break";
|
|
493
|
+
}>;
|
|
494
|
+
suggested_adjustments: z.ZodString;
|
|
495
|
+
checked_at: z.ZodString;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
type MatchCutVerdict = z.infer<typeof MatchCutVerdictSchema>;
|
|
498
|
+
|
|
499
|
+
export { type AssetRef as A, type MatchCutVerdict as M, type SceneMetadata as S, type TransitionType as T, AssetRefSchema as a, MatchCutVerdictSchema as b, SceneMetadataSchema as c, type SceneNodeData as d, SceneNodeDataSchema as e, type ShotSpec as f, ShotSpecSchema as g, TransitionTypeSchema as h, sceneRenderStateRegistry as s };
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cast Swap's input limits and a trend's prompt limits: the server enforces
|
|
3
|
+
* them and the admin screen holds Save on them, both from here. Pinned, so a
|
|
4
|
+
* change is a decision (the engine's own schema has to move with it).
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from "vitest"
|
|
7
|
+
import {
|
|
8
|
+
CAST_SWAP_FACE_MASKING_BOUNDS,
|
|
9
|
+
CAST_SWAP_FACE_MASKING_DEFAULTS,
|
|
10
|
+
CAST_SWAP_POST_PROMPT_MAX,
|
|
11
|
+
TREND_PROMPT_LIMITS,
|
|
12
|
+
} from "../cast-swap-limits.js"
|
|
13
|
+
|
|
14
|
+
describe("Cast Swap limits", () => {
|
|
15
|
+
it("pins the post prompt cap and a trend's prompt limits", () => {
|
|
16
|
+
expect(CAST_SWAP_POST_PROMPT_MAX).toBe(4000)
|
|
17
|
+
expect(TREND_PROMPT_LIMITS).toEqual({ trendPromptMax: 3000, prePromptMax: 3000, detailsMax: 1000, engineTextReserve: 17_000 })
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it("leaves a new trend prompt 2998 characters: the post prompt less the details and the blank line", () => {
|
|
21
|
+
expect(CAST_SWAP_POST_PROMPT_MAX - 2 - TREND_PROMPT_LIMITS.detailsMax).toBe(2998)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it("pins the face masking bounds, and every default sits inside them", () => {
|
|
25
|
+
expect(CAST_SWAP_FACE_MASKING_BOUNDS).toEqual({
|
|
26
|
+
faceHeightPct: [0, 100],
|
|
27
|
+
zonePct: [0, 49],
|
|
28
|
+
blurStrengthPct: [0.1, 5],
|
|
29
|
+
threshold: [0.05, 0.95],
|
|
30
|
+
})
|
|
31
|
+
const inside = (v: number, [lo, hi]: readonly [number, number]) => v >= lo && v <= hi
|
|
32
|
+
const b = CAST_SWAP_FACE_MASKING_BOUNDS
|
|
33
|
+
const d = CAST_SWAP_FACE_MASKING_DEFAULTS
|
|
34
|
+
expect(inside(d.minFaceHeightPct, b.faceHeightPct)).toBe(true)
|
|
35
|
+
expect(inside(d.maxFaceHeightPct, b.faceHeightPct)).toBe(true)
|
|
36
|
+
expect(inside(d.zonePct, b.zonePct)).toBe(true)
|
|
37
|
+
expect(inside(d.blurStrengthPct, b.blurStrengthPct)).toBe(true)
|
|
38
|
+
expect(inside(d.threshold, b.threshold)).toBe(true)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
@@ -605,6 +605,7 @@
|
|
|
605
605
|
"LIP_SYNC_PROVIDERS",
|
|
606
606
|
"LLM_CREDIT_RUNGS",
|
|
607
607
|
"LLM_FEATURE_DEFAULTS",
|
|
608
|
+
"LLM_FEATURE_DEFAULTS_FROM",
|
|
608
609
|
"LLM_FEATURE_DEFAULT_EFFORTS",
|
|
609
610
|
"LLM_MODALITY_CAPS",
|
|
610
611
|
"LLM_MODELS",
|
|
@@ -2187,6 +2188,8 @@
|
|
|
2187
2188
|
"listSlotSids",
|
|
2188
2189
|
"liveRowColumn",
|
|
2189
2190
|
"llmCreditIdForRung",
|
|
2191
|
+
"llmDefaultsFeature",
|
|
2192
|
+
"llmPriceKey",
|
|
2190
2193
|
"llmRouteDefaults",
|
|
2191
2194
|
"llmServesDirect",
|
|
2192
2195
|
"llmTierCreditIds",
|
|
@@ -3071,6 +3074,7 @@
|
|
|
3071
3074
|
"LIP_SYNC_PROVIDERS",
|
|
3072
3075
|
"LLM_CREDIT_RUNGS",
|
|
3073
3076
|
"LLM_FEATURE_DEFAULTS",
|
|
3077
|
+
"LLM_FEATURE_DEFAULTS_FROM",
|
|
3074
3078
|
"LLM_FEATURE_DEFAULT_EFFORTS",
|
|
3075
3079
|
"LLM_MODALITY_CAPS",
|
|
3076
3080
|
"LLM_MODELS",
|
|
@@ -4090,6 +4094,8 @@
|
|
|
4090
4094
|
"listSlotSids",
|
|
4091
4095
|
"liveRowColumn",
|
|
4092
4096
|
"llmCreditIdForRung",
|
|
4097
|
+
"llmDefaultsFeature",
|
|
4098
|
+
"llmPriceKey",
|
|
4093
4099
|
"llmRouteDefaults",
|
|
4094
4100
|
"llmServesDirect",
|
|
4095
4101
|
"llmTierCreditIds",
|
|
@@ -580,22 +580,22 @@ describe("defaultReasoningEffort", () => {
|
|
|
580
580
|
// DESCRIBE_TO_PICKER_MODELS — what the node offers and its route accepts
|
|
581
581
|
// ---------------------------------------------------------------------------
|
|
582
582
|
describe("DESCRIBE_TO_PICKER_MODELS", () => {
|
|
583
|
-
it("is the structured vision list
|
|
584
|
-
|
|
583
|
+
it("is the whole structured vision list: nothing is withheld, Claude Fable 5 is offered again (metered pricing, 2026-10-20)", () => {
|
|
584
|
+
// Metered pricing charges a legend-sized read what it really costs, so the
|
|
585
|
+
// cost-audit withholding is gone; the deprecated set stays exported, empty.
|
|
586
|
+
expect(DESCRIBE_TO_PICKER_WITHHELD_MODELS.size).toBe(0)
|
|
585
587
|
const ids = DESCRIBE_TO_PICKER_MODELS.map((m) => m.id)
|
|
586
|
-
expect(ids).
|
|
587
|
-
expect(ids.sort()).toEqual(
|
|
588
|
-
STRUCTURED_VISION_MODELS.map((m) => m.id).filter((id) => !DESCRIBE_TO_PICKER_WITHHELD_MODELS.has(id)).sort(),
|
|
589
|
-
)
|
|
588
|
+
expect(ids).toContain("claude-fable-5")
|
|
589
|
+
expect(ids.sort()).toEqual(STRUCTURED_VISION_MODELS.map((m) => m.id).sort())
|
|
590
590
|
})
|
|
591
591
|
|
|
592
592
|
it("every withheld id is a registered model (a typo would withhold nothing)", () => {
|
|
593
593
|
for (const id of DESCRIBE_TO_PICKER_WITHHELD_MODELS) expect(getLlmModel(id)?.id, id).toBe(id)
|
|
594
594
|
})
|
|
595
595
|
|
|
596
|
-
it("the other legend-sized structured reads (text-to-picker, llm-structured) withhold
|
|
596
|
+
it("the other legend-sized structured reads (text-to-picker, llm-structured) withhold nothing either", () => {
|
|
597
597
|
expect(LLM_STRUCTURED_WITHHELD_MODELS).toBe(DESCRIBE_TO_PICKER_WITHHELD_MODELS)
|
|
598
|
-
expect(LLM_STRUCTURED_WITHHELD_MODELS.has("claude-fable-5")).toBe(
|
|
598
|
+
expect(LLM_STRUCTURED_WITHHELD_MODELS.has("claude-fable-5")).toBe(false)
|
|
599
599
|
})
|
|
600
600
|
|
|
601
601
|
it("offers the default, the fallback and the Opus 5.5 recipe model", () => {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { LLM_FEATURE_DEFAULTS, LLM_FEATURE_DEFAULTS_FROM, llmDefaultsFeature, llmPriceKey } from "../entries/llm-models.js"
|
|
3
|
+
|
|
4
|
+
// The key a client asks `POST /v1/credits/model-costs` for a metered LLM
|
|
5
|
+
// call's price with: `<feature>:<model>`, plus `:direct` when the call is
|
|
6
|
+
// served on the vendor's own API (it is then priced at the direct rate).
|
|
7
|
+
describe("llmPriceKey", () => {
|
|
8
|
+
it("is <feature>:<model> for a call on the model's primary lane", () => {
|
|
9
|
+
expect(llmPriceKey("llm-chat", "claude-opus-5.5")).toBe("llm-chat:claude-opus-5.5")
|
|
10
|
+
expect(llmPriceKey("llm-chat", "gemini-3.8-flash")).toBe("llm-chat:gemini-3.8-flash")
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it("adds :direct when an effort runs the model direct", () => {
|
|
14
|
+
expect(llmPriceKey("llm-chat", "claude-opus-5.5", "high")).toBe("llm-chat:claude-opus-5.5:direct")
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it("adds :direct in Advanced mode, only for a model that has it", () => {
|
|
18
|
+
expect(llmPriceKey("llm-chat", "claude-opus-5.5", undefined, true)).toBe("llm-chat:claude-opus-5.5:direct")
|
|
19
|
+
// GPT has no direct lane: Advanced mode cannot apply, so the key is the KIE one.
|
|
20
|
+
expect(llmPriceKey("llm-chat", "gpt-5.2", undefined, true)).toBe("llm-chat:gpt-5.2")
|
|
21
|
+
expect(llmPriceKey("llm-chat", "gpt-5.2", "high")).toBe("llm-chat:gpt-5.2")
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it("reads the feature's default effort when none is sent, as the run does", () => {
|
|
25
|
+
// describe-to-picker runs Opus 5.5 at `high` by default (LLM_FEATURE_DEFAULT_EFFORTS),
|
|
26
|
+
// which only Anthropic's own API honours: the call is held and charged direct.
|
|
27
|
+
expect(llmPriceKey("describe-to-picker", "claude-opus-5.5")).toBe("describe-to-picker:claude-opus-5.5:direct")
|
|
28
|
+
// …only on that model.
|
|
29
|
+
expect(llmPriceKey("describe-to-picker", "claude-sonnet-5.5")).toBe("describe-to-picker:claude-sonnet-5.5")
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it("a feature that borrows its defaults reads the effort of the feature it borrows from", () => {
|
|
33
|
+
// Text to Picker runs on Describe to Picker's defaults: Opus 5.5 at high → direct.
|
|
34
|
+
expect(llmPriceKey("text-to-picker", "claude-opus-5.5")).toBe("text-to-picker:claude-opus-5.5:direct")
|
|
35
|
+
// Generate Structured runs on Generate Text's (no recipe effort), the Choose
|
|
36
|
+
// Best judge on pick-best-llm's (none): their Opus 5.5 calls run on KIE.
|
|
37
|
+
expect(llmPriceKey("llm-structured", "claude-opus-5.5")).toBe("llm-structured:claude-opus-5.5")
|
|
38
|
+
expect(llmPriceKey("reduce:pick-best-llm", "claude-opus-5.5")).toBe("reduce:pick-best-llm:claude-opus-5.5")
|
|
39
|
+
// An explicit effort still decides.
|
|
40
|
+
expect(llmPriceKey("llm-structured", "claude-opus-5.5", "high")).toBe("llm-structured:claude-opus-5.5:direct")
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it("llmDefaultsFeature maps the borrowing features and leaves the rest alone", () => {
|
|
44
|
+
expect(llmDefaultsFeature("text-to-picker")).toBe("describe-to-picker")
|
|
45
|
+
expect(llmDefaultsFeature("llm-structured")).toBe("llm-chat")
|
|
46
|
+
expect(llmDefaultsFeature("reduce:pick-best-llm")).toBe("pick-best-llm")
|
|
47
|
+
expect(llmDefaultsFeature("llm-chat")).toBe("llm-chat")
|
|
48
|
+
expect(llmDefaultsFeature("toString")).toBe("toString")
|
|
49
|
+
for (const target of Object.values(LLM_FEATURE_DEFAULTS_FROM)) expect(LLM_FEATURE_DEFAULTS).toHaveProperty(target)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("refuses an unresolved (empty) model id", () => {
|
|
53
|
+
expect(() => llmPriceKey("llm-chat", "")).toThrow(TypeError)
|
|
54
|
+
})
|
|
55
|
+
})
|