vocnu 0.9.1 → 0.9.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vocnu",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Vocnu from your terminal and your AI assistant: AI voice-over and subtitles for your videos (CLI and MCP server).",
5
5
  "type": "module",
6
6
  "bin": {
package/src/hours.js CHANGED
@@ -199,12 +199,14 @@ export function balanceLines(report, grade, mode = 'subtitles') {
199
199
  return lines
200
200
  }
201
201
 
202
- // A balance in one grade as an assistant hears it, subtitles alone first where they have a time (backend ADR 0129, as
203
- // Vocnu's own MCP server says it): "8 h of subtitles or 6 h of voice-over".
204
- export function gradeBalance(credits, grade, times) {
205
- const voice = `${duration(minutesOf(credits, times.voice[grade], 'down'))} of voice-over`
202
+ // A balance in one grade as an assistant hears it, in the time of what the person makes (backend ADR 0129, as Vocnu's
203
+ // own MCP server and the app's header say it): "8 h of subtitles" until they choose a voice-over, then "6 h of
204
+ // voice-over"; a voice-over's where subtitles alone have no time in the grade.
205
+ export function gradeBalance(credits, grade, times, mode = 'subtitles') {
206
206
  const seconds = times.subtitles[grade]
207
- return seconds ? `${duration(minutesOf(credits, seconds, 'down'))} of subtitles or ${voice}` : voice
207
+ return mode !== 'voice' && seconds
208
+ ? `${duration(minutesOf(credits, seconds, 'down'))} of subtitles`
209
+ : `${duration(minutesOf(credits, times.voice[grade], 'down'))} of voice-over`
208
210
  }
209
211
 
210
212
  // The balance as one time for a sentence, in the grade and mode of the person (login) or of a job: "6 h 40 min of
package/src/mcp.js CHANGED
@@ -101,8 +101,9 @@ export function createServer(api, { cwd = process.cwd() } = {}) {
101
101
  + 'unless they chose Premium), and price_time_by_grade in each grade offered. Each output is told in the time '
102
102
  + 'of what it makes in its grade: subtitles alone in subtitles ("12 min of Standard subtitles"), the others in '
103
103
  + 'voice-over ("24 min of Standard voice-over"); sdh_extra is what SDH adds to a voice-over, '
104
- + 'sdh_extra_with_subtitles to subtitles alone. balance_time: the time left in each grade, of subtitles alone '
105
- + 'and of voice-over. Subtitles alone last longest, so offer them first. Standard: the time lasts several '
104
+ + 'sdh_extra_with_subtitles to subtitles alone. balance_time: the time left in each grade of what the user makes, '
105
+ + 'as Vocnu shows it: subtitles alone ("8 h of subtitles") unless they chose a voice-over in Vocnu ("6 h of '
106
+ + 'voice-over"). Subtitles alone last longest, so offer them first. Standard: the time lasts several '
106
107
  + 'times as long as in Premium, a quick translation, read by a plain synthetic voice in a voice-over; Premium: '
107
108
  + 'natural voices and a careful translation. '
108
109
  + 'price_credits, price_credits_by_grade (with each grade\'s '
@@ -153,12 +154,14 @@ export function createServer(api, { cwd = process.cwd() } = {}) {
153
154
  // one a job takes without a grade.
154
155
  const quoted = Object.keys(source.quote.grades ?? { premium: true })
155
156
  const offered = GRADES.filter((grade) => quoted.includes(grade))
156
- const preferred = await preferredGrade(api, catalog)
157
+ const preferences = await preferencesOf(api)
158
+ const preferred = gradeFrom(preferences, catalog)
157
159
  const grade = offered.includes(preferred) ? preferred : 'premium'
160
+ const mode = modeFrom(preferences)
158
161
  return {
159
162
  balance,
160
163
  balance_time: typeof balance === 'number'
161
- ? Object.fromEntries(offered.map((name) => [name, gradeBalance(balance, name, times)]))
164
+ ? Object.fromEntries(offered.map((name) => [name, gradeBalance(balance, name, times, mode)]))
162
165
  : null,
163
166
  captions_only: source.captions_only === true,
164
167
  duration_seconds: source.duration_seconds,