palmier 0.9.5 → 0.9.7

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 (258) hide show
  1. package/README.md +30 -13
  2. package/dist/agents/agent.d.ts +0 -1
  3. package/dist/agents/agent.js +0 -1
  4. package/dist/agents/aider.d.ts +0 -1
  5. package/dist/agents/aider.js +0 -1
  6. package/dist/agents/claude.d.ts +0 -1
  7. package/dist/agents/claude.js +0 -1
  8. package/dist/agents/cline.d.ts +0 -1
  9. package/dist/agents/cline.js +0 -1
  10. package/dist/agents/codex.d.ts +0 -1
  11. package/dist/agents/codex.js +0 -1
  12. package/dist/agents/copilot.d.ts +0 -1
  13. package/dist/agents/copilot.js +0 -1
  14. package/dist/agents/cursor.d.ts +0 -1
  15. package/dist/agents/cursor.js +0 -1
  16. package/dist/agents/deepagents.d.ts +0 -1
  17. package/dist/agents/deepagents.js +0 -1
  18. package/dist/agents/droid.d.ts +0 -1
  19. package/dist/agents/droid.js +0 -1
  20. package/dist/agents/gemini.d.ts +0 -1
  21. package/dist/agents/gemini.js +0 -1
  22. package/dist/agents/goose.d.ts +0 -1
  23. package/dist/agents/goose.js +0 -1
  24. package/dist/agents/hermes.d.ts +0 -1
  25. package/dist/agents/hermes.js +0 -1
  26. package/dist/agents/kimi.d.ts +0 -1
  27. package/dist/agents/kimi.js +0 -1
  28. package/dist/agents/kiro.d.ts +0 -1
  29. package/dist/agents/kiro.js +0 -1
  30. package/dist/agents/openclaw.d.ts +0 -1
  31. package/dist/agents/openclaw.js +0 -1
  32. package/dist/agents/opencode.d.ts +0 -1
  33. package/dist/agents/opencode.js +0 -1
  34. package/dist/agents/qoder.d.ts +0 -1
  35. package/dist/agents/qoder.js +0 -1
  36. package/dist/agents/qwen.d.ts +0 -1
  37. package/dist/agents/qwen.js +0 -1
  38. package/dist/agents/shared-prompt.d.ts +0 -1
  39. package/dist/agents/shared-prompt.js +0 -1
  40. package/dist/client-store.d.ts +0 -1
  41. package/dist/client-store.js +0 -1
  42. package/dist/commands/clients.d.ts +0 -1
  43. package/dist/commands/clients.js +0 -1
  44. package/dist/commands/info.d.ts +0 -1
  45. package/dist/commands/info.js +0 -1
  46. package/dist/commands/init.d.ts +0 -1
  47. package/dist/commands/init.js +3 -4
  48. package/dist/commands/pair.d.ts +0 -1
  49. package/dist/commands/pair.js +0 -1
  50. package/dist/commands/restart.d.ts +0 -1
  51. package/dist/commands/restart.js +0 -1
  52. package/dist/commands/run.d.ts +0 -1
  53. package/dist/commands/run.js +0 -1
  54. package/dist/commands/serve.d.ts +0 -1
  55. package/dist/commands/serve.js +0 -1
  56. package/dist/commands/uninstall.d.ts +0 -1
  57. package/dist/commands/uninstall.js +0 -1
  58. package/dist/config.d.ts +0 -1
  59. package/dist/config.js +0 -1
  60. package/dist/event-queues.d.ts +0 -1
  61. package/dist/event-queues.js +0 -1
  62. package/dist/events.d.ts +0 -1
  63. package/dist/events.js +0 -1
  64. package/dist/index.d.ts +0 -1
  65. package/dist/index.js +0 -1
  66. package/dist/linked-device.d.ts +0 -1
  67. package/dist/linked-device.js +0 -1
  68. package/dist/mcp-handler.d.ts +0 -1
  69. package/dist/mcp-handler.js +0 -1
  70. package/dist/mcp-tools.d.ts +0 -1
  71. package/dist/mcp-tools.js +0 -1
  72. package/dist/nats-client.d.ts +0 -1
  73. package/dist/nats-client.js +0 -1
  74. package/dist/network.d.ts +0 -1
  75. package/dist/network.js +0 -1
  76. package/dist/notification-store.d.ts +0 -1
  77. package/dist/notification-store.js +0 -1
  78. package/dist/pending-requests.d.ts +0 -1
  79. package/dist/pending-requests.js +0 -1
  80. package/dist/platform/index.d.ts +0 -1
  81. package/dist/platform/index.js +0 -1
  82. package/dist/platform/linux.d.ts +0 -1
  83. package/dist/platform/linux.js +0 -1
  84. package/dist/platform/macos.d.ts +0 -1
  85. package/dist/platform/macos.js +0 -1
  86. package/dist/platform/platform.d.ts +0 -1
  87. package/dist/platform/platform.js +0 -1
  88. package/dist/platform/windows.d.ts +0 -1
  89. package/dist/platform/windows.js +0 -1
  90. package/dist/pwa/apple-touch-icon.png +0 -0
  91. package/dist/pwa/assets/index-D1bIhEbd.css +1 -0
  92. package/dist/pwa/assets/{index-Cvffaohh.js → index-DWvRAUiy.js} +31 -31
  93. package/dist/pwa/assets/{web-qdLcAD7T.js → web-C4iZbqTC.js} +1 -1
  94. package/dist/pwa/assets/{web-ChtbM4nv.js → web-CBFqJGX6.js} +1 -1
  95. package/dist/pwa/assets/{web-hExASsqW.js → web-DL4uXOpS.js} +1 -1
  96. package/dist/pwa/favicon.ico +0 -0
  97. package/dist/pwa/index.html +3 -3
  98. package/dist/pwa/manifest.webmanifest +1 -1
  99. package/dist/pwa/pwa-192x192.png +0 -0
  100. package/dist/pwa/pwa-512x512.png +0 -0
  101. package/dist/pwa/service-worker.js +1 -1
  102. package/dist/rpc-handler.d.ts +0 -1
  103. package/dist/rpc-handler.js +3 -10
  104. package/dist/sms-store.d.ts +0 -1
  105. package/dist/sms-store.js +0 -1
  106. package/dist/spawn-command.d.ts +0 -1
  107. package/dist/spawn-command.js +0 -1
  108. package/dist/task.d.ts +1 -1
  109. package/dist/task.js +14 -1
  110. package/dist/transports/http-transport.d.ts +0 -1
  111. package/dist/transports/http-transport.js +0 -1
  112. package/dist/transports/nats-transport.d.ts +0 -1
  113. package/dist/transports/nats-transport.js +0 -1
  114. package/dist/types.d.ts +0 -1
  115. package/dist/types.js +0 -1
  116. package/dist/update-checker.d.ts +0 -1
  117. package/dist/update-checker.js +0 -1
  118. package/package.json +5 -1
  119. package/.github/workflows/ci.yml +0 -16
  120. package/.github/workflows/publish.yml +0 -37
  121. package/CLAUDE.md +0 -22
  122. package/dist/pwa/assets/index-DBgOYBrB.css +0 -1
  123. package/palmier-server/.github/workflows/ci.yml +0 -21
  124. package/palmier-server/.github/workflows/deploy.yml +0 -38
  125. package/palmier-server/CLAUDE.md +0 -17
  126. package/palmier-server/PRODUCTION.md +0 -358
  127. package/palmier-server/README.md +0 -231
  128. package/palmier-server/nats.conf +0 -19
  129. package/palmier-server/package.json +0 -15
  130. package/palmier-server/pnpm-lock.yaml +0 -7639
  131. package/palmier-server/pnpm-workspace.yaml +0 -3
  132. package/palmier-server/pwa/index.html +0 -16
  133. package/palmier-server/pwa/logo/logo-prompt.md +0 -28
  134. package/palmier-server/pwa/logo/logo_20260330.png +0 -0
  135. package/palmier-server/pwa/package.json +0 -34
  136. package/palmier-server/pwa/public/apple-touch-icon.png +0 -0
  137. package/palmier-server/pwa/public/favicon.ico +0 -0
  138. package/palmier-server/pwa/public/pwa-192x192.png +0 -0
  139. package/palmier-server/pwa/public/pwa-512x512.png +0 -0
  140. package/palmier-server/pwa/src/App.css +0 -3004
  141. package/palmier-server/pwa/src/App.tsx +0 -59
  142. package/palmier-server/pwa/src/agentLabels.ts +0 -11
  143. package/palmier-server/pwa/src/api.ts +0 -67
  144. package/palmier-server/pwa/src/components/CapabilityToggles.tsx +0 -170
  145. package/palmier-server/pwa/src/components/ConnectionStatusIcon.tsx +0 -114
  146. package/palmier-server/pwa/src/components/HostMenu.tsx +0 -429
  147. package/palmier-server/pwa/src/components/PermissionsDialog.tsx +0 -34
  148. package/palmier-server/pwa/src/components/PullToRefreshIndicator.tsx +0 -46
  149. package/palmier-server/pwa/src/components/RunDetailView.tsx +0 -343
  150. package/palmier-server/pwa/src/components/SessionComposer.tsx +0 -157
  151. package/palmier-server/pwa/src/components/SessionsView.tsx +0 -326
  152. package/palmier-server/pwa/src/components/SwipeToDeleteRow.tsx +0 -170
  153. package/palmier-server/pwa/src/components/TabBar.tsx +0 -40
  154. package/palmier-server/pwa/src/components/TaskCard.tsx +0 -255
  155. package/palmier-server/pwa/src/components/TaskForm.tsx +0 -764
  156. package/palmier-server/pwa/src/components/TasksView.tsx +0 -179
  157. package/palmier-server/pwa/src/constants.ts +0 -2
  158. package/palmier-server/pwa/src/contexts/HostConnectionContext.tsx +0 -432
  159. package/palmier-server/pwa/src/contexts/HostStoreContext.tsx +0 -124
  160. package/palmier-server/pwa/src/draftGuard.ts +0 -24
  161. package/palmier-server/pwa/src/formatTime.ts +0 -44
  162. package/palmier-server/pwa/src/hooks/useBackClose.ts +0 -75
  163. package/palmier-server/pwa/src/hooks/useMediaQuery.ts +0 -17
  164. package/palmier-server/pwa/src/hooks/usePullToRefresh.ts +0 -102
  165. package/palmier-server/pwa/src/hooks/usePushSubscription.ts +0 -77
  166. package/palmier-server/pwa/src/main.tsx +0 -14
  167. package/palmier-server/pwa/src/native/Device.ts +0 -49
  168. package/palmier-server/pwa/src/pages/Dashboard.tsx +0 -542
  169. package/palmier-server/pwa/src/pages/PairHost.tsx +0 -232
  170. package/palmier-server/pwa/src/pages/PairSetup.tsx +0 -134
  171. package/palmier-server/pwa/src/service-worker.ts +0 -142
  172. package/palmier-server/pwa/src/types.ts +0 -75
  173. package/palmier-server/pwa/src/vite-env.d.ts +0 -11
  174. package/palmier-server/pwa/tsconfig.json +0 -21
  175. package/palmier-server/pwa/tsconfig.node.json +0 -19
  176. package/palmier-server/pwa/vite.config.ts +0 -47
  177. package/palmier-server/server/.env.example +0 -20
  178. package/palmier-server/server/package.json +0 -36
  179. package/palmier-server/server/src/db.ts +0 -44
  180. package/palmier-server/server/src/fcm.ts +0 -74
  181. package/palmier-server/server/src/index.ts +0 -688
  182. package/palmier-server/server/src/nats-jwt.ts +0 -299
  183. package/palmier-server/server/src/nats-setup.ts +0 -48
  184. package/palmier-server/server/src/nats.ts +0 -33
  185. package/palmier-server/server/src/notify.ts +0 -34
  186. package/palmier-server/server/src/push.ts +0 -68
  187. package/palmier-server/server/src/routes/device.ts +0 -224
  188. package/palmier-server/server/src/routes/fcm.ts +0 -64
  189. package/palmier-server/server/src/routes/hosts.ts +0 -56
  190. package/palmier-server/server/src/routes/push.ts +0 -101
  191. package/palmier-server/server/tsconfig.json +0 -20
  192. package/palmier-server/spec.md +0 -533
  193. package/src/agents/agent-instructions.md +0 -28
  194. package/src/agents/agent.ts +0 -114
  195. package/src/agents/aider.ts +0 -35
  196. package/src/agents/claude.ts +0 -39
  197. package/src/agents/cline.ts +0 -35
  198. package/src/agents/codex.ts +0 -40
  199. package/src/agents/copilot.ts +0 -37
  200. package/src/agents/cursor.ts +0 -36
  201. package/src/agents/deepagents.ts +0 -36
  202. package/src/agents/droid.ts +0 -35
  203. package/src/agents/gemini.ts +0 -43
  204. package/src/agents/goose.ts +0 -33
  205. package/src/agents/hermes.ts +0 -36
  206. package/src/agents/kimi.ts +0 -35
  207. package/src/agents/kiro.ts +0 -36
  208. package/src/agents/openclaw.ts +0 -29
  209. package/src/agents/opencode.ts +0 -36
  210. package/src/agents/qoder.ts +0 -36
  211. package/src/agents/qwen.ts +0 -32
  212. package/src/agents/shared-prompt.ts +0 -30
  213. package/src/client-store.ts +0 -68
  214. package/src/commands/clients.ts +0 -29
  215. package/src/commands/info.ts +0 -29
  216. package/src/commands/init.ts +0 -165
  217. package/src/commands/pair.ts +0 -137
  218. package/src/commands/restart.ts +0 -6
  219. package/src/commands/run.ts +0 -608
  220. package/src/commands/serve.ts +0 -211
  221. package/src/commands/uninstall.ts +0 -9
  222. package/src/config.ts +0 -36
  223. package/src/cross-spawn.d.ts +0 -5
  224. package/src/event-queues.ts +0 -41
  225. package/src/events.ts +0 -29
  226. package/src/index.ts +0 -111
  227. package/src/linked-device.ts +0 -52
  228. package/src/mcp-handler.ts +0 -200
  229. package/src/mcp-tools.ts +0 -839
  230. package/src/nats-client.ts +0 -19
  231. package/src/network.ts +0 -96
  232. package/src/notification-store.ts +0 -30
  233. package/src/pending-requests.ts +0 -73
  234. package/src/platform/index.ts +0 -20
  235. package/src/platform/linux.ts +0 -296
  236. package/src/platform/macos.ts +0 -329
  237. package/src/platform/platform.ts +0 -31
  238. package/src/platform/windows.ts +0 -299
  239. package/src/rpc-handler.ts +0 -694
  240. package/src/sms-store.ts +0 -28
  241. package/src/spawn-command.ts +0 -123
  242. package/src/task.ts +0 -330
  243. package/src/transports/http-transport.ts +0 -478
  244. package/src/transports/nats-transport.ts +0 -76
  245. package/src/types.ts +0 -89
  246. package/src/update-checker.ts +0 -40
  247. package/test/agent-instructions.test.ts +0 -209
  248. package/test/agent-output-parsing.test.ts +0 -74
  249. package/test/linux-cron.test.ts +0 -41
  250. package/test/macos-plist.test.ts +0 -112
  251. package/test/notification-store.test.ts +0 -57
  252. package/test/pairing.test.ts +0 -35
  253. package/test/result-state.test.ts +0 -110
  254. package/test/task-parsing.test.ts +0 -82
  255. package/test/taskrun-messages.test.ts +0 -224
  256. package/test/tsconfig.json +0 -9
  257. package/test/windows-xml.test.ts +0 -89
  258. package/tsconfig.json +0 -19
@@ -1,64 +0,0 @@
1
- import { Router, Request, Response } from "express";
2
- import type { Router as RouterType } from "express";
3
- import { pool } from "../db.js";
4
- import { getNatsConnection } from "../nats.js";
5
- import { StringCodec } from "nats";
6
-
7
- const router: RouterType = Router();
8
-
9
- // POST /api/fcm/register - Register or refresh an FCM token for a host
10
- router.post("/register", async (req: Request, res: Response) => {
11
- try {
12
- const { hostId, fcmToken, deviceLabel } = req.body;
13
-
14
- if (!hostId || !fcmToken) {
15
- res.status(400).json({ error: "hostId and fcmToken are required" });
16
- return;
17
- }
18
-
19
- await pool.query(
20
- `INSERT INTO fcm_tokens (host_id, fcm_token, device_label, updated_at)
21
- VALUES ($1, $2, $3, NOW())
22
- ON CONFLICT (host_id, fcm_token)
23
- DO UPDATE SET device_label = EXCLUDED.device_label, updated_at = NOW()`,
24
- [hostId, fcmToken, deviceLabel || null]
25
- );
26
-
27
- res.status(201).json({ message: "FCM token registered" });
28
- } catch (err) {
29
- console.error("FCM register error:", err);
30
- res.status(500).json({ error: "Internal server error" });
31
- }
32
- });
33
-
34
- // POST /api/fcm/geolocation-response - Receive location from Android device, forward via NATS
35
- router.post("/geolocation-response", async (req: Request, res: Response) => {
36
- try {
37
- const { requestId, hostId, latitude, longitude, accuracy, timestamp, error } = req.body;
38
-
39
- if (!requestId || !hostId) {
40
- res.status(400).json({ error: "requestId and hostId are required" });
41
- return;
42
- }
43
-
44
- const conn = await getNatsConnection();
45
- const sc = StringCodec();
46
- const subject = `host.${hostId}.geolocation.${requestId}`;
47
-
48
- if (error) {
49
- conn.publish(subject, sc.encode(JSON.stringify({ error })));
50
- } else {
51
- conn.publish(
52
- subject,
53
- sc.encode(JSON.stringify({ latitude, longitude, accuracy, timestamp }))
54
- );
55
- }
56
-
57
- res.json({ message: "Location forwarded" });
58
- } catch (err) {
59
- console.error("FCM geolocation-response error:", err);
60
- res.status(500).json({ error: "Internal server error" });
61
- }
62
- });
63
-
64
- export default router;
@@ -1,56 +0,0 @@
1
- import { Router, Request, Response } from "express";
2
- import type { Router as RouterType } from "express";
3
- import { pool } from "../db.js";
4
- import { createHostCredentials } from "../nats-jwt.js";
5
-
6
- const router: RouterType = Router();
7
-
8
- // POST /api/hosts/register - Register a host (called by palmier init).
9
- // If the request includes a hostId that already exists, the row is reused
10
- // so re-initializing a host doesn't create a duplicate entry.
11
- router.post("/register", async (req: Request, res: Response) => {
12
- try {
13
- const accountSeed = process.env.NATS_ACCOUNT_SEED;
14
- if (!accountSeed) {
15
- console.error("NATS_ACCOUNT_SEED not configured");
16
- res.status(500).json({ error: "Server NATS auth not configured" });
17
- return;
18
- }
19
-
20
- const requestedId: string | undefined = req.body?.hostId;
21
-
22
- let hostId: string;
23
- if (requestedId) {
24
- // Reuse existing row or create one with the requested id.
25
- await pool.query(
26
- `INSERT INTO hosts (id) VALUES ($1) ON CONFLICT (id) DO NOTHING`,
27
- [requestedId],
28
- );
29
- hostId = requestedId;
30
- } else {
31
- const result = await pool.query(
32
- "INSERT INTO hosts DEFAULT VALUES RETURNING id"
33
- );
34
- hostId = result.rows[0].id;
35
- }
36
-
37
- // Generate per-host NATS credentials (scoped to this host's subjects)
38
- const creds = createHostCredentials(accountSeed, hostId);
39
-
40
- const natsUrl = process.env.NATS_HOST_URL || process.env.NATS_URL || "nats://localhost:4222";
41
- const natsWsUrl = process.env.NATS_WS_URL || "";
42
-
43
- res.status(201).json({
44
- hostId,
45
- natsUrl,
46
- natsWsUrl,
47
- natsJwt: creds.jwt,
48
- natsNkeySeed: creds.nkeySeed,
49
- });
50
- } catch (err) {
51
- console.error("Register host error:", err);
52
- res.status(500).json({ error: "Internal server error" });
53
- }
54
- });
55
-
56
- export default router;
@@ -1,101 +0,0 @@
1
- import { Router, Request, Response } from "express";
2
- import type { Router as RouterType } from "express";
3
- import { pool } from "../db.js";
4
- import { getNatsConnection } from "../nats.js";
5
- import { StringCodec } from "nats";
6
-
7
- const router: RouterType = Router();
8
-
9
- // POST /api/push/subscribe - Upsert push subscription (keyed by hostId)
10
- router.post("/subscribe", async (req: Request, res: Response) => {
11
- try {
12
- const { hostId, endpoint, keys } = req.body;
13
-
14
- if (!hostId || !endpoint || !keys || !keys.p256dh || !keys.auth) {
15
- res.status(400).json({
16
- error: "hostId, endpoint, keys.p256dh, and keys.auth are required",
17
- });
18
- return;
19
- }
20
-
21
- await pool.query(
22
- `INSERT INTO push_subscriptions (host_id, endpoint, p256dh, auth)
23
- VALUES ($1, $2, $3, $4)
24
- ON CONFLICT (host_id, endpoint)
25
- DO UPDATE SET p256dh = EXCLUDED.p256dh, auth = EXCLUDED.auth`,
26
- [hostId, endpoint, keys.p256dh, keys.auth]
27
- );
28
-
29
- res.status(201).json({ message: "Push subscription saved" });
30
- } catch (err) {
31
- console.error("Push subscribe error:", err);
32
- res.status(500).json({ error: "Internal server error" });
33
- }
34
- });
35
-
36
- // DELETE /api/push/subscribe - Delete push subscription by endpoint
37
- router.delete("/subscribe", async (req: Request, res: Response) => {
38
- try {
39
- const { hostId, endpoint } = req.body;
40
-
41
- if (!hostId || !endpoint) {
42
- res.status(400).json({ error: "hostId and endpoint are required" });
43
- return;
44
- }
45
-
46
- const result = await pool.query(
47
- "DELETE FROM push_subscriptions WHERE host_id = $1 AND endpoint = $2 RETURNING id",
48
- [hostId, endpoint]
49
- );
50
-
51
- if (result.rows.length === 0) {
52
- res.status(404).json({ error: "Subscription not found" });
53
- return;
54
- }
55
-
56
- res.json({ message: "Push subscription removed" });
57
- } catch (err) {
58
- console.error("Push unsubscribe error:", err);
59
- res.status(500).json({ error: "Internal server error" });
60
- }
61
- });
62
-
63
- // GET /api/push/vapid-key - Public endpoint
64
- router.get("/vapid-key", (_req, res: Response) => {
65
- const publicKey = process.env.VAPID_PUBLIC_KEY || "";
66
- res.json({ publicKey });
67
- });
68
-
69
- // POST /api/push/respond - Respond to a pending request via NATS request-reply
70
- router.post("/respond", async (req: Request, res: Response) => {
71
- try {
72
- const { task_id, session_id, host_id, response } = req.body;
73
- const id = session_id || task_id;
74
-
75
- if (!id || !host_id || !response) {
76
- res.status(400).json({
77
- error: "host_id, response, and session_id (or task_id for permissions) are required",
78
- });
79
- return;
80
- }
81
-
82
- const conn = await getNatsConnection();
83
- const sc = StringCodec();
84
- const subject = `host.${host_id}.rpc.task.user_input`;
85
- const payload = sc.encode(JSON.stringify({ id, value: [response] }));
86
-
87
- const reply = await conn.request(subject, payload, { timeout: 5000 });
88
- const result = JSON.parse(sc.decode(reply.data));
89
-
90
- res.json({ message: "Confirmation response recorded", ...result });
91
- } catch (err: any) {
92
- console.error("Push respond error:", err);
93
- if (err.code === "503" || err.message?.includes("timeout")) {
94
- res.status(504).json({ error: "Host did not respond" });
95
- return;
96
- }
97
- res.status(500).json({ error: "Internal server error" });
98
- }
99
- });
100
-
101
- export default router;
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2023",
4
- "module": "Node16",
5
- "moduleResolution": "Node16",
6
- "lib": ["ES2023"],
7
- "outDir": "dist",
8
- "rootDir": "src",
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "resolveJsonModule": true,
14
- "declaration": true,
15
- "declarationMap": true,
16
- "sourceMap": true
17
- },
18
- "include": ["src"],
19
- "exclude": ["node_modules", "dist"]
20
- }