1+ /** Platform-specific doctor notes for macOS gateway launchd state and startup tuning. */
12import { execFile } from "node:child_process" ;
23import fs from "node:fs" ;
34import os from "node:os" ;
@@ -18,6 +19,7 @@ function resolveHomeDir(): string {
1819 return process . env . HOME ?? os . homedir ( ) ;
1920}
2021
22+ /** Returns the macOS marker warning when LaunchAgent writes are locally disabled. */
2123export function collectMacLaunchAgentOverrideWarning ( deps ?: {
2224 platform ?: NodeJS . Platform ;
2325 homeDir ?: string ;
@@ -42,13 +44,15 @@ export function collectMacLaunchAgentOverrideWarning(deps?: {
4244 ] . join ( "\n" ) ;
4345}
4446
47+ /** Emits the macOS LaunchAgent override warning when present. */
4548export async function noteMacLaunchAgentOverrides ( ) {
4649 const warning = collectMacLaunchAgentOverrideWarning ( ) ;
4750 if ( warning ) {
4851 note ( warning , "Gateway (macOS)" ) ;
4952 }
5053}
5154
55+ /** Returns a warning for stale OpenClaw updater launchd jobs left after interrupted updates. */
5256export async function collectMacStaleOpenClawUpdateLaunchdJobsWarning ( deps ?: {
5357 platform ?: NodeJS . Platform ;
5458 findJobs ?: typeof findStaleOpenClawUpdateLaunchdJobs ;
@@ -80,6 +84,7 @@ export async function collectMacStaleOpenClawUpdateLaunchdJobsWarning(deps?: {
8084 ] . join ( "\n" ) ;
8185}
8286
87+ /** Emits stale updater launchd job notes using the gateway service environment when available. */
8388export async function noteMacStaleOpenClawUpdateLaunchdJobs ( deps ?: {
8489 platform ?: NodeJS . Platform ;
8590 findJobs ?: typeof findStaleOpenClawUpdateLaunchdJobs ;
@@ -122,6 +127,7 @@ function hasConfigGatewayCreds(cfg: OpenClawConfig): boolean {
122127 ) ;
123128}
124129
130+ /** Returns a warning for host-wide launchctl gateway auth env overrides. */
125131export async function collectMacLaunchctlGatewayEnvOverrideWarning (
126132 cfg : OpenClawConfig ,
127133 deps ?: {
@@ -171,6 +177,7 @@ export async function collectMacLaunchctlGatewayEnvOverrideWarning(
171177 . join ( "\n" ) ;
172178}
173179
180+ /** Emits macOS launchctl gateway auth override warnings. */
174181export async function noteMacLaunchctlGatewayEnvOverrides (
175182 cfg : OpenClawConfig ,
176183 deps ?: {
@@ -200,6 +207,7 @@ async function resolveGatewayServiceEnvForPlatformNotes(deps?: {
200207 : baseEnv ;
201208}
202209
210+ /** Collects all macOS gateway platform warnings without emitting notes. */
203211export async function collectMacGatewayPlatformWarnings (
204212 cfg : OpenClawConfig ,
205213 deps ?: {
@@ -246,6 +254,7 @@ function isTmpCompileCachePath(cachePath: string): boolean {
246254 ) ;
247255}
248256
257+ /** Emits startup tuning hints for low-power Linux hosts when env settings are suboptimal. */
249258export function noteStartupOptimizationHints (
250259 env : NodeJS . ProcessEnv = process . env ,
251260 deps ?: {
0 commit comments