skillfree 0.1.29 → 0.1.38

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.
@@ -1,67 +0,0 @@
1
- const { run } = require('./run')
2
-
3
- /**
4
- * Text-to-speech command
5
- * @param {object} params - TTS parameters
6
- * @param {string} params.model - Model in "vendor/model" format
7
- * @param {string} params.text - Text to synthesize
8
- * @param {string} [params.voiceId] - Voice ID (provider-specific)
9
- * @param {string} params.output - Output audio file path
10
- * @returns {Promise<object>} TTS result
11
- */
12
- async function tts(params) {
13
- if (!params.text) {
14
- throw new Error('--text is required for TTS')
15
- }
16
- if (!params.output) {
17
- throw new Error('--output is required for TTS')
18
- }
19
-
20
- const inputs = {}
21
-
22
- // Provider-specific input mapping
23
- const [vendor] = params.model.split('/')
24
- if (vendor === 'elevenlabs') {
25
- // ElevenLabs uses 'text' and requires voice_id - default to "Rachel"
26
- inputs.text = params.text
27
- inputs.voice_id = params.voiceId || 'EXAVITQu4vr4xnSDxMaL'
28
- } else if (vendor === 'minimax') {
29
- // MiniMax uses 'text' and 'voice_setting' object
30
- inputs.text = params.text
31
- inputs.voice_setting = {
32
- voice_id: params.voiceId || 'male-qn-qingse',
33
- speed: 1.0,
34
- vol: 1.0,
35
- pitch: 0,
36
- }
37
- } else if (vendor === 'openai') {
38
- // OpenAI TTS uses 'input' and 'voice'
39
- inputs.input = params.text
40
- inputs.voice = params.voiceId || 'alloy'
41
- } else if (vendor === 'replicate') {
42
- // Replicate XTTS uses 'text' and requires 'speaker' (audio URL for voice cloning)
43
- inputs.text = params.text
44
- if (params.speaker) {
45
- inputs.speaker = params.speaker
46
- } else if (params.voiceId) {
47
- inputs.speaker = params.voiceId
48
- } else {
49
- // Default speaker sample
50
- inputs.speaker =
51
- 'https://replicate.delivery/pbxt/Jt79w0xsT64R1JsiJ0LQRL8UcWspg5J4RFrU6YwEKpOT1ukS/male.wav'
52
- }
53
- } else if (vendor === 'mm') {
54
- // MM TTS (qwen3-tts-flash) uses 'text' and optional 'voice'
55
- inputs.text = params.text
56
- if (params.voiceId) {
57
- inputs.voice = params.voiceId
58
- }
59
- } else {
60
- // Default: use 'text'
61
- inputs.text = params.text
62
- }
63
-
64
- return run({ model: params.model, inputs, output: params.output })
65
- }
66
-
67
- module.exports = { tts }