@ouro.bot/cli 0.1.0-alpha.544 → 0.1.0-alpha.545

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/changelog.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.545",
6
+ "changes": [
7
+ "Launchd-managed habit jobs now inherit the runtime PATH in their plist environment, preventing login-started jobs from failing to find the Node runtime.",
8
+ "The default daemon starter now launches with the current process executable instead of a bare `node` lookup, so background restarts survive sparse launch contexts.",
9
+ "Adds regression coverage for restart launch path hardening and mail-import discovery timestamp fallbacks."
10
+ ]
11
+ },
4
12
  {
5
13
  "version": "0.1.0-alpha.544",
6
14
  "changes": [
@@ -81,7 +81,7 @@ function defaultStartDaemonProcess(socketPath) {
81
81
  // when the daemon's logging system writes to stderr after the parent exits.
82
82
  const outFd = fs.openSync(os.devNull, "w");
83
83
  const errFd = fs.openSync(os.devNull, "w");
84
- const child = (0, child_process_1.spawn)("node", [entry, "--socket", socketPath], {
84
+ const child = (0, child_process_1.spawn)(process.execPath, [entry, "--socket", socketPath], {
85
85
  detached: true,
86
86
  stdio: ["ignore", outFd, errFd],
87
87
  });
@@ -77,6 +77,7 @@ function createRealOsCronDeps() {
77
77
  },
78
78
  mkdirp: (dir) => fs.mkdirSync(dir, { recursive: true }),
79
79
  homeDir: os.homedir(),
80
+ envPath: process.env.PATH ?? "",
80
81
  };
81
82
  }
82
83
  function createRealCrontabDeps() {
@@ -80,7 +80,7 @@ function scheduleToCalendarInterval(schedule) {
80
80
  result.Month = parseInt(month, 10);
81
81
  return Object.keys(result).length > 0 ? result : null;
82
82
  }
83
- function generatePlistXml(job) {
83
+ function generatePlistXml(job, envPath) {
84
84
  const label = plistLabel(job);
85
85
  const seconds = cadenceToSeconds(job.schedule);
86
86
  const calendar = seconds === null ? scheduleToCalendarInterval(job.schedule) : null;
@@ -97,7 +97,7 @@ function generatePlistXml(job) {
97
97
  else {
98
98
  triggerXml = ` <key>StartInterval</key>\n <integer>1800</integer>`;
99
99
  }
100
- return [
100
+ const lines = [
101
101
  `<?xml version="1.0" encoding="UTF-8"?>`,
102
102
  `<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">`,
103
103
  `<plist version="1.0">`,
@@ -110,14 +110,12 @@ function generatePlistXml(job) {
110
110
  ...job.command.split(" ").slice(1).map((arg) => ` <string>${arg}</string>`),
111
111
  ` </array>`,
112
112
  triggerXml,
113
- ` <key>StandardOutPath</key>`,
114
- ` <string>/tmp/${label}.stdout.log</string>`,
115
- ` <key>StandardErrorPath</key>`,
116
- ` <string>/tmp/${label}.stderr.log</string>`,
117
- `</dict>`,
118
- `</plist>`,
119
- ``,
120
- ].join("\n");
113
+ ];
114
+ if (envPath) {
115
+ lines.push(` <key>EnvironmentVariables</key>`, ` <dict>`, ` <key>PATH</key>`, ` <string>${envPath}</string>`, ` </dict>`);
116
+ }
117
+ lines.push(` <key>StandardOutPath</key>`, ` <string>/tmp/${label}.stdout.log</string>`, ` <key>StandardErrorPath</key>`, ` <string>/tmp/${label}.stderr.log</string>`, `</dict>`, `</plist>`, ``);
118
+ return lines.join("\n");
121
119
  }
122
120
  class LaunchdCronManager {
123
121
  deps;
@@ -148,7 +146,7 @@ class LaunchdCronManager {
148
146
  const label = plistLabel(job);
149
147
  const filename = `${label}.plist`;
150
148
  const fullPath = `${this.launchAgentsDir}/${filename}`;
151
- const xml = generatePlistXml(job);
149
+ const xml = generatePlistXml(job, this.deps.envPath);
152
150
  try {
153
151
  this.deps.exec(`launchctl unload "${fullPath}"`);
154
152
  }
@@ -248,6 +246,7 @@ function createOsCronManager(options = {}) {
248
246
  listDir: () => [],
249
247
  mkdirp: () => { },
250
248
  homeDir: os.homedir(),
249
+ envPath: process.env.PATH ?? "",
251
250
  };
252
251
  /* v8 ignore stop */
253
252
  return new LaunchdCronManager(deps);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.544",
3
+ "version": "0.1.0-alpha.545",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",