claude-usage-limits 1.39.1 → 1.39.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usage-limits",
|
|
3
3
|
"displayName": "Usage Limits",
|
|
4
|
-
"version": "1.39.
|
|
4
|
+
"version": "1.39.2",
|
|
5
5
|
"description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Ridelink",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usage-limits",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.2",
|
|
4
4
|
"description": "Reports how much of your Codex usage limit is left as turns of work rather than a percentage, prices a job before you start it, and counts the other agents sharing the same budget.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ridelink",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-usage-limits",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.2",
|
|
4
4
|
"description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -1042,7 +1042,7 @@ function scheduleWindows(when, argv, name, cwd, deadline) {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
|
-
function schedulePosix(when, argv, name, cwd) {
|
|
1045
|
+
function schedulePosix(when, argv, name, cwd, deadline) {
|
|
1046
1046
|
const seconds = Math.max(60, Math.round((when - Date.now()) / 1000));
|
|
1047
1047
|
// `at` is the right tool and is absent on most desktops now. A detached
|
|
1048
1048
|
// sleeper is second best: it survives the terminal closing, but not a
|
|
@@ -1051,9 +1051,12 @@ function schedulePosix(when, argv, name, cwd) {
|
|
|
1051
1051
|
const at = spawnSync('sh', ['-c', 'command -v at >/dev/null 2>&1 && echo yes || echo no'], { encoding: 'utf8' });
|
|
1052
1052
|
if ((at.stdout || '').trim() === 'yes') {
|
|
1053
1053
|
const minutes = Math.max(1, Math.round(seconds / 60));
|
|
1054
|
+
// Bounded by what the caller has left, like the Windows route: a hook is
|
|
1055
|
+
// killed at ten seconds and this used to wait twenty. An `at` that runs
|
|
1056
|
+
// out of time falls through to the sleeper below, which returns at once.
|
|
1054
1057
|
const run = spawnSync('sh', ['-c', 'echo ' + JSON.stringify(command) + ' | at now + ' + minutes + ' minutes'], {
|
|
1055
1058
|
encoding: 'utf8',
|
|
1056
|
-
timeout: 20000,
|
|
1059
|
+
timeout: Math.max(1000, remainingMs(deadline, 20000)),
|
|
1057
1060
|
});
|
|
1058
1061
|
// macOS ships `at` but launchd leaves atrun DISABLED by default, so the
|
|
1059
1062
|
// command succeeds, prints a job id, and the wake never fires. Reporting
|
|
@@ -1083,7 +1086,7 @@ function schedule(when, argv, name, cwd, deadline) {
|
|
|
1083
1086
|
if (Number.isFinite(deadline) && deadline - Date.now() < 1500) {
|
|
1084
1087
|
return { ok: false, error: 'no time left in this hook to register the wake; it will arm on the next prompt' };
|
|
1085
1088
|
}
|
|
1086
|
-
return schedulePosix(when, argv, name, cwd);
|
|
1089
|
+
return schedulePosix(when, argv, name, cwd, deadline);
|
|
1087
1090
|
}
|
|
1088
1091
|
|
|
1089
1092
|
function cancelSchedule(name) {
|