vibeaudio 0.16.1 → 0.16.2

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <img src="docs/og.png?v=2" alt="VibeAudio — Focus music while your AI codes" width="720">
5
5
  </p>
6
6
 
7
- [![test](https://github.com/kiril6/vibeaudio/actions/workflows/test.yml/badge.svg)](https://github.com/kiril6/vibeaudio/actions/workflows/test.yml) [![npm](https://img.shields.io/npm/v/vibeaudio)](https://www.npmjs.com/package/vibeaudio) [![downloads](https://img.shields.io/npm/d18m/vibeaudio?label=downloads)](https://npm-stat.com/charts.html?package=vibeaudio) [![downloads/month](https://img.shields.io/npm/dm/vibeaudio)](https://npm-stat.com/charts.html?package=vibeaudio)
7
+ [![test](https://github.com/kiril6/vibeaudio/actions/workflows/test.yml/badge.svg)](https://github.com/kiril6/vibeaudio/actions/workflows/test.yml) [![npm](https://img.shields.io/npm/v/vibeaudio)](https://www.npmjs.com/package/vibeaudio) [![license](https://img.shields.io/npm/l/vibeaudio)](LICENSE) [![node](https://img.shields.io/node/v/vibeaudio)](https://nodejs.org) [![downloads/month](https://img.shields.io/npm/dm/vibeaudio)](https://npm-stat.com/charts.html?package=vibeaudio) [![M8ven Score](https://m8ven.ai/badge/mcp/kiril6/vibeaudio)](https://m8ven.ai/mcp/kiril6/vibeaudio?s=readme)
8
8
 
9
9
  > **Procedural focus music while your AI coding tools think.**
10
10
  > Every project gets its own arrangement. Zero dependencies, zero audio files.
@@ -321,7 +321,7 @@ Every session of an agent is tracked separately, by the session id in its hook p
321
321
 
322
322
  * **More sessions, more music.** Two sessions working at once plays at least tier 2 and three or more plays tier 3 — the same piece with more layers, arriving at the next loop boundary and easing off as sessions finish. It only ever raises the tier, so it works alongside time escalation and [reactive mode](#reactive-mode-opt-in).
323
323
  * **Dialogs and Esc are per session.** A permission dialog in one terminal plays the "your turn" chime but only pauses the music once *every* session is waiting; Esc ends just that session's turn.
324
- * **Crashed agents can't hold it hostage.** A session that never sent `Stop` is dropped after 15 minutes, the same ceiling the background player stops at.
324
+ * **Crashed agents can't hold it hostage.** A session that goes 15 minutes without any hook (no tool call, no `Stop`) is taken for a crashed agent and dropped. A long turn that keeps working keeps its music.
325
325
 
326
326
  Sessions with no id in their payload share a single slot, so they behave as one. VibeAudio keeps one stream: per-session genres or several streams mixed together aren't supported.
327
327
 
@@ -499,7 +499,7 @@ Changes land at the next loop boundary, so it shifts musically rather than cutti
499
499
  * **Backs up first, once.** The first install copies your file alongside as `*.vibeaudio.bak`. Later installs leave it alone — re-copying would overwrite your real pre-VibeAudio config with a copy of VibeAudio's own last install.
500
500
  * **Reinstalling updates, never duplicates.** Uninstalling sweeps every supported agent and removes only VibeAudio's own entries.
501
501
  * **Refuses rather than clobbers.** Malformed JSON aborts the write; a temporary `npx` checkout is rejected outright, since the hook records an absolute path that npm's cache eviction would later delete.
502
- * **Can't run away.** The background player is capped at 15 minutes, so a missed stop event can't leave music looping.
502
+ * **Can't run away.** The background player stops once its sessions have been silent for 15 minutes (and after 4 hours at most), so a missed stop event can't leave music looping.
503
503
 
504
504
  </details>
505
505
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeaudio",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "description": "Procedural focus music while your AI coding tools (Claude Code, Codex, Cursor, Grok, Gemini, Copilot) think — a different arrangement per project.",
5
5
  "bin": {
6
6
  "vibeaudio": "bin/vibeaudio.js",
package/src/hooks.js CHANGED
@@ -143,8 +143,13 @@ function hookTool() {
143
143
  setTimeout(commit, 500).unref();
144
144
  }
145
145
 
146
- // A lost Stop hook must not leave music looping forever.
147
- const MAX_DAEMON_MS = 15 * 60 * 1000;
146
+ // A lost Stop hook must not leave music looping forever. This is how long a
147
+ // session may go without a hook before it is taken for a crashed agent; every
148
+ // tool call refreshes it, so a long turn that keeps working keeps its music.
149
+ // VIBE_MAX_DAEMON_MS is internal, for the suite.
150
+ const MAX_DAEMON_MS = Number(process.env.VIBE_MAX_DAEMON_MS) || 15 * 60 * 1000;
151
+ // The daemon's own ceiling, whatever the sessions say: a backstop, not the rule.
152
+ const DAEMON_CEILING_MS = Math.max(MAX_DAEMON_MS, 4 * 60 * 60 * 1000);
148
153
 
149
154
  /**
150
155
  * The agents VibeAudio can wire itself into, and the few things that differ
@@ -519,7 +524,7 @@ function readPid() {
519
524
  * so an unverified kill would eventually SIGTERM an unrelated process.
520
525
  *
521
526
  * Failing closed is the safe direction here: a daemon we decline to kill stops
522
- * itself at MAX_DAEMON_MS, while killing a stranger's process has no such
527
+ * itself once no session is left (MAX_DAEMON_MS of silence), while killing a stranger's process has no such
523
528
  * ceiling.
524
529
  *
525
530
  * ponytail: posix only. Windows has no cheap command-line lookup, so the pid
@@ -694,8 +699,8 @@ function writeSession(id, data) {
694
699
 
695
700
  /**
696
701
  * Every session with a turn in flight. One that has not been touched for
697
- * MAX_DAEMON_MS is a crashed agent - it never sent Stop - and is dropped here,
698
- * the same ceiling the daemon itself stops at.
702
+ * MAX_DAEMON_MS is a crashed agent - it never sent Stop - and is dropped here;
703
+ * the daemon stops once none is left, with DAEMON_CEILING_MS as the backstop.
699
704
  */
700
705
  function listSessions() {
701
706
  let names;
@@ -947,7 +952,7 @@ function runDaemon(genre, volume, { reactive = false, volumeSource = null } = {}
947
952
 
948
953
  process.on("SIGTERM", shutdown);
949
954
  process.on("SIGINT", shutdown);
950
- setTimeout(shutdown, MAX_DAEMON_MS);
955
+ setTimeout(shutdown, DAEMON_CEILING_MS);
951
956
 
952
957
  setInterval(() => {
953
958
  // The pid file names the one daemon that owns the speakers. Two prompts