import type { ProjectRegistration } from '../../types'; import { getCliEntryPoint, getNodePath } from './node-paths'; import type { ServiceConfig, ServiceOptions, ServiceStatus, ServiceStrategy } from './types'; export { getCliEntryPoint, getNodePath }; /** Returns the systemd unit name for a given project (without .service suffix) */ export declare function getProjectUnitName(tenantCode: string, projectCode: string): string; /** Returns the .service file path for a given project */ export declare function getProjectUnitFilePath(tenantCode: string, projectCode: string): string; /** Lists all per-project unit files under ~/.config/systemd/user */ export declare function getAllProjectUnits(): Array<{ unitName: string; unitPath: string; }>; /** * Detect ai-support-agent unit files manually placed under /etc/systemd/system/. * * The CLI only manages user-scope units (~/.config/systemd/user/). System-scope * units have to be created out-of-band (typically `sudo cp` by an operator) and * the CLI cannot manage them — but it can still warn the user that a stray * unit exists, since running both at the same time creates duplicate Docker * containers and confusing "not installed" diagnostics from `service status`. * * Returns the absolute paths of matching unit files. Returns an empty list * when the directory is unreadable (e.g. permission denied on a hardened host). */ export declare function detectSystemSystemdUnits(): string[]; export declare function generateServiceUnit(options: ServiceConfig): string; /** Generate a systemd unit that runs a wrapper shell script for one project */ export declare function generateProjectServiceUnit(opts: { unitName: string; wrapperScriptPath: string; logDir: string; }): string; /** Generate a bash wrapper script that runs docker for one project */ export declare function generateWrapperScript(opts: { imageName: string; tenantCode: string; projectCode: string; projectConfigHostDir: string; projectDir?: string; token: string; apiUrl: string; anthropicApiKey?: string; claudeCodeOauthToken?: string; codexApiKey?: string; codexAccessToken?: string; verbose?: boolean; updateScriptPath: string; /** * Per-project log directory. When set, the wrapper redirects the docker * subprocess's stdout and stderr into separate `ai-support-agent * log-rotate --no-tee` subprocesses, producing `agent.out.log` / * `agent.err.log` (plus rotated generations `.1` … `.N`) under this * directory. The systemd unit's `StandardOutput` / `StandardError` * point at separate `wrapper.out.log` / `wrapper.err.log` files (NOT * the rotator-owned paths) to avoid a double-write race where * systemd's open fd would otherwise keep appending to a rotated * generation. */ logDir?: string; }): string; /** Generate the update-and-restart.sh script for systemd */ export declare function generateUpdateScript(): string; /** * Write run.sh and systemd unit for a single project. Does NOT systemctl start. * Returns the unit file path. */ export declare function writeProjectServiceFiles(project: ProjectRegistration, options?: { verbose?: boolean; }): string; /** * Install service files and immediately start a single project via systemctl. * Idempotent: stops any existing service before starting so that token/config * updates take effect immediately. */ export declare function installAndStartProject(project: ProjectRegistration, options?: { verbose?: boolean; }): void; export declare class LinuxServiceStrategy implements ServiceStrategy { install(options: ServiceOptions): void; uninstall(): void; start(): void; stop(): void; restart(): void; status(): ServiceStatus; } //# sourceMappingURL=linux-service.d.ts.map