@moises.ai/extension 1.0.0 → 1.0.1

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
@@ -2,21 +2,11 @@
2
2
  /** Controlling common UI elements */
3
3
  export interface UiApi {
4
4
 
5
- /** Sets the extension size in the interface */
6
- setPluginSize: (params: {
7
-
8
- /** Width in pixels */
9
- width: number;
10
-
11
- /** Height in pixels */
12
- height: number;
13
- }) => void;
14
-
15
5
  /** Displays a progress bar or loading indicator */
16
6
  progress: (options: {
17
7
 
18
- /** Progress message */
19
- message?: string;
8
+ /** Progress title */
9
+ title?: string;
20
10
 
21
11
  /** Progress value (0-100) */
22
12
  value?: number;
@@ -26,10 +16,16 @@ export interface UiApi {
26
16
  alert: (options: {
27
17
 
28
18
  /** Alert title */
29
- title: string;
19
+ title?: string;
20
+
21
+ /** Alert description */
22
+ description?: string;
23
+
24
+ /** Alert CTA label */
25
+ ctaLabel?: string;
30
26
 
31
- /** Alert message */
32
- message: string;
27
+ /** Alert CTA color */
28
+ ctaColor?: string;
33
29
  }) => Promise<void>;
34
30
 
35
31
  /** Displays a confirmation dialog */
@@ -38,8 +34,14 @@ export interface UiApi {
38
34
  /** Confirmation title */
39
35
  title: string;
40
36
 
41
- /** Confirmation message */
42
- message: string;
37
+ /** Confirmation description */
38
+ description: string;
39
+
40
+ /** Confirmation CTA label */
41
+ ctaLabel?: string;
42
+
43
+ /** Confirmation CTA color */
44
+ ctaColor?: string;
43
45
  }) => Promise<boolean>;
44
46
 
45
47
  /** Displays a text input dialog */
@@ -48,11 +50,20 @@ export interface UiApi {
48
50
  /** Prompt title */
49
51
  title: string;
50
52
 
51
- /** Prompt message */
52
- message: string;
53
+ /** Prompt description */
54
+ description: string;
55
+
56
+ /** Prompt label */
57
+ label?: string;
53
58
 
54
- /** Default input value */
59
+ /** Prompt default value */
55
60
  defaultValue?: string;
61
+
62
+ /** Prompt CTA label */
63
+ ctaLabel?: string;
64
+
65
+ /** Prompt CTA color */
66
+ ctaColor?: string;
56
67
  }) => Promise<string>;
57
68
 
58
69
  /** Creates a panel in the interface */
@@ -129,10 +140,10 @@ export interface TrackApi {
129
140
  arrayBuffer: any;
130
141
 
131
142
  /** The name of the track */
132
- name?: string;
143
+ name: string;
133
144
 
134
- /** Additional options for the track */
135
- options?: any;
145
+ /** The start position of the track in seconds */
146
+ startPositionSec: number;
136
147
  }) => Promise<any>;
137
148
 
138
149
  /** Updates a track */
@@ -153,6 +164,209 @@ export interface TrackApi {
153
164
  }
154
165
 
155
166
 
167
+ /** Group API for managing audio groups */
168
+ export interface GroupApi {
169
+
170
+ /** Creates a new group */
171
+ create: (params: {
172
+
173
+ /** The name of the group */
174
+ name: string;
175
+
176
+ /** The ID of the group */
177
+ id: string;
178
+
179
+ /** The type of the group */
180
+ type: string;
181
+
182
+ /** The order of the group */
183
+ order: number;
184
+
185
+ /** Whether the group is solo */
186
+ solo: boolean;
187
+
188
+ /** Whether the group is muted */
189
+ muted: boolean;
190
+
191
+ /** The pan of the group */
192
+ pan: number;
193
+
194
+ /** The volume of the group */
195
+ volume: number;
196
+
197
+ /** Additional options for the group */
198
+ options: any;
199
+ }) => Promise<any>;
200
+
201
+ /** Updates a group */
202
+ update: (params: {
203
+
204
+ /** The ID of the group to update */
205
+ groupId: string;
206
+
207
+ /** The name of the group */
208
+ name: string;
209
+
210
+ /** The type of the group */
211
+ type: string;
212
+
213
+ /** The order of the group */
214
+ order: number;
215
+
216
+ /** Whether the group is solo */
217
+ solo: boolean;
218
+
219
+ /** Whether the group is muted */
220
+ muted: boolean;
221
+
222
+ /** The pan of the group */
223
+ pan: number;
224
+
225
+ /** The volume of the group */
226
+ volume: number;
227
+ }) => Promise<any>;
228
+ }
229
+
230
+
231
+ /** Storage API for managing audio files */
232
+ export interface StorageApi {
233
+
234
+ /** Uploads a buffer to the storage */
235
+ upload: (params: {
236
+
237
+ /** The audio data to upload */
238
+ buffer: any;
239
+ }) => Promise<any>;
240
+
241
+ /** Downloads an audio file from the storage */
242
+ download: (params: {
243
+
244
+ /** The URL of the audio file to download */
245
+ url: string;
246
+ }) => Promise<any>;
247
+ }
248
+
249
+
250
+ /** Compute API for managing audio computations */
251
+ export interface ComputeApi {
252
+
253
+ /** Generates a session player */
254
+ sessionPlayerGenerate: (params: {
255
+
256
+ /** The context audio for the session player */
257
+ contextAudio: any;
258
+
259
+ /** The conditioning audio for the session player */
260
+ conditioningAudio: any;
261
+
262
+ /** The conditioning text for the session player */
263
+ conditioningText: string;
264
+
265
+ /** The number of steps for the session player */
266
+ steps: number;
267
+
268
+ /** The guidance scale for the session player */
269
+ guidanceScale: number;
270
+
271
+ /** The weight schedule for the session player */
272
+ weightSchedule: number;
273
+
274
+ /** The instrument for the session player */
275
+ instrument: string;
276
+
277
+ /** The preset ID for the session player */
278
+ presetId: string;
279
+
280
+ /** Whether to use chroma for the session player */
281
+ chroma: boolean;
282
+
283
+ /** The timestamps for the session player */
284
+ inpaintingTimestamps: any[];
285
+
286
+ /** The target for the session player */
287
+ inpaintingTarget: any[];
288
+ }) => Promise<void>;
289
+
290
+ /** Gets the list of session player presets */
291
+ sessionPlayerPresets: () => Promise<void>;
292
+
293
+ /** Inpaints an audio file */
294
+ sessionPlayerInpaint: (params: {
295
+
296
+ /** The input audio data */
297
+ input: any;
298
+
299
+ /** The mask for the inpainting */
300
+ mask: any;
301
+ }) => Promise<void>;
302
+
303
+ /** Runs a workflow */
304
+ workflow: (params: {
305
+
306
+ /** The ID of the workflow to run */
307
+ workflowId: string;
308
+
309
+ /** The parameters for the workflow TODO: add type */
310
+ params: any;
311
+ }) => Promise<void>;
312
+
313
+ /** Runs an automix job */
314
+ automix: (params: {
315
+
316
+ /** The ID of the workflow to run TODO: add type */
317
+ workflowId: string;
318
+
319
+ /** The parameters for the workflow TODO: add type */
320
+ params: any;
321
+ }) => Promise<void>;
322
+
323
+ /** Detects instruments in an audio file */
324
+ instruments: (params: {
325
+
326
+ /** The input audio data */
327
+ input: string;
328
+ }) => Promise<void>;
329
+
330
+ /** Detects chords in an audio file */
331
+ chords: (params: {
332
+
333
+ /** The input audio data */
334
+ input: string;
335
+ }) => Promise<void>;
336
+
337
+ /** Detects beats in an audio file */
338
+ beats: (params: {
339
+
340
+ /** The input audio data */
341
+ input: string;
342
+ }) => Promise<void>;
343
+
344
+ /** Detects sections in an audio file */
345
+ sections: (params: {
346
+
347
+ /** The input audio data */
348
+ input: string;
349
+ }) => Promise<void>;
350
+
351
+ /** Detects lyrics in an audio file */
352
+ lyrics: (params: {
353
+
354
+ /** The input audio data */
355
+ input: string;
356
+ }) => Promise<void>;
357
+
358
+ /** Extracts stems from an audio file */
359
+ stems: (params: {
360
+
361
+ /** The input audio data */
362
+ input: string;
363
+
364
+ /** The stems to extract */
365
+ stemsToExtract: any[];
366
+ }) => void;
367
+ }
368
+
369
+
156
370
  /** Registration methods for extensions */
157
371
  export interface RegisterApi {
158
372
 
@@ -171,6 +385,12 @@ export interface MoisesAPI {
171
385
  session: SessionApi;
172
386
  /** Track API for managing audio tracks */
173
387
  track: TrackApi;
388
+ /** Group API for managing audio groups */
389
+ group: GroupApi;
390
+ /** Storage API for managing audio files */
391
+ storage: StorageApi;
392
+ /** Compute API for managing audio computations */
393
+ compute: ComputeApi;
174
394
  /** Registration methods for extensions */
175
395
  register: RegisterApi;
176
396
 
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@moises.ai/extension",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "SDK for Moises AI extensions",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.js",
9
+ "bin": {
10
+ "moises-extension": "./scripts/init-boilerplate.js"
11
+ },
9
12
  "exports": {
10
13
  ".": {
11
14
  "import": "./dist/index.js",
@@ -23,7 +26,8 @@
23
26
  "dist",
24
27
  "styles.css",
25
28
  "src/client.d.ts",
26
- "src/index.d.ts"
29
+ "src/index.d.ts",
30
+ "scripts/init-boilerplate.js"
27
31
  ],
28
32
  "scripts": {
29
33
  "build": "vite build",
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ import { promisify } from "util";
3
+ import cp from "child_process";
4
+ import path from "path";
5
+ import fs from "fs";
6
+
7
+ // convert libs to promises
8
+ const exec = promisify(cp.exec);
9
+ const rm = promisify(fs.rm);
10
+
11
+ // Simple custom spinner implementation
12
+ class Spinner {
13
+ constructor(message) {
14
+ this.message = message;
15
+ this.frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
16
+ this.currentFrame = 0;
17
+ this.isSpinning = false;
18
+ this.interval = null;
19
+ }
20
+
21
+ start() {
22
+ this.isSpinning = true;
23
+ process.stdout.write('\x1B[?25l'); // Hide cursor
24
+ this.interval = setInterval(() => {
25
+ process.stdout.write('\r' + this.frames[this.currentFrame] + ' ' + this.message);
26
+ this.currentFrame = (this.currentFrame + 1) % this.frames.length;
27
+ }, 100);
28
+ return this;
29
+ }
30
+
31
+ succeed(successMessage) {
32
+ this.stop();
33
+ process.stdout.write('\r✅ ' + (successMessage || this.message) + '\n');
34
+ }
35
+
36
+ fail(errorMessage) {
37
+ this.stop();
38
+ process.stdout.write('\r❌ ' + (errorMessage || this.message) + '\n');
39
+ }
40
+
41
+ stop() {
42
+ if (this.interval) {
43
+ clearInterval(this.interval);
44
+ this.interval = null;
45
+ }
46
+ this.isSpinning = false;
47
+ process.stdout.write('\x1B[?25h'); // Show cursor
48
+ process.stdout.write('\r' + ' '.repeat(this.message.length + 10) + '\r');
49
+ }
50
+ }
51
+
52
+ if (process.argv.length < 3) {
53
+ console.log("You have to provide a name for your extension project.");
54
+ console.log("For example:");
55
+ console.log(" npx @moises.ai/extension my-extension");
56
+ process.exit(1);
57
+ }
58
+
59
+ // Display ASCII banner
60
+ console.log(`
61
+ _ _
62
+ (_) (_)
63
+ _ __ ___ ___ _ ___ ___ ___ __ _ _
64
+ | '_ \` _ \\ / _ \\| / __|/ _ \\/ __| / _\` | |
65
+ | | | | | | (_) | \\__ \\ __/\\__ \\| (_| | |
66
+ |_| |_| |_|\\___/|_|___/\\___||___(_)__,_|_|
67
+
68
+ `);
69
+
70
+ const projectName = process.argv[2];
71
+ const currentPath = process.cwd();
72
+ const projectPath = path.join(currentPath, projectName);
73
+ const git_repo = "https://github.com/moises-ai/extensions-boilerplate.git";
74
+
75
+ // create project directory
76
+ if (fs.existsSync(projectPath)) {
77
+ console.log(`The directory ${projectName} already exists in the current directory, please give it another name.`);
78
+ process.exit(1);
79
+ } else {
80
+ fs.mkdirSync(projectPath);
81
+ }
82
+
83
+ try {
84
+ const gitSpinner = new Spinner("Downloading boilerplate files...").start();
85
+ // clone the repo into the project folder -> creates the new boilerplate
86
+ await exec(`git clone --depth 1 ${git_repo} ${projectPath} --quiet`);
87
+ gitSpinner.succeed();
88
+
89
+ const cleanSpinner = new Spinner("Cleaning up template files...").start();
90
+ // remove git history to start fresh
91
+ const rmGit = rm(path.join(projectPath, ".git"), { recursive: true, force: true });
92
+ await rmGit;
93
+ cleanSpinner.succeed();
94
+
95
+ // change to project directory for npm operations
96
+ process.chdir(projectPath);
97
+
98
+ const npmSpinner = new Spinner("Installing dependencies...").start();
99
+ await exec("npm install");
100
+ npmSpinner.succeed();
101
+
102
+ console.log("\n🎉 Extension project created successfully!");
103
+ console.log("\nNext steps:");
104
+ console.log(` cd ${projectName}`);
105
+ console.log(` npm run dev`);
106
+ console.log("\nHappy coding! 🚀");
107
+
108
+ } catch (error) {
109
+ // clean up in case of error, so the user does not have to do it manually
110
+ fs.rmSync(projectPath, { recursive: true, force: true });
111
+ console.error("❌ Error creating extension project:");
112
+ console.error(error.message);
113
+ process.exit(1);
114
+ }
package/src/client.d.ts CHANGED
@@ -2,21 +2,11 @@
2
2
  /** Controlling common UI elements */
3
3
  export interface UiApi {
4
4
 
5
- /** Sets the extension size in the interface */
6
- setPluginSize: (params: {
7
-
8
- /** Width in pixels */
9
- width: number;
10
-
11
- /** Height in pixels */
12
- height: number;
13
- }) => void;
14
-
15
5
  /** Displays a progress bar or loading indicator */
16
6
  progress: (options: {
17
7
 
18
- /** Progress message */
19
- message?: string;
8
+ /** Progress title */
9
+ title?: string;
20
10
 
21
11
  /** Progress value (0-100) */
22
12
  value?: number;
@@ -26,10 +16,16 @@ export interface UiApi {
26
16
  alert: (options: {
27
17
 
28
18
  /** Alert title */
29
- title: string;
19
+ title?: string;
20
+
21
+ /** Alert description */
22
+ description?: string;
23
+
24
+ /** Alert CTA label */
25
+ ctaLabel?: string;
30
26
 
31
- /** Alert message */
32
- message: string;
27
+ /** Alert CTA color */
28
+ ctaColor?: string;
33
29
  }) => Promise<void>;
34
30
 
35
31
  /** Displays a confirmation dialog */
@@ -38,8 +34,14 @@ export interface UiApi {
38
34
  /** Confirmation title */
39
35
  title: string;
40
36
 
41
- /** Confirmation message */
42
- message: string;
37
+ /** Confirmation description */
38
+ description: string;
39
+
40
+ /** Confirmation CTA label */
41
+ ctaLabel?: string;
42
+
43
+ /** Confirmation CTA color */
44
+ ctaColor?: string;
43
45
  }) => Promise<boolean>;
44
46
 
45
47
  /** Displays a text input dialog */
@@ -48,11 +50,20 @@ export interface UiApi {
48
50
  /** Prompt title */
49
51
  title: string;
50
52
 
51
- /** Prompt message */
52
- message: string;
53
+ /** Prompt description */
54
+ description: string;
55
+
56
+ /** Prompt label */
57
+ label?: string;
53
58
 
54
- /** Default input value */
59
+ /** Prompt default value */
55
60
  defaultValue?: string;
61
+
62
+ /** Prompt CTA label */
63
+ ctaLabel?: string;
64
+
65
+ /** Prompt CTA color */
66
+ ctaColor?: string;
56
67
  }) => Promise<string>;
57
68
 
58
69
  /** Creates a panel in the interface */
@@ -129,10 +140,10 @@ export interface TrackApi {
129
140
  arrayBuffer: any;
130
141
 
131
142
  /** The name of the track */
132
- name?: string;
143
+ name: string;
133
144
 
134
- /** Additional options for the track */
135
- options?: any;
145
+ /** The start position of the track in seconds */
146
+ startPositionSec: number;
136
147
  }) => Promise<any>;
137
148
 
138
149
  /** Updates a track */
@@ -153,6 +164,209 @@ export interface TrackApi {
153
164
  }
154
165
 
155
166
 
167
+ /** Group API for managing audio groups */
168
+ export interface GroupApi {
169
+
170
+ /** Creates a new group */
171
+ create: (params: {
172
+
173
+ /** The name of the group */
174
+ name: string;
175
+
176
+ /** The ID of the group */
177
+ id: string;
178
+
179
+ /** The type of the group */
180
+ type: string;
181
+
182
+ /** The order of the group */
183
+ order: number;
184
+
185
+ /** Whether the group is solo */
186
+ solo: boolean;
187
+
188
+ /** Whether the group is muted */
189
+ muted: boolean;
190
+
191
+ /** The pan of the group */
192
+ pan: number;
193
+
194
+ /** The volume of the group */
195
+ volume: number;
196
+
197
+ /** Additional options for the group */
198
+ options: any;
199
+ }) => Promise<any>;
200
+
201
+ /** Updates a group */
202
+ update: (params: {
203
+
204
+ /** The ID of the group to update */
205
+ groupId: string;
206
+
207
+ /** The name of the group */
208
+ name: string;
209
+
210
+ /** The type of the group */
211
+ type: string;
212
+
213
+ /** The order of the group */
214
+ order: number;
215
+
216
+ /** Whether the group is solo */
217
+ solo: boolean;
218
+
219
+ /** Whether the group is muted */
220
+ muted: boolean;
221
+
222
+ /** The pan of the group */
223
+ pan: number;
224
+
225
+ /** The volume of the group */
226
+ volume: number;
227
+ }) => Promise<any>;
228
+ }
229
+
230
+
231
+ /** Storage API for managing audio files */
232
+ export interface StorageApi {
233
+
234
+ /** Uploads a buffer to the storage */
235
+ upload: (params: {
236
+
237
+ /** The audio data to upload */
238
+ buffer: any;
239
+ }) => Promise<any>;
240
+
241
+ /** Downloads an audio file from the storage */
242
+ download: (params: {
243
+
244
+ /** The URL of the audio file to download */
245
+ url: string;
246
+ }) => Promise<any>;
247
+ }
248
+
249
+
250
+ /** Compute API for managing audio computations */
251
+ export interface ComputeApi {
252
+
253
+ /** Generates a session player */
254
+ sessionPlayerGenerate: (params: {
255
+
256
+ /** The context audio for the session player */
257
+ contextAudio: any;
258
+
259
+ /** The conditioning audio for the session player */
260
+ conditioningAudio: any;
261
+
262
+ /** The conditioning text for the session player */
263
+ conditioningText: string;
264
+
265
+ /** The number of steps for the session player */
266
+ steps: number;
267
+
268
+ /** The guidance scale for the session player */
269
+ guidanceScale: number;
270
+
271
+ /** The weight schedule for the session player */
272
+ weightSchedule: number;
273
+
274
+ /** The instrument for the session player */
275
+ instrument: string;
276
+
277
+ /** The preset ID for the session player */
278
+ presetId: string;
279
+
280
+ /** Whether to use chroma for the session player */
281
+ chroma: boolean;
282
+
283
+ /** The timestamps for the session player */
284
+ inpaintingTimestamps: any[];
285
+
286
+ /** The target for the session player */
287
+ inpaintingTarget: any[];
288
+ }) => Promise<void>;
289
+
290
+ /** Gets the list of session player presets */
291
+ sessionPlayerPresets: () => Promise<void>;
292
+
293
+ /** Inpaints an audio file */
294
+ sessionPlayerInpaint: (params: {
295
+
296
+ /** The input audio data */
297
+ input: any;
298
+
299
+ /** The mask for the inpainting */
300
+ mask: any;
301
+ }) => Promise<void>;
302
+
303
+ /** Runs a workflow */
304
+ workflow: (params: {
305
+
306
+ /** The ID of the workflow to run */
307
+ workflowId: string;
308
+
309
+ /** The parameters for the workflow TODO: add type */
310
+ params: any;
311
+ }) => Promise<void>;
312
+
313
+ /** Runs an automix job */
314
+ automix: (params: {
315
+
316
+ /** The ID of the workflow to run TODO: add type */
317
+ workflowId: string;
318
+
319
+ /** The parameters for the workflow TODO: add type */
320
+ params: any;
321
+ }) => Promise<void>;
322
+
323
+ /** Detects instruments in an audio file */
324
+ instruments: (params: {
325
+
326
+ /** The input audio data */
327
+ input: string;
328
+ }) => Promise<void>;
329
+
330
+ /** Detects chords in an audio file */
331
+ chords: (params: {
332
+
333
+ /** The input audio data */
334
+ input: string;
335
+ }) => Promise<void>;
336
+
337
+ /** Detects beats in an audio file */
338
+ beats: (params: {
339
+
340
+ /** The input audio data */
341
+ input: string;
342
+ }) => Promise<void>;
343
+
344
+ /** Detects sections in an audio file */
345
+ sections: (params: {
346
+
347
+ /** The input audio data */
348
+ input: string;
349
+ }) => Promise<void>;
350
+
351
+ /** Detects lyrics in an audio file */
352
+ lyrics: (params: {
353
+
354
+ /** The input audio data */
355
+ input: string;
356
+ }) => Promise<void>;
357
+
358
+ /** Extracts stems from an audio file */
359
+ stems: (params: {
360
+
361
+ /** The input audio data */
362
+ input: string;
363
+
364
+ /** The stems to extract */
365
+ stemsToExtract: any[];
366
+ }) => void;
367
+ }
368
+
369
+
156
370
  /** Registration methods for extensions */
157
371
  export interface RegisterApi {
158
372
 
@@ -171,6 +385,12 @@ export interface MoisesAPI {
171
385
  session: SessionApi;
172
386
  /** Track API for managing audio tracks */
173
387
  track: TrackApi;
388
+ /** Group API for managing audio groups */
389
+ group: GroupApi;
390
+ /** Storage API for managing audio files */
391
+ storage: StorageApi;
392
+ /** Compute API for managing audio computations */
393
+ compute: ComputeApi;
174
394
  /** Registration methods for extensions */
175
395
  register: RegisterApi;
176
396
 
package/src/index.d.ts CHANGED
@@ -2,21 +2,11 @@
2
2
  /** Controlling common UI elements */
3
3
  export interface UiApi {
4
4
 
5
- /** Sets the extension size in the interface */
6
- setPluginSize: (params: {
7
-
8
- /** Width in pixels */
9
- width: number;
10
-
11
- /** Height in pixels */
12
- height: number;
13
- }) => void;
14
-
15
5
  /** Displays a progress bar or loading indicator */
16
6
  progress: (options: {
17
7
 
18
- /** Progress message */
19
- message?: string;
8
+ /** Progress title */
9
+ title?: string;
20
10
 
21
11
  /** Progress value (0-100) */
22
12
  value?: number;
@@ -26,10 +16,16 @@ export interface UiApi {
26
16
  alert: (options: {
27
17
 
28
18
  /** Alert title */
29
- title: string;
19
+ title?: string;
20
+
21
+ /** Alert description */
22
+ description?: string;
23
+
24
+ /** Alert CTA label */
25
+ ctaLabel?: string;
30
26
 
31
- /** Alert message */
32
- message: string;
27
+ /** Alert CTA color */
28
+ ctaColor?: string;
33
29
  }) => Promise<void>;
34
30
 
35
31
  /** Displays a confirmation dialog */
@@ -38,8 +34,14 @@ export interface UiApi {
38
34
  /** Confirmation title */
39
35
  title: string;
40
36
 
41
- /** Confirmation message */
42
- message: string;
37
+ /** Confirmation description */
38
+ description: string;
39
+
40
+ /** Confirmation CTA label */
41
+ ctaLabel?: string;
42
+
43
+ /** Confirmation CTA color */
44
+ ctaColor?: string;
43
45
  }) => Promise<boolean>;
44
46
 
45
47
  /** Displays a text input dialog */
@@ -48,11 +50,20 @@ export interface UiApi {
48
50
  /** Prompt title */
49
51
  title: string;
50
52
 
51
- /** Prompt message */
52
- message: string;
53
+ /** Prompt description */
54
+ description: string;
55
+
56
+ /** Prompt label */
57
+ label?: string;
53
58
 
54
- /** Default input value */
59
+ /** Prompt default value */
55
60
  defaultValue?: string;
61
+
62
+ /** Prompt CTA label */
63
+ ctaLabel?: string;
64
+
65
+ /** Prompt CTA color */
66
+ ctaColor?: string;
56
67
  }) => Promise<string>;
57
68
 
58
69
  /** Creates a panel in the interface */
@@ -129,10 +140,10 @@ export interface TrackApi {
129
140
  arrayBuffer: any;
130
141
 
131
142
  /** The name of the track */
132
- name?: string;
143
+ name: string;
133
144
 
134
- /** Additional options for the track */
135
- options?: any;
145
+ /** The start position of the track in seconds */
146
+ startPositionSec: number;
136
147
  }) => Promise<any>;
137
148
 
138
149
  /** Updates a track */
@@ -153,6 +164,209 @@ export interface TrackApi {
153
164
  }
154
165
 
155
166
 
167
+ /** Group API for managing audio groups */
168
+ export interface GroupApi {
169
+
170
+ /** Creates a new group */
171
+ create: (params: {
172
+
173
+ /** The name of the group */
174
+ name: string;
175
+
176
+ /** The ID of the group */
177
+ id: string;
178
+
179
+ /** The type of the group */
180
+ type: string;
181
+
182
+ /** The order of the group */
183
+ order: number;
184
+
185
+ /** Whether the group is solo */
186
+ solo: boolean;
187
+
188
+ /** Whether the group is muted */
189
+ muted: boolean;
190
+
191
+ /** The pan of the group */
192
+ pan: number;
193
+
194
+ /** The volume of the group */
195
+ volume: number;
196
+
197
+ /** Additional options for the group */
198
+ options: any;
199
+ }) => Promise<any>;
200
+
201
+ /** Updates a group */
202
+ update: (params: {
203
+
204
+ /** The ID of the group to update */
205
+ groupId: string;
206
+
207
+ /** The name of the group */
208
+ name: string;
209
+
210
+ /** The type of the group */
211
+ type: string;
212
+
213
+ /** The order of the group */
214
+ order: number;
215
+
216
+ /** Whether the group is solo */
217
+ solo: boolean;
218
+
219
+ /** Whether the group is muted */
220
+ muted: boolean;
221
+
222
+ /** The pan of the group */
223
+ pan: number;
224
+
225
+ /** The volume of the group */
226
+ volume: number;
227
+ }) => Promise<any>;
228
+ }
229
+
230
+
231
+ /** Storage API for managing audio files */
232
+ export interface StorageApi {
233
+
234
+ /** Uploads a buffer to the storage */
235
+ upload: (params: {
236
+
237
+ /** The audio data to upload */
238
+ buffer: any;
239
+ }) => Promise<any>;
240
+
241
+ /** Downloads an audio file from the storage */
242
+ download: (params: {
243
+
244
+ /** The URL of the audio file to download */
245
+ url: string;
246
+ }) => Promise<any>;
247
+ }
248
+
249
+
250
+ /** Compute API for managing audio computations */
251
+ export interface ComputeApi {
252
+
253
+ /** Generates a session player */
254
+ sessionPlayerGenerate: (params: {
255
+
256
+ /** The context audio for the session player */
257
+ contextAudio: any;
258
+
259
+ /** The conditioning audio for the session player */
260
+ conditioningAudio: any;
261
+
262
+ /** The conditioning text for the session player */
263
+ conditioningText: string;
264
+
265
+ /** The number of steps for the session player */
266
+ steps: number;
267
+
268
+ /** The guidance scale for the session player */
269
+ guidanceScale: number;
270
+
271
+ /** The weight schedule for the session player */
272
+ weightSchedule: number;
273
+
274
+ /** The instrument for the session player */
275
+ instrument: string;
276
+
277
+ /** The preset ID for the session player */
278
+ presetId: string;
279
+
280
+ /** Whether to use chroma for the session player */
281
+ chroma: boolean;
282
+
283
+ /** The timestamps for the session player */
284
+ inpaintingTimestamps: any[];
285
+
286
+ /** The target for the session player */
287
+ inpaintingTarget: any[];
288
+ }) => Promise<void>;
289
+
290
+ /** Gets the list of session player presets */
291
+ sessionPlayerPresets: () => Promise<void>;
292
+
293
+ /** Inpaints an audio file */
294
+ sessionPlayerInpaint: (params: {
295
+
296
+ /** The input audio data */
297
+ input: any;
298
+
299
+ /** The mask for the inpainting */
300
+ mask: any;
301
+ }) => Promise<void>;
302
+
303
+ /** Runs a workflow */
304
+ workflow: (params: {
305
+
306
+ /** The ID of the workflow to run */
307
+ workflowId: string;
308
+
309
+ /** The parameters for the workflow TODO: add type */
310
+ params: any;
311
+ }) => Promise<void>;
312
+
313
+ /** Runs an automix job */
314
+ automix: (params: {
315
+
316
+ /** The ID of the workflow to run TODO: add type */
317
+ workflowId: string;
318
+
319
+ /** The parameters for the workflow TODO: add type */
320
+ params: any;
321
+ }) => Promise<void>;
322
+
323
+ /** Detects instruments in an audio file */
324
+ instruments: (params: {
325
+
326
+ /** The input audio data */
327
+ input: string;
328
+ }) => Promise<void>;
329
+
330
+ /** Detects chords in an audio file */
331
+ chords: (params: {
332
+
333
+ /** The input audio data */
334
+ input: string;
335
+ }) => Promise<void>;
336
+
337
+ /** Detects beats in an audio file */
338
+ beats: (params: {
339
+
340
+ /** The input audio data */
341
+ input: string;
342
+ }) => Promise<void>;
343
+
344
+ /** Detects sections in an audio file */
345
+ sections: (params: {
346
+
347
+ /** The input audio data */
348
+ input: string;
349
+ }) => Promise<void>;
350
+
351
+ /** Detects lyrics in an audio file */
352
+ lyrics: (params: {
353
+
354
+ /** The input audio data */
355
+ input: string;
356
+ }) => Promise<void>;
357
+
358
+ /** Extracts stems from an audio file */
359
+ stems: (params: {
360
+
361
+ /** The input audio data */
362
+ input: string;
363
+
364
+ /** The stems to extract */
365
+ stemsToExtract: any[];
366
+ }) => void;
367
+ }
368
+
369
+
156
370
  /** Registration methods for extensions */
157
371
  export interface RegisterApi {
158
372
 
@@ -171,6 +385,12 @@ export interface MoisesAPI {
171
385
  session: SessionApi;
172
386
  /** Track API for managing audio tracks */
173
387
  track: TrackApi;
388
+ /** Group API for managing audio groups */
389
+ group: GroupApi;
390
+ /** Storage API for managing audio files */
391
+ storage: StorageApi;
392
+ /** Compute API for managing audio computations */
393
+ compute: ComputeApi;
174
394
  /** Registration methods for extensions */
175
395
  register: RegisterApi;
176
396