pi-sdk-web 0.4.0 → 0.4.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.
@@ -28,7 +28,23 @@ from rpc_client import RpcClient, RpcCommands
28
28
  from websocket import WebSocketConnection, WebSocketServer
29
29
 
30
30
  DEFAULT_PORT = 4080
31
- STATIC_DIR = Path(__file__).resolve().parent.parent / "static"
31
+
32
+
33
+ def _resolve_static_dir() -> Path:
34
+ """Find the static/ directory: the repo layout keeps it next to the
35
+ project root (server.py's parent.parent), while the npm package layout
36
+ ships it at dist/static (server.py lives at dist/pi-bin/server/). Search
37
+ upward so both layouts resolve."""
38
+ d = Path(__file__).resolve().parent
39
+ for _ in range(4):
40
+ candidate = d / "static"
41
+ if candidate.is_dir():
42
+ return candidate
43
+ d = d.parent
44
+ return Path(__file__).resolve().parent / "static"
45
+
46
+
47
+ STATIC_DIR = _resolve_static_dir()
32
48
 
33
49
 
34
50
  class Peripheral:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-sdk-web",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Browser Web access for Pi (AI coding agent) via the Pi SDK - standalone module, zero modification to Pi itself",
5
5
  "type": "module",
6
6
  "bin": {