pi-insomnia 0.1.0 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ This project follows the spirit of [Keep a Changelog](https://keepachangelog.com
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.2] - 2026-07-01
10
+
11
+ ### Changed
12
+
13
+ - Update Pi core development dependency for Pi 0.80 compatibility.
14
+
15
+ ## [0.1.1] - 2026-06-09
16
+
9
17
  ## [0.1.0] - TBD
10
18
 
11
19
  ### Added
@@ -4,9 +4,34 @@ import { MacSleepInhibitor } from "../src/sleep-inhibitor.js";
4
4
 
5
5
  const STATUS_KEY = "pi-insomnia";
6
6
 
7
- function setStatus(ctx: ExtensionContext, active: boolean): void {
7
+ // Braille spinner — same 10-frame cycle used by npm, vite, webpack, etc.
8
+ const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
9
+ const SPINNER_INTERVAL_MS = 80;
10
+
11
+ let spinnerTimer: ReturnType<typeof setInterval> | undefined;
12
+ let spinnerFrame = 0;
13
+
14
+ function setStatus(ctx: ExtensionContext, text: string | undefined): void {
8
15
  if (!ctx.hasUI) return;
9
- ctx.ui.setStatus(STATUS_KEY, active ? "☕ sleep inhibited" : undefined);
16
+ ctx.ui.setStatus(STATUS_KEY, text);
17
+ }
18
+
19
+ function startSpinner(ctx: ExtensionContext): void {
20
+ if (!ctx.hasUI || spinnerTimer) return;
21
+ spinnerFrame = 0;
22
+ setStatus(ctx, `${SPINNER_FRAMES[0]} sleep inhibited`);
23
+ spinnerTimer = setInterval(() => {
24
+ spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES.length;
25
+ setStatus(ctx, `${SPINNER_FRAMES[spinnerFrame]} sleep inhibited`);
26
+ }, SPINNER_INTERVAL_MS);
27
+ }
28
+
29
+ function stopSpinner(ctx: ExtensionContext): void {
30
+ if (spinnerTimer) {
31
+ clearInterval(spinnerTimer);
32
+ spinnerTimer = undefined;
33
+ }
34
+ setStatus(ctx, undefined);
10
35
  }
11
36
 
12
37
  export default function piInsomnia(pi: ExtensionAPI) {
@@ -15,16 +40,16 @@ export default function piInsomnia(pi: ExtensionAPI) {
15
40
  const inhibitor = new MacSleepInhibitor();
16
41
 
17
42
  pi.on("agent_start", async (_event, ctx) => {
18
- if (inhibitor.acquire()) setStatus(ctx, true);
43
+ if (inhibitor.acquire()) startSpinner(ctx);
19
44
  });
20
45
 
21
46
  pi.on("agent_end", async (_event, ctx) => {
22
47
  inhibitor.release();
23
- if (!inhibitor.isInhibiting) setStatus(ctx, false);
48
+ if (!inhibitor.isInhibiting) stopSpinner(ctx);
24
49
  });
25
50
 
26
51
  pi.on("session_shutdown", async (_event, ctx) => {
27
52
  inhibitor.forceStop();
28
- setStatus(ctx, false);
53
+ stopSpinner(ctx);
29
54
  });
30
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-insomnia",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Prevent macOS idle sleep while Pi agents are working.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,8 +51,8 @@
51
51
  "@earendil-works/pi-coding-agent": "*"
52
52
  },
53
53
  "devDependencies": {
54
- "@earendil-works/pi-coding-agent": "^0.78.0",
55
- "@types/node": "^25.6.2",
54
+ "@earendil-works/pi-coding-agent": "^0.80.0",
55
+ "@types/node": "^25.9.3",
56
56
  "typescript": "^6.0.3"
57
57
  },
58
58
  "publishConfig": {