voicci 1.0.7 → 1.0.8
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/package.json +1 -1
- package/scripts/postinstall.js +64 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voicci",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "AI-Powered Audiobook Generator for Claude Code, OpenCode & AI Code Editors. Convert books and PDFs to audiobooks using natural language.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "cli/index.js",
|
package/scripts/postinstall.js
CHANGED
|
@@ -9,10 +9,33 @@ import { execFileSync } from 'child_process';
|
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
const __dirname = path.dirname(__filename);
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
const
|
|
12
|
+
// Two skill files: simple and detailed
|
|
13
|
+
const SKILL_NAME_SIMPLE = 'voicci.md';
|
|
14
|
+
const SKILL_NAME_DETAILED = 'voicci-audiobook.md';
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const SKILL_CONTENT_SIMPLE = `---
|
|
17
|
+
description: "Voicci - AI audiobook generator"
|
|
18
|
+
argument-hint: "COMMAND_OR_FILE"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Voicci - AI Audiobook Generator
|
|
22
|
+
|
|
23
|
+
Convert books, PDFs, and documents to audiobooks using AI text-to-speech.
|
|
24
|
+
|
|
25
|
+
## Quick Examples
|
|
26
|
+
- \`/voicci "Lord of the Rings"\` - Search and convert book
|
|
27
|
+
- \`/voicci mybook.pdf\` - Convert local file
|
|
28
|
+
- \`/voicci -s\` - Check job status
|
|
29
|
+
- \`/voicci -l\` - List audiobooks
|
|
30
|
+
- \`/voicci --help\` - Show all options
|
|
31
|
+
|
|
32
|
+
\`\`\`!
|
|
33
|
+
#!/bin/bash
|
|
34
|
+
voicci $ARGUMENTS
|
|
35
|
+
\`\`\`
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const SKILL_CONTENT_DETAILED = `---
|
|
16
39
|
description: "Voicci - AI audiobook generator CLI"
|
|
17
40
|
argument-hint: "COMMAND_OR_FILE"
|
|
18
41
|
---
|
|
@@ -113,8 +136,7 @@ const EDITORS = {
|
|
|
113
136
|
return false;
|
|
114
137
|
}
|
|
115
138
|
},
|
|
116
|
-
skillsDir: () => path.join(os.homedir(), '.claude', 'skills')
|
|
117
|
-
skillName: SKILL_NAME
|
|
139
|
+
skillsDir: () => path.join(os.homedir(), '.claude', 'skills')
|
|
118
140
|
},
|
|
119
141
|
'OpenCode': {
|
|
120
142
|
name: 'OpenCode',
|
|
@@ -129,8 +151,7 @@ const EDITORS = {
|
|
|
129
151
|
return false;
|
|
130
152
|
}
|
|
131
153
|
},
|
|
132
|
-
skillsDir: () => path.join(os.homedir(), '.opencode', 'skills')
|
|
133
|
-
skillName: SKILL_NAME
|
|
154
|
+
skillsDir: () => path.join(os.homedir(), '.opencode', 'skills')
|
|
134
155
|
},
|
|
135
156
|
'Cursor': {
|
|
136
157
|
name: 'Cursor',
|
|
@@ -158,8 +179,7 @@ const EDITORS = {
|
|
|
158
179
|
if (fs.existsSync(parent)) return loc;
|
|
159
180
|
}
|
|
160
181
|
return locations[0]; // Default to first
|
|
161
|
-
}
|
|
162
|
-
skillName: SKILL_NAME
|
|
182
|
+
}
|
|
163
183
|
},
|
|
164
184
|
'Windsurf': {
|
|
165
185
|
name: 'Windsurf',
|
|
@@ -174,11 +194,26 @@ const EDITORS = {
|
|
|
174
194
|
return false;
|
|
175
195
|
}
|
|
176
196
|
},
|
|
177
|
-
skillsDir: () => path.join(os.homedir(), '.windsurf', 'skills')
|
|
178
|
-
skillName: SKILL_NAME
|
|
197
|
+
skillsDir: () => path.join(os.homedir(), '.windsurf', 'skills')
|
|
179
198
|
}
|
|
180
199
|
};
|
|
181
200
|
|
|
201
|
+
function installSkillFile(skillsDir, skillName, content) {
|
|
202
|
+
const skillFile = path.join(skillsDir, skillName);
|
|
203
|
+
|
|
204
|
+
// Check if already installed
|
|
205
|
+
if (fs.existsSync(skillFile)) {
|
|
206
|
+
const existingContent = fs.readFileSync(skillFile, 'utf8');
|
|
207
|
+
if (existingContent.includes('voicci $ARGUMENTS')) {
|
|
208
|
+
return 'exists';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Write the skill file
|
|
213
|
+
fs.writeFileSync(skillFile, content, 'utf8');
|
|
214
|
+
return 'new';
|
|
215
|
+
}
|
|
216
|
+
|
|
182
217
|
function detectAndInstall() {
|
|
183
218
|
const homeDir = os.homedir();
|
|
184
219
|
const installedEditors = [];
|
|
@@ -193,28 +228,27 @@ function detectAndInstall() {
|
|
|
193
228
|
console.log(`✓ Found ${editor.name}`);
|
|
194
229
|
|
|
195
230
|
const skillsDir = editor.skillsDir();
|
|
196
|
-
const skillFile = path.join(skillsDir, editor.skillName);
|
|
197
231
|
|
|
198
232
|
// Create skills directory if it doesn't exist
|
|
199
233
|
if (!fs.existsSync(skillsDir)) {
|
|
200
234
|
fs.mkdirSync(skillsDir, { recursive: true });
|
|
201
235
|
}
|
|
202
236
|
|
|
203
|
-
//
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
// Only skip if it's already our skill
|
|
207
|
-
if (existingContent.includes('voicci $ARGUMENTS')) {
|
|
208
|
-
console.log(` ↳ Skill already installed at: ${skillFile}`);
|
|
209
|
-
installedEditors.push({ name: editor.name, path: skillFile, status: 'exists' });
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
237
|
+
// Install both skills
|
|
238
|
+
const simpleStatus = installSkillFile(skillsDir, SKILL_NAME_SIMPLE, SKILL_CONTENT_SIMPLE);
|
|
239
|
+
const detailedStatus = installSkillFile(skillsDir, SKILL_NAME_DETAILED, SKILL_CONTENT_DETAILED);
|
|
213
240
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
241
|
+
const simpleFile = path.join(skillsDir, SKILL_NAME_SIMPLE);
|
|
242
|
+
const detailedFile = path.join(skillsDir, SKILL_NAME_DETAILED);
|
|
243
|
+
|
|
244
|
+
if (simpleStatus === 'exists' && detailedStatus === 'exists') {
|
|
245
|
+
console.log(` ↳ Skills already installed`);
|
|
246
|
+
installedEditors.push({ name: editor.name, status: 'exists' });
|
|
247
|
+
} else {
|
|
248
|
+
if (simpleStatus === 'new') console.log(` ↳ Installed: ${simpleFile}`);
|
|
249
|
+
if (detailedStatus === 'new') console.log(` ↳ Installed: ${detailedFile}`);
|
|
250
|
+
installedEditors.push({ name: editor.name, status: 'new' });
|
|
251
|
+
}
|
|
218
252
|
}
|
|
219
253
|
} catch (error) {
|
|
220
254
|
failedEditors.push({ name: editor.name, error: error.message });
|
|
@@ -227,7 +261,7 @@ function detectAndInstall() {
|
|
|
227
261
|
if (installedEditors.length > 0) {
|
|
228
262
|
console.log('\n✅ Voicci CLI installed successfully!');
|
|
229
263
|
console.log('\n📦 Command-line tool: voicci');
|
|
230
|
-
console.log('🔧 Skill
|
|
264
|
+
console.log('🔧 Skill commands: /voicci OR /voicci-audiobook');
|
|
231
265
|
console.log('\n📍 Installed in:');
|
|
232
266
|
installedEditors.forEach(editor => {
|
|
233
267
|
const status = editor.status === 'new' ? '(new)' : '(already installed)';
|
|
@@ -236,8 +270,9 @@ function detectAndInstall() {
|
|
|
236
270
|
|
|
237
271
|
console.log('\n💡 Usage:');
|
|
238
272
|
console.log(' 1. Restart your AI code editor');
|
|
239
|
-
console.log(' 2. Use: /voicci
|
|
240
|
-
console.log(' 3. Or
|
|
273
|
+
console.log(' 2. Use: /voicci "search query" (simple)');
|
|
274
|
+
console.log(' 3. Or: /voicci-audiobook "search query" (detailed docs)');
|
|
275
|
+
console.log(' 4. Or CLI: voicci "your search query"');
|
|
241
276
|
} else {
|
|
242
277
|
console.log('\n⚠️ No supported AI code editors detected');
|
|
243
278
|
console.log('\nSupported editors: Claude Code, OpenCode, Cursor, Windsurf');
|