palmier 0.3.9 → 0.4.0

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/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Website:** [palmier.me](https://www.palmier.me) | **App:** [app.palmier.me](https://app.palmier.me)
8
8
 
9
- A Node.js CLI that runs on your machine as a persistent daemon. It lets you create, schedule, and run AI agent tasks from your phone or browser, communicating via a cloud relay (NATS) and/or direct HTTP.
9
+ A Node.js CLI that lets you run your own AI agents from your phone. It runs on your machine as a persistent daemon, letting you create, schedule, and monitor agent tasks from any device via a cloud relay (NATS) and/or direct HTTP.
10
10
 
11
11
  > **Important:** By using Palmier, you agree to the [Terms of Service](https://www.palmier.me/terms) and [Privacy Policy](https://www.palmier.me/privacy). See the [Disclaimer](#disclaimer) section below.
12
12
 
@@ -15,7 +15,7 @@ const agentLabels = {
15
15
  gemini: "Gemini CLI",
16
16
  codex: "Codex CLI",
17
17
  openclaw: "OpenClaw",
18
- copilot: "GitHub Copilot",
18
+ copilot: "Copilot CLI",
19
19
  };
20
20
  export async function detectAgents() {
21
21
  const detected = [];
@@ -106,9 +106,17 @@ export class WindowsPlatform {
106
106
  console.log("\nHost initialization complete!");
107
107
  }
108
108
  async restartDaemon() {
109
- // Kill the old daemon if we have its PID
110
- if (fs.existsSync(DAEMON_PID_FILE)) {
111
- const oldPid = fs.readFileSync(DAEMON_PID_FILE, "utf-8").trim();
109
+ const script = process.argv[1] || "palmier";
110
+ const oldPid = fs.existsSync(DAEMON_PID_FILE)
111
+ ? fs.readFileSync(DAEMON_PID_FILE, "utf-8").trim()
112
+ : null;
113
+ // Spawn the new daemon before killing the old one.
114
+ this.spawnDaemon(script);
115
+ if (oldPid && oldPid === String(process.pid)) {
116
+ // We ARE the old daemon (auto-update) — exit so only the new one runs.
117
+ process.exit(0);
118
+ }
119
+ else if (oldPid) {
112
120
  try {
113
121
  execFileSync("taskkill", ["/pid", oldPid, "/t", "/f"], { windowsHide: true });
114
122
  }
@@ -116,8 +124,6 @@ export class WindowsPlatform {
116
124
  // Process may have already exited
117
125
  }
118
126
  }
119
- const script = process.argv[1] || "palmier";
120
- this.spawnDaemon(script);
121
127
  }
122
128
  spawnDaemon(script) {
123
129
  const child = nodeSpawn(process.execPath, [script, "serve"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "Palmier host CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hongxu Cai",
@@ -43,7 +43,7 @@ const agentLabels: Record<string, string> = {
43
43
  gemini: "Gemini CLI",
44
44
  codex: "Codex CLI",
45
45
  openclaw: "OpenClaw",
46
- copilot: "GitHub Copilot",
46
+ copilot: "Copilot CLI",
47
47
  };
48
48
 
49
49
  export interface DetectedAgent {
@@ -126,18 +126,24 @@ export class WindowsPlatform implements PlatformService {
126
126
  }
127
127
 
128
128
  async restartDaemon(): Promise<void> {
129
- // Kill the old daemon if we have its PID
130
- if (fs.existsSync(DAEMON_PID_FILE)) {
131
- const oldPid = fs.readFileSync(DAEMON_PID_FILE, "utf-8").trim();
129
+ const script = process.argv[1] || "palmier";
130
+ const oldPid = fs.existsSync(DAEMON_PID_FILE)
131
+ ? fs.readFileSync(DAEMON_PID_FILE, "utf-8").trim()
132
+ : null;
133
+
134
+ // Spawn the new daemon before killing the old one.
135
+ this.spawnDaemon(script);
136
+
137
+ if (oldPid && oldPid === String(process.pid)) {
138
+ // We ARE the old daemon (auto-update) — exit so only the new one runs.
139
+ process.exit(0);
140
+ } else if (oldPid) {
132
141
  try {
133
142
  execFileSync("taskkill", ["/pid", oldPid, "/t", "/f"], { windowsHide: true });
134
143
  } catch {
135
144
  // Process may have already exited
136
145
  }
137
146
  }
138
-
139
- const script = process.argv[1] || "palmier";
140
- this.spawnDaemon(script);
141
147
  }
142
148
 
143
149
  private spawnDaemon(script: string): void {