pennyrouter 0.2.23 → 0.2.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pennyrouter",
3
- "version": "0.2.23",
3
+ "version": "0.2.24",
4
4
  "description": "Install and manage PennyRouter local coding-agent integrations.",
5
5
  "homepage": "https://pennyrouter.com",
6
6
  "bugs": {
package/src/statusline.js CHANGED
@@ -46,7 +46,7 @@ export async function configureClaudeCodeStatusline(current) {
46
46
  current.statusLine = {
47
47
  type: "command",
48
48
  command: `node "${statuslineScriptPath()}"`,
49
- refreshInterval: 10,
49
+ refreshInterval: 1,
50
50
  ...(existing?.padding !== undefined ? { padding: existing.padding } : {}),
51
51
  };
52
52
  return { script_path: statuslineScriptPath(), wrapped: Boolean(config.wrap_command) };
@@ -121,6 +121,9 @@ if (process.argv[2] === "--refresh") {
121
121
  });
122
122
  if (resp.ok) {
123
123
  const data = await resp.json();
124
+ if (data.cache_expires_at && typeof data.cache_expires_at === "number") {
125
+ data.cache_expires_at = Math.round(data.cache_expires_at / 10) * 10;
126
+ }
124
127
  mkdirSync(cacheDir, { recursive: true });
125
128
  writeFileSync(join(cacheDir, sessionId + ".json"), JSON.stringify(data));
126
129
  }
@@ -168,17 +171,15 @@ function askBadges(c) {
168
171
  // Cache warmth countdown: when a prompt cache prefix is live, show time remaining.
169
172
  // The gateway sends cache_expires_at (absolute Unix timestamp); we interpolate locally
170
173
  // so it ticks down smoothly every statusline render (every ~1s), only "jumping" when
171
- // the gateway refreshes (~10s) with a fresh timestamp. Round to nearest 10 seconds
172
- // to avoid annoying flicker; show ❄️ cold when expired.
174
+ // the gateway refreshes (~15s) with a fresh timestamp. Show ❄️ cold when expired.
173
175
  function cacheWarmth(c) {
174
176
  if (!c || typeof c.cache_expires_at !== "number" || c.cache_expires_at <= 0) {
175
177
  return "";
176
178
  }
177
179
  const remaining = c.cache_expires_at - Date.now() / 1000;
178
180
  if (remaining <= 0) return " · ❄️ cold";
179
- const roundedRemaining = Math.round(remaining / 10) * 10;
180
- const minutes = Math.floor(roundedRemaining / 60);
181
- const seconds = Math.floor(roundedRemaining % 60);
181
+ const minutes = Math.floor(remaining / 60);
182
+ const seconds = Math.floor(remaining % 60);
182
183
  return " · 🔥 warm " + minutes + ":" + String(seconds).padStart(2, "0");
183
184
  }
184
185