claude-usage-limits 1.11.7 → 1.13.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +133 -3
- package/bin/cli.js +1 -0
- package/commands/relay.md +45 -0
- package/commands/voice.md +33 -0
- package/hooks/hooks.json +24 -1
- package/package.json +1 -1
- package/skills/usage-limits/SKILL.md +130 -5
- package/skills/usage-limits/scripts/bars.js +56 -0
- package/skills/usage-limits/scripts/brief.js +257 -17
- package/skills/usage-limits/scripts/codex-lowpower.js +135 -0
- package/skills/usage-limits/scripts/codex.js +92 -22
- package/skills/usage-limits/scripts/feed.js +136 -5
- package/skills/usage-limits/scripts/install-codex-hook.js +71 -20
- package/skills/usage-limits/scripts/lowpower.js +10 -2
- package/skills/usage-limits/scripts/panel.js +180 -15
- package/skills/usage-limits/scripts/pulse.js +82 -22
- package/skills/usage-limits/scripts/reading.js +121 -0
- package/skills/usage-limits/scripts/recommend.js +16 -3
- package/skills/usage-limits/scripts/relay.js +859 -0
- package/skills/usage-limits/scripts/tally.js +7 -8
- package/skills/usage-limits/scripts/usage.js +842 -53
- package/skills/usage-limits/scripts/view.js +150 -8
- package/skills/usage-limits/scripts/voice.js +416 -0
- package/skills/usage-limits/scripts/wake.js +312 -0
|
@@ -46,15 +46,14 @@ function readState() {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
// Atomic, because this file is read, changed and written back by the Stop hook
|
|
50
|
+
// of every session at once. A torn read here did not just lose one total: the
|
|
51
|
+
// reader parsed nothing, then wrote its own slot back as the whole file, and
|
|
52
|
+
// every other session's tally went with it.
|
|
49
53
|
function writeState(all) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
fs.writeFileSync(file, JSON.stringify(all), 'utf8');
|
|
54
|
-
} catch (err) {
|
|
55
|
-
// Losing the total costs one re-read of the transcript. Failing the hook
|
|
56
|
-
// that runs after every reply is not worth avoiding that.
|
|
57
|
-
}
|
|
54
|
+
// Never throws: losing the total costs one re-read of the transcript, and
|
|
55
|
+
// failing the hook that runs after every reply is not worth avoiding that.
|
|
56
|
+
usage.writeJsonAtomic(stateFile(), all);
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
function isSession(value) {
|