@slatesvideo/shared 0.5.5 → 0.5.6

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.d.ts CHANGED
@@ -3,7 +3,7 @@ export { SlatesCloudClient, type SlatesUserInfo, type CreditsBalance, type Model
3
3
  export { SlatesDesktopClient, type DesktopHealth } from './clients/desktop.js';
4
4
  export { SKILLS } from './skills/content.js';
5
5
  export * as operations from './operations/index.js';
6
- export { ALL_OPERATIONS, VIDEO_MODELS, defaultContext, type Operation, type OperationContext, type OperationResult } from './operations/index.js';
6
+ export { ALL_OPERATIONS, VIDEO_MODELS, AUDIO_MODELS, defaultContext, type Operation, type OperationContext, type OperationResult } from './operations/index.js';
7
7
  export { MODEL_FACTS, getModelFact, type ModelFact } from './prompts/model-facts.js';
8
8
  export { PROMPTING_TIPS, getPromptingTips, type PromptingTipsEntry, type PromptingTipCard, type PromptingTipsKey } from './prompts/prompting-tips.js';
9
9
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -3,9 +3,9 @@ export { SlatesCloudClient } from './clients/cloud.js';
3
3
  export { SlatesDesktopClient } from './clients/desktop.js';
4
4
  export { SKILLS } from './skills/content.js';
5
5
  export * as operations from './operations/index.js';
6
- export { ALL_OPERATIONS, VIDEO_MODELS, defaultContext } from './operations/index.js';
6
+ export { ALL_OPERATIONS, VIDEO_MODELS, AUDIO_MODELS, defaultContext } from './operations/index.js';
7
7
  // Model routing/prompting facts — the SSOT the desktop Studio Agent system
8
- // prompt derives its MODEL ROUTING doctrine from (kind: image vs video,
8
+ // prompt derives its MODEL ROUTING doctrine from (kind: image | video | audio,
9
9
  // default/premium/niche notes). Edit model-facts.ts, never prose copies.
10
10
  export { MODEL_FACTS, getModelFact } from './prompts/model-facts.js';
11
11
  // Per-model prompting tips — the SSOT for the desktop "See prompting tips"
@@ -32,6 +32,7 @@ export declare const estimateGenerationCost: Operation<{
32
32
  model: string;
33
33
  quantity?: number;
34
34
  duration?: number;
35
+ characters?: number;
35
36
  videoResolution?: '480p' | '720p' | '1080p' | '4k';
36
37
  resolution?: '1k' | '2k' | '3k' | '4k';
37
38
  quality?: 'medium' | 'high';
@@ -67,7 +68,7 @@ export declare const uploadReferenceImage: Operation<{
67
68
  projectId: string;
68
69
  filePath?: string;
69
70
  dataUrl?: string;
70
- type?: 'image' | 'video';
71
+ type?: 'image' | 'video' | 'audio';
71
72
  }>;
72
73
  export declare const listFolders: Operation<{
73
74
  projectId: string;
@@ -80,6 +81,21 @@ export declare const moveAssetsToFolder: Operation<{
80
81
  assetIds: string[];
81
82
  folderId: string | null;
82
83
  }>;
84
+ export declare const moveAssetsToProject: Operation<{
85
+ sourceProjectId: string;
86
+ assetIds: string[];
87
+ targetProjectId: string;
88
+ }>;
89
+ export declare const copyAssetsToProject: Operation<{
90
+ sourceProjectId: string;
91
+ assetIds: string[];
92
+ targetProjectId: string;
93
+ }>;
94
+ export declare const moveEntityToProject: Operation<{
95
+ kind: 'character' | 'environment' | 'style';
96
+ entityId: string;
97
+ targetProjectId: string;
98
+ }>;
83
99
  export declare const listCharacters: Operation<{
84
100
  projectId: string;
85
101
  }>;
@@ -182,6 +198,42 @@ export declare function videoCostKey(input: {
182
198
  }): string;
183
199
  export declare function klingEditCostKey(model: 'kling-v3.0-omni-edit' | 'kling-v3.0-omni-pro-edit', duration: number): string;
184
200
  export declare function omniFlashEditCostKey(duration: number): string;
201
+ export declare const AUDIO_MODELS: readonly ["seed-audio", "eleven-v3", "eleven-sfx", "suno"];
202
+ export type AudioModel = (typeof AUDIO_MODELS)[number];
203
+ /**
204
+ * Per-surface bounds and defaults.
205
+ *
206
+ * 🚨 THESE FOUR NUMBERS PER SURFACE LIVE IN THREE REPOS. A change is a
207
+ * three-site edit, every time:
208
+ * 1. HERE (`audioCostKey`, the agent's pre-flight quote)
209
+ * 2. `slate/src/shared/pricing.ts` → MODEL_REGISTRY `audio.durationSeconds`
210
+ * (min/max/default), read by `clampAudioDuration` + `audioCreditKey`
211
+ * 3. `slates-api/src/lib/audio-keys.ts` → the server's fail-closed bounds
212
+ * `slates-api/scripts/pricing-consistency-check.mjs` §4 asserts 1 and 2 agree
213
+ * at EVERY value including out-of-range ones; the gate check covers 3.
214
+ *
215
+ * The MINs used to be missing here, and the clamp floor was a hardcoded 1. That
216
+ * made `slates_estimate_generation_cost({model:'seed-audio', duration:2})`
217
+ * quote a real `seed-audio-2s` price for a generation the desktop would bill as
218
+ * 3s and the proxy would REJECT outright. Same for an omitted duration, which
219
+ * quoted `seed-audio-1s` against the desktop's `seed-audio-15s`.
220
+ */
221
+ export declare const SEED_AUDIO_MIN_SECONDS = 3;
222
+ export declare const SEED_AUDIO_MAX_SECONDS = 120;
223
+ export declare const SEED_AUDIO_DEFAULT_SECONDS = 15;
224
+ export declare const ELEVEN_SFX_MIN_SECONDS = 1;
225
+ export declare const ELEVEN_SFX_MAX_SECONDS = 22;
226
+ export declare const ELEVEN_SFX_DEFAULT_SECONDS = 4;
227
+ export declare const ELEVEN_V3_MAX_CHARACTERS = 5000;
228
+ export declare const SUNO_MIN_SECONDS = 10;
229
+ export declare const SUNO_MAX_SECONDS = 360;
230
+ export declare function audioCostKey(input: {
231
+ model: AudioModel;
232
+ /** seed-audio + eleven-sfx: the REQUESTED duration in seconds (ceiled). */
233
+ durationSeconds?: number;
234
+ /** eleven-v3: character count of the text to speak (ceiled to 100-char buckets). */
235
+ characters?: number;
236
+ }): string;
185
237
  export declare const generateVideo: Operation<{
186
238
  prompt: string;
187
239
  model: string;
@@ -208,6 +260,34 @@ export declare const generateVideo: Operation<{
208
260
  background?: boolean;
209
261
  confirm?: boolean;
210
262
  }>;
263
+ export declare const generateAudio: Operation<{
264
+ projectId: string;
265
+ model: AudioModel;
266
+ prompt: string;
267
+ durationSeconds?: number;
268
+ voice?: string;
269
+ stability?: number;
270
+ languageCode?: string;
271
+ speed?: number;
272
+ volume?: number;
273
+ pitch?: number;
274
+ multilingual?: boolean;
275
+ loop?: boolean;
276
+ promptInfluence?: number;
277
+ audioReferenceAssetIds?: string[];
278
+ imageReferenceAssetId?: string;
279
+ sunoModel?: 'V4' | 'V4_5' | 'V4_5PLUS' | 'V4_5ALL' | 'V5' | 'V5_5';
280
+ customMode?: boolean;
281
+ instrumental?: boolean;
282
+ style?: string;
283
+ title?: string;
284
+ negativeTags?: string;
285
+ vocalGender?: 'm' | 'f';
286
+ styleWeight?: number;
287
+ weirdnessConstraint?: number;
288
+ background?: boolean;
289
+ confirm?: boolean;
290
+ }>;
211
291
  export declare const generateLipSync: Operation<{
212
292
  projectId: string;
213
293
  sourceAssetId: string;