@slatesvideo/shared 0.7.17 → 0.7.19

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.
@@ -42,6 +42,8 @@ const READ_ONLY_PREFIXES = [
42
42
  'slates_blender_search_docs',
43
43
  // Runs HyperFrames' check on a composition and writes nothing; it POSTs because the document is the payload.
44
44
  'slates_check_composition',
45
+ 'slates_quote_cut_drafts',
46
+ 'slates_quote_draft_finish',
45
47
  ];
46
48
  /**
47
49
  * Ops whose effect a user cannot undo from inside Slates.
@@ -154,6 +156,7 @@ export const OPERATION_GROUPS = {
154
156
  'slates_update_style',
155
157
  'slates_delete_style',
156
158
  'slates_list_library',
159
+ 'slates_quote_draft_finish', 'slates_finish_draft',
157
160
  'slates_create_library_item',
158
161
  'slates_update_library_item',
159
162
  'slates_delete_library_item',
@@ -174,6 +177,7 @@ export const OPERATION_GROUPS = {
174
177
  script: ['slates_get_script_document', 'slates_update_script_document', 'slates_get_script_sections', 'slates_update_script_section', 'slates_get_script_suggestions', 'slates_update_script_suggestions', 'slates_get_script_uses', 'slates_preview_script_variation', 'slates_create_script_variation', 'slates_get_shot_inputs', 'slates_reuse_shot_take'],
175
178
  timeline: [
176
179
  'slates_list_timelines', 'slates_save_timeline', 'slates_export_cuts',
180
+ 'slates_quote_cut_drafts', 'slates_finish_cut_drafts', 'slates_get_cut_draft_status',
177
181
  'slates_get_export_batch', 'slates_cancel_export_batch', 'slates_get_variant_grid', 'slates_get_recipe',
178
182
  'slates_reframe_clip', 'slates_get_reframe_report',
179
183
  'slates_get_timeline',
@@ -118,7 +118,7 @@ export const WORKING_METHOD = [
118
118
  // the exception: it is multi-line and generated, and supplies its own bullet.
119
119
  export const HARD_RULES = [
120
120
  // FORKED: "outside an approved plan" names the desktop's code-level gate.
121
- fork(`- COST DISCIPLINE (slates-cost-discipline): never fire a billable generation outside an approved plan. Estimate before you promise. Batch related generations into one plan. When the user says cheap or cheapest, price decides: plan the lowest-priced setting the estimates show (at a tie, the better quality at that price); "best" then means the best picture at that price, never a dearer tier. A dearer tier is named in words, never generated unless the user asks for it.`, `- COST DISCIPLINE (slates-cost-discipline): never fire a billable generation the user has not agreed to. Estimate before you promise. Batch related generations into one quote so the user approves a total, not a drip.`),
121
+ fork(`- COST DISCIPLINE (slates-cost-discipline): never fire a billable generation outside an approved plan. Estimate before you promise, and say each price exactly as the estimate gives it, never rounded. Batch related generations into one plan. When the user says cheap or cheapest, price decides: plan the lowest-priced setting the estimates show (at a tie, the better quality at that price); "best" then means the best picture at that price, never a dearer tier. A dearer tier is named in words, never generated unless the user asks for it.`, `- COST DISCIPLINE (slates-cost-discipline): never fire a billable generation the user has not agreed to. Estimate before you promise, and say each price exactly as the estimate gives it, never rounded. Batch related generations into one quote so the user approves a total, not a drip.`),
122
122
  both(`- CONTENT POLICY: before writing prompts involving real people/celebrities, minors, brands/logos, weapons, or gore, load slates-content-policy and build the scene safe from the first word. If a provider rejects (e.g. real-face detection), explain in plain language — refunds for provider rejections are automatic.`),
123
123
  both(`- PROMPT IS LAW (reference doctrine): references are cited inline by name and image number ("Marcus (images 1 and 2)"); the prompt text leads. Never write role-essays about what each reference is "for".`),
124
124
  both(`- NAMES AND DESCRIPTIONS ARE THE USER'S UI, NOT YOUR NOTEPAD. A project, board or shot name is rendered at the top of the user's screen at all times. Name it after the piece ("Kaiju selfie"), never after your process, and NEVER append your own status or housekeeping — no "shot list", no "v2", no "Written from IMG-A172 and IMG-A182", no "Delete freely", no "scratch". Leave the description empty unless the user gave you one worth keeping: a note-to-self at the top of the screen reads as part of the product, and the user has to look at it every day. Say that kind of thing in your reply to them instead.`),
@@ -2,7 +2,7 @@
2
2
  * This is NOT a model capability or provider batch limit. Desktop mirror is
3
3
  * generated by slate/scripts/sync-generation-policy.mjs; never edit it there. */
4
4
  export declare const IMAGE_QUANTITIES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
5
- export declare const MAX_IMAGE_VARIATIONS: 9 | 3 | 1 | 4 | 5 | 2 | 6 | 10 | 8 | 7;
5
+ export declare const MAX_IMAGE_VARIATIONS: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
6
6
  export type ImageQuantity = typeof IMAGE_QUANTITIES[number];
7
7
  export declare const clampImageQuantity: (count?: number) => ImageQuantity;
8
8
  /** Default saved-recipe framing, shared by composer restore, quote and dispatch. */
@@ -26,8 +26,13 @@ export const DEFAULT_SHOT_ASPECT_RATIO = '16:9';
26
26
  export const BUILT_IN_TOOLS = ['character-sheet', 'environment-plate', 'grid-extract', 'image-edit'];
27
27
  export const DEFAULT_IMAGE_SEAT = 'default-image';
28
28
  export const TOOL_SEAT = {
29
- 'character-sheet': DEFAULT_IMAGE_SEAT,
30
- 'environment-plate': DEFAULT_IMAGE_SEAT,
29
+ // Pinned to the seat they ran on when Seedream 5.5 became the default image
30
+ // model (2026-11-16). A sheet is a panelled identity frame built from one base
31
+ // image, the layout work GPT Image is routed for, and on Seedream 5.5 every
32
+ // input image bills on its own; moving the sheets is a pick with a side-by-side
33
+ // of its own, not a side effect of the default changing.
34
+ 'character-sheet': 'gpt-image-2-6-sunburst',
35
+ 'environment-plate': 'gpt-image-2-6-sunburst',
31
36
  // Pinned: the image viewer offers grid extraction a fixed short list of seats,
32
37
  // and the cell-extraction prompt has a variant per seat family. Moving it is a
33
38
  // picker and a prompt change first.
@@ -102,6 +102,45 @@ export declare const GPT_IMAGE_25_SIZES: Record<string, Record<string, {
102
102
  width: number;
103
103
  height: number;
104
104
  }>>;
105
+ /**
106
+ * Seedream 5.5's output `size` (`WxH`) per Slates rung and aspect ratio, sent to
107
+ * BytePlus ModelArk direct (`dola-seedream-5-5-261028`).
108
+ *
109
+ * 🚨 A BILLING INPUT. BytePlus bills an output by its total pixels P: $0.020 when
110
+ * P ≤ 1536² × 1.05² (2,601,123.84), $0.035 up to 2048² × 1.05² (4,624,220.16)
111
+ * (pricing page, ripped 2026-11-16 to second-brain/business/projects/slates/
112
+ * provider-docs/byteplus-seedream-5-5-docs.md). The proxy derives the cost key's
113
+ * rung from the body's `size` by that same line (`seedream55RungOfSize`), so every
114
+ * size here must sit inside its rung's band.
115
+ *
116
+ * Rungs are named by pixel width, as GPT Image's are (`2k` ≈ 2048 px wide, `3k`
117
+ * ≈ 2816): `2k` is BytePlus's "1.5K" preset class, `3k` its "2K" class. The 1K
118
+ * preset is not offered: it bills the same $0.020 as 1.5K for a smaller picture.
119
+ * Eight aspects are BytePlus's own preset dimensions (API reference, `size`,
120
+ * "Seedream 5.5 (image generation)"); `4:5` and `5:4`, which it does not list,
121
+ * hold the 1:1 preset's pixel count in multiples of 8. Exact `WxH` is sent rather
122
+ * than a bare preset because a preset lets the prompt choose the aspect.
123
+ * BytePlus's band: total pixels [921,600, 4,624,220], aspect [1/16, 16].
124
+ */
125
+ export declare const SEEDREAM_5_5_SIZES: Record<'2k' | '3k', Record<AspectRatio, {
126
+ width: number;
127
+ height: number;
128
+ }>>;
129
+ /** BytePlus's pixel line between Seedream 5.5's two price tiers, and its band. */
130
+ export declare const SEEDREAM_5_5_PIXEL_BOUNDS: {
131
+ readonly min: 921600;
132
+ readonly tierLine: 2601123;
133
+ readonly max: 4624220;
134
+ };
135
+ /**
136
+ * The rung a Seedream 5.5 `WxH` bills at, by BytePlus's pixel line, or null when
137
+ * the size is outside the band or malformed. The proxy's one reading of a 5.5
138
+ * request's price tier; the desktop's sizes come from `SEEDREAM_5_5_SIZES`.
139
+ */
140
+ export declare function seedream55RungOfSize(size: unknown): '2k' | '3k' | null;
141
+ export declare function seedream55CostKey(resolution: string | undefined, referenceCount: number): string;
142
+ /** Seedream 5.5's `size` string for a rung and aspect ratio. */
143
+ export declare function seedream55Size(aspectRatio: string | undefined, resolution: string | undefined): string;
105
144
  /**
106
145
  * fal's named ~1MP presets per aspect ratio, with custom dims where fal has no
107
146
  * preset. The `1k` rung of every non-GPT image model resolves through this.
@@ -151,6 +151,100 @@ export const GPT_IMAGE_25_SIZES = {
151
151
  '3:4': { width: 2448, height: 3264 },
152
152
  },
153
153
  };
154
+ /**
155
+ * Seedream 5.5's output `size` (`WxH`) per Slates rung and aspect ratio, sent to
156
+ * BytePlus ModelArk direct (`dola-seedream-5-5-261028`).
157
+ *
158
+ * 🚨 A BILLING INPUT. BytePlus bills an output by its total pixels P: $0.020 when
159
+ * P ≤ 1536² × 1.05² (2,601,123.84), $0.035 up to 2048² × 1.05² (4,624,220.16)
160
+ * (pricing page, ripped 2026-11-16 to second-brain/business/projects/slates/
161
+ * provider-docs/byteplus-seedream-5-5-docs.md). The proxy derives the cost key's
162
+ * rung from the body's `size` by that same line (`seedream55RungOfSize`), so every
163
+ * size here must sit inside its rung's band.
164
+ *
165
+ * Rungs are named by pixel width, as GPT Image's are (`2k` ≈ 2048 px wide, `3k`
166
+ * ≈ 2816): `2k` is BytePlus's "1.5K" preset class, `3k` its "2K" class. The 1K
167
+ * preset is not offered: it bills the same $0.020 as 1.5K for a smaller picture.
168
+ * Eight aspects are BytePlus's own preset dimensions (API reference, `size`,
169
+ * "Seedream 5.5 (image generation)"); `4:5` and `5:4`, which it does not list,
170
+ * hold the 1:1 preset's pixel count in multiples of 8. Exact `WxH` is sent rather
171
+ * than a bare preset because a preset lets the prompt choose the aspect.
172
+ * BytePlus's band: total pixels [921,600, 4,624,220], aspect [1/16, 16].
173
+ */
174
+ export const SEEDREAM_5_5_SIZES = {
175
+ '2k': {
176
+ '1:1': { width: 1536, height: 1536 },
177
+ '16:9': { width: 2048, height: 1152 },
178
+ '9:16': { width: 1152, height: 2048 },
179
+ '4:3': { width: 1792, height: 1344 },
180
+ '3:4': { width: 1344, height: 1792 },
181
+ '3:2': { width: 1872, height: 1248 },
182
+ '2:3': { width: 1248, height: 1872 },
183
+ '5:4': { width: 1720, height: 1376 },
184
+ '4:5': { width: 1376, height: 1720 },
185
+ '21:9': { width: 2352, height: 1008 },
186
+ },
187
+ '3k': {
188
+ '1:1': { width: 2048, height: 2048 },
189
+ '16:9': { width: 2816, height: 1584 },
190
+ '9:16': { width: 1584, height: 2816 },
191
+ '4:3': { width: 2368, height: 1776 },
192
+ '3:4': { width: 1776, height: 2368 },
193
+ '3:2': { width: 2496, height: 1664 },
194
+ '2:3': { width: 1664, height: 2496 },
195
+ '5:4': { width: 2288, height: 1832 },
196
+ '4:5': { width: 1832, height: 2288 },
197
+ '21:9': { width: 3136, height: 1344 },
198
+ },
199
+ };
200
+ /** BytePlus's pixel line between Seedream 5.5's two price tiers, and its band. */
201
+ export const SEEDREAM_5_5_PIXEL_BOUNDS = { min: 921_600, tierLine: 2_601_123, max: 4_624_220 };
202
+ /**
203
+ * The rung a Seedream 5.5 `WxH` bills at, by BytePlus's pixel line, or null when
204
+ * the size is outside the band or malformed. The proxy's one reading of a 5.5
205
+ * request's price tier; the desktop's sizes come from `SEEDREAM_5_5_SIZES`.
206
+ */
207
+ export function seedream55RungOfSize(size) {
208
+ if (typeof size !== 'string')
209
+ return null;
210
+ const m = /^(\d{2,5})x(\d{2,5})$/.exec(size);
211
+ if (!m)
212
+ return null;
213
+ const w = Number(m[1]);
214
+ const h = Number(m[2]);
215
+ const pixels = w * h;
216
+ if (w / h < 1 / 16 || w / h > 16)
217
+ return null;
218
+ if (pixels < SEEDREAM_5_5_PIXEL_BOUNDS.min || pixels > SEEDREAM_5_5_PIXEL_BOUNDS.max)
219
+ return null;
220
+ return pixels <= SEEDREAM_5_5_PIXEL_BOUNDS.tierLine ? '2k' : '3k';
221
+ }
222
+ /**
223
+ * Seedream 5.5's billing key: its price rung, then the input-image count when
224
+ * there is one (`seedream-5-5-3k`, `seedream-5-5-3k-ref2`). BytePlus bills each
225
+ * input image ($0.008) on top of the output, so the count is part of the price.
226
+ * THE ONE HOME of the key's shape: the op quote, the desktop's `imageCreditKey`
227
+ * and the proxy's key derivation all call this. Counts clamp to the model's cap,
228
+ * which the proxy refuses past.
229
+ */
230
+ /** A requested rung, or the model's default when none (or an unknown one) is named. */
231
+ function seedream55Rung(resolution) {
232
+ if (resolution === '2k' || resolution === '3k')
233
+ return resolution;
234
+ return MODEL_CAPABILITIES['seedream-5-5']?.defaultImageResolution === '3k' ? '3k' : '2k';
235
+ }
236
+ export function seedream55CostKey(resolution, referenceCount) {
237
+ const rung = seedream55Rung(resolution);
238
+ const cap = MODEL_CAPABILITIES['seedream-5-5']?.maxRefImages ?? 0;
239
+ const refs = Math.max(0, Math.min(cap, Number.isFinite(referenceCount) ? Math.floor(referenceCount) : 0));
240
+ return `seedream-5-5-${rung}${refs > 0 ? `-ref${refs}` : ''}`;
241
+ }
242
+ /** Seedream 5.5's `size` string for a rung and aspect ratio. */
243
+ export function seedream55Size(aspectRatio, resolution) {
244
+ const rung = seedream55Rung(resolution);
245
+ const dims = SEEDREAM_5_5_SIZES[rung][(aspectRatio ?? '16:9')] ?? SEEDREAM_5_5_SIZES[rung]['16:9'];
246
+ return `${dims.width}x${dims.height}`;
247
+ }
154
248
  /**
155
249
  * fal's named ~1MP presets per aspect ratio, with custom dims where fal has no
156
250
  * preset. The `1k` rung of every non-GPT image model resolves through this.
@@ -203,8 +297,11 @@ export function falImageSize(model, aspectRatio, resolution) {
203
297
  if (res === '1k') {
204
298
  return FAL_1MP_SIZES[ar] || 'landscape_16_9';
205
299
  }
206
- // Seedream 5 Lite: custom dims must be ≥3.69MP (2560×1440) and ≤9.44MP
207
- // (3072×3072), so its three rungs target 4 / 7 / 9 MP — all inside that band.
300
+ // Seedream 5 Lite, retired 2026-11-16 for Seedream 5.5 (which never comes
301
+ // here: it runs on BytePlus with `seedream55Size`). Kept because slates-api
302
+ // still validates and bills 5 Lite requests from desktops 1.6.9 and older.
303
+ // Custom dims must be ≥3.69MP (2560×1440) and ≤9.44MP (3072×3072), so its
304
+ // three rungs target 4 / 7 / 9 MP, all inside that band.
208
305
  if (isSeedream5) {
209
306
  if (res === '4k')
210
307
  return computeFalDimensions(ar, 9);
@@ -341,9 +438,17 @@ export const MODEL_CAPABILITIES = {
341
438
  aspectRatios: FULL_ASPECT_RATIOS,
342
439
  maxRefImages: 10,
343
440
  },
344
- 'seedream-5-lite': {
345
- defaultImageResolution: '2k',
346
- imageResolutions: ['2k', '3k', '4k'],
441
+ // Seedream 5.5 on BytePlus ModelArk direct (`dola-seedream-5-5-261028`),
442
+ // replacing Seedream 5 Lite 2026-11-16 (Eric) and THE DEFAULT IMAGE SEAT
443
+ // (MODEL_FACTS tier). Read off the ModelArk API reference, ripped 2026-11-16
444
+ // (provider-docs/byteplus-seedream-5-5-docs.md): "Seedream 5.5 ... support up
445
+ // to 10 reference images"; aspect ratio [1/16, 16] covers all ten of ours.
446
+ // Rungs and sizes: SEEDREAM_5_5_SIZES above. Default 3k (2816 px wide at
447
+ // 16:9; Eric, 2026-11-16: "Why wouldn't we make the default 3K? It's cheap
448
+ // enough"); 2k is the cheaper option. 5 Lite is in RETIRED_MODELS below.
449
+ 'seedream-5-5': {
450
+ defaultImageResolution: '3k',
451
+ imageResolutions: ['2k', '3k'],
347
452
  aspectRatios: FULL_ASPECT_RATIOS,
348
453
  maxRefImages: 10,
349
454
  },
@@ -535,15 +640,8 @@ export const MODEL_CAPABILITIES = {
535
640
  },
536
641
  'seedance-2.5': {
537
642
  aspectRatios: SEEDANCE_ASPECT_RATIOS,
538
- // 1080p landed 2026-08-24 on ALL THREE rails — BytePlus and EvoLink publish
539
- // 1080p rate rows and fal's live OpenAPI enum reads
540
- // ['480p','720p','1080p']. There is still NO 4K on 2.5 (2.0 is the only
541
- // Seedance with one), which is what keeps `is4kVideoKey` version-blind.
542
- //
543
- // DEFAULT STAYS 720p, deliberately: a 30s take at 1080p is ~853 credits
544
- // against a 1,000-credit welcome grant. Reaching a tier and defaulting to it
545
- // are different decisions.
546
- videoResolution: { options: ['480p', '720p', '1080p'], default: '720p' },
643
+ // Keep 720p as the default: a 30s take at 1080p is ~853 credits.
644
+ videoResolution: { options: ['480p', '720p', '1080p', '4k'], default: '720p' },
547
645
  duration: { min: 4, max: 30, mode: 'continuous' },
548
646
  maxIngredientImages: 30,
549
647
  maxReferenceVideos: 10,
@@ -555,10 +653,7 @@ export const MODEL_CAPABILITIES = {
555
653
  },
556
654
  'seedance-2.5-edit': {
557
655
  aspectRatios: SEEDANCE_ASPECT_RATIOS,
558
- // Same ladder as the generation row (1080p added 2026-08-24). EvoLink's
559
- // rate card carries 1080p on the edit/extend row and BytePlus's video-input
560
- // column runs the full tier list; an edit bills that tier × 2.
561
- videoResolution: { options: ['480p', '720p', '1080p'], default: '720p' },
656
+ videoResolution: { options: ['480p', '720p', '1080p', '4k'], default: '720p' },
562
657
  duration: { min: 4, max: 30, mode: 'continuous' },
563
658
  // 🚨 ZERO, AND IT MUST MATCH WHAT THE HANDLER SENDS. The model's edit task
564
659
  // type does accept reference images, but slate's
@@ -832,6 +927,8 @@ export const RETIRED_MODELS = {
832
927
  // 2026-11-10 (Eric, "Yes, same release"): Gemini Omni Flash 1.2 replaced 1.1, seat for seat.
833
928
  'omni-flash': 'omni-flash-1-2',
834
929
  'omni-flash-edit': 'omni-flash-1-2-edit',
930
+ // 2026-11-16 (Eric): Seedream 5.5 replaced Seedream 5 Lite and became the default image seat.
931
+ 'seedream-5-lite': 'seedream-5-5',
835
932
  };
836
933
  /**
837
934
  * The retired seat a cost key bills, or null when the key belongs to a current
@@ -169,11 +169,12 @@ export const MODEL_FACTS = [
169
169
  {
170
170
  id: 'gpt-image-2-6-sunburst',
171
171
  route: 'generate',
172
- tier: 'default',
172
+ // The default image seat until 2026-11-16, when Seedream 5.5 took it (Eric).
173
+ tier: 'specialist',
173
174
  label: 'GPT Image 2.6 Sunburst',
174
175
  kind: 'image',
175
176
  ...caps('gpt-image-2-6-sunburst'),
176
- notes: 'THE QUALITY GPT IMAGE SEAT — OpenAI\'s most capable image model, same price as Flare, deliberately SLOWER. Route here unless speed is the point: finals, hero frames, photoreal people, and multi-reference edits where every reference must survive into one frame. Explore on Flare, finish on Sunburst.',
177
+ notes: 'THE QUALITY GPT IMAGE SEAT — OpenAI\'s most capable image model, same price as Flare, deliberately SLOWER. Route here for polish over realism: designed graphics, dense in-image text and layout, and multi-reference edits where every reference must survive into one frame. Explore on Flare, finish on Sunburst.',
177
178
  },
178
179
  {
179
180
  id: 'flux-3',
@@ -186,13 +187,17 @@ export const MODEL_FACTS = [
186
187
  notes: 'The premium less-filtered image seat: photoreal frames, precise layout and in-image text, at its loosest safety setting, which can still reject a prompt. Auto-routes to its edit endpoint when references are present.',
187
188
  },
188
189
  {
189
- id: 'seedream-5-lite',
190
+ id: 'seedream-5-5',
190
191
  route: 'generate',
191
- tier: 'specialist',
192
- label: 'Seedream 5 Lite',
192
+ tier: 'default',
193
+ // ByteDance's Seedream 5.5 on BytePlus ModelArk direct, replacing Seedream
194
+ // 5 Lite and taking the default image seat from Sunburst, 2026-11-16 (Eric:
195
+ // "there's no comparison in Fidelity for video frames and realistic looking
196
+ // images"). Stored 5 Lite ids migrate through RETIRED_MODELS.
197
+ label: 'Seedream 5.5',
193
198
  kind: 'image',
194
- ...caps('seedream-5-lite'),
195
- notes: 'Cheapest flat-priced image seat (GPT Image at low quality costs less per image). Less filtered, though it can still reject a prompt. Routes to its edit endpoint when references are present.',
199
+ ...caps('seedream-5-5'),
200
+ notes: 'DEFAULT IMAGE MODEL — the realism seat: photoreal people, places and products, and start and end frames for video, where it holds fidelity better than the GPT Image seats. Cheaper than every other seat at full quality (GPT Image on its low and medium tiers costs less) and less filtered, though it can still reject a prompt. Renders a TRANSPARENT background on request (backgroundMode). Go to Sunburst for designed graphics and dense in-image text.',
196
201
  },
197
202
  {
198
203
  id: 'seedance-2',
@@ -202,7 +207,7 @@ export const MODEL_FACTS = [
202
207
  kind: 'video',
203
208
  ...caps('seedance-2'),
204
209
  audioRefNeedsCompanion: true,
205
- notes: 'THE 4K AND VALUE SEAT beside the 2.5 default — the only Seedance with native 4K (Pro-gated; base accounts get PRO_REQUIRED) and cheaper than 2.5 at every resolution they share, with the same physics, effects and scale strengths; shorter takes, fewer references, no timestamps. VIDEO-ONLY. A bare "seedance" still resolves here for older CLIs that expect 4K.',
210
+ notes: 'The lower-cost Seedance seat through native 4K (Pro), with the same physics, effects and scale strengths; shorter takes, fewer references, no timestamps. VIDEO-ONLY. A bare "seedance" still resolves here for older CLIs that expect 4K.',
206
211
  },
207
212
  {
208
213
  id: 'seedance-2.5',
@@ -213,7 +218,7 @@ export const MODEL_FACTS = [
213
218
  ...caps('seedance-2.5'),
214
219
  // No companion requirement — audio-only references are one of the things
215
220
  // the second seat actually buys.
216
- notes: 'DEFAULT VIDEO MODEL — the strongest seat for physics, effects, scale and hero shots, and the only Seedance that takes long single takes, many references, audio-only references and integer-second timestamps. No 4K, and dearer than 2.0 at every shared resolution: go to 2.0 for 4K or the same resolution cheaper. LENGTH is the price dial — quote long takes first. VIDEO-ONLY. Timestamp grammar and the edit/extend words that make the provider reclassify and fail a generation are in slates-prompting-seedance-2-5.',
221
+ notes: 'DEFAULT VIDEO MODEL — the strongest seat for physics, effects, scale and hero shots, and the only Seedance that takes long single takes, many references, audio-only references and integer-second timestamps. Generate directly through native 4K (Pro), or finish a selected 480p draft at 1080p or 4K. The final is billed separately at full duration. LENGTH is the price dial — quote long takes first. VIDEO-ONLY. Timestamp grammar and the edit/extend words that make the provider reclassify and fail a generation are in slates-prompting-seedance-2-5.',
217
222
  },
218
223
  {
219
224
  id: 'seedance-2.5-edit',
@@ -121,7 +121,7 @@ const SEEDANCE_25 = {
121
121
  ...SEEDANCE,
122
122
  label: 'Seedance 2.5',
123
123
  intro: [
124
- 'Seedance 2.5 is the default video model. Against 2.0 it buys one 30-second take instead of 15, up to 30 image references (plus 10 video and 10 audio), audio-only references and integer-second timestamps — and it gives up 4K. It runs at 480p, 720p or 1080p, and it costs more than 2.0 at every tier they share, so pick 2.0 when you want the same resolution cheaper or you want 4K.',
124
+ 'Seedance 2.5 supports takes up to 30 seconds, up to 30 image references plus 10 video and 10 audio references, audio-only references and integer-second timestamps. Both 2.0 and 2.5 can generate directly at native 4K with Pro. Choose 2.5 to cut with 480p drafts and finish approved takes at 1080p or 4K.',
125
125
  "ByteDance's official advanced formula has 8 slots: precise subject + action details + scene/environment + lighting & color tone + camera movement + visual style + image quality + constraints. Sweet spot 60-150 words for a single shot, longer for multi-shot.",
126
126
  ],
127
127
  columns: [
@@ -144,7 +144,7 @@ const SEEDANCE_25 = {
144
144
  {
145
145
  heading: '720p is not the cheap one here',
146
146
  example: '30s \u00b7 720p \u00b7 Seedance 2.5 Face = 489 credits\n15s \u00b7 1080p \u00b7 Seedance 2.0 Face = 411 credits',
147
- note: 'Length is what moves the price, and 2.5 doubles the length ceiling — so a 30-second 720p clip can cost more than a 15-second 1080p one, against a 1,000-credit starting balance. Explore at short LENGTH rather than low resolution: cut the seconds to 4-8 while you are finding the shot, and stay at the resolution you actually want. A 480p pass does not de-risk a 720p render — generation is stochastic, so the 720p run is a different take, not the same shot rendered better. The Generate button always shows the exact number first.',
147
+ note: 'Length affects the price. Try 4–8 seconds while finding the shot. For a take you can finish later, select Draft before generating and save the 480p proxy. The finish quote covers the whole source at the chosen resolution, including referenced video, even if the cut uses only a few seconds. The draft and final are billed separately.',
148
148
  critical: true,
149
149
  },
150
150
  {
@@ -80,6 +80,7 @@ export interface ShotParams {
80
80
  audioLanguage?: string;
81
81
  audioAccent?: string;
82
82
  generateMusic?: boolean;
83
+ seedanceDraft?: boolean;
83
84
  seedanceFace?: boolean;
84
85
  multiShot?: boolean;
85
86
  multiShotSegments?: Array<{
@@ -193,10 +193,13 @@ function readParams(v) {
193
193
  n('audioPromptInfluence');
194
194
  b('sound');
195
195
  b('generateMusic');
196
+ b('seedanceDraft');
196
197
  b('seedanceFace');
197
198
  b('multiShot');
198
199
  b('audioLoop');
199
200
  b('audioMultilingual');
201
+ if (out.seedanceDraft && out.videoResolution === undefined)
202
+ out.videoResolution = '480p';
200
203
  // Shape validation only. The pre-2026-09-09 tier MIGRATION deliberately does
201
204
  // NOT live here: this file is a dependency-free leaf, and the migration's
202
205
  // SSOT is `migrateGptQuality` in slate/src/shared/pricing.ts, applied in
@@ -35,6 +35,7 @@ export const BRAIN_SHAPE = {
35
35
  "rule": [
36
36
  "slates-blocking-to-prompt",
37
37
  "slates-camera-language",
38
+ "slates-cinematic-advertisement",
38
39
  "slates-cinematic-look",
39
40
  "slates-content-policy",
40
41
  "slates-cost-discipline",
@@ -45,6 +46,7 @@ export const BRAIN_SHAPE = {
45
46
  "slates-shot-variety",
46
47
  "slates-style-prompting",
47
48
  "slates-transitions",
49
+ "slates-ugc-advertisement",
48
50
  "slates-vision-feedback-loop"
49
51
  ],
50
52
  "model": [
@@ -62,7 +64,7 @@ export const BRAIN_SHAPE = {
62
64
  "slates-prompting-seed-audio",
63
65
  "slates-prompting-seedance",
64
66
  "slates-prompting-seedance-2-5",
65
- "slates-prompting-seedream-5-lite",
67
+ "slates-prompting-seedream-5-5",
66
68
  "slates-prompting-wan-3"
67
69
  ]
68
70
  },
@@ -74,8 +76,8 @@ export const BRAIN_SHAPE = {
74
76
  "model": 6500
75
77
  },
76
78
  "layerWords": {
77
- "playbook": 29500,
78
- "rule": 25000,
79
+ "playbook": 29600,
80
+ "rule": 29000,
79
81
  "model": 43000
80
82
  },
81
83
  "mine": {
@@ -0,0 +1,34 @@
1
+ /** The file a lesson goes to when the agent names none. */
2
+ export declare const MY_BRAIN_RULES = "my-rules";
3
+ export interface RememberInput {
4
+ /** One lesson in the user's words, as a rule or a preset ("cut every hook to its first word"). */
5
+ lesson?: string;
6
+ /** Their file to put it in; a shared guide's name adds to that guide for them. */
7
+ file?: string;
8
+ /** What taught it: "said always", "corrected twice", "kept take IMG-A8". */
9
+ source?: string;
10
+ /** An existing line this lesson replaces, or with no lesson, the line to remove (undo, forget). */
11
+ replaces?: string;
12
+ }
13
+ export interface RememberResult {
14
+ file: string;
15
+ saved?: string;
16
+ removed?: string;
17
+ unchanged?: boolean;
18
+ }
19
+ /** Whether agents may save lessons on their own. On unless the user switched it off (the desktop's My brain panel). */
20
+ export declare function myBrainLearning(dir?: string): boolean;
21
+ export declare function setMyBrainLearning(on: boolean, dir?: string): void;
22
+ export interface MyBrainLesson {
23
+ text: string;
24
+ source: string;
25
+ date: string;
26
+ }
27
+ /** Every saved lesson, file by file, for a panel that lists them; lines written by hand are not lessons and are left out. */
28
+ export declare function myBrainLessons(dir?: string): Array<{
29
+ file: string;
30
+ lessons: MyBrainLesson[];
31
+ }>;
32
+ /** Add, replace or remove one lesson. Throws with a reason the agent can act on. */
33
+ export declare function remember(input: RememberInput, dir?: string, now?: Date): RememberResult;
34
+ //# sourceMappingURL=my-brain-write.d.ts.map
@@ -0,0 +1,126 @@
1
+ // ============================================================
2
+ // MY BRAIN, THE WRITE SIDE: a lesson the user teaches lands in their own brain
3
+ // (second-brain plans/2026-10-25-slates-brain.md § My brain, step 5).
4
+ //
5
+ // One lesson is one line in the operative summary of one file, with its source
6
+ // and date, so the loader (my-brain.ts) reads it first and every line can be
7
+ // traced and reverted. A lesson already there is not written twice; one that
8
+ // replaces an older line removes it, and the older line is kept in
9
+ // .history.jsonl (the newest wins, the loser is logged). After every write the
10
+ // file is checked with the loader's own checks; a write that would leave it
11
+ // unloaded (over a cap, a passage the shared brain already holds) is undone and
12
+ // the reason returned, so the agent consolidates instead.
13
+ // ============================================================
14
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
15
+ import { join } from 'node:path';
16
+ import { MY_BRAIN_PROFILE, loadMyBrain, myBrainDir } from './my-brain.js';
17
+ const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
18
+ const SUMMARY_RE = /(<!--\s*@operative:start\s*-->\r?\n)([\s\S]*?)(<!--\s*@operative:end\s*-->)/;
19
+ const LESSON_RE = /^- (.*?) _\(from (.*?), (\d{4}-\d{2}-\d{2})\)_$/;
20
+ const HISTORY_FILE = '.history.jsonl';
21
+ /** The file a lesson goes to when the agent names none. */
22
+ export const MY_BRAIN_RULES = 'my-rules';
23
+ const norm = (text) => text.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
24
+ const oneLine = (text) => text.replace(/\s+/g, ' ').trim();
25
+ function newFile(name) {
26
+ const title = name === MY_BRAIN_PROFILE ? 'My profile' : name === MY_BRAIN_RULES ? 'My rules' : `My ${name.replace(/-/g, ' ')}`;
27
+ const what = name === MY_BRAIN_PROFILE ? 'who they are, what they make, for whom, in what voice' : 'rules and presets they taught Slates';
28
+ return `---\nname: ${name}\ndescription: "${title}: ${what}. Theirs, and it wins over the shared brain."\n---\n\n# ${title}\n\n<!-- @operative:start -->\n**Operative summary.**\n<!-- @operative:end -->\n`;
29
+ }
30
+ function writeAtomic(path, text) {
31
+ const temp = `${path}.${process.pid}.tmp`;
32
+ writeFileSync(temp, text);
33
+ renameSync(temp, path);
34
+ }
35
+ const SETTINGS_FILE = '.settings.json';
36
+ /** Whether agents may save lessons on their own. On unless the user switched it off (the desktop's My brain panel). */
37
+ export function myBrainLearning(dir = myBrainDir()) {
38
+ try {
39
+ return JSON.parse(readFileSync(join(dir, SETTINGS_FILE), 'utf8')).learning !== false;
40
+ }
41
+ catch {
42
+ return true;
43
+ }
44
+ }
45
+ export function setMyBrainLearning(on, dir = myBrainDir()) {
46
+ mkdirSync(dir, { recursive: true });
47
+ writeAtomic(join(dir, SETTINGS_FILE), JSON.stringify({ learning: on }, null, 2));
48
+ }
49
+ /** Every saved lesson, file by file, for a panel that lists them; lines written by hand are not lessons and are left out. */
50
+ export function myBrainLessons(dir = myBrainDir()) {
51
+ const { files } = loadMyBrain(dir);
52
+ return Object.entries(files).map(([file, text]) => ({
53
+ file,
54
+ lessons: (SUMMARY_RE.exec(text)?.[2] ?? '').split(/\r?\n/).flatMap((l) => {
55
+ const m = LESSON_RE.exec(l);
56
+ return m ? [{ text: m[1], source: m[2], date: m[3] }] : [];
57
+ }),
58
+ })).filter((f) => f.lessons.length);
59
+ }
60
+ /** Add, replace or remove one lesson. Throws with a reason the agent can act on. */
61
+ export function remember(input, dir = myBrainDir(), now = new Date()) {
62
+ if (input.lesson && !myBrainLearning(dir))
63
+ throw new Error('not saved: the user turned learning off (Settings → AI tools → My brain). Tell them in one line; nothing was saved.');
64
+ const file = (input.file ?? MY_BRAIN_RULES).trim().toLowerCase();
65
+ if (!NAME_RE.test(file))
66
+ throw new Error('file must be lowercase words joined by hyphens, for example "hooks" or "profile"');
67
+ const lesson = input.lesson ? oneLine(input.lesson) : '';
68
+ const replaces = input.replaces ? norm(input.replaces) : '';
69
+ if (!lesson && !replaces)
70
+ throw new Error('pass a lesson to save, or replaces alone to remove a line');
71
+ if (lesson.includes('_(from '))
72
+ throw new Error('write the lesson alone; the source goes in source');
73
+ const path = join(dir, `${file}.md`);
74
+ const before = existsSync(path) ? readFileSync(path, 'utf8') : null;
75
+ if (before === null && !lesson)
76
+ throw new Error(`${file}.md does not exist, so there is nothing to remove`);
77
+ const text = before ?? newFile(file);
78
+ const match = SUMMARY_RE.exec(text);
79
+ if (!match)
80
+ throw new Error(`${file}.md has no operative summary to add to; fix the file or name another`);
81
+ const lines = match[2].split(/\r?\n/).filter((l) => l.trim());
82
+ const lessonText = (l) => {
83
+ const m = LESSON_RE.exec(l);
84
+ return m ? norm(m[1]) : null;
85
+ };
86
+ if (lesson && lines.some((l) => lessonText(l) === norm(lesson)))
87
+ return { file, saved: lesson, unchanged: true };
88
+ let removed;
89
+ if (replaces) {
90
+ const at = lines.findIndex((l) => lessonText(l) === replaces) >= 0
91
+ ? lines.findIndex((l) => lessonText(l) === replaces)
92
+ : lines.findIndex((l) => lessonText(l)?.includes(replaces));
93
+ if (at >= 0) {
94
+ removed = LESSON_RE.exec(lines[at])[1];
95
+ lines.splice(at, 1);
96
+ }
97
+ else if (!lesson)
98
+ throw new Error(`no line in ${file}.md matches "${input.replaces}"`);
99
+ }
100
+ if (lesson)
101
+ lines.push(`- ${lesson} _(from ${oneLine(input.source || 'the user')}, ${now.toISOString().slice(0, 10)})_`);
102
+ const next = text.replace(SUMMARY_RE, (_all, start, _body, end) => `${start}${lines.join('\n')}\n${end}`);
103
+ mkdirSync(dir, { recursive: true });
104
+ // A file this op made, left with no lesson, is removed whole; a file with anything else of theirs is kept.
105
+ const empty = next.trim() === newFile(file).trim();
106
+ if (empty)
107
+ rmSync(path);
108
+ else
109
+ writeAtomic(path, next);
110
+ const problem = empty ? undefined : loadMyBrain(dir).skipped.find((s) => s.file === `${file}.md`);
111
+ if (problem) {
112
+ if (before === null)
113
+ rmSync(path);
114
+ else
115
+ writeAtomic(path, before);
116
+ throw new Error(`not saved: ${problem.reason}. Merge it into a line ${file}.md already has (pass replaces), or remove one first.`);
117
+ }
118
+ try {
119
+ appendFileSync(join(dir, HISTORY_FILE), `${JSON.stringify({ at: now.toISOString(), file, saved: lesson || undefined, removed, source: input.source })}\n`);
120
+ }
121
+ catch {
122
+ // The history is for tracing; the lesson is saved either way.
123
+ }
124
+ return { file, ...(lesson ? { saved: lesson } : {}), ...(removed ? { removed } : {}) };
125
+ }
126
+ //# sourceMappingURL=my-brain-write.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slatesvideo/shared",
3
- "version": "0.7.17",
3
+ "version": "0.7.19",
4
4
  "description": "Shared operations layer for the Slates MCP server and CLI: auth, cloud/desktop clients, and the single tool surface both consume. Most users want @slatesvideo/mcp-server or @slatesvideo/cli instead.",
5
5
  "license": "MIT",
6
6
  "type": "module",