palmier 0.3.6 → 0.3.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.
@@ -96,6 +96,17 @@ WantedBy=default.target
96
96
  console.log("\nHost initialization complete!");
97
97
  }
98
98
  async restartDaemon() {
99
+ // Update the service file's PATH to the current shell PATH,
100
+ // so the daemon can find agent CLIs installed after init.
101
+ const servicePath = path.join(UNIT_DIR, "palmier.service");
102
+ if (fs.existsSync(servicePath)) {
103
+ const content = fs.readFileSync(servicePath, "utf-8");
104
+ const updated = content.replace(/^Environment=PATH=.*/m, `Environment=PATH=${process.env.PATH || "/usr/local/bin:/usr/bin:/bin"}`);
105
+ if (updated !== content) {
106
+ fs.writeFileSync(servicePath, updated, "utf-8");
107
+ execSync("systemctl --user daemon-reload", { encoding: "utf-8" });
108
+ }
109
+ }
99
110
  execSync("systemctl --user restart palmier.service", { stdio: "inherit" });
100
111
  console.log("Palmier daemon restarted.");
101
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Palmier host CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hongxu Cai",
@@ -113,6 +113,20 @@ WantedBy=default.target
113
113
  }
114
114
 
115
115
  async restartDaemon(): Promise<void> {
116
+ // Update the service file's PATH to the current shell PATH,
117
+ // so the daemon can find agent CLIs installed after init.
118
+ const servicePath = path.join(UNIT_DIR, "palmier.service");
119
+ if (fs.existsSync(servicePath)) {
120
+ const content = fs.readFileSync(servicePath, "utf-8");
121
+ const updated = content.replace(
122
+ /^Environment=PATH=.*/m,
123
+ `Environment=PATH=${process.env.PATH || "/usr/local/bin:/usr/bin:/bin"}`,
124
+ );
125
+ if (updated !== content) {
126
+ fs.writeFileSync(servicePath, updated, "utf-8");
127
+ execSync("systemctl --user daemon-reload", { encoding: "utf-8" });
128
+ }
129
+ }
116
130
  execSync("systemctl --user restart palmier.service", { stdio: "inherit" });
117
131
  console.log("Palmier daemon restarted.");
118
132
  }