feat: improve background startup and launcher control

Detach --background launches from terminals with quieter runtime output, make wrapper/plugin overlay start explicit, and allow trailing commas in JSONC configs for safer hot-reload edits. Includes pending Anki/docs/backlog updates in this unreleased batch.
This commit is contained in:
2026-02-18 02:22:01 -08:00
parent 4703b995da
commit ebaed49f76
34 changed files with 515 additions and 48 deletions

View File

@@ -24,7 +24,6 @@ import {
resolvePathMaybe,
isUrlTarget,
uniqueNormalizedLangCodes,
parseBoolLike,
inferWhisperLanguage,
} from './util.js';
@@ -160,7 +159,6 @@ function getPluginConfigCandidates(): string[] {
export function readPluginRuntimeConfig(logLevel: LogLevel): PluginRuntimeConfig {
const runtimeConfig: PluginRuntimeConfig = {
autoStartOverlay: false,
socketPath: DEFAULT_SOCKET_PATH,
};
const candidates = getPluginConfigCandidates();
@@ -173,16 +171,6 @@ export function readPluginRuntimeConfig(logLevel: LogLevel): PluginRuntimeConfig
for (const line of lines) {
const trimmed = line.trim();
if (trimmed.length === 0 || trimmed.startsWith('#')) continue;
const autoStartMatch = trimmed.match(/^auto_start\s*=\s*(.+)$/i);
if (autoStartMatch) {
const value = (autoStartMatch[1] || '').split('#', 1)[0]?.trim() || '';
const parsed = parseBoolLike(value);
if (parsed !== null) {
runtimeConfig.autoStartOverlay = parsed;
}
continue;
}
const socketMatch = trimmed.match(/^socket_path\s*=\s*(.+)$/i);
if (socketMatch) {
const value = (socketMatch[1] || '').split('#', 1)[0]?.trim() || '';
@@ -192,7 +180,7 @@ export function readPluginRuntimeConfig(logLevel: LogLevel): PluginRuntimeConfig
log(
'debug',
logLevel,
`Using mpv plugin settings from ${configPath}: auto_start=${runtimeConfig.autoStartOverlay ? 'yes' : 'no'} socket_path=${runtimeConfig.socketPath}`,
`Using mpv plugin settings from ${configPath}: socket_path=${runtimeConfig.socketPath}`,
);
return runtimeConfig;
} catch {
@@ -204,7 +192,7 @@ export function readPluginRuntimeConfig(logLevel: LogLevel): PluginRuntimeConfig
log(
'debug',
logLevel,
`No mpv subminer.conf found; using launcher defaults (auto_start=no socket_path=${runtimeConfig.socketPath})`,
`No mpv subminer.conf found; using launcher defaults (socket_path=${runtimeConfig.socketPath})`,
);
return runtimeConfig;
}