simplify speech bootstrap and clean daemon startup locking
This commit is contained in:
@@ -25,9 +25,6 @@ interface OnboardOptions extends DaemonStartOptions {
|
||||
}
|
||||
|
||||
type OnboardPersistedConfig = PersistedConfig & {
|
||||
providers?: PersistedConfig['providers'] & {
|
||||
local?: PersistedConfig['providers'] extends { local?: infer T } ? T : { autoDownload?: boolean }
|
||||
}
|
||||
features?: PersistedConfig['features'] & {
|
||||
dictation?: PersistedConfig['features'] extends { dictation?: infer T }
|
||||
? T & { enabled?: boolean }
|
||||
@@ -103,13 +100,6 @@ function savePersistedConfig(paseoHome: string, config: OnboardPersistedConfig):
|
||||
function applyVoiceSelection(config: OnboardPersistedConfig, enabled: boolean): OnboardPersistedConfig {
|
||||
return {
|
||||
...config,
|
||||
providers: {
|
||||
...config.providers,
|
||||
local: {
|
||||
...config.providers?.local,
|
||||
autoDownload: enabled,
|
||||
},
|
||||
},
|
||||
features: {
|
||||
...config.features,
|
||||
dictation: {
|
||||
@@ -366,7 +356,7 @@ export async function runOnboard(options: OnboardOptions): Promise<void> {
|
||||
const config = loadConfig(paseoHome, { cli: toCliOverrides(options) })
|
||||
|
||||
const voiceStatus = voiceEnabled
|
||||
? 'Voice features enabled. Local speech models will download in the background if missing.'
|
||||
? 'Voice features enabled. Local speech models will be downloaded automatically if missing.'
|
||||
: 'Voice features disabled. Local speech models will not be downloaded.'
|
||||
log.message(voiceStatus)
|
||||
|
||||
|
||||
@@ -46,14 +46,10 @@ try {
|
||||
dictation?: { enabled?: boolean }
|
||||
voiceMode?: { enabled?: boolean }
|
||||
}
|
||||
providers?: {
|
||||
local?: { autoDownload?: boolean }
|
||||
}
|
||||
}
|
||||
|
||||
assert.strictEqual(config.features?.dictation?.enabled, false, 'dictation.enabled should be false')
|
||||
assert.strictEqual(config.features?.voiceMode?.enabled, false, 'voiceMode.enabled should be false')
|
||||
assert.strictEqual(config.providers?.local?.autoDownload, false, 'local.autoDownload should be false')
|
||||
const daemonLog = await readFile(join(paseoHome, 'daemon.log'), 'utf-8')
|
||||
assert(
|
||||
!daemonLog.includes('Ensuring local speech models'),
|
||||
|
||||
Reference in New Issue
Block a user