@codexstar/pi-listen 1.0.8 → 1.0.10
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/extensions/voice.ts +21 -36
- package/package.json +1 -1
package/extensions/voice.ts
CHANGED
|
@@ -693,43 +693,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
693
693
|
config = loaded.config;
|
|
694
694
|
configSource = loaded.source;
|
|
695
695
|
updateSocketPath(config, currentCwd);
|
|
696
|
-
updateVoiceStatus();
|
|
697
|
-
setupHoldToTalk();
|
|
698
|
-
|
|
699
|
-
if (needsOnboarding(config, configSource) && startCtx.hasUI) {
|
|
700
|
-
const decision = await promptFirstRunOnboarding(startCtx);
|
|
701
|
-
if (decision.action === "start") {
|
|
702
|
-
const diagnostics = scanEnvironment(TRANSCRIBE_SCRIPT);
|
|
703
|
-
const result = await runVoiceOnboarding(startCtx, config, diagnostics);
|
|
704
|
-
if (result) {
|
|
705
|
-
await finalizeAndSaveSetup(startCtx, result.config, result.selectedScope, result.summaryLines, "first-run");
|
|
706
|
-
} else {
|
|
707
|
-
config = {
|
|
708
|
-
...config,
|
|
709
|
-
onboarding: {
|
|
710
|
-
...config.onboarding,
|
|
711
|
-
skippedAt: new Date().toISOString(),
|
|
712
|
-
},
|
|
713
|
-
};
|
|
714
|
-
saveConfig(config, config.scope, currentCwd);
|
|
715
|
-
startCtx.ui.notify("Voice setup skipped. Run /voice setup anytime.", "warning");
|
|
716
|
-
}
|
|
717
|
-
} else {
|
|
718
|
-
config = {
|
|
719
|
-
...config,
|
|
720
|
-
onboarding: {
|
|
721
|
-
...config.onboarding,
|
|
722
|
-
skippedAt: new Date().toISOString(),
|
|
723
|
-
},
|
|
724
|
-
};
|
|
725
|
-
saveConfig(config, config.scope, currentCwd);
|
|
726
|
-
startCtx.ui.notify("Voice setup skipped. Run /voice setup anytime.", "warning");
|
|
727
|
-
}
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
696
|
|
|
731
|
-
//
|
|
732
|
-
|
|
697
|
+
// No auto-popup on startup. Users run `/voice setup` to configure.
|
|
698
|
+
// Only activate voice features if setup has been completed previously.
|
|
699
|
+
if (config.enabled && config.onboarding.completed) {
|
|
700
|
+
updateVoiceStatus();
|
|
701
|
+
setupHoldToTalk();
|
|
733
702
|
ensureDaemon(config).catch(() => {});
|
|
734
703
|
}
|
|
735
704
|
});
|
|
@@ -1021,6 +990,22 @@ export default function (pi: ExtensionAPI) {
|
|
|
1021
990
|
},
|
|
1022
991
|
});
|
|
1023
992
|
|
|
993
|
+
// ─── Dedicated setup command (discoverable in /command list) ──────────────
|
|
994
|
+
|
|
995
|
+
pi.registerCommand("voice-setup", {
|
|
996
|
+
description: "Configure voice input — select backend, model, and language",
|
|
997
|
+
handler: async (_args, cmdCtx) => {
|
|
998
|
+
ctx = cmdCtx;
|
|
999
|
+
const diagnostics = scanEnvironment(TRANSCRIBE_SCRIPT);
|
|
1000
|
+
const result = await runVoiceOnboarding(cmdCtx, config, diagnostics);
|
|
1001
|
+
if (!result) {
|
|
1002
|
+
cmdCtx.ui.notify("Voice setup cancelled.", "warning");
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
await finalizeAndSaveSetup(cmdCtx, result.config, result.selectedScope, result.summaryLines, "setup-command");
|
|
1006
|
+
},
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1024
1009
|
pi.registerCommand("btw:new", {
|
|
1025
1010
|
description: "Start a fresh BTW thread",
|
|
1026
1011
|
handler: async (args, cmdCtx) => {
|