yourturn 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +169 -2
- package/bin/yourturn.js +25 -0
- package/package.json +17 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fatih Furkan Cabbar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,170 @@
|
|
|
1
|
-
#
|
|
1
|
+
# yourturn
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Your own sound when your AI coding agent stops and it is your turn.**
|
|
4
|
+
|
|
5
|
+
You give Claude Code or Codex a task, switch to something else, and forget to check back. `yourturn` plays a sound and shows a notification the moment the agent is done or needs you.
|
|
6
|
+
|
|
7
|
+
Any sound file works: a short ding, a movie quote, a whole song. Give every project its own sound and you can hear *which* agent finished without looking.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yourturn install claude
|
|
11
|
+
yourturn sound done ~/Music/victory.mp3
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- **Any audio file**: mp3, wav, flac, ogg, m4a, aiff. Decoding is built in, so it behaves the same on every machine.
|
|
17
|
+
- **A sound per project**: hear which agent finished.
|
|
18
|
+
- **Songs work**: a long track plays in the background and fades out when you send your next prompt.
|
|
19
|
+
- **Several agents at once**: sounds take turns instead of playing over each other.
|
|
20
|
+
- **A folder of sounds**: point an event at a folder and it picks one at random.
|
|
21
|
+
- **Desktop notification** with the agent and project name.
|
|
22
|
+
- **One small binary** (about 2.5 MB). No Python, no `afplay`, no PowerShell, no background service.
|
|
23
|
+
|
|
24
|
+
| Agent | Finished | Asks for permission or asks you a question |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| Claude Code | yes | yes |
|
|
27
|
+
| Codex (CLI and app) | yes | yes |
|
|
28
|
+
|
|
29
|
+
Tested on macOS. Linux is untested. Windows is not supported yet.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
With npm (downloads a prebuilt binary):
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g yourturn
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
With Cargo (builds from source, needs Rust; on Linux also `libasound2-dev`):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cargo install yourturn
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then connect your agents:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
yourturn install claude # Claude Code
|
|
49
|
+
yourturn install codex # Codex
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Codex only:** Codex runs a hook after you approve it. Type `/hooks` in the Codex CLI, or open Settings > Hooks in the Codex app, and trust the three yourturn hooks.
|
|
53
|
+
|
|
54
|
+
Check that it works:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
yourturn test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You should hear two rising notes and see a notification.
|
|
61
|
+
|
|
62
|
+
> Use `npm install -g`, not `npx`. The hooks point at the installed binary, and the `npx` cache is temporary. If you switch Node versions with nvm, fnm or volta, the global folder moves: run `yourturn install <agent>` again.
|
|
63
|
+
|
|
64
|
+
## Choose your sounds
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
yourturn sound done ~/Music/victory.mp3 # one file
|
|
68
|
+
yourturn sound done ~/Music/done-songs # a folder: random pick
|
|
69
|
+
yourturn sound attention ~/Sounds/hey.wav # when the agent needs you
|
|
70
|
+
yourturn sound done default # back to the built-in chime
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
A different sound per project:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cd ~/code/shop && yourturn sound done ~/Music/shop.mp3 --here
|
|
77
|
+
yourturn sound done ~/Music/blog.mp3 --project ~/code/blog
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
A project sound applies to that folder and everything inside it. An event the project does not set uses the general sound.
|
|
81
|
+
|
|
82
|
+
Need sounds? [Wikimedia Commons](https://commons.wikimedia.org/wiki/Category:Sound_effects) and [Freesound](https://freesound.org) have many under free licenses. yourturn ships no audio files; the default is a chime it generates itself.
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
| Command | What it does |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `yourturn install <agent>` | Add yourturn to an agent's hooks (`claude`, `codex`) |
|
|
89
|
+
| `yourturn uninstall <agent>` | Remove it again |
|
|
90
|
+
| `yourturn sound <event> <path>` | Set a sound. Add `--here` or `--project <folder>` for one project |
|
|
91
|
+
| `yourturn test [event]` | Notify and play, as if an agent in this folder stopped |
|
|
92
|
+
| `yourturn play <file>` | Just play a file |
|
|
93
|
+
| `yourturn stop` | Silence whatever is playing |
|
|
94
|
+
| `yourturn status` | Show settings and recent activity |
|
|
95
|
+
|
|
96
|
+
Events: `done` (the agent finished) and `attention` (the agent asks for permission or asks you a question).
|
|
97
|
+
|
|
98
|
+
## Settings
|
|
99
|
+
|
|
100
|
+
`~/.config/yourturn/config.toml`:
|
|
101
|
+
|
|
102
|
+
```toml
|
|
103
|
+
volume = 0.8 # 0.0 to 1.0
|
|
104
|
+
max_seconds = 30 # stop a sound after this long; 0 plays to the end
|
|
105
|
+
notify = true # desktop notification
|
|
106
|
+
sound = true # play a sound
|
|
107
|
+
|
|
108
|
+
[sounds]
|
|
109
|
+
done = "/Users/you/Music/victory.mp3"
|
|
110
|
+
attention = "/Users/you/Sounds/hey.wav"
|
|
111
|
+
|
|
112
|
+
[[project]]
|
|
113
|
+
path = "/Users/you/code/shop"
|
|
114
|
+
done = "/Users/you/Music/shop.mp3"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## How it works
|
|
118
|
+
|
|
119
|
+
Agents have hook systems: they run a command when something happens. `yourturn install` registers a few hooks:
|
|
120
|
+
|
|
121
|
+
| Agent event | yourturn does |
|
|
122
|
+
|---|---|
|
|
123
|
+
| The agent stops | plays the `done` sound, notifies |
|
|
124
|
+
| The agent asks for permission or asks a question | plays the `attention` sound, notifies |
|
|
125
|
+
| You send a prompt | silences that session's sound |
|
|
126
|
+
|
|
127
|
+
The hook command starts a detached player and returns in about 10 ms, so the agent never waits. It prints nothing, because agents may feed a hook's output to the model.
|
|
128
|
+
|
|
129
|
+
Only one player uses the speakers at a time. A player that finds them busy waits its turn; if the current sound has played for 15 seconds, the next one takes over, so a long song cannot block another agent.
|
|
130
|
+
|
|
131
|
+
## What install changes on your machine
|
|
132
|
+
|
|
133
|
+
- **Claude Code:** four entries under `hooks` in `~/.claude/settings.json`.
|
|
134
|
+
- **Codex:** three entries under `hooks` in `~/.codex/hooks.json`.
|
|
135
|
+
|
|
136
|
+
Everything else in those files is left exactly as it was. Before its first change yourturn writes a backup next to the file (`*.yourturn-backup`). That backup is a full copy, so treat it like the original if your settings hold secrets.
|
|
137
|
+
|
|
138
|
+
yourturn's own files live in `~/.config/yourturn/` (settings, a log of hook calls, and small state files). It makes no network requests and collects nothing.
|
|
139
|
+
|
|
140
|
+
## Troubleshooting
|
|
141
|
+
|
|
142
|
+
`yourturn status` shows the settings, which agents are connected, and the last hook calls. Every call is logged to `~/.config/yourturn/yourturn.log` with the folder the agent reported and which rule chose the sound.
|
|
143
|
+
|
|
144
|
+
- **No sound from Codex:** trust the hooks (see Install).
|
|
145
|
+
- **It stopped working after a Node upgrade:** run `yourturn install <agent>` again; `yourturn status` tells you when a hook points at a missing file.
|
|
146
|
+
- **Wrong sound for a project:** compare the `cwd` in the log with the project folder you set.
|
|
147
|
+
- **No notification on macOS:** allow notifications for Script Editor in System Settings > Notifications. Installing `terminal-notifier` makes yourturn use that instead.
|
|
148
|
+
|
|
149
|
+
## Uninstall
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
yourturn uninstall claude
|
|
153
|
+
yourturn uninstall codex
|
|
154
|
+
npm uninstall -g yourturn # or: cargo uninstall yourturn
|
|
155
|
+
rm -rf ~/.config/yourturn
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Roadmap
|
|
159
|
+
|
|
160
|
+
- Linux and Windows
|
|
161
|
+
- Gemini CLI and Cursor
|
|
162
|
+
- A menu bar app for the settings
|
|
163
|
+
|
|
164
|
+
## Contributing
|
|
165
|
+
|
|
166
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Security reports: [SECURITY.md](SECURITY.md).
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
[MIT](LICENSE)
|
package/bin/yourturn.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// yourturn is a native program. npm installs the right binary for this
|
|
3
|
+
// machine as an optional dependency; this script finds it and runs it.
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require("node:child_process");
|
|
6
|
+
|
|
7
|
+
const name = `@yourturn/${process.platform}-${process.arch}`;
|
|
8
|
+
|
|
9
|
+
let binary;
|
|
10
|
+
try {
|
|
11
|
+
binary = require.resolve(`${name}/bin/yourturn`);
|
|
12
|
+
} catch {
|
|
13
|
+
console.error(
|
|
14
|
+
`yourturn: no prebuilt binary for ${process.platform} ${process.arch}.\n` +
|
|
15
|
+
`If you have Rust, build it yourself: cargo install yourturn`
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
21
|
+
if (result.error) {
|
|
22
|
+
console.error(`yourturn: ${result.error.message}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yourturn",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Your own sound when your AI coding agent stops and it is your turn. Works with Claude Code and Codex.",
|
|
5
|
+
"keywords": ["claude-code", "codex", "ai-agent", "notification", "sound", "hooks", "cli"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": { "type": "git", "url": "git+https://github.com/ffcabbar/yourturn.git" },
|
|
8
|
+
"homepage": "https://github.com/ffcabbar/yourturn#readme",
|
|
9
|
+
"bugs": "https://github.com/ffcabbar/yourturn/issues",
|
|
10
|
+
"bin": { "yourturn": "bin/yourturn.js" },
|
|
11
|
+
"files": ["bin", "README.md", "LICENSE"],
|
|
12
|
+
"engines": { "node": ">=18" },
|
|
13
|
+
"optionalDependencies": {
|
|
14
|
+
"@yourturn/darwin-arm64": "0.1.0",
|
|
15
|
+
"@yourturn/darwin-x64": "0.1.0",
|
|
16
|
+
"@yourturn/linux-arm64": "0.1.0",
|
|
17
|
+
"@yourturn/linux-x64": "0.1.0"
|
|
18
|
+
}
|
|
19
|
+
}
|