trymeanwhile 1.3.0 → 1.3.1
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/bin/meanwhile.js +24 -3
- package/package.json +1 -1
package/bin/meanwhile.js
CHANGED
|
@@ -49,10 +49,10 @@ async function downloadTo(remoteName, localPath) {
|
|
|
49
49
|
fs.writeFileSync(localPath, await res.text());
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function wireSettings(settingsPath, runtime, scriptPath) {
|
|
52
|
+
function wireSettings(settingsPath, runtime, scriptPath, extra = {}) {
|
|
53
53
|
fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
|
|
54
54
|
const settings = fs.existsSync(settingsPath) ? JSON.parse(fs.readFileSync(settingsPath, "utf8") || "{}") : {};
|
|
55
|
-
settings.statusLine = { type: "command", command: `"${runtime}" "${scriptPath}"
|
|
55
|
+
settings.statusLine = { type: "command", command: `"${runtime}" "${scriptPath}"`, ...extra };
|
|
56
56
|
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
57
57
|
vlog(`wired into ${settingsPath}`);
|
|
58
58
|
}
|
|
@@ -176,7 +176,7 @@ async function main() {
|
|
|
176
176
|
|
|
177
177
|
const claudeScript = path.join(INSTALL_DIR, "statusline.js");
|
|
178
178
|
await downloadTo("statusline.js", claudeScript);
|
|
179
|
-
wireSettings(path.join(os.homedir(), ".claude", "settings.json"), node, claudeScript);
|
|
179
|
+
wireSettings(path.join(os.homedir(), ".claude", "settings.json"), node, claudeScript, { refreshInterval: 10 });
|
|
180
180
|
|
|
181
181
|
if (wireCopilot) {
|
|
182
182
|
const copilotScript = path.join(INSTALL_DIR, "copilot_statusline.js");
|
|
@@ -185,12 +185,33 @@ async function main() {
|
|
|
185
185
|
vlog("Copilot CLI detected -- wired that too, same install ID, earnings share one balance.");
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
// Prove the connection actually works right now, before asking anyone
|
|
189
|
+
// to trust a restart they can't yet see the result of. A skeptical
|
|
190
|
+
// first-time installer shouldn't have to take "it'll work after you
|
|
191
|
+
// restart" on faith -- this is the exact same /line call the real
|
|
192
|
+
// client makes, just fired once, synchronously, during install.
|
|
193
|
+
// Non-fatal if it fails (slow network, offline install) -- the real
|
|
194
|
+
// client will pick it up fine once the tool actually restarts.
|
|
195
|
+
let sampleLine = null;
|
|
196
|
+
try {
|
|
197
|
+
const params = new URLSearchParams({ id: installId, event: "install_check", sid: "", cost: "", tok: "", cwd: "" });
|
|
198
|
+
const res = await fetch(`${SERVER}/line?${params}`, { signal: AbortSignal.timeout(5000) });
|
|
199
|
+
if (res.ok) {
|
|
200
|
+
const data = await res.json();
|
|
201
|
+
if (data.line) sampleLine = data.line;
|
|
202
|
+
}
|
|
203
|
+
} catch {}
|
|
204
|
+
|
|
188
205
|
// The one-time summary a real person actually reads. This used to be
|
|
189
206
|
// seven identically-styled lines -- the one thing that actually matters
|
|
190
207
|
// (restart your tool) read no differently than housekeeping. Blank
|
|
191
208
|
// lines and indentation do the hierarchy work no --verbose flag can.
|
|
192
209
|
console.log("meanwhile: installed. congratulations, you now get paid to wait.");
|
|
193
210
|
console.log();
|
|
211
|
+
if (sampleLine) {
|
|
212
|
+
console.log(` just tested the connection -- here's a real line: "${sampleLine}"`);
|
|
213
|
+
console.log();
|
|
214
|
+
}
|
|
194
215
|
console.log(" restart Claude Code to see it live");
|
|
195
216
|
console.log(" (the one step between you and money -- yes, actually do it)");
|
|
196
217
|
console.log();
|
package/package.json
CHANGED