palmier 0.3.7 → 0.3.8

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,12 +96,18 @@ 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.
99
+ // Update the service file's PATH so the daemon can find agent CLIs.
100
+ // Resolve the user's login PATH (not the daemon's limited PATH)
101
+ // by sourcing their shell profile.
101
102
  const servicePath = path.join(UNIT_DIR, "palmier.service");
102
103
  if (fs.existsSync(servicePath)) {
104
+ let userPath = process.env.PATH || "";
105
+ try {
106
+ userPath = execSync("bash -lc 'echo $PATH'", { encoding: "utf-8" }).trim();
107
+ }
108
+ catch { /* fall back to current PATH */ }
103
109
  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"}`);
110
+ const updated = content.replace(/^Environment=PATH=.*/m, `Environment=PATH=${userPath || "/usr/local/bin:/usr/bin:/bin"}`);
105
111
  if (updated !== content) {
106
112
  fs.writeFileSync(servicePath, updated, "utf-8");
107
113
  execSync("systemctl --user daemon-reload", { encoding: "utf-8" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
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,14 +113,19 @@ 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.
116
+ // Update the service file's PATH so the daemon can find agent CLIs.
117
+ // Resolve the user's login PATH (not the daemon's limited PATH)
118
+ // by sourcing their shell profile.
118
119
  const servicePath = path.join(UNIT_DIR, "palmier.service");
119
120
  if (fs.existsSync(servicePath)) {
121
+ let userPath = process.env.PATH || "";
122
+ try {
123
+ userPath = execSync("bash -lc 'echo $PATH'", { encoding: "utf-8" }).trim();
124
+ } catch { /* fall back to current PATH */ }
120
125
  const content = fs.readFileSync(servicePath, "utf-8");
121
126
  const updated = content.replace(
122
127
  /^Environment=PATH=.*/m,
123
- `Environment=PATH=${process.env.PATH || "/usr/local/bin:/usr/bin:/bin"}`,
128
+ `Environment=PATH=${userPath || "/usr/local/bin:/usr/bin:/bin"}`,
124
129
  );
125
130
  if (updated !== content) {
126
131
  fs.writeFileSync(servicePath, updated, "utf-8");