@codexstar/pi-listen 1.0.16 → 1.0.17

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.
@@ -1091,15 +1091,9 @@ export default function (pi: ExtensionAPI) {
1091
1091
 
1092
1092
  // ── SPACE handling ──
1093
1093
  if (matchesKey(data, "space")) {
1094
- // RULE: If editor has content, SPACE always types a space never voice
1095
- const editorText = ctx?.hasUI ? ctx.ui.getEditorText() : "";
1096
- if (editorText && editorText.trim().length > 0) {
1097
- clearHoldTimer();
1098
- clearReleaseTimer();
1099
- spaceDownTime = null;
1100
- spaceConsumed = false;
1101
- return undefined; // let the default space character through
1102
- }
1094
+ // Check editor content hold-to-talk still works even with content,
1095
+ // but a quick tap types a space as normal
1096
+ const editorHasContent = !!(ctx?.hasUI && ctx.ui.getEditorText()?.trim().length);
1103
1097
 
1104
1098
  // ── Kitty key-release ──
1105
1099
  if (isKeyRelease(data)) {
@@ -1172,10 +1166,10 @@ export default function (pi: ExtensionAPI) {
1172
1166
  }
1173
1167
 
1174
1168
  // After threshold: activate voice recording
1169
+ // Works regardless of whether editor has content — hold always activates voice
1175
1170
  holdActivationTimer = setTimeout(() => {
1176
1171
  holdActivationTimer = null;
1177
- const currentText = ctx?.hasUI ? ctx.ui.getEditorText() : "";
1178
- if (voiceState === "idle" && spaceDownTime && !(currentText && currentText.trim().length > 0)) {
1172
+ if (voiceState === "idle" && spaceDownTime) {
1179
1173
  spaceConsumed = true;
1180
1174
  isHolding = true;
1181
1175
  startVoiceRecording("editor").then((ok) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexstar/pi-listen",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Voice input, first-run onboarding, and side-channel BTW conversations for Pi",
5
5
  "type": "module",
6
6
  "keywords": [