From 2f5f640b71aa8da163049508505e45d9de209139 Mon Sep 17 00:00:00 2001 From: Lucas Proxmox Date: Thu, 8 Oct 2026 15:09:37 +0200 Subject: [PATCH] feat(voice): show the voice bar in the speaking session only (0.34.0, live 0.4.0) - progress.json carries sessionId (Claude Code's id) and, for replies, the session's spoken name. - Explanations look the session up from sessions/, recorded by the prompt hook (only when voice is set up or CLAUDE_PID makes it free). - devscope-live draws the bar and Stop only where $.session.id() matches; other windows show one dimmed line naming the session. No sessionId (older plugin): the bar shows everywhere, as before. Co-Authored-By: Claude Opus 5.5 (1M context) --- .claude-plugin/marketplace.json | 4 +- .claude-plugin/plugin.json | 2 +- CHANGELOG.md | 11 ++++++ CLAUDE.md | 5 ++- mods/devscope-live/.claude-plugin/plugin.json | 2 +- mods/devscope-live/CHANGELOG.md | 9 +++++ mods/devscope-live/hooks/register.tsx | 11 +++++- mods/devscope-live/hooks/voiceBar.ts | 14 +++++++ mods/devscope-live/tests/hooks.test.tsx | 22 +++++++++++ mods/devscope-live/tests/logic.test.ts | 19 ++++++++- mods/devscope-live/types/index.d.ts | 4 +- scripts/voice/cli.sh | 3 +- scripts/voice/lib.sh | 39 +++++++++++++++++-- scripts/voice/speak.sh | 9 +++-- tests/voice/run.sh | 25 ++++++++++++ 15 files changed, 163 insertions(+), 16 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 3e75670..d537eb5 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,7 +10,7 @@ { "name": "devscope", "description": "Real-time developer activity monitoring for Claude Code sessions", - "version": "0.33.0", + "version": "0.34.0", "author": { "name": "Lucas Dow", "email": "lucdow7@gmail.com" @@ -22,7 +22,7 @@ { "name": "devscope-live", "description": "DevScope in the live session: team prompt suggestions, team skills, a stuck band, outcome labels and session-to-commit links (Claude Code mod)", - "version": "0.3.0", + "version": "0.4.0", "author": { "name": "Lucas Dow", "email": "lucdow7@gmail.com" diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 392c43b..cc200f6 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "devscope", - "version": "0.33.0", + "version": "0.34.0", "description": "Real-time developer activity monitoring for Claude Code sessions", "author": { "name": "Lucas Dow", diff --git a/CHANGELOG.md b/CHANGELOG.md index b7e8a09..d5a1159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.34.0] - 2026-10-08 + +### Added +- **The voice bar shows in the session that is speaking.** `progress.json` + carries `sessionId` (the Claude Code session the speech is about) and, for + replies, the session's spoken name as `project`. Explanations are started by + a command that is not told the session, so the prompt hook records each + window's session in `~/.cache/devscope/voice/sessions/` (only + when voice is set up or Claude Code passes its PID) and `/devscope:voice + explain` looks it up. Needs devscope-live 0.4.0 to take effect. + ## [0.33.0] - 2026-10-08 ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index c7d88cd..3631908 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -272,7 +272,10 @@ claude plugin disable devscope@devscope # Disable - **`progress.json`** is the contract with the devscope-live mod's voice bar: the speak lock holder (`speak.sh`, `DS_VOICE_PROGRESS_KIND` set) writes `{kind, project, phase: summarizing|voicing|speaking, piece, pieces, pieceMs, at (epoch ms), pid}` atomically per - phase and piece (`pieceMs` from the WAV header, 0 when unknown) and removes it on exit. + phase and piece (`pieceMs` from the WAV header, 0 when unknown) and removes it on exit. `sessionId` + (Claude Code's id; replies from the job, explanations via `sessions/`, written by the prompt hook) + makes the bar per session: the mod draws it only where `$.session.id()` matches, a dimmed one-liner elsewhere, + and the whole bar everywhere when the field is absent (older plugins). The mod parses it in `hooks/voiceBar.ts` and treats a file past its piece's end + 15 s as dead; change both sides together. diff --git a/mods/devscope-live/.claude-plugin/plugin.json b/mods/devscope-live/.claude-plugin/plugin.json index d98bf5c..79f2c45 100644 --- a/mods/devscope-live/.claude-plugin/plugin.json +++ b/mods/devscope-live/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "devscope-live", - "version": "0.3.0", + "version": "0.4.0", "description": "DevScope in the live session: team prompt suggestions, team skills, a stuck band, outcome labels and session-to-commit links", "author": { "name": "Lucas Dow", diff --git a/mods/devscope-live/CHANGELOG.md b/mods/devscope-live/CHANGELOG.md index 8f1237d..1efe20f 100644 --- a/mods/devscope-live/CHANGELOG.md +++ b/mods/devscope-live/CHANGELOG.md @@ -2,6 +2,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.4.0] - 2026-10-08 + +### Changed +- **Voice bar per session.** The bar and its Stop button appear only in the + window whose session is speaking; every other window shows one dimmed line, + "馃攰 api-service, rate limiter fix 路 reading the summary". Progress from a + devscope plugin older than 0.34.0 names no session and still shows the bar + everywhere. + ## [0.3.0] - 2026-10-07 ### Changed diff --git a/mods/devscope-live/hooks/register.tsx b/mods/devscope-live/hooks/register.tsx index ff8d66f..9f53672 100644 --- a/mods/devscope-live/hooks/register.tsx +++ b/mods/devscope-live/hooks/register.tsx @@ -11,7 +11,7 @@ import type { Suggestion } from './suggestions' import { USE_IT, matchSkill, skillContext, skillLabel } from './teamSkills' import type { TeamSkill } from './teamSkills' import { isPrUrl, linkFromBash, parseGhPr, withTrailer, withoutCredentials } from './vcs' -import { barCells, fraction, isStale, parseProgress, runs, voiceLabel } from './voiceBar' +import { barCells, fraction, isOwnSpeech, isStale, otherSpeechLabel, parseProgress, runs, voiceLabel } from './voiceBar' const band = atom({ plugin: 'devscope-live', key: 'band' } as const, null as Band) const voice = atom({ plugin: 'devscope-live', key: 'voice' } as const, null as VoiceView) @@ -395,7 +395,14 @@ export const register: Register = (on, pluginOptions) => { const { Box, Button, Text } = $.ui.resolve(e) const clear = () => update($, band, () => null) - const voiceRow = speaking ? ( + // The bar (and its Stop) belongs to the window whose session is speaking; + // every other window gets one dimmed line naming the session. + const own = speaking ? isOwnSpeech(speaking.progress, await $.session.id()) : false + const voiceRow = speaking && !own ? ( + + {otherSpeechLabel(speaking.progress)} + + ) : speaking ? ( {runs(barCells(fraction(speaking.progress, await $.clock.now()), speaking.frame)).map((run, i) => ( diff --git a/mods/devscope-live/hooks/voiceBar.ts b/mods/devscope-live/hooks/voiceBar.ts index 4fdf226..d5fca97 100644 --- a/mods/devscope-live/hooks/voiceBar.ts +++ b/mods/devscope-live/hooks/voiceBar.ts @@ -36,6 +36,7 @@ export function parseProgress(text: string): VoiceProgress | undefined { pieceMs: p.pieceMs as number, at: p.at as number, pid: p.pid as number, + sessionId: typeof p.sessionId === 'string' ? p.sessionId.slice(0, 200) : '', } } catch { return undefined @@ -106,3 +107,16 @@ export function voiceLabel(p: VoiceProgress): string { const part = p.phase === 'speaking' && p.pieces > 1 ? ` ${Math.min(p.piece + 1, p.pieces)}/${p.pieces}` : '' return `${p.project ? `${p.project} 路 ` : ''}${what}${part}` } + +/** + * Whether this window's session is the one speaking. Progress from an older + * plugin names no session and counts as everyone's, as it always did. + */ +export function isOwnSpeech(p: VoiceProgress, sessionId: string): boolean { + return p.sessionId === '' || p.sessionId === sessionId +} + +/** The dimmed line other windows show while a session speaks. */ +export function otherSpeechLabel(p: VoiceProgress): string { + return `馃攰 ${voiceLabel({ ...p, project: p.project || 'Another session' })}` +} diff --git a/mods/devscope-live/tests/hooks.test.tsx b/mods/devscope-live/tests/hooks.test.tsx index 7fc1594..793c089 100644 --- a/mods/devscope-live/tests/hooks.test.tsx +++ b/mods/devscope-live/tests/hooks.test.tsx @@ -420,6 +420,28 @@ describe('voice progress bar', () => { await ui.unmount() }) + test('shows the bar only in the speaking session; other windows get a dimmed line', async ($, on) => { + const files: Files = {} + const { clock } = setup(on, {}, files) + await $.session.start(SESSION) + const own = 'cc-session-1' // the test engine's session id + + files[PROGRESS] = progress(clock.now(), { sessionId: own }) + await clock.advance(1000) + let ui = await $.ui.mount({ ...ABOVE_PROMPT, surface: 'terminal' }) + expect(await ui.find({ key: 'voice-stop' })).toBeDefined() + expect(await ui.find({ type: 'Text', text: /^馃攰/ })).toBeUndefined() + await ui.unmount() + + files[PROGRESS] = progress(clock.now(), { sessionId: 'some-other-session', kind: 'reply', project: 'api, rate limiter fix' }) + await clock.advance(1000) + ui = await $.ui.mount({ ...ABOVE_PROMPT, surface: 'terminal' }) + expect(await ui.find({ type: 'Text', text: '馃攰 api, rate limiter fix 路 reading the summary 2/4' })).toBeDefined() + expect(await ui.find({ key: 'voice-stop' })).toBeUndefined() + expect(await ui.find({ type: 'Text', text: /\u283f/ })).toBeUndefined() + await ui.unmount() + }) + test('animates while the audio is made, and goes away when the speaker is done', async ($, on) => { const files: Files = {} const { clock } = setup(on, {}, files) diff --git a/mods/devscope-live/tests/logic.test.ts b/mods/devscope-live/tests/logic.test.ts index 0a40168..a1a5f44 100644 --- a/mods/devscope-live/tests/logic.test.ts +++ b/mods/devscope-live/tests/logic.test.ts @@ -6,7 +6,7 @@ import { SUGGEST, afterPrompt, basename, fitsSuggestion, nextPromptsBody, should import { matchSkill } from '../hooks/teamSkills' import type { TeamSkill } from '../hooks/teamSkills' import { isPrUrl, linkFromBash, parseGhPr, withTrailer, withoutCredentials } from '../hooks/vcs' -import { LEVELS, TRACK, TRACK_COLOR, barCells, fraction, isStale, parseProgress, runs, voiceLabel } from '../hooks/voiceBar' +import { LEVELS, TRACK, TRACK_COLOR, barCells, fraction, isOwnSpeech, isStale, otherSpeechLabel, parseProgress, runs, voiceLabel } from '../hooks/voiceBar' import type { VoiceProgress } from '../types' const skill = (id: string, ...triggerPhrases: string[]): TeamSkill => ({ @@ -171,9 +171,26 @@ describe('voice bar', () => { pieceMs: 10_000, at: 1_000_000, pid: 4242, + sessionId: '', ...over, }) + test('the bar belongs to the session that speaks; older plugins name none', () => { + expect(parseProgress(JSON.stringify({ ...progress(), sessionId: undefined }))?.sessionId).toBe('') + expect(parseProgress(JSON.stringify(progress({ sessionId: 's-1' })))?.sessionId).toBe('s-1') + expect(parseProgress(JSON.stringify({ ...progress(), sessionId: 7 }))?.sessionId).toBe('') + expect(isOwnSpeech(progress({ sessionId: 's-1' }), 's-1')).toBe(true) + expect(isOwnSpeech(progress({ sessionId: 's-1' }), 's-2')).toBe(false) + expect(isOwnSpeech(progress(), 's-2')).toBe(true) + }) + + test('other windows get one line naming the session', () => { + expect(otherSpeechLabel(progress({ kind: 'reply', project: 'api, rate limiter fix', piece: 0, pieces: 1 }))).toBe( + '馃攰 api, rate limiter fix 路 reading the summary', + ) + expect(otherSpeechLabel(progress({ project: '', phase: 'voicing' }))).toBe('馃攰 Another session 路 creating audio') + }) + test('parses the speaker file and rejects anything malformed', () => { expect(parseProgress(JSON.stringify(progress()))).toEqual(progress()) expect(parseProgress('{')).toBeUndefined() diff --git a/mods/devscope-live/types/index.d.ts b/mods/devscope-live/types/index.d.ts index f70adc8..c5e42d3 100644 --- a/mods/devscope-live/types/index.d.ts +++ b/mods/devscope-live/types/index.d.ts @@ -10,7 +10,8 @@ export type Band = /** * What the Bash plugin's speaker is doing (~/.cache/devscope/voice/progress.json): * `at` is when the phase or piece began (epoch ms), `pieceMs` how long the piece - * plays (0 when unknown), `pid` the speaker's process group. + * plays (0 when unknown), `pid` the speaker's process group. `sessionId` is the + * Claude Code session the speech is about ('' from older plugins: shown everywhere). */ export type VoiceProgress = { kind: 'explain' | 'reply' @@ -21,6 +22,7 @@ export type VoiceProgress = { pieceMs: number at: number pid: number + sessionId: string } /** The voice bar: the latest progress, and a frame counter that animates it. */ diff --git a/scripts/voice/cli.sh b/scripts/voice/cli.sh index 5200ccc..e4e3b68 100755 --- a/scripts/voice/cli.sh +++ b/scripts/voice/cli.sh @@ -203,7 +203,8 @@ say() { _ds_voice_mkdirs job="$DS_VOICE_DIR/say/$(cat /proc/sys/kernel/random/uuid 2>/dev/null || uuidgen 2>/dev/null || echo "s-$(_ds_now_ns)").json" ( umask 077; jq -n --arg t "$text" --arg p "${DEVSCOPE_PRIVACY:-standard}" --arg project "$(basename "$PWD")" \ - '{text: $t, privacy: $p, project: $project}' > "$job" ) || return 1 + --arg sid "$(_ds_voice_this_session)" \ + '{text: $t, privacy: $p, project: $project, sessionId: $sid}' > "$job" ) || return 1 # This turn spoke: auto voice does not summarize its reply on top. pid=$(_ds_voice_claude_pid) [ -n "$pid" ] && : > "$DS_VOICE_DIR/spoke/$pid" diff --git a/scripts/voice/lib.sh b/scripts/voice/lib.sh index d68e7be..08b85b0 100755 --- a/scripts/voice/lib.sh +++ b/scripts/voice/lib.sh @@ -21,7 +21,10 @@ # window (/devscope:voice auto), over the default. # speakers/ running speak.sh processes, for /devscope:voice stop. # progress.json what the speaking speak.sh is doing, for the -# devscope-live mod's progress bar. +# devscope-live mod's progress bar; `sessionId` says +# whose speech it is, so only that window shows the bar. +# sessions/ the Claude Code session id of that window, written on +# each prompt, so /devscope:voice explain knows it. # speak.lock serializes speech across all sessions. # queue/- one ticket per process waiting to speak; the oldest # live ticket speaks next, so speech is first come, @@ -90,7 +93,8 @@ DS_VOICE_REPLY_TAIL=1100 # State and log can hold summaries of the user's work: keep them owner-only. _ds_voice_mkdirs() { ( umask 077; mkdir -p "$DS_VOICE_PENDING" "$DS_VOICE_DIR/replies" "$DS_VOICE_DIR/say" \ - "$DS_VOICE_DIR/spoke" "$DS_VOICE_DIR/speakers" "$DS_VOICE_DIR/auto" "$DS_VOICE_DIR/labels" "$DS_VOICE_DIR/queue" ) 2>/dev/null + "$DS_VOICE_DIR/spoke" "$DS_VOICE_DIR/speakers" "$DS_VOICE_DIR/auto" "$DS_VOICE_DIR/labels" "$DS_VOICE_DIR/queue" \ + "$DS_VOICE_DIR/sessions" ) 2>/dev/null } # --- Session labels --- @@ -349,6 +353,7 @@ _ds_voice_marker() { # Arm or clear from one hook event. Arguments: DevScope event type, raw hook input. _ds_voice_on_event() { + [ "$1" = prompt.submit ] && _ds_voice_note_session "$2" _ds_voice_on_reply_event "$1" "$2" _ds_voice_enabled || return 0 local et="$1" input="$2" sid tool m @@ -583,6 +588,32 @@ _ds_voice_arm() { # session-id type hook-input _ds_voice_spawn "$DS_VOICE_LIB_DIR/timer.sh" "$sid" "$eid" } +# Remember which session this Claude Code window runs, for speech started from a +# command (/devscope:voice explain), which is told no session id. Only when it +# is cheap (Claude Code gave its PID) or voice is set up, so a plugin user who +# never uses voice pays no process lookups. +_ds_voice_note_session() { # hook-input + local sid pid f + [ -n "${CLAUDE_PID:-}" ] || [ -f "$DS_VOICE_CONFIG" ] || return 0 + sid=$(printf '%s' "$1" | jq -r '.session_id // empty' 2>/dev/null) + [ -n "$sid" ] || return 0 + pid=$(_ds_voice_claude_pid) + [ -n "$pid" ] || return 0 + _ds_voice_mkdirs + f="$DS_VOICE_DIR/sessions/$pid" + [ "$(cat "$f" 2>/dev/null)" = "$sid" ] && return 0 + find "$DS_VOICE_DIR/sessions" -type f -mtime +2 -delete 2>/dev/null || true + ( umask 077; printf '%s' "$sid" > "$f" ) 2>/dev/null || true +} + +# The session id of the Claude Code window this command runs in, if known. +_ds_voice_this_session() { + local pid + pid=$(_ds_voice_claude_pid) + [ -n "$pid" ] && cat "$DS_VOICE_DIR/sessions/$pid" 2>/dev/null + return 0 +} + # Start a process that outlives the hook (Claude Code may reap the hook's group). _ds_voice_spawn() { if command -v setsid >/dev/null 2>&1; then @@ -962,10 +993,12 @@ _ds_voice_progress() { # phase [piece pieces [piece-ms]] [ -n "${DS_VOICE_PROGRESS_KIND:-}" ] || return 0 local tmp="$DS_VOICE_PROGRESS.tmp.$$" jq -n --arg kind "$DS_VOICE_PROGRESS_KIND" --arg project "${DS_VOICE_PROGRESS_PROJECT:-}" \ + --arg session "${DS_VOICE_PROGRESS_SESSION:-}" \ --arg phase "$1" --argjson piece "${2:-0}" --argjson pieces "${3:-0}" --argjson ms "${4:-0}" \ --argjson at "$(( $(_ds_now_ns) / 1000000 ))" --argjson pid "$$" \ '{kind: $kind, project: $project, phase: $phase, piece: $piece, pieces: $pieces, - pieceMs: $ms, at: $at, pid: $pid}' > "$tmp" 2>/dev/null && mv "$tmp" "$DS_VOICE_PROGRESS" || rm -f "$tmp" + pieceMs: $ms, at: $at, pid: $pid} + + (if $session == "" then {} else {sessionId: $session} end)' > "$tmp" 2>/dev/null && mv "$tmp" "$DS_VOICE_PROGRESS" || rm -f "$tmp" } # Remove the progress file if this process wrote it. diff --git a/scripts/voice/speak.sh b/scripts/voice/speak.sh index 195ebef..d06d123 100755 --- a/scripts/voice/speak.sh +++ b/scripts/voice/speak.sh @@ -29,8 +29,10 @@ case "${1:-}" in current() { [ "$(jq -r '.eventId' "$JOB" 2>/dev/null)" = "$EID" ]; } current || exit 0 export DS_VOICE_PROGRESS_KIND=reply - DS_VOICE_PROGRESS_PROJECT=$(jq -r '.project // ""' "$JOB" 2>/dev/null) - export DS_VOICE_PROGRESS_PROJECT + # The session's spoken name, and its id so only its window shows the bar. + DS_VOICE_PROGRESS_PROJECT=$(_ds_voice_name "$JOB") + DS_VOICE_PROGRESS_SESSION=$(jq -r '.sessionId // ""' "$JOB" 2>/dev/null) + export DS_VOICE_PROGRESS_PROJECT DS_VOICE_PROGRESS_SESSION # Summarized before waiting for a turn: sessions that finish together get # their summaries in parallel instead of each waiting on the others' calls. TEXT=$(_ds_voice_reply_text "$JOB") || exit 0 @@ -53,7 +55,8 @@ case "${1:-}" in [ -f "$JOB" ] || exit 0 export DS_VOICE_PROGRESS_KIND=explain DS_VOICE_PROGRESS_PROJECT=$(jq -r '.project // ""' "$JOB" 2>/dev/null) - export DS_VOICE_PROGRESS_PROJECT + DS_VOICE_PROGRESS_SESSION=$(jq -r '.sessionId // ""' "$JOB" 2>/dev/null) + export DS_VOICE_PROGRESS_PROJECT DS_VOICE_PROGRESS_SESSION speak_job() { _ds_voice_log "speak explanation ($(jq -r '.text | length' "$JOB" 2>/dev/null) chars)" _ds_voice_speak_long "$(jq -r '.text' "$JOB" 2>/dev/null)" "$(jq -r '.privacy' "$JOB" 2>/dev/null)" diff --git a/tests/voice/run.sh b/tests/voice/run.sh index a7023d1..f957de6 100644 --- a/tests/voice/run.sh +++ b/tests/voice/run.sh @@ -265,6 +265,31 @@ printf 'One short explanation.\n' | "$S/voice/cli.sh" say >/dev/null wait_spoken 1 5; sleep 0.5 [ ! -f "$HOME/.cache/devscope/voice/progress.json" ] && ok "progress file removed when speech ends" || bad "progress cleanup" "$(cat "$HOME/.cache/devscope/voice/progress.json")" +# 10f. The bar is per session: progress.json names the session speaking. +PJ="$HOME/.cache/devscope/voice/progress.json" +progress_of() { # wait for a speaking progress file, print a jq field + for _ in $(seq 1 60); do [ -f "$PJ" ] && jq -e '.phase == "speaking"' "$PJ" >/dev/null 2>&1 && { jq -r "$1" "$PJ"; return; }; sleep 0.1; done +} +configure; reset; "$S/voice/cli.sh" auto-default on >/dev/null; respond '{"text": "Reply done."}' +DS_VOICE_TEST_SPEAK_SEC=1.5 hook response-stop.sh own-reply /work/api '{hook_event_name: "Stop", last_assistant_message: "Done."}' +[ "$(progress_of .sessionId)" = own-reply ] && ok "bar per session: a reply's progress names its session" || bad "progress reply session" "$(cat "$PJ" 2>/dev/null)" +wait_spoken 1 5; "$S/voice/cli.sh" auto-default off >/dev/null + +# An explanation is started by a command, which is not told the session: the +# prompt hook recorded which session that Claude Code window runs. +configure; reset; sleep 60 & fakeclaude=$! +DS_VOICE_CLAUDE_PID=$fakeclaude hook prompt-submit.sh ex-session /work/api '{hook_event_name: "UserPromptSubmit", prompt: "explain it"}' +[ "$(cat "$HOME/.cache/devscope/voice/sessions/$fakeclaude" 2>/dev/null)" = ex-session ] && ok "bar per session: the prompt hook records the window's session" || bad "session record" "$(ls "$HOME/.cache/devscope/voice/sessions" 2>/dev/null)" +printf 'An explanation for one session.\n' | DS_VOICE_CLAUDE_PID=$fakeclaude DS_VOICE_TEST_SPEAK_SEC=1.5 "$S/voice/cli.sh" say >/dev/null +[ "$(progress_of .sessionId)" = ex-session ] && ok "bar per session: an explanation's progress names the session that asked" || bad "progress explain session" "$(cat "$PJ" 2>/dev/null)" +wait_spoken 1 5; kill "$fakeclaude" 2>/dev/null || true + +# Someone who never set up voice pays no process lookups for it. +rm -f "$CONF"; rm -rf "$HOME/.cache/devscope/voice/sessions" +( unset CLAUDE_PID; DS_VOICE_CLAUDE_PID=12345 hook prompt-submit.sh nv-session /work/api '{hook_event_name: "UserPromptSubmit", prompt: "hi there"}' ) +[ -z "$(ls "$HOME/.cache/devscope/voice/sessions" 2>/dev/null)" ] && ok "bar per session: nothing recorded without voice set up" || bad "session record gate" "$(ls "$HOME/.cache/devscope/voice/sessions")" +configure + # 11b. Screen lock: detection, then each kind of speech. mkdir -p "$TMP/bin" cat > "$TMP/bin/loginctl" <<'EOF'