agent-afk 5.35.3 → 5.36.0

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.
@@ -0,0 +1,63 @@
1
+ export type ServiceName = 'telegram' | 'daemon';
2
+ export declare const SERVICE_NAMES: readonly ServiceName[];
3
+ export interface ServiceInstallOptions {
4
+ noWatch?: boolean;
5
+ dryRun?: boolean;
6
+ environment?: Record<string, string>;
7
+ }
8
+ export type ServiceInstallOutcome = {
9
+ kind: 'installed';
10
+ configPath: string;
11
+ label: string;
12
+ autoRestartOnRebuild: boolean;
13
+ notes?: string[];
14
+ } | {
15
+ kind: 'already-installed';
16
+ configPath: string;
17
+ label: string;
18
+ } | {
19
+ kind: 'failed';
20
+ reason: string;
21
+ };
22
+ export type ServiceUninstallOutcome = {
23
+ kind: 'uninstalled';
24
+ configPath: string;
25
+ } | {
26
+ kind: 'not-installed';
27
+ configPath: string;
28
+ } | {
29
+ kind: 'failed';
30
+ reason: string;
31
+ };
32
+ export type ServiceRestartOutcome = {
33
+ kind: 'restarted';
34
+ label: string;
35
+ } | {
36
+ kind: 'not-installed';
37
+ configPath: string;
38
+ } | {
39
+ kind: 'failed';
40
+ reason: string;
41
+ };
42
+ export interface ServiceStatus {
43
+ name: ServiceName;
44
+ label: string;
45
+ installed: boolean;
46
+ configPath: string;
47
+ pid?: number;
48
+ lastExitStatus?: number;
49
+ logFile: string;
50
+ }
51
+ export interface ServiceManager {
52
+ readonly backend: 'launchd' | 'systemd';
53
+ readonly configKind: string;
54
+ install(name: ServiceName, opts?: ServiceInstallOptions): ServiceInstallOutcome;
55
+ uninstall(name: ServiceName): ServiceUninstallOutcome;
56
+ status(name: ServiceName): ServiceStatus;
57
+ restart(name: ServiceName): ServiceRestartOutcome;
58
+ isInstalled(name: ServiceName): boolean;
59
+ configPath(name: ServiceName): string;
60
+ logPath(name: ServiceName): string;
61
+ label(name: ServiceName): string;
62
+ readConfigFile(name: ServiceName): string | undefined;
63
+ }