vidgen 0.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.
Files changed (61) hide show
  1. package/README.md +781 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/db/init.d.ts +6 -0
  7. package/dist/commands/db/init.js +18 -0
  8. package/dist/commands/generate/stt.d.ts +13 -0
  9. package/dist/commands/generate/stt.js +73 -0
  10. package/dist/commands/generate/tts.d.ts +11 -0
  11. package/dist/commands/generate/tts.js +30 -0
  12. package/dist/commands/index/chunk.d.ts +11 -0
  13. package/dist/commands/index/chunk.js +55 -0
  14. package/dist/commands/index/describe.d.ts +11 -0
  15. package/dist/commands/index/describe.js +29 -0
  16. package/dist/commands/index/embed.d.ts +11 -0
  17. package/dist/commands/index/embed.js +29 -0
  18. package/dist/commands/index/save.d.ts +10 -0
  19. package/dist/commands/index/save.js +24 -0
  20. package/dist/commands/project/create.d.ts +11 -0
  21. package/dist/commands/project/create.js +63 -0
  22. package/dist/commands/project/delete.d.ts +9 -0
  23. package/dist/commands/project/delete.js +31 -0
  24. package/dist/commands/project/get.d.ts +9 -0
  25. package/dist/commands/project/get.js +39 -0
  26. package/dist/commands/project/list.d.ts +6 -0
  27. package/dist/commands/project/list.js +26 -0
  28. package/dist/commands/project/validate.d.ts +10 -0
  29. package/dist/commands/project/validate.js +29 -0
  30. package/dist/commands/search/asset.d.ts +12 -0
  31. package/dist/commands/search/asset.js +35 -0
  32. package/dist/commands/segment/add.d.ts +11 -0
  33. package/dist/commands/segment/add.js +49 -0
  34. package/dist/commands/segment/delete.d.ts +9 -0
  35. package/dist/commands/segment/delete.js +29 -0
  36. package/dist/commands/segment/list.d.ts +9 -0
  37. package/dist/commands/segment/list.js +33 -0
  38. package/dist/commands/segment/update.d.ts +13 -0
  39. package/dist/commands/segment/update.js +50 -0
  40. package/dist/commands/video/caption.d.ts +12 -0
  41. package/dist/commands/video/caption.js +43 -0
  42. package/dist/commands/video/trim.d.ts +13 -0
  43. package/dist/commands/video/trim.js +52 -0
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +1 -0
  46. package/dist/lib/db.d.ts +7 -0
  47. package/dist/lib/db.js +39 -0
  48. package/dist/lib/stt/deepgram-to-combo.d.ts +2 -0
  49. package/dist/lib/stt/deepgram-to-combo.js +49 -0
  50. package/dist/lib/stt/deepgram.d.ts +18 -0
  51. package/dist/lib/stt/deepgram.js +71 -0
  52. package/dist/lib/stt/detect-language.d.ts +2 -0
  53. package/dist/lib/stt/detect-language.js +31 -0
  54. package/dist/lib/stt/index.d.ts +50 -0
  55. package/dist/lib/stt/index.js +50 -0
  56. package/dist/lib/stt/types.d.ts +65 -0
  57. package/dist/lib/stt/types.js +1 -0
  58. package/dist/lib/types.d.ts +131 -0
  59. package/dist/lib/types.js +1 -0
  60. package/oclif.manifest.json +874 -0
  61. package/package.json +79 -0
@@ -0,0 +1,50 @@
1
+ import { createClient } from '@deepgram/sdk';
2
+ import { deepgramToCombo } from './deepgram-to-combo.js';
3
+ /**
4
+ * Transcribe audio from a URL using Deepgram
5
+ *
6
+ * @param options - Transcription options
7
+ * @returns Parsed transcription result in Combo format
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const result = await transcribe({
12
+ * url: "https://example.com/audio.mp3",
13
+ * language: "en"
14
+ * });
15
+ * ```
16
+ */
17
+ export async function transcribe(options) {
18
+ const { url, apiKey = process.env.DEEPGRAM_API_KEY, language, model = 'nova-3', smartFormat = true, paragraphs = true } = options;
19
+ if (!url) {
20
+ throw new Error('Audio URL is required');
21
+ }
22
+ if (!apiKey) {
23
+ throw new Error('Deepgram API key is required');
24
+ }
25
+ // Create Deepgram client
26
+ const deepgram = createClient(apiKey);
27
+ // Build Deepgram options
28
+ const deepgramOptions = {
29
+ model,
30
+ smart_format: smartFormat,
31
+ paragraphs,
32
+ detect_language: true,
33
+ };
34
+ // Add language if provided
35
+ if (language && language !== 'auto') {
36
+ deepgramOptions.language = language;
37
+ }
38
+ // Transcribe audio
39
+ const { result, error } = await deepgram.listen.prerecorded.transcribeUrl({ url }, deepgramOptions);
40
+ if (error) {
41
+ throw new Error(error.message || 'Failed to transcribe audio');
42
+ }
43
+ // Convert Deepgram result to Combo format
44
+ const parsed = await deepgramToCombo(result);
45
+ return parsed;
46
+ }
47
+ // Export types
48
+ export * from './types.js';
49
+ export { deepgramToCombo } from './deepgram-to-combo.js';
50
+ export { detectLanguage } from './detect-language.js';
@@ -0,0 +1,65 @@
1
+ export type Transcript = {
2
+ id?: string;
3
+ userId: string;
4
+ sourceUrl: string;
5
+ originalLanguage: string;
6
+ targetLanguage: string;
7
+ originalTranscript: any;
8
+ translatedTranscript: any;
9
+ status: 'pending' | 'completed' | 'failed';
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ };
13
+ export interface TranscriptObject {
14
+ id: string;
15
+ sourceUrl: string;
16
+ duration: number;
17
+ results: {
18
+ main: {
19
+ language: LanguageDetectionResultsEntry;
20
+ text: string;
21
+ words: Word[];
22
+ paragraphs: Paragraph[];
23
+ };
24
+ translation?: {
25
+ language: LanguageDetectionResultsEntry;
26
+ text: string;
27
+ words: Word[];
28
+ paragraphs: Paragraph[];
29
+ };
30
+ };
31
+ createdAt: Date;
32
+ }
33
+ export interface Word {
34
+ word: string;
35
+ start: number;
36
+ end: number;
37
+ confidence: number;
38
+ }
39
+ export type LanguageDetectionResults = LanguageDetectionResultsEntry[];
40
+ export interface LanguageDetectionResultsEntry {
41
+ language: string;
42
+ languageName: string;
43
+ confidence?: number;
44
+ }
45
+ export interface Sentence {
46
+ text: string;
47
+ start: number;
48
+ end: number;
49
+ }
50
+ export interface Paragraph {
51
+ sentences: Sentence[];
52
+ numWords: number;
53
+ start: number;
54
+ end: number;
55
+ }
56
+ interface WordSegment {
57
+ word: string;
58
+ start_time: number;
59
+ end_time: number;
60
+ }
61
+ export interface OpenAITranscription {
62
+ transcript: WordSegment[];
63
+ duration: number;
64
+ }
65
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,131 @@
1
+ export interface VoiceConfig {
2
+ id?: string;
3
+ name?: string;
4
+ speed?: number;
5
+ url?: string;
6
+ }
7
+ export interface VisualsConfig {
8
+ type: string;
9
+ style: string;
10
+ }
11
+ export interface MusicConfig {
12
+ id: string;
13
+ url: string;
14
+ }
15
+ export interface CaptionsConfig {
16
+ id: string;
17
+ name: string;
18
+ position: 'top' | 'middle' | 'bottom';
19
+ size: 'small' | 'medium' | 'large';
20
+ }
21
+ export interface Clip {
22
+ id: string;
23
+ refId?: string;
24
+ type: string;
25
+ src?: string[];
26
+ url?: string;
27
+ previewSrc?: string;
28
+ duration?: number;
29
+ display?: {
30
+ from: number;
31
+ to: number;
32
+ };
33
+ trim?: {
34
+ from: number;
35
+ to: number;
36
+ };
37
+ active?: boolean;
38
+ prompt?: string;
39
+ status?: 'generating' | 'completed' | 'failed';
40
+ taskId?: string;
41
+ error?: string;
42
+ createdAt?: number;
43
+ isVisualOnly?: boolean;
44
+ isCloned?: boolean;
45
+ }
46
+ export interface TextToSpeech {
47
+ refId: string;
48
+ src: string;
49
+ duration: number;
50
+ }
51
+ export interface VisualShot {
52
+ id?: string;
53
+ type: 'product' | 'generic' | 'lifestyle' | 'medical_cgi' | 'metaphor' | 'b-roll';
54
+ category: string;
55
+ firstFrame: string;
56
+ videoPrompt: string;
57
+ scenePrompt: string;
58
+ words?: string;
59
+ segmentId?: string;
60
+ prompt?: string;
61
+ triggerWords?: string;
62
+ video?: string;
63
+ lastFrame?: string;
64
+ hasProductInteraction?: boolean;
65
+ productSizing?: string;
66
+ }
67
+ export interface VisualBroll {
68
+ time?: number;
69
+ url?: string;
70
+ duration?: number;
71
+ type: 'video' | 'image';
72
+ firstFrame?: string;
73
+ videoPrompt?: string;
74
+ scenePrompt?: string;
75
+ words?: string;
76
+ productSizing?: string;
77
+ }
78
+ export interface SpeechToText {
79
+ refId: string;
80
+ src: string;
81
+ }
82
+ export interface Segment {
83
+ id: string;
84
+ title: string;
85
+ text: string;
86
+ description: string;
87
+ searchQuery: string;
88
+ tags: string[];
89
+ shots?: VisualShot[];
90
+ bRolls?: VisualBroll[];
91
+ clips: Clip[];
92
+ duration: number;
93
+ assets?: Clip[];
94
+ textToSpeech?: TextToSpeech;
95
+ speechToText?: SpeechToText;
96
+ mergeWithNext?: boolean;
97
+ estimatedDuration?: number;
98
+ isContinuation?: boolean;
99
+ }
100
+ export interface Schema {
101
+ id?: string;
102
+ title?: string;
103
+ description?: string;
104
+ tags?: string[];
105
+ segments?: Segment[];
106
+ voice: VoiceConfig;
107
+ visuals: VisualsConfig;
108
+ music?: MusicConfig;
109
+ caption: CaptionsConfig;
110
+ aspectRatio: '1:1' | '16:9' | '9:16' | '11';
111
+ product?: {
112
+ name?: string;
113
+ description?: string;
114
+ };
115
+ assets?: {
116
+ id: string;
117
+ name: string;
118
+ url: string;
119
+ type: 'image' | 'video';
120
+ }[];
121
+ avatar?: {
122
+ id: string;
123
+ name: string;
124
+ url: string;
125
+ };
126
+ type?: 'narrative-video' | 'product-video-ad' | 'ugc-video-ad' | string;
127
+ script?: string;
128
+ pacing?: 'fast' | 'slow' | 'regular' | 'dynamic' | 'relaxed';
129
+ quality?: 'regular' | 'high';
130
+ duration?: number;
131
+ }
@@ -0,0 +1 @@
1
+ export {};