palmier 0.7.2 → 0.7.4

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.
Files changed (36) hide show
  1. package/README.md +43 -22
  2. package/dist/commands/serve.js +14 -1
  3. package/dist/device-capabilities.d.ts +9 -0
  4. package/dist/device-capabilities.js +36 -0
  5. package/dist/mcp-handler.js +4 -1
  6. package/dist/mcp-tools.js +414 -7
  7. package/dist/pwa/assets/{index-C6Lz09EY.css → index-B-ByUHPS.css} +1 -1
  8. package/dist/pwa/assets/index-BirmfPUC.js +118 -0
  9. package/dist/pwa/assets/{web-HDs03L2B.js → web-Dc9-IiRD.js} +1 -1
  10. package/dist/pwa/assets/{web-CBI458eN.js → web-_b3Dvcvz.js} +1 -1
  11. package/dist/pwa/index.html +2 -2
  12. package/dist/pwa/service-worker.js +1 -1
  13. package/dist/rpc-handler.js +19 -4
  14. package/dist/sms-store.d.ts +11 -0
  15. package/dist/sms-store.js +19 -0
  16. package/dist/transports/http-transport.js +16 -1
  17. package/package.json +1 -1
  18. package/palmier-server/README.md +11 -3
  19. package/palmier-server/pwa/src/App.css +3 -0
  20. package/palmier-server/pwa/src/components/HostMenu.tsx +465 -0
  21. package/palmier-server/pwa/src/constants.ts +1 -1
  22. package/palmier-server/server/src/index.ts +306 -0
  23. package/palmier-server/server/src/routes/device.ts +168 -0
  24. package/palmier-server/spec.md +32 -3
  25. package/src/commands/serve.ts +14 -1
  26. package/src/device-capabilities.ts +55 -0
  27. package/src/mcp-handler.ts +4 -1
  28. package/src/mcp-tools.ts +473 -7
  29. package/src/rpc-handler.ts +19 -4
  30. package/src/sms-store.ts +28 -0
  31. package/src/transports/http-transport.ts +16 -1
  32. package/test/agent-instructions.test.ts +1 -1
  33. package/dist/location-device.d.ts +0 -8
  34. package/dist/location-device.js +0 -32
  35. package/dist/pwa/assets/index-DLxrL0hR.js +0 -118
  36. package/src/location-device.ts +0 -35
@@ -1,35 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { CONFIG_DIR } from "./config.js";
4
-
5
- const LOCATION_FILE = path.join(CONFIG_DIR, "location-device.json");
6
-
7
- export interface LocationDevice {
8
- clientToken: string;
9
- fcmToken: string;
10
- }
11
-
12
- export function getLocationDevice(): LocationDevice | null {
13
- try {
14
- if (!fs.existsSync(LOCATION_FILE)) return null;
15
- const raw = fs.readFileSync(LOCATION_FILE, "utf-8");
16
- const data = JSON.parse(raw) as LocationDevice;
17
- if (!data.clientToken || !data.fcmToken) return null;
18
- return data;
19
- } catch {
20
- return null;
21
- }
22
- }
23
-
24
- export function setLocationDevice(clientToken: string, fcmToken: string): void {
25
- fs.mkdirSync(CONFIG_DIR, { recursive: true });
26
- fs.writeFileSync(LOCATION_FILE, JSON.stringify({ clientToken, fcmToken }, null, 2), "utf-8");
27
- }
28
-
29
- export function clearLocationDevice(): void {
30
- try {
31
- if (fs.existsSync(LOCATION_FILE)) fs.unlinkSync(LOCATION_FILE);
32
- } catch {
33
- // ignore
34
- }
35
- }