gentle-pi 4.3.0 → 4.5.0

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.
Files changed (218) hide show
  1. package/README.md +10 -7
  2. package/assets/agents/gentle-ai-worker.md +1 -1
  3. package/assets/design-canvas/canvas.css +648 -0
  4. package/assets/design-canvas/canvas.js +1497 -0
  5. package/assets/design-canvas/index.html +88 -0
  6. package/assets/design-canvas/inspector.js +290 -0
  7. package/assets/orchestrator-delegation-reference.md +2 -2
  8. package/assets/orchestrator-verification.md +1 -1
  9. package/assets/orchestrator.md +2 -2
  10. package/bin/engram-guard +1 -1
  11. package/bin/gentle-shell.mjs +138 -155
  12. package/docs/bundled-install.md +47 -42
  13. package/docs/delegated-verification.md +6 -0
  14. package/docs/gentle-agents-activity.md +5 -1
  15. package/docs/gentle-music.md +82 -0
  16. package/docs/gentle-shell.md +80 -10
  17. package/docs/install-wizard.md +30 -6
  18. package/docs/permission-modes.md +7 -2
  19. package/docs/readme-reference.md +72 -55
  20. package/docs/session-profile-format.md +26 -0
  21. package/docs/voice.md +259 -0
  22. package/docs/yolo-mode.md +17 -2
  23. package/extensions/ask-user-choice.ts +4 -1
  24. package/extensions/gentle-agents.ts +187 -40
  25. package/extensions/gentle-ai.ts +1765 -1185
  26. package/extensions/gentle-design.ts +158 -0
  27. package/extensions/gentle-music.ts +354 -0
  28. package/extensions/gentle-shell.ts +418 -79
  29. package/extensions/gentle-voice.ts +11 -0
  30. package/extensions/session-scratch.ts +41 -22
  31. package/extensions/skill-registry.ts +63 -8
  32. package/lib/agent-profiles.ts +26 -0
  33. package/lib/agents-config.ts +35 -0
  34. package/lib/agents-protocol.ts +57 -1
  35. package/lib/agents-runner.ts +52 -3
  36. package/lib/agents-session-transport.ts +101 -6
  37. package/lib/agents-widget.ts +14 -1
  38. package/lib/auto-permission-memory.ts +48 -18
  39. package/lib/auto-permission-runtime.ts +21 -6
  40. package/lib/clipboard-image.ts +147 -0
  41. package/lib/command-palette-catalog.ts +3 -2
  42. package/lib/commit-slice-signal.ts +1 -1
  43. package/lib/context-backstop.ts +36 -0
  44. package/lib/design-canvas-server.ts +947 -0
  45. package/lib/design-comments.ts +437 -0
  46. package/lib/design-handoffs.ts +313 -0
  47. package/lib/design-open-browser.ts +58 -0
  48. package/lib/design-sources.ts +120 -0
  49. package/lib/external-editor.ts +31 -0
  50. package/lib/gentle-design.ts +513 -0
  51. package/lib/gentle-shell-bundled.ts +141 -57
  52. package/lib/gentle-shell-launcher.ts +11 -4
  53. package/lib/gentle-shell-startup-update.ts +61 -9
  54. package/lib/gentle-shell-uninstall.ts +33 -1
  55. package/lib/image-attachments.ts +150 -0
  56. package/lib/inprocess-reviewer.ts +33 -2
  57. package/lib/jobs-sidebar-state.ts +22 -3
  58. package/lib/jobs-widget.ts +112 -0
  59. package/lib/nan-provider.ts +3 -0
  60. package/lib/native-review-cli.ts +11 -4
  61. package/lib/notification-audio-native.ts +149 -13
  62. package/lib/notification-audio.ts +4 -0
  63. package/lib/notification-pulse-worker.ts +82 -18
  64. package/lib/notification-service.ts +5 -1
  65. package/lib/orchestrator-presence.ts +78 -8
  66. package/lib/orchestrator-scope.ts +10 -0
  67. package/lib/orchestrator-state.ts +11 -3
  68. package/lib/permission-mode-policy.ts +2 -2
  69. package/lib/review-host-relay.ts +11 -2
  70. package/lib/review-reminder-receipt.ts +24 -1
  71. package/lib/session-profile-append-controller.ts +713 -0
  72. package/lib/session-profile-disk-reader.ts +182 -0
  73. package/lib/session-profile-freeze.ts +2 -2
  74. package/lib/session-profile-persistence.ts +15 -7
  75. package/lib/session-scratch.ts +52 -3
  76. package/lib/session-worktree-registry.ts +7 -0
  77. package/lib/shell-bar.ts +6 -7
  78. package/lib/shell-changes.ts +81 -5
  79. package/lib/shell-prompt.ts +4 -4
  80. package/lib/shell-sidebar-layout.ts +27 -7
  81. package/lib/shell-todo.ts +1 -1
  82. package/lib/verifier-admission.ts +5 -4
  83. package/lib/vim-editor-adapter.ts +14 -10
  84. package/lib/voice-artifacts.ts +188 -0
  85. package/lib/voice-command.ts +576 -0
  86. package/lib/voice-install.ts +455 -0
  87. package/lib/voice-platform.ts +99 -0
  88. package/lib/voice-push-to-talk.ts +262 -0
  89. package/lib/voice-session.ts +460 -0
  90. package/lib/voice-settings.ts +50 -0
  91. package/lib/voice-ui.ts +158 -0
  92. package/lib/yolo-session-policy.ts +58 -22
  93. package/package.json +1 -1
  94. package/runtime/gentle-shell-bundled.mjs +140 -56
  95. package/runtime/gentle-shell-launcher.mjs +11 -4
  96. package/runtime/gentle-shell-startup-update.mjs +61 -9
  97. package/runtime/gentle-shell-uninstall.mjs +33 -1
  98. package/runtime/native-review-cli.mjs +11 -4
  99. package/scripts/bundled-engram-migration.mjs +0 -6
  100. package/scripts/bundled-install.mjs +209 -13
  101. package/scripts/gentle-ai-installer.mjs +10 -10
  102. package/scripts/installer-downloads.mjs +31 -7
  103. package/scripts/installer-preflight.mjs +6 -4
  104. package/scripts/installer-windows.mjs +37 -7
  105. package/scripts/main-channel.mjs +91 -17
  106. package/scripts/pi-update.mjs +37 -7
  107. package/scripts/verify-package-files.mjs +26 -2
  108. package/scripts/voice-worker.cjs +476 -0
  109. package/skills/design/SKILL.md +110 -0
  110. package/tests/agent-profiles.test.ts +24 -0
  111. package/tests/agents-config.test.ts +61 -0
  112. package/tests/agents-fake-child.ts +8 -1
  113. package/tests/agents-protocol.test.ts +32 -0
  114. package/tests/agents-runner.test.ts +226 -5
  115. package/tests/agents-session-transport.test.ts +53 -3
  116. package/tests/ask-user-choice.test.ts +30 -0
  117. package/tests/auto-mode.test.ts +17 -0
  118. package/tests/auto-permission-memory-diagnostics.test.ts +56 -0
  119. package/tests/auto-permission-runtime.test.ts +85 -1
  120. package/tests/autonomous-guard.test.ts +20 -0
  121. package/tests/bundled-install.test.ts +276 -5
  122. package/tests/clipboard-image.test.ts +114 -0
  123. package/tests/command-palette.test.ts +4 -4
  124. package/tests/context-backstop.test.ts +70 -4
  125. package/tests/delegate-for-reason-contract.test.ts +2 -1
  126. package/tests/design-canvas-assets.test.ts +710 -0
  127. package/tests/design-canvas-server.test.ts +1096 -0
  128. package/tests/design-comments.test.ts +201 -0
  129. package/tests/design-handoffs.test.ts +282 -0
  130. package/tests/design-open-browser.test.ts +70 -0
  131. package/tests/design-sources.test.ts +132 -0
  132. package/tests/engram-safety.test.ts +132 -57
  133. package/tests/external-editor.test.ts +84 -0
  134. package/tests/fixtures/primary-session-prompt/gentleman.golden.md +3 -3
  135. package/tests/gentle-agents.test.ts +369 -24
  136. package/tests/gentle-ai-binary.test.ts +1 -1
  137. package/tests/gentle-ai-installer.test.ts +51 -51
  138. package/tests/gentle-ai.test.ts +928 -448
  139. package/tests/gentle-design.test.ts +1313 -0
  140. package/tests/gentle-music.test.ts +452 -0
  141. package/tests/gentle-shell-bundled.test.ts +321 -248
  142. package/tests/gentle-shell-launcher.test.ts +29 -2
  143. package/tests/gentle-shell-startup-update.test.ts +77 -1
  144. package/tests/gentle-shell-uninstall.test.ts +59 -0
  145. package/tests/gentle-shell.test.ts +227 -27
  146. package/tests/gentle-todo.test.ts +11 -0
  147. package/tests/image-attachments.test.ts +119 -0
  148. package/tests/image-paste-chips.test.ts +236 -0
  149. package/tests/inprocess-reviewer.test.ts +55 -2
  150. package/tests/installer-bundles.test.ts +12 -6
  151. package/tests/installer-downloads.test.ts +32 -0
  152. package/tests/installer-posix-bootstrap.test.ts +8 -8
  153. package/tests/installer-preflight.test.ts +16 -0
  154. package/tests/installer-server.test.ts +2 -2
  155. package/tests/installer-windows-bootstrap.test.ts +61 -3
  156. package/tests/installer-windows-diagnostics.test.ts +111 -0
  157. package/tests/jobs-widget.test.ts +138 -0
  158. package/tests/main-channel-upgrade.test.ts +232 -2
  159. package/tests/main-channel.test.ts +140 -21
  160. package/tests/model-profiles-preservation.test.ts +2 -2
  161. package/tests/nan-provider.test.ts +36 -0
  162. package/tests/native-review-capability-contract.test.ts +11 -4
  163. package/tests/native-review-parity.test.ts +1 -1
  164. package/tests/notification-audio-native.test.ts +128 -9
  165. package/tests/notification-customize.test.ts +17 -5
  166. package/tests/odd-routing-canonical-ratchet.test.ts +2 -1
  167. package/tests/orchestrator-budget.test.ts +5 -2
  168. package/tests/orchestrator-presence.test.ts +100 -2
  169. package/tests/orchestrator-rdd-ownership.test.ts +2 -2
  170. package/tests/orchestrator-scope.test.ts +14 -0
  171. package/tests/orchestrator-state.test.ts +29 -0
  172. package/tests/package-files.test.ts +34 -0
  173. package/tests/package-manifest.test.ts +6 -6
  174. package/tests/permission-mode-policy.test.ts +10 -1
  175. package/tests/pi-update.test.ts +104 -4
  176. package/tests/rdd-aware-verification-contract.test.ts +1 -1
  177. package/tests/review-host-relay-routing.test.ts +88 -1
  178. package/tests/review-host-relay.test.ts +9 -2
  179. package/tests/review-json-arguments.test.ts +20 -3
  180. package/tests/review-loadout-rdd-off-sdk.test.ts +23 -2
  181. package/tests/review-relay-transport-agent.test.ts +26 -0
  182. package/tests/review-reminder-receipt.test.ts +31 -1
  183. package/tests/runtime-harness.mjs +188 -211
  184. package/tests/session-changes.test.ts +2 -1
  185. package/tests/session-profile-append-controller-fork.test.ts +458 -0
  186. package/tests/session-profile-append-controller-pi.test.ts +290 -0
  187. package/tests/session-profile-append-controller.test.ts +731 -0
  188. package/tests/session-profile-disk-reader-pi.test.ts +183 -0
  189. package/tests/session-profile-disk-reader.test.ts +311 -0
  190. package/tests/session-profile-freeze.test.ts +6 -4
  191. package/tests/session-scratch.test.ts +68 -2
  192. package/tests/session-worktree-registry.test.ts +13 -1
  193. package/tests/shell-bar.test.ts +18 -6
  194. package/tests/shell-changes.test.ts +148 -1
  195. package/tests/shell-prompt.test.ts +3 -3
  196. package/tests/shell-render-cache.test.ts +134 -1
  197. package/tests/shell-sidebar-layout.test.ts +67 -0
  198. package/tests/short-check-routing-contract.test.ts +1 -1
  199. package/tests/skill-collision-prefixes.test.ts +3 -1
  200. package/tests/skill-registry-watcher.test.ts +17 -5
  201. package/tests/skill-registry.test.ts +47 -3
  202. package/tests/task-size-routing-contract.test.ts +1 -1
  203. package/tests/test-strength-contract.test.ts +1 -1
  204. package/tests/verifier-admission.test.ts +18 -1
  205. package/tests/vim-editor-adapter.test.ts +2 -2
  206. package/tests/voice-command.test.ts +773 -0
  207. package/tests/voice-install.test.ts +323 -0
  208. package/tests/voice-platform.test.ts +176 -0
  209. package/tests/voice-push-to-talk.test.ts +444 -0
  210. package/tests/voice-session.test.ts +434 -0
  211. package/tests/voice-settings.test.ts +49 -0
  212. package/tests/voice-ui.test.ts +97 -0
  213. package/tests/voice-worker.test.ts +445 -0
  214. package/tests/weak-model-economy-prompt.test.ts +32 -0
  215. package/tests/windows-hidden-processes.test.ts +25 -2
  216. package/tests/yolo-customize.test.ts +5 -1
  217. package/tests/yolo-mode.test.ts +1 -1
  218. package/tests/yolo-session-policy-capture.test.ts +104 -0
package/docs/voice.md ADDED
@@ -0,0 +1,259 @@
1
+ # Optional local voice dictation
2
+
3
+ Voice dictation is optional. It transcribes speech locally with NVIDIA Parakeet
4
+ through sherpa-onnx, with no API key and no cloud inference. Everything happens
5
+ from `/gentle:voice`; nothing described here runs at startup.
6
+
7
+ ## Quick path
8
+
9
+ 1. Run `/gentle:voice` and choose **Download voice dictation**. The
10
+ confirmation lists each component, its size, the destination directory,
11
+ the licenses and the platform limitations. Esc during the download cancels it.
12
+ 2. Run `/gentle:voice` again and choose **Start dictation**. Speak, then press
13
+ Enter to stop. Esc cancels at any point.
14
+ 3. The transcript is pasted into the editor draft at the cursor. It is never
15
+ sent automatically. Pi collapses pastes over 1,000 characters or 10 lines into
16
+ a `[paste #N …]` marker; the full text is retained and expanded when you submit.
17
+ Long transcripts are therefore not displayed as editable text in the draft.
18
+ 4. Or hold Space in the editor: push-to-talk is turned on by a successful
19
+ download. See [Push-to-talk](#push-to-talk-hold-space).
20
+
21
+ ## The command
22
+
23
+ | Topic | Behavior |
24
+ |-------|----------|
25
+ | Menu | Built-in select and confirm dialogs. **Show status and notices** reports the target, both components, limitations and licenses. **Disable push-to-talk (hold Space)** appears while it is on; **Enable push-to-talk (hold Space)** appears only when voice is installed. |
26
+ | Download | Only after the confirmation; runtime first, then the model. A cancelled download keeps components that already finished. |
27
+ | Dictation | A compact overlay shows preparing, recording, transcribing. Enter stops recording; the overlay stays until the transcript is ready. |
28
+ | Recording limit | After 2 minutes recording stops by itself, and the transcript is pasted without a key press. |
29
+ | Insertion | The recognized text goes through Pi's editor paste pipeline, which may collapse long text into a paste marker. A blank result pastes nothing. |
30
+ | One at a time | A second `/gentle:voice` while a download or dictation runs is refused with a notice. A Space hold during either one types spaces as usual. |
31
+ | Cancel and shutdown | Esc, reload or session shutdown aborts the download or cancels the session. A transcript that arrives afterwards is dropped. |
32
+ | Where it runs | Interactive TUI parent sessions only. RPC, print, JSON and delegated child sessions refuse it. No model-callable tool exists. |
33
+ | Errors | Fixed messages with the action to take, such as installing ALSA or the Visual C++ runtime. Gentle AI never runs those installers. |
34
+
35
+ The command is tested with fake dialogs, downloads and sessions only. No real
36
+ download, native load or microphone recording has been exercised through it.
37
+
38
+ ## Push-to-talk (hold Space)
39
+
40
+ Hold Space in the editor to record; release it to stop. The transcript is
41
+ pasted at the cursor and never sent. Esc cancels while recording or
42
+ transcribing. A one-line footer status shows preparing, recording and
43
+ transcribing; no overlay opens, so the editor keeps the focus.
44
+
45
+ | Topic | Behavior |
46
+ |-------|----------|
47
+ | Toggle | Stored as `voice-settings.json` (`gentle-pi.voice-settings/v1`) in the Gentle AI config home. A successful download turns it on; the `/gentle:voice` menu turns it off and on, effective immediately. A missing or malformed file means off. |
48
+ | When it is armed | Only with the toggle on, in an interactive TUI parent session. Delegated child sessions, RPC, print and JSON modes never arm it. Reload or shutdown disarms it and cancels a running dictation. |
49
+ | Startup | Reads the toggle file only. No voice files are checked, nothing is downloaded or loaded, and no worker starts. |
50
+ | First hold | Checks that the runtime and model are installed; the spaces keep typing meanwhile. If voice is not installed, a notice points to `/gentle:voice` and push-to-talk stays off for the session; the saved choice is kept. |
51
+ | One at a time | A hold while a download or dictation runs types spaces normally. |
52
+
53
+ ### How a hold is recognized
54
+
55
+ With Pi's keyboard mode, terminals report Space as plain text and never report
56
+ its release, so push-to-talk relies on the operating system's key auto-repeat.
57
+ Pi lets an extension drop or replace a key as it arrives, but not type one
58
+ later, so every space reaches the editor unchanged:
59
+
60
+ - **Typing:** a tap, several spaces, an indent or Space then a letter are
61
+ typed exactly as without push-to-talk, with no delay.
62
+ - **Hold:** auto-repeat has a long initial delay followed by short, regular
63
+ repeats; typing does not. A hold needs a first gap of 180 to 1000 ms (macOS
64
+ allows at least about 225 ms, X11 defaults to 660 ms), then three repeats
65
+ each at most 250 ms apart and regular (the slowest at most 1.6 times the
66
+ fastest), with the first gap at least 1.5 times the slowest repeat. Each
67
+ space must have added exactly one space to the draft. The following repeats
68
+ are turned into Backspace, through the editor's normal key path, until the
69
+ spaces the hold typed are removed; when the hold followed a word, one space
70
+ stays as the separator before the transcript. Later repeats are dropped.
71
+ While recording starts, those spaces can be seen briefly.
72
+ - **Release:** no repeat for 2.5 times the observed repeat interval, between
73
+ 150 and 400 ms. The decision waits until input already queued is handled, so
74
+ a repeat delayed by a busy moment is not taken for a release.
75
+ - **Guards:** only single-space input counts. Pastes, escape sequences and
76
+ multi-character input pass through and end the attempt. If the draft changes
77
+ in any other way, for example Vim NORMAL mode where Space only moves the
78
+ cursor, autocomplete, or another key, the hold is not confirmed, or erasing
79
+ stops, and nothing else is removed. Spaces that were in the draft before the
80
+ hold are never removed.
81
+
82
+ Limitations: the timing depends on the keyboard repeat settings. An initial
83
+ repeat delay under 180 ms or over 1000 ms, or a repeat interval over 250 ms,
84
+ prevents a hold from being recognized. Five or more spaces typed with a pause
85
+ and then a very even fast rhythm could still look like a hold. Whether a space
86
+ precedes the hold is judged as if typing at the end of the draft; in the
87
+ middle of existing spaces the separator may be missing. Esc pressed while
88
+ repeats are still arriving, and a release right as the hold is confirmed, can
89
+ leave a stray space. Recording starts once the hold is confirmed and the
90
+ microphone is open; the model is verified while you speak (see below). A hold
91
+ while a dialog or overlay has the focus does not change the draft and is
92
+ ignored. Push-to-talk is tested with fake terminals, editors and sessions
93
+ only.
94
+
95
+ ## What gets downloaded
96
+
97
+ All versions, sizes and digests are pinned in `lib/voice-artifacts.ts`.
98
+
99
+ | Component | Source | Size | Verified by |
100
+ |-----------|--------|------|-------------|
101
+ | `sherpa-onnx-node@1.13.8` | npm registry | 12 KB | `dist.integrity` (SHA-512) |
102
+ | `sherpa-onnx-<platform>-<arch>@1.13.8` | npm registry | 9–14 MB | `dist.integrity` (SHA-512) |
103
+ | `node-cpal@1.0.0` (microphone capture) | npm registry | 7.7 MB | `dist.integrity` (SHA-512) |
104
+ | Parakeet TDT 0.6B v3, int8 | Hugging Face, commit `2bda32ec70b0` | about 670 MB | per-file size and SHA-256 |
105
+
106
+ The model is the sherpa-onnx export
107
+ `csukuangfj/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8`: `encoder.int8.onnx`,
108
+ `decoder.int8.onnx`, `joiner.int8.onnx` and `tokens.txt`.
109
+
110
+ ## Where it is stored
111
+
112
+ Everything lives in `<Gentle AI config home>/voice` (by default
113
+ `~/.pi/gentle-ai/voice`; see `gentlePiConfigHome()`):
114
+
115
+ ```text
116
+ voice/
117
+ runtime/sherpa-onnx-1.13.8-node-cpal-1.0.0-<target>/node_modules/
118
+ sherpa-onnx-node/
119
+ sherpa-onnx-<platform>-<arch>/
120
+ node-cpal/
121
+ models/parakeet-tdt-0.6b-v3-int8-2bda32ec70b0/
122
+ ```
123
+
124
+ The platform package sits next to `sherpa-onnx-node` because its loader resolves
125
+ `../sherpa-onnx-<platform>-<arch>/sherpa-onnx.node`. node-cpal loads
126
+ `bin/<platform>-<arch>/index.node` from its own directory. The runtime directory
127
+ names both native versions, so a runtime installed with other pins is never
128
+ reported as the current one.
129
+
130
+ ## How an install stays safe
131
+
132
+ - **Explicit only.** Importing the voice modules performs no filesystem or
133
+ network access. Status checks never create the voice directory.
134
+ - **Streamed and bounded.** Each file is hashed while it streams to disk and is
135
+ cut off as soon as it exceeds its pinned size. A wrong length or digest fails
136
+ the install.
137
+ - **Pinned redirects.** npm tarballs are fetched without redirects. Hugging Face
138
+ redirects are followed only over HTTPS to the paths observed for this revision:
139
+ `huggingface.co/api/resolve-cache/...` and `us.aws.cdn.hf.co/xet-bridge-us/...`.
140
+ Any other host, including other CDN regions, is refused.
141
+ - **Cancellable and time-bounded.** An install can be aborted. It also stops
142
+ when no data arrives for 60 seconds, or when it runs past 20 minutes for the
143
+ runtime or 2 hours for the model.
144
+ - **Checked archives.** Every tarball is validated before anything is
145
+ extracted. Only regular files under `package/` are accepted, within the
146
+ registry's file count and unpacked size. Links, directories, traversal,
147
+ duplicates and Windows device names are refused. No package script runs, and
148
+ no downloaded code is loaded during installation.
149
+ - **Atomic publication.** Work happens in a private `.staging-*` directory. The
150
+ install marker is written last, and one rename publishes the component. A
151
+ failure or cancellation removes only that staging directory. An existing
152
+ installation is never partially overwritten: a valid one is kept as is, and an
153
+ invalid one is replaced only by a complete, verified copy.
154
+
155
+ ## Dictation session
156
+
157
+ `lib/voice-session.ts` records one dictation and returns its text. It never
158
+ submits the text or touches the editor; the caller decides what to do with it.
159
+
160
+ - **Separate process.** `start()` runs `scripts/voice-worker.cjs` with the same
161
+ Node executable, from the runtime directory, with no shell. Microphone
162
+ capture, the model load and the decode all happen in that process, so a
163
+ native crash or a long decode cannot freeze Gentle AI. Importing the module or
164
+ creating a session does nothing until `start()`.
165
+ - **Checked before loading.** `start()` first requires both components to be
166
+ reported installed. The worker then checks the files again before it loads
167
+ the native code that uses them: every entry in the runtime and model
168
+ directories must be a plain directory or regular file, owned by the current
169
+ user and not writable by everyone (ownership and modes are not checked on
170
+ Windows). Each required runtime file must be present, and each model file
171
+ must match its pinned size and SHA-256. The digests are recomputed on every
172
+ session, which reads the whole model (about 670 MB). Directories above the
173
+ voice home are not checked. These checks catch broken or swapped installs;
174
+ they cannot stop someone with the same user account from replacing the files,
175
+ which is the same as running code as that user.
176
+ - **Order.** So that the first words are recorded, the worker validates the
177
+ runtime files, loads node-cpal and opens the microphone, then reports
178
+ `recording` and verifies the model digests while recording, reading each
179
+ file in chunks so capture keeps running. sherpa-onnx and the model are loaded
180
+ only after every digest matched and recording stopped, because that load is
181
+ synchronous and would stall capture. A mismatch found while recording closes
182
+ the microphone at once and reports the model as invalid; one found after stop
183
+ is reported instead of a transcript. Cancel stops the verification and loads
184
+ nothing. The tradeoff: the recognizer load (about 0.85 seconds measured on an
185
+ Apple Silicon Mac) now happens after stop, so a transcript takes that much
186
+ longer to arrive, and any verification still running when you stop is
187
+ awaited too.
188
+ - **Lifecycle.** A session is used once: `start()` resolves when recording
189
+ begins, `stop()` resolves with `{ text, truncated }`, and `cancel()` (or
190
+ `dispose()`) discards everything, including a transcript that arrives late.
191
+ `start()` resolves while the worker keeps recording; `stop()`, `cancel()` and
192
+ a failed `start()` settle only after the worker has exited. A worker that does
193
+ not exit within 2 seconds of finishing or being cancelled is killed. If the parent
194
+ disappears, the worker sees its input close and stops capturing.
195
+ - **Bounds.** Recording stops by itself after 120 seconds, and the worker then
196
+ transcribes what it has (`truncated: true`). Starting (runtime checks and
197
+ opening the microphone) and transcribing (the rest of the model
198
+ verification, the model load and the decode) each have a 120-second limit. Audio is kept in memory
199
+ only up to the recording limit. All of these are options.
200
+ - **Audio.** The worker opens the default input device through node-cpal,
201
+ preferring 32-bit float samples and otherwise using the device's default
202
+ integer or float format. It mixes all channels down to mono and resamples to
203
+ 16 kHz in JavaScript (averaging when downsampling, linear interpolation when
204
+ upsampling). No SoX or FFmpeg is used. Less than 0.1 seconds of audio is
205
+ reported as empty, and a blank transcript as no speech.
206
+ - **Errors.** The worker reports a fixed code only, and the session turns it
207
+ into a fixed message. Native error text, file paths and environment values
208
+ are never included, and the worker's stderr is discarded.
209
+ - **Environment.** The worker gets only home, temp, locale and audio-session
210
+ variables (`HOME`, `USERPROFILE`, `SystemRoot`, `windir`, `TEMP`, `TMP`,
211
+ `TMPDIR`, `XDG_RUNTIME_DIR`, `PULSE_SERVER`, `PULSE_COOKIE`, `LANG`, `LC_ALL`,
212
+ `LC_CTYPE`). Credentials, `PATH`, `NODE_OPTIONS` and loader variables are
213
+ dropped.
214
+ - **Protocol.** JSON lines with schema `gentle.voice/v1`. The parent sends
215
+ `start` (with paths computed from the pinned manifests), then `stop` or
216
+ `cancel`. The worker answers `recording`, `transcribing`, and one final
217
+ `result` or `error`. Any other message, an unknown field, more than 16 lines
218
+ or a line over 64 KB stops the worker.
219
+
220
+ The session has been tested only with scripted fake workers and with the real
221
+ worker driving fake capture and recognizer modules. It has not loaded the real
222
+ native modules, opened a real microphone or transcribed real speech.
223
+
224
+ ## Platform support
225
+
226
+ All five targets get the pinned runtime and a `node-cpal@1.0.0` capture binary
227
+ built for their architecture (checked from the binary headers, not by loading).
228
+
229
+ | Target | Prerequisites (not checked before loading) |
230
+ |--------|--------------------------------------------|
231
+ | macOS arm64 | macOS 11 or newer |
232
+ | macOS x64 | macOS 10.12 or newer |
233
+ | Linux x64, glibc 2.34+ | ALSA `libasound.so.2` |
234
+ | Linux arm64, glibc 2.34+ | ALSA `libasound.so.2` |
235
+ | Windows x64 | Microsoft Visual C++ runtime (`vcruntime140.dll`) |
236
+
237
+ node-cpal requires Node 22 or newer, and a dictation session refuses to start
238
+ on an older Node. Gentle AI never downloads or installs the Visual C++ runtime;
239
+ a missing runtime is expected to surface as a runtime load failure, which has
240
+ not been observed on hardware. `/gentle:voice` then names the runtime to install.
241
+
242
+ None of these targets has been verified on real hardware yet: native loading,
243
+ library paths and microphone capture have not been executed. Linux with a glibc
244
+ older than 2.34 is unsupported and the diagnosis names the version found.
245
+ Windows ARM64 has no native sherpa-onnx package and is unsupported. musl Linux
246
+ is unsupported. WSL is reported as unproven.
247
+
248
+ ## Licenses and attribution
249
+
250
+ - **Model:** Parakeet TDT 0.6B v3 by NVIDIA, licensed under CC-BY-4.0. The int8
251
+ sherpa-onnx export is by csukuangfj. The export repository has no license file
252
+ of its own; its license is taken from the upstream NVIDIA model.
253
+ - **Runtime:** sherpa-onnx, Apache-2.0. The npm tarballs ship no LICENSE or
254
+ NOTICE file. The platform packages bundle onnxruntime (MIT) without its
255
+ license text.
256
+ - **Capture:** node-cpal 1.0.0, ISC. The tarball ships no LICENSE or NOTICE file. Its prebuilt
257
+ binaries link Rust crates whose notices are not included.
258
+
259
+ These gaps are unresolved and are listed in `VOICE_NOTICES`.
package/docs/yolo-mode.md CHANGED
@@ -9,12 +9,27 @@ Use `/gentle:yolo enable` in the interactive primary Pi TUI to stop repeated per
9
9
  | `/gentle:yolo enable` | Select YOLO for this live session and workspace/clone. |
10
10
  | `/gentle:yolo disable` | Select Normal immediately and clear the YOLO indicators; saved defaults stay unchanged. |
11
11
  | `/gentle:yolo status` | Show the current state without activating. |
12
- | `/gentle:yolo` | Open a menu titled **🚀 Gentle YOLO 🔥 — full speed, destructive actions still ask (current: ON\|OFF)** with `enable`, `disable` and `status`. Cancelling changes nothing. Without an interactive menu UI it behaves like `status`. |
12
+ | `/gentle:yolo` | Open a menu titled **🚀 Gentle YOLO 🔥 — standing permission (current: ON\|OFF)** with `enable`, `disable` and `status`. Cancelling changes nothing. Without an interactive menu UI it behaves like `status`. |
13
13
 
14
14
  Invalid arguments leave state unchanged.
15
15
 
16
16
  The Session command palette also includes YOLO. Interactive selection requires an eligible primary TUI, live session identity and identifiable workspace. Outside Git, the canonical workspace directory supplies identity. There is no model-callable activation tool. `/gentle:mode default yolo` optionally saves a trusted user-global default for new primary sessions; `/gentle:mode default normal` removes that elevated default. Neither command changes the current mode.
17
17
 
18
+ ## Super Yolo
19
+
20
+ **💥 Super Yolo removes every permission prompt; the only line left is private material.** Select it with `/gentle:mode super-yolo` or save it for new sessions with `/gentle:mode default super-yolo`.
21
+
22
+ While it is active:
23
+
24
+ - Every shell-guard confirmation is waived, data loss included: recursive `rm`, SQL drops, ordinary pushes, rebases, forced branch deletion, `npm publish` and configured guardrail `confirm`/`block` rules all run without dialogs. Code-level hard denies stay blocked (`git reset --hard`, forced clean, force push); see below.
25
+ - The Auto classifier does not run.
26
+ - The **sensitive-path guard stays hard-blocked**: `read`, `write` and `edit` of `.env` files, `.ssh`, keychains, `*.pem/*.key/*.p12/*.pfx`, `secrets/` directories and cloud credential files are refused in every mode, Super Yolo included.
27
+ - Code-level catastrophic denies remain: `rm -rf /`, `rm -rf ~`, `--no-preserve-root`, `git reset --hard`, forced clean and force push are blocked without a dialog.
28
+ - `ask_user` tools, provider consent, maintenance/recovery authorization and opaque-token decisions are never automatically answered.
29
+ - The `/gentle:yolo` toggle shows **ON** while Super Yolo is active and turning it off returns to Normal. Children never inherit Super Yolo; their bounded delegation and child guards are unchanged.
30
+
31
+ Super Yolo is deliberate maximum autonomy for a workspace you accept the consequences of. The shell recognition remains lexical, not a sandbox: unrecognized script forms, custom tools and prompt injection can still reach destructive effects, and OS-level isolation remains your real containment boundary.
32
+
18
33
  ## Configuration menu path
19
34
 
20
35
  1. Open `/gentle:customize` → **Editor**.
@@ -23,7 +38,7 @@ The Session command palette also includes YOLO. Interactive selection requires a
23
38
 
24
39
  Navigation, the read-only preview and Escape never grant permission. The preview reminds you that ordinary scoped commits/push/PR are covered, destructive confirmations remain, review consent is unchanged and reload resets the live grant. **UNAVAILABLE** means the live primary owner or eligible session/workspace cannot be used; selecting it cannot activate YOLO.
25
40
 
26
- The live YOLO toggle does not save preferences. The separate **Default permissions** rows can save Normal, Auto or YOLO in the dedicated user-global permission store, never a repository preference or visual profile. **Session permissions** selects the current mode without changing that default. Closing the menu removes its observers and cancels unfinished menu activation; it does not revoke an already completed activation. Reload or session replacement invalidates old menu callbacks and resets the live permission.
41
+ The live YOLO toggle does not save preferences. The separate **Default permissions** rows can save Normal, Auto, YOLO or Super Yolo in the dedicated user-global permission store, never a repository preference or visual profile. **Session permissions** selects the current mode without changing that default. Closing the menu removes its observers and cancels unfinished menu activation; it does not revoke an already completed activation. Reload or session replacement invalidates old menu callbacks and resets the live permission.
27
42
 
28
43
  ## What activation authorizes
29
44
 
@@ -326,7 +326,10 @@ export default function askUserChoice(pi: ExtensionAPI): void {
326
326
  if (details?.selection) {
327
327
  return new Text(theme.fg("success", `✓ ${details.selection.index}. ${details.selection.label}`), 0, 0);
328
328
  }
329
- if (details?.customResponse !== undefined) return new Text(theme.fg("success", "✓ Custom response"), 0, 0);
329
+ if (details?.customResponse !== undefined) {
330
+ const text = details.customResponse.trim();
331
+ return new Text(theme.fg("success", text ? `✓ Custom response — ${details.customResponse}` : "✓ Custom response"), 0, 0);
332
+ }
330
333
  return new Text(theme.fg("warning", "Cancelled"), 0, 0);
331
334
  },
332
335
  });