@mohitkumawat/warmup-cli 1.2.15 → 1.3.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/README.md +37 -14
- package/dist/commands/default.d.ts +3 -1
- package/dist/commands/default.d.ts.map +1 -1
- package/dist/commands/default.js +25 -0
- package/dist/commands/default.js.map +1 -1
- package/dist/commands/doctor.d.ts +51 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +219 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/execute.d.ts +24 -1
- package/dist/commands/execute.d.ts.map +1 -1
- package/dist/commands/execute.js +53 -21
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/logs.d.ts +12 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +27 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/menu.d.ts +52 -0
- package/dist/commands/menu.d.ts.map +1 -0
- package/dist/commands/menu.js +185 -0
- package/dist/commands/menu.js.map +1 -0
- package/dist/commands/setup.d.ts +7 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +94 -5
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts +8 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +89 -4
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +25 -4
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +15 -0
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/config.d.ts +23 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +38 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -3
- package/dist/index.js.map +1 -1
- package/dist/notify.d.ts +14 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +91 -0
- package/dist/notify.js.map +1 -0
- package/dist/runtime.d.ts +10 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +39 -8
- package/dist/runtime.js.map +1 -1
- package/dist/scheduler/index.d.ts +17 -0
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +42 -0
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/linux.d.ts.map +1 -1
- package/dist/scheduler/linux.js +3 -10
- package/dist/scheduler/linux.js.map +1 -1
- package/dist/scheduler/macos.d.ts +38 -0
- package/dist/scheduler/macos.d.ts.map +1 -1
- package/dist/scheduler/macos.js +158 -23
- package/dist/scheduler/macos.js.map +1 -1
- package/dist/scheduler/script.d.ts +18 -0
- package/dist/scheduler/script.d.ts.map +1 -0
- package/dist/scheduler/script.js +62 -0
- package/dist/scheduler/script.js.map +1 -0
- package/dist/scheduler/windows.js +1 -1
- package/dist/ui.d.ts +50 -4
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +250 -38
- package/dist/ui.js.map +1 -1
- package/dist/warmup.d.ts +52 -4
- package/dist/warmup.d.ts.map +1 -1
- package/dist/warmup.js +194 -79
- package/dist/warmup.js.map +1 -1
- package/package.json +3 -1
package/dist/warmup.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NEAR_SCHEDULE_DEDUP_WINDOW_MINUTES = exports.NEAR_SCHEDULE_TOLERANCE_MINUTES = void 0;
|
|
3
4
|
exports.isClaudeInstalled = isClaudeInstalled;
|
|
4
5
|
exports.isClaudeAuthenticated = isClaudeAuthenticated;
|
|
5
6
|
exports.getClaudeVersion = getClaudeVersion;
|
|
6
7
|
exports.executeWarmup = executeWarmup;
|
|
8
|
+
exports.executeWarmupAsync = executeWarmupAsync;
|
|
7
9
|
exports.shouldBootRecover = shouldBootRecover;
|
|
10
|
+
exports.shouldRunNearSchedule = shouldRunNearSchedule;
|
|
11
|
+
exports.shouldLogSkip = shouldLogSkip;
|
|
8
12
|
const child_process_1 = require("child_process");
|
|
9
13
|
const config_1 = require("./config");
|
|
10
14
|
const runtime_1 = require("./runtime");
|
|
15
|
+
// The checks default to the bare `claude` on PATH, but accept an explicit
|
|
16
|
+
// binary so `warmup doctor` can probe the SAME absolute path the scheduler runs
|
|
17
|
+
// (config.runtime.claudePath) — a launchd/systemd job has a minimal PATH where
|
|
18
|
+
// bare `claude` may not resolve, so probing bare `claude` could misreport.
|
|
11
19
|
/** Check if Claude Code CLI is installed */
|
|
12
|
-
function isClaudeInstalled() {
|
|
20
|
+
function isClaudeInstalled(binary = 'claude') {
|
|
13
21
|
try {
|
|
14
|
-
const result = (0, child_process_1.spawnSync)(
|
|
22
|
+
const result = (0, child_process_1.spawnSync)(binary, ['--version'], {
|
|
15
23
|
encoding: 'utf-8',
|
|
16
24
|
timeout: 10000,
|
|
17
25
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -23,9 +31,9 @@ function isClaudeInstalled() {
|
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
/** Check if Claude Code is authenticated (has valid session) */
|
|
26
|
-
function isClaudeAuthenticated() {
|
|
34
|
+
function isClaudeAuthenticated(binary = 'claude') {
|
|
27
35
|
try {
|
|
28
|
-
const result = (0, child_process_1.spawnSync)(
|
|
36
|
+
const result = (0, child_process_1.spawnSync)(binary, ['auth', 'status', '--json'], {
|
|
29
37
|
encoding: 'utf-8',
|
|
30
38
|
timeout: 10000,
|
|
31
39
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -37,9 +45,9 @@ function isClaudeAuthenticated() {
|
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
47
|
/** Get Claude Code version string */
|
|
40
|
-
function getClaudeVersion() {
|
|
48
|
+
function getClaudeVersion(binary = 'claude') {
|
|
41
49
|
try {
|
|
42
|
-
const result = (0, child_process_1.spawnSync)(
|
|
50
|
+
const result = (0, child_process_1.spawnSync)(binary, ['--version'], {
|
|
43
51
|
encoding: 'utf-8',
|
|
44
52
|
timeout: 10000,
|
|
45
53
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -53,92 +61,147 @@ function getClaudeVersion() {
|
|
|
53
61
|
return null;
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
const PING_ARGS = ['-p', 'ping', '--max-turns', '1'];
|
|
65
|
+
const PING_TIMEOUT_MS = 30000;
|
|
66
|
+
const pingEnv = () => ({ ...process.env, CLAUDE_NO_ANALYTICS: '1' });
|
|
67
|
+
function localTime(timezone) {
|
|
68
|
+
return new Date().toLocaleTimeString('en-US', {
|
|
69
|
+
timeZone: timezone,
|
|
70
|
+
hour: 'numeric',
|
|
71
|
+
minute: '2-digit',
|
|
72
|
+
hour12: true,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const dryRunResult = (isBootRecovery) => ({
|
|
76
|
+
success: true,
|
|
77
|
+
message: 'Dry run completed successfully (no request sent)',
|
|
78
|
+
duration: 5,
|
|
79
|
+
isBootRecovery,
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Build + persist the outcome of a completed ping (exit code known). Shared by
|
|
83
|
+
* the sync (scheduler) and async (interactive `test`) paths so both log and
|
|
84
|
+
* report identically.
|
|
85
|
+
*/
|
|
86
|
+
function finalizeWarmup(ok, stderr, startTime, isBootRecovery, config, timezone) {
|
|
87
|
+
const duration = Date.now() - startTime;
|
|
88
|
+
if (ok) {
|
|
89
|
+
(0, config_1.writeLog)({
|
|
90
|
+
timestamp: new Date().toISOString(),
|
|
91
|
+
status: isBootRecovery ? 'boot-recovery' : 'success',
|
|
92
|
+
message: isBootRecovery
|
|
93
|
+
? 'Boot-recovery pre-warm executed (machine was off at scheduled time)'
|
|
94
|
+
: 'Pre-warm executed successfully',
|
|
95
|
+
scheduledTime: config?.schedule.time || 'unknown',
|
|
96
|
+
actualTime: localTime(timezone),
|
|
97
|
+
}, timezone);
|
|
63
98
|
return {
|
|
64
99
|
success: true,
|
|
65
|
-
message: '
|
|
66
|
-
duration
|
|
100
|
+
message: isBootRecovery ? 'Boot-recovery pre-warm sent!' : 'Pre-warm sent successfully!',
|
|
101
|
+
duration,
|
|
67
102
|
isBootRecovery,
|
|
68
103
|
};
|
|
69
104
|
}
|
|
105
|
+
const errorMsg = stderr.trim() || 'Unknown error';
|
|
106
|
+
(0, config_1.writeLog)({
|
|
107
|
+
timestamp: new Date().toISOString(),
|
|
108
|
+
status: 'failed',
|
|
109
|
+
message: `Pre-warm failed: ${errorMsg}`,
|
|
110
|
+
scheduledTime: config?.schedule.time || 'unknown',
|
|
111
|
+
actualTime: localTime(timezone),
|
|
112
|
+
}, timezone);
|
|
113
|
+
return { success: false, message: `Failed: ${errorMsg}`, duration, isBootRecovery };
|
|
114
|
+
}
|
|
115
|
+
/** Build + persist the outcome when the ping process couldn't run at all. */
|
|
116
|
+
function recordWarmupError(err, startTime, isBootRecovery, timezone) {
|
|
117
|
+
const duration = Date.now() - startTime;
|
|
118
|
+
(0, config_1.writeLog)({
|
|
119
|
+
timestamp: new Date().toISOString(),
|
|
120
|
+
status: 'failed',
|
|
121
|
+
message: `Pre-warm error: ${err.message}`,
|
|
122
|
+
}, timezone);
|
|
123
|
+
return { success: false, message: `Error: ${err.message}`, duration, isBootRecovery };
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Execute the pre-warm synchronously. This is the path the OS scheduler
|
|
127
|
+
* (`_execute-warmup`) uses — it must stay blocking and side-effect-identical.
|
|
128
|
+
*/
|
|
129
|
+
function executeWarmup(isBootRecovery = false, dryRun = false) {
|
|
130
|
+
const config = (0, config_1.readConfig)();
|
|
131
|
+
const startTime = Date.now();
|
|
132
|
+
const timezone = config?.schedule.timezone || 'UTC';
|
|
133
|
+
const claudeBinary = config?.runtime?.claudePath || 'claude';
|
|
134
|
+
if (dryRun)
|
|
135
|
+
return dryRunResult(isBootRecovery);
|
|
70
136
|
try {
|
|
71
|
-
const result = (0, child_process_1.spawnSync)(claudeBinary,
|
|
137
|
+
const result = (0, child_process_1.spawnSync)(claudeBinary, PING_ARGS, {
|
|
72
138
|
encoding: 'utf-8',
|
|
73
|
-
timeout:
|
|
139
|
+
timeout: PING_TIMEOUT_MS,
|
|
74
140
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
75
|
-
env:
|
|
141
|
+
env: pingEnv(),
|
|
76
142
|
});
|
|
77
|
-
|
|
78
|
-
if (result.status === 0) {
|
|
79
|
-
const logEntry = {
|
|
80
|
-
timestamp: new Date().toISOString(),
|
|
81
|
-
status: isBootRecovery ? 'boot-recovery' : 'success',
|
|
82
|
-
message: isBootRecovery
|
|
83
|
-
? `Boot-recovery pre-warm executed (machine was off at scheduled time)`
|
|
84
|
-
: `Pre-warm executed successfully`,
|
|
85
|
-
scheduledTime: config?.schedule.time || 'unknown',
|
|
86
|
-
actualTime: new Date().toLocaleTimeString('en-US', {
|
|
87
|
-
timeZone: timezone,
|
|
88
|
-
hour: 'numeric',
|
|
89
|
-
minute: '2-digit',
|
|
90
|
-
hour12: true,
|
|
91
|
-
}),
|
|
92
|
-
};
|
|
93
|
-
(0, config_1.writeLog)(logEntry, timezone);
|
|
94
|
-
return {
|
|
95
|
-
success: true,
|
|
96
|
-
message: isBootRecovery
|
|
97
|
-
? 'Boot-recovery pre-warm sent!'
|
|
98
|
-
: 'Pre-warm sent successfully!',
|
|
99
|
-
duration,
|
|
100
|
-
isBootRecovery,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
const errorMsg = result.stderr?.trim() || 'Unknown error';
|
|
105
|
-
const logEntry = {
|
|
106
|
-
timestamp: new Date().toISOString(),
|
|
107
|
-
status: 'failed',
|
|
108
|
-
message: `Pre-warm failed: ${errorMsg}`,
|
|
109
|
-
scheduledTime: config?.schedule.time || 'unknown',
|
|
110
|
-
actualTime: new Date().toLocaleTimeString('en-US', {
|
|
111
|
-
timeZone: timezone,
|
|
112
|
-
hour: 'numeric',
|
|
113
|
-
minute: '2-digit',
|
|
114
|
-
hour12: true,
|
|
115
|
-
}),
|
|
116
|
-
};
|
|
117
|
-
(0, config_1.writeLog)(logEntry, timezone);
|
|
118
|
-
return {
|
|
119
|
-
success: false,
|
|
120
|
-
message: `Failed: ${errorMsg}`,
|
|
121
|
-
duration,
|
|
122
|
-
isBootRecovery,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
143
|
+
return finalizeWarmup(result.status === 0, result.stderr || '', startTime, isBootRecovery, config, timezone);
|
|
125
144
|
}
|
|
126
145
|
catch (err) {
|
|
127
|
-
|
|
128
|
-
const logEntry = {
|
|
129
|
-
timestamp: new Date().toISOString(),
|
|
130
|
-
status: 'failed',
|
|
131
|
-
message: `Pre-warm error: ${err.message}`,
|
|
132
|
-
};
|
|
133
|
-
(0, config_1.writeLog)(logEntry, timezone);
|
|
134
|
-
return {
|
|
135
|
-
success: false,
|
|
136
|
-
message: `Error: ${err.message}`,
|
|
137
|
-
duration,
|
|
138
|
-
isBootRecovery,
|
|
139
|
-
};
|
|
146
|
+
return recordWarmupError(err, startTime, isBootRecovery, timezone);
|
|
140
147
|
}
|
|
141
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Execute the pre-warm asynchronously (non-blocking) so an interactive caller
|
|
151
|
+
* can animate a live spinner tied to the REAL ping latency. Used by `warmup
|
|
152
|
+
* test`; the scheduler keeps the sync path above. Logs/reports identically.
|
|
153
|
+
*/
|
|
154
|
+
function executeWarmupAsync(isBootRecovery = false, dryRun = false) {
|
|
155
|
+
const config = (0, config_1.readConfig)();
|
|
156
|
+
const startTime = Date.now();
|
|
157
|
+
const timezone = config?.schedule.timezone || 'UTC';
|
|
158
|
+
const claudeBinary = config?.runtime?.claudePath || 'claude';
|
|
159
|
+
if (dryRun)
|
|
160
|
+
return Promise.resolve(dryRunResult(isBootRecovery));
|
|
161
|
+
return new Promise((resolve) => {
|
|
162
|
+
let settled = false;
|
|
163
|
+
let stderr = '';
|
|
164
|
+
let timer;
|
|
165
|
+
// Settle exactly once. The log-writing side effect lives INSIDE the guard
|
|
166
|
+
// (build is only invoked when we actually settle) so a late 'close' after a
|
|
167
|
+
// kill/error can't write a second log entry.
|
|
168
|
+
const settle = (build) => {
|
|
169
|
+
if (settled)
|
|
170
|
+
return;
|
|
171
|
+
settled = true;
|
|
172
|
+
if (timer)
|
|
173
|
+
clearTimeout(timer);
|
|
174
|
+
resolve(build());
|
|
175
|
+
};
|
|
176
|
+
let child;
|
|
177
|
+
try {
|
|
178
|
+
child = (0, child_process_1.spawn)(claudeBinary, PING_ARGS, { stdio: ['pipe', 'pipe', 'pipe'], env: pingEnv() });
|
|
179
|
+
}
|
|
180
|
+
catch (err) {
|
|
181
|
+
// Synchronous spawn throw — mirrors the sync path's catch.
|
|
182
|
+
settle(() => recordWarmupError(err, startTime, isBootRecovery, timezone));
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
// Mirror spawnSync semantics: give the child immediate stdin EOF (else
|
|
186
|
+
// `claude` waits ~3s for stdin) and drain stdout (else a >64KB write could
|
|
187
|
+
// back-pressure and never close). stderr is captured for the failure path.
|
|
188
|
+
child.stdin?.end();
|
|
189
|
+
child.stdout?.resume();
|
|
190
|
+
child.stderr?.on('data', (chunk) => { stderr += chunk.toString(); });
|
|
191
|
+
timer = setTimeout(() => {
|
|
192
|
+
// Route through finalizeWarmup so the log entry matches the sync path
|
|
193
|
+
// (status 'failed' + scheduledTime/actualTime + "Pre-warm failed:" wording).
|
|
194
|
+
settle(() => finalizeWarmup(false, 'Timed out after 30s', startTime, isBootRecovery, config, timezone));
|
|
195
|
+
try {
|
|
196
|
+
child.kill('SIGKILL');
|
|
197
|
+
}
|
|
198
|
+
catch { /* already exited */ }
|
|
199
|
+
child.unref(); // don't keep the event loop alive if the kill is slow
|
|
200
|
+
}, PING_TIMEOUT_MS);
|
|
201
|
+
child.on('error', (err) => settle(() => finalizeWarmup(false, err.message, startTime, isBootRecovery, config, timezone)));
|
|
202
|
+
child.on('close', (code) => settle(() => finalizeWarmup(code === 0, stderr, startTime, isBootRecovery, config, timezone)));
|
|
203
|
+
});
|
|
204
|
+
}
|
|
142
205
|
/**
|
|
143
206
|
* Boot-recovery check: determine if we should fire a pre-warm now
|
|
144
207
|
* because the scheduled time was missed (machine was off).
|
|
@@ -159,4 +222,56 @@ function shouldBootRecover(config, now = new Date()) {
|
|
|
159
222
|
const mostRecentScheduledOccurrence = (0, config_1.getMostRecentScheduledOccurrence)(config.schedule.time, config.schedule.timezone, now);
|
|
160
223
|
return !(0, config_1.hasSuccessfulRunSince)(mostRecentScheduledOccurrence);
|
|
161
224
|
}
|
|
225
|
+
/** Tolerance (minutes) around the scheduled time for a "normal" run. Must stay
|
|
226
|
+
* in sync with the default passed to isNearScheduledTime below. */
|
|
227
|
+
exports.NEAR_SCHEDULE_TOLERANCE_MINUTES = 5;
|
|
228
|
+
/**
|
|
229
|
+
* Dedup window (minutes) for the near-schedule run. Two near-schedule fires for
|
|
230
|
+
* the same occurrence both fall within ±tolerance of the scheduled minute, so
|
|
231
|
+
* they are at most 2*tolerance apart; the window must exceed that to dedup a
|
|
232
|
+
* re-fire. 15 > 2*5 leaves a 5-minute margin. If the tolerance grows, grow this.
|
|
233
|
+
*/
|
|
234
|
+
exports.NEAR_SCHEDULE_DEDUP_WINDOW_MINUTES = 15;
|
|
235
|
+
/**
|
|
236
|
+
* Whether to run a normal (near-schedule) pre-warm now: within tolerance of the
|
|
237
|
+
* scheduled time AND no successful run in the recent dedup window. A recency
|
|
238
|
+
* window — not the most-recent scheduled occurrence — is used so a fire a few
|
|
239
|
+
* minutes BEFORE the scheduled minute is not wrongly suppressed by yesterday's
|
|
240
|
+
* success (which getMostRecentScheduledOccurrence would round back to). A
|
|
241
|
+
* RunAtLoad login moments after the scheduled fire is still deduped.
|
|
242
|
+
*/
|
|
243
|
+
function shouldRunNearSchedule(config, now = new Date()) {
|
|
244
|
+
if (!config.schedule.enabled)
|
|
245
|
+
return false;
|
|
246
|
+
if (!(0, config_1.isNearScheduledTime)(config.schedule.time, config.schedule.timezone, exports.NEAR_SCHEDULE_TOLERANCE_MINUTES, now)) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
const windowStart = new Date(now.getTime() - exports.NEAR_SCHEDULE_DEDUP_WINDOW_MINUTES * 60 * 1000);
|
|
250
|
+
return !(0, config_1.hasSuccessfulRunSince)(windowStart);
|
|
251
|
+
}
|
|
252
|
+
/** Latest point after the scheduled time at which a missed window is still
|
|
253
|
+
* worth recording (keeps stale overnight gaps out of the log). */
|
|
254
|
+
const SKIP_LOG_MAX_ELAPSED_MINUTES = 18 * 60;
|
|
255
|
+
/**
|
|
256
|
+
* Whether to record a "skipped" entry: the scheduled time passed, the 5-hour
|
|
257
|
+
* recovery window has expired (so {@link shouldBootRecover} declined), and no
|
|
258
|
+
* run or skip has been recorded yet for this occurrence. This turns the old
|
|
259
|
+
* silent no-op — the literal "never runs even if I open my pc later" — into a
|
|
260
|
+
* visible signal, recorded at most once per day.
|
|
261
|
+
*/
|
|
262
|
+
function shouldLogSkip(config, now = new Date()) {
|
|
263
|
+
if (!config.schedule.enabled)
|
|
264
|
+
return false;
|
|
265
|
+
const elapsedMinutes = (0, config_1.getMinutesSinceScheduled)(config.schedule.time, config.schedule.timezone, now);
|
|
266
|
+
// Within the recovery window shouldBootRecover handles it; far past it the
|
|
267
|
+
// miss is stale and not worth surfacing.
|
|
268
|
+
if (elapsedMinutes < 5 * 60 || elapsedMinutes > SKIP_LOG_MAX_ELAPSED_MINUTES) {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
const mostRecentScheduledOccurrence = (0, config_1.getMostRecentScheduledOccurrence)(config.schedule.time, config.schedule.timezone, now);
|
|
272
|
+
// Suppress the skip if anything already happened for this occurrence —
|
|
273
|
+
// including a failure, so we never log a contradicting "skipped" after a
|
|
274
|
+
// "failed".
|
|
275
|
+
return !(0, config_1.hasOutcomeSince)(mostRecentScheduledOccurrence);
|
|
276
|
+
}
|
|
162
277
|
//# sourceMappingURL=warmup.js.map
|
package/dist/warmup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warmup.js","sourceRoot":"","sources":["../src/warmup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warmup.js","sourceRoot":"","sources":["../src/warmup.ts"],"names":[],"mappings":";;;AAkBA,8CAWC;AAGD,sDAYC;AAGD,4CAcC;AA+FD,sCAmBC;AAOD,gDAqDC;AAYD,8CAsBC;AAsBD,sDAcC;AAaD,sCA2BC;AAzVD,iDAAiD;AACjD,qCAQkB;AAClB,uCAAkD;AAElD,0EAA0E;AAC1E,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAE3E,4CAA4C;AAC5C,SAAgB,iBAAiB,CAAC,SAAiB,QAAQ;IACzD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE;YAC9C,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,gEAAgE;AAChE,SAAgB,qBAAqB,CAAC,SAAiB,QAAQ;IAC7D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE;YAC7D,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC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,CACJ,EAAE,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,0CAAkC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7F,OAAO,CAAC,IAAA,8BAAqB,EAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED;mEACmE;AACnE,MAAM,4BAA4B,GAAG,EAAE,GAAG,EAAE,CAAC;AAE7C;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,MAE7B,EAAE,MAAY,IAAI,IAAI,EAAE;IACvB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAE3C,MAAM,cAAc,GAAG,IAAA,iCAAwB,EAC7C,MAAM,CAAC,QAAQ,CAAC,IAAI,EACpB,MAAM,CAAC,QAAQ,CAAC,QAAQ,EACxB,GAAG,CACJ,CAAC;IAEF,2EAA2E;IAC3E,yCAAyC;IACzC,IAAI,cAAc,GAAG,CAAC,GAAG,EAAE,IAAI,cAAc,GAAG,4BAA4B,EAAE,CAAC;QAC7E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,6BAA6B,GAAG,IAAA,yCAAgC,EACpE,MAAM,CAAC,QAAQ,CAAC,IAAI,EACpB,MAAM,CAAC,QAAQ,CAAC,QAAQ,EACxB,GAAG,CACJ,CAAC;IAEF,uEAAuE;IACvE,yEAAyE;IACzE,YAAY;IACZ,OAAO,CAAC,IAAA,wBAAe,EAAC,6BAA6B,CAAC,CAAC;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohitkumawat/warmup-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Pre-warm your Claude rate limits while you sleep. One command, zero daily effort.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -38,12 +38,14 @@
|
|
|
38
38
|
"figures": "^3.2.0",
|
|
39
39
|
"gradient-string": "^2.0.2",
|
|
40
40
|
"inquirer": "^8.2.6",
|
|
41
|
+
"inquirer-autocomplete-prompt": "^2.0.1",
|
|
41
42
|
"ora": "^5.4.1",
|
|
42
43
|
"string-width": "^4.2.3"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@types/gradient-string": "^1.1.6",
|
|
46
47
|
"@types/inquirer": "^8.2.10",
|
|
48
|
+
"@types/inquirer-autocomplete-prompt": "^3.0.3",
|
|
47
49
|
"@types/node": "^20.11.0",
|
|
48
50
|
"ts-node": "^10.9.2",
|
|
49
51
|
"typescript": "^5.3.3"
|