process-watchdog 1.0.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.
- package/config/default.json +16 -0
- package/dashboard/watchdog.html +856 -0
- package/dist/api/routes.d.ts +6 -0
- package/dist/api/routes.d.ts.map +1 -0
- package/dist/api/routes.js +105 -0
- package/dist/api/routes.js.map +1 -0
- package/dist/api/server.d.ts +10 -0
- package/dist/api/server.d.ts.map +1 -0
- package/dist/api/server.js +16 -0
- package/dist/api/server.js.map +1 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +45 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon/processwatchdog.err.log +973 -0
- package/dist/daemon/processwatchdog.exe +0 -0
- package/dist/daemon/processwatchdog.exe.config +6 -0
- package/dist/daemon/processwatchdog.out.log +2 -0
- package/dist/daemon/processwatchdog.wrapper.log +18 -0
- package/dist/daemon/processwatchdog.xml +30 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +203 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/service.d.ts +3 -0
- package/dist/installer/service.d.ts.map +1 -0
- package/dist/installer/service.js +41 -0
- package/dist/installer/service.js.map +1 -0
- package/dist/integrations/mah.d.ts +3 -0
- package/dist/integrations/mah.d.ts.map +1 -0
- package/dist/integrations/mah.js +22 -0
- package/dist/integrations/mah.js.map +1 -0
- package/dist/integrations/total-recall.d.ts +3 -0
- package/dist/integrations/total-recall.d.ts.map +1 -0
- package/dist/integrations/total-recall.js +22 -0
- package/dist/integrations/total-recall.js.map +1 -0
- package/dist/platform/index.d.ts +4 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +10 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/platform.interface.d.ts +42 -0
- package/dist/platform/platform.interface.d.ts.map +1 -0
- package/dist/platform/platform.interface.js +2 -0
- package/dist/platform/platform.interface.js.map +1 -0
- package/dist/platform/windows.d.ts +14 -0
- package/dist/platform/windows.d.ts.map +1 -0
- package/dist/platform/windows.js +162 -0
- package/dist/platform/windows.js.map +1 -0
- package/dist/plugins/cpu-monitor.d.ts +11 -0
- package/dist/plugins/cpu-monitor.d.ts.map +1 -0
- package/dist/plugins/cpu-monitor.js +57 -0
- package/dist/plugins/cpu-monitor.js.map +1 -0
- package/dist/plugins/disk-health.d.ts +11 -0
- package/dist/plugins/disk-health.d.ts.map +1 -0
- package/dist/plugins/disk-health.js +111 -0
- package/dist/plugins/disk-health.js.map +1 -0
- package/dist/plugins/memory-monitor.d.ts +11 -0
- package/dist/plugins/memory-monitor.d.ts.map +1 -0
- package/dist/plugins/memory-monitor.js +61 -0
- package/dist/plugins/memory-monitor.js.map +1 -0
- package/dist/plugins/plugin-loader.d.ts +4 -0
- package/dist/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/plugin-loader.js +25 -0
- package/dist/plugins/plugin-loader.js.map +1 -0
- package/dist/plugins/plugin.interface.d.ts +28 -0
- package/dist/plugins/plugin.interface.d.ts.map +1 -0
- package/dist/plugins/plugin.interface.js +2 -0
- package/dist/plugins/plugin.interface.js.map +1 -0
- package/dist/plugins/process-guard.d.ts +11 -0
- package/dist/plugins/process-guard.d.ts.map +1 -0
- package/dist/plugins/process-guard.js +139 -0
- package/dist/plugins/process-guard.js.map +1 -0
- package/dist/plugins/startup-optimizer.d.ts +11 -0
- package/dist/plugins/startup-optimizer.d.ts.map +1 -0
- package/dist/plugins/startup-optimizer.js +78 -0
- package/dist/plugins/startup-optimizer.js.map +1 -0
- package/dist/scheduler.d.ts +16 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +46 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/store/history.d.ts +20 -0
- package/dist/store/history.d.ts.map +1 -0
- package/dist/store/history.js +60 -0
- package/dist/store/history.js.map +1 -0
- package/package.json +35 -0
- package/src/api/routes.ts +123 -0
- package/src/api/server.ts +20 -0
- package/src/config.ts +78 -0
- package/src/index.ts +228 -0
- package/src/installer/service.ts +50 -0
- package/src/integrations/mah.ts +22 -0
- package/src/integrations/total-recall.ts +27 -0
- package/src/platform/index.ts +13 -0
- package/src/platform/platform.interface.ts +46 -0
- package/src/platform/windows.ts +242 -0
- package/src/plugins/cpu-monitor.ts +67 -0
- package/src/plugins/disk-health.ts +128 -0
- package/src/plugins/memory-monitor.ts +70 -0
- package/src/plugins/plugin-loader.ts +27 -0
- package/src/plugins/plugin.interface.ts +31 -0
- package/src/plugins/process-guard.ts +165 -0
- package/src/plugins/startup-optimizer.ts +103 -0
- package/src/scheduler.ts +53 -0
- package/src/store/history.ts +90 -0
- package/tests/api/routes.test.ts +113 -0
- package/tests/config.test.ts +24 -0
- package/tests/platform/windows.test.ts +59 -0
- package/tests/plugins/cpu-monitor.test.ts +69 -0
- package/tests/plugins/disk-health.test.ts +69 -0
- package/tests/plugins/memory-monitor.test.ts +57 -0
- package/tests/plugins/plugin-loader.test.ts +35 -0
- package/tests/plugins/process-guard.test.ts +40 -0
- package/tests/plugins/startup-optimizer.test.ts +50 -0
- package/tests/scheduler.test.ts +69 -0
- package/tests/store/history.test.ts +89 -0
- package/tsconfig.json +18 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
function ps(script) {
|
|
3
|
+
return execFileSync('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', script], {
|
|
4
|
+
encoding: 'utf-8',
|
|
5
|
+
timeout: 60000,
|
|
6
|
+
}).trim();
|
|
7
|
+
}
|
|
8
|
+
function psJson(script) {
|
|
9
|
+
const raw = ps(`${script} | ConvertTo-Json -Compress`);
|
|
10
|
+
if (!raw)
|
|
11
|
+
return [];
|
|
12
|
+
return JSON.parse(raw);
|
|
13
|
+
}
|
|
14
|
+
export class WindowsPlatform {
|
|
15
|
+
async getProcesses() {
|
|
16
|
+
const result = psJson(`Get-Process -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, @{N='memoryMB';E={[math]::Round($_.WorkingSet64/1MB)}}, @{N='cpu';E={$_.CPU}}, Responding`);
|
|
17
|
+
const arr = Array.isArray(result) ? result : [result];
|
|
18
|
+
return arr.map((p) => ({
|
|
19
|
+
pid: p.Id,
|
|
20
|
+
name: p.ProcessName,
|
|
21
|
+
memoryMB: p.memoryMB ?? 0,
|
|
22
|
+
cpu: p.cpu ?? 0,
|
|
23
|
+
responding: p.Responding ?? false,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
async getProcessesByName(name) {
|
|
27
|
+
const result = psJson(`Get-Process ${name} -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, @{N='memoryMB';E={[math]::Round($_.WorkingSet64/1MB)}}, @{N='cpu';E={$_.CPU}}, Responding`);
|
|
28
|
+
const arr = Array.isArray(result) ? result : [result];
|
|
29
|
+
return arr.map((p) => ({
|
|
30
|
+
pid: p.Id,
|
|
31
|
+
name: p.ProcessName,
|
|
32
|
+
memoryMB: p.memoryMB ?? 0,
|
|
33
|
+
cpu: p.cpu ?? 0,
|
|
34
|
+
responding: p.Responding ?? false,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
async getListeningPids() {
|
|
38
|
+
const result = psJson(`Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue | Select-Object OwningProcess -Unique`);
|
|
39
|
+
if (!result)
|
|
40
|
+
return [];
|
|
41
|
+
const arr = Array.isArray(result) ? result : [result];
|
|
42
|
+
return arr.map((c) => c.OwningProcess);
|
|
43
|
+
}
|
|
44
|
+
async killProcess(pid) {
|
|
45
|
+
try {
|
|
46
|
+
ps(`Stop-Process -Id ${pid} -Force -ErrorAction Stop`);
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async getMemoryInfo() {
|
|
54
|
+
const osInfo = psJson(`Get-CimInstance Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, FreePhysicalMemory`);
|
|
55
|
+
const osArr = Array.isArray(osInfo) ? osInfo : [osInfo];
|
|
56
|
+
const os = osArr[0];
|
|
57
|
+
const totalMB = Math.round(os.TotalVisibleMemorySize / 1024);
|
|
58
|
+
const freeMB = Math.round(os.FreePhysicalMemory / 1024);
|
|
59
|
+
const usedMB = totalMB - freeMB;
|
|
60
|
+
const usedPct = totalMB > 0 ? Math.round((usedMB / totalMB) * 100) : 0;
|
|
61
|
+
let pageFileUsageMB = 0;
|
|
62
|
+
try {
|
|
63
|
+
const pfInfo = psJson(`Get-CimInstance Win32_PageFileUsage | Select-Object CurrentUsage`);
|
|
64
|
+
if (pfInfo) {
|
|
65
|
+
const pfArr = Array.isArray(pfInfo) ? pfInfo : [pfInfo];
|
|
66
|
+
pageFileUsageMB = pfArr.reduce((sum, pf) => sum + (pf.CurrentUsage ?? 0), 0);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// page file info is optional
|
|
71
|
+
}
|
|
72
|
+
return { totalMB, freeMB, usedPct, pageFileUsageMB };
|
|
73
|
+
}
|
|
74
|
+
async getDiskInfo() {
|
|
75
|
+
const result = psJson(`Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" | Select-Object DeviceID, @{N='totalGB';E={[math]::Round($_.Size/1GB)}}, @{N='freeGB';E={[math]::Round($_.FreeSpace/1GB)}}`);
|
|
76
|
+
const arr = Array.isArray(result) ? result : [result];
|
|
77
|
+
return arr.map((d) => {
|
|
78
|
+
const usedGB = d.totalGB - d.freeGB;
|
|
79
|
+
const usedPct = d.totalGB > 0 ? Math.round((usedGB / d.totalGB) * 100) : 0;
|
|
80
|
+
return {
|
|
81
|
+
drive: d.DeviceID,
|
|
82
|
+
totalGB: d.totalGB,
|
|
83
|
+
freeGB: d.freeGB,
|
|
84
|
+
usedPct,
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async getCpuUsage(samples, intervalMs) {
|
|
89
|
+
const intervalSec = Math.max(1, Math.round(intervalMs / 1000));
|
|
90
|
+
try {
|
|
91
|
+
const raw = ps(`$c = Get-Counter '\\Processor(_Total)\\% Processor Time' -SampleInterval ${intervalSec} -MaxSamples ${samples}; $c.CounterSamples | Select-Object CookedValue, Timestamp | ConvertTo-Json -Compress`);
|
|
92
|
+
if (!raw)
|
|
93
|
+
return [];
|
|
94
|
+
const parsed = JSON.parse(raw);
|
|
95
|
+
const arr = Array.isArray(parsed) ? parsed : [parsed];
|
|
96
|
+
return arr.map((s) => ({
|
|
97
|
+
usedPct: Math.round(s.CookedValue),
|
|
98
|
+
timestamp: new Date(s.Timestamp),
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async getStartupItems() {
|
|
106
|
+
const items = [];
|
|
107
|
+
// Read from registry run key
|
|
108
|
+
try {
|
|
109
|
+
const raw = ps(`$reg = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Run'; if (Test-Path $reg) { Get-ItemProperty $reg | Select-Object * -ExcludeProperty PSPath,PSParentPath,PSChildName,PSDrive,PSProvider | ConvertTo-Json -Compress }`);
|
|
110
|
+
if (raw) {
|
|
111
|
+
const obj = JSON.parse(raw);
|
|
112
|
+
for (const [name, command] of Object.entries(obj)) {
|
|
113
|
+
items.push({
|
|
114
|
+
name,
|
|
115
|
+
command,
|
|
116
|
+
location: 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
|
|
117
|
+
enabled: true,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// registry read failed, continue
|
|
124
|
+
}
|
|
125
|
+
// Read from startup folder
|
|
126
|
+
try {
|
|
127
|
+
const startupFolder = ps(`[Environment]::GetFolderPath('Startup')`);
|
|
128
|
+
if (startupFolder) {
|
|
129
|
+
const files = ps(`$f = [Environment]::GetFolderPath('Startup'); if (Test-Path $f) { Get-ChildItem $f -File | Select-Object Name, FullName | ConvertTo-Json -Compress }`);
|
|
130
|
+
if (files) {
|
|
131
|
+
const parsed = JSON.parse(files);
|
|
132
|
+
const arr = Array.isArray(parsed) ? parsed : [parsed];
|
|
133
|
+
for (const f of arr) {
|
|
134
|
+
items.push({
|
|
135
|
+
name: f.Name,
|
|
136
|
+
command: f.FullName,
|
|
137
|
+
location: startupFolder,
|
|
138
|
+
enabled: true,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// startup folder read failed, continue
|
|
146
|
+
}
|
|
147
|
+
return items;
|
|
148
|
+
}
|
|
149
|
+
async disableStartupItem(name) {
|
|
150
|
+
try {
|
|
151
|
+
ps(`Remove-ItemProperty -Path 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' -Name '${name}' -ErrorAction Stop`);
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
getTempDirs() {
|
|
159
|
+
return [process.env.TEMP, process.env.APPDATA ? process.env.APPDATA + '\\npm-cache' : undefined].filter((d) => Boolean(d));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=windows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows.js","sourceRoot":"","sources":["../../src/platform/windows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUlD,SAAS,EAAE,CAAC,MAAc;IACxB,OAAO,YAAY,CACjB,gBAAgB,EAChB,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,EAChE;QACE,QAAQ,EAAE,O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,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,WAAW;QACT,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CACrG,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAC/B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WatchdogPlugin, HealthCheck, FixResult, PluginConfig } from './plugin.interface.js';
|
|
2
|
+
export declare class CpuMonitorPlugin implements WatchdogPlugin {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultInterval: number;
|
|
6
|
+
private config;
|
|
7
|
+
configure(opts: PluginConfig): void;
|
|
8
|
+
check(): Promise<HealthCheck>;
|
|
9
|
+
fix(): Promise<FixResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=cpu-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpu-monitor.d.ts","sourceRoot":"","sources":["../../src/plugins/cpu-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG7F,qBAAa,gBAAiB,YAAW,cAAc;IACrD,IAAI,SAAiB;IACrB,WAAW,SAA2D;IACtE,eAAe,SAAU;IACzB,OAAO,CAAC,MAAM,CAKZ;IAEF,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAI7B,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAoC7B,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;CAYhC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getPlatform } from '../platform/index.js';
|
|
2
|
+
export class CpuMonitorPlugin {
|
|
3
|
+
name = 'cpu-monitor';
|
|
4
|
+
description = 'Detect sustained high CPU usage and identify culprits';
|
|
5
|
+
defaultInterval = 120000;
|
|
6
|
+
config = {
|
|
7
|
+
enabled: true,
|
|
8
|
+
interval: 120000,
|
|
9
|
+
autoFix: false,
|
|
10
|
+
thresholds: { warningPct: 75, criticalPct: 90 },
|
|
11
|
+
};
|
|
12
|
+
configure(opts) {
|
|
13
|
+
this.config = { ...this.config, ...opts };
|
|
14
|
+
}
|
|
15
|
+
async check() {
|
|
16
|
+
const platform = getPlatform();
|
|
17
|
+
const samples = await platform.getCpuUsage(3, 2000);
|
|
18
|
+
const sampleCount = samples.length;
|
|
19
|
+
const cpuUsedPct = sampleCount > 0
|
|
20
|
+
? samples.reduce((sum, s) => sum + s.usedPct, 0) / sampleCount
|
|
21
|
+
: 0;
|
|
22
|
+
const warningPct = this.config.thresholds['warningPct'] ?? 75;
|
|
23
|
+
const criticalPct = this.config.thresholds['criticalPct'] ?? 90;
|
|
24
|
+
let status;
|
|
25
|
+
const suggestedActions = [];
|
|
26
|
+
if (cpuUsedPct >= criticalPct) {
|
|
27
|
+
status = 'critical';
|
|
28
|
+
suggestedActions.push('CPU critically high — investigate top CPU-consuming processes');
|
|
29
|
+
}
|
|
30
|
+
else if (cpuUsedPct >= warningPct) {
|
|
31
|
+
status = 'warning';
|
|
32
|
+
suggestedActions.push('CPU usage elevated — monitor for sustained spikes');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
status = 'healthy';
|
|
36
|
+
}
|
|
37
|
+
const message = `Average CPU usage: ${cpuUsedPct.toFixed(1)}% over ${sampleCount} sample(s)`;
|
|
38
|
+
return {
|
|
39
|
+
status,
|
|
40
|
+
metrics: { cpuUsedPct, sampleCount },
|
|
41
|
+
message,
|
|
42
|
+
suggestedActions,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async fix() {
|
|
46
|
+
// Alert-only: no automated process killing for CPU
|
|
47
|
+
const check = await this.check();
|
|
48
|
+
const metrics = check.metrics;
|
|
49
|
+
return {
|
|
50
|
+
actionsKept: ['CPU monitor is alert-only; no automated fix applied'],
|
|
51
|
+
resourcesFreed: '0 MB',
|
|
52
|
+
beforeMetrics: metrics,
|
|
53
|
+
afterMetrics: metrics,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=cpu-monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpu-monitor.js","sourceRoot":"","sources":["../../src/plugins/cpu-monitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,OAAO,gBAAgB;IAC3B,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAAG,uDAAuD,CAAC;IACtE,eAAe,GAAG,MAAM,CAAC;IACjB,MAAM,GAAiB;QAC7B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;KAChD,CAAC;IAEF,SAAS,CAAC,IAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAEpD,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;QACnC,MAAM,UAAU,GACd,WAAW,GAAG,CAAC;YACb,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAA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Result, PluginConfig } from './plugin.interface.js';
|
|
2
|
+
export declare class DiskHealthPlugin implements WatchdogPlugin {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultInterval: number;
|
|
6
|
+
private config;
|
|
7
|
+
configure(opts: PluginConfig): void;
|
|
8
|
+
check(): Promise<HealthCheck>;
|
|
9
|
+
fix(): Promise<FixResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=disk-health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-health.d.ts","sourceRoot":"","sources":["../../src/plugins/disk-health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK7F,qBAAa,gBAAiB,YAAW,cAAc;IACrD,IAAI,SAAiB;IACrB,WAAW,SAA+C;IAC1D,eAAe,SAAW;IAC1B,OAAO,CAAC,MAAM,CAKZ;IAEF,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAI7B,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IA4C7B,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;CA+DhC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { getPlatform } from '../platform/index.js';
|
|
2
|
+
import { readdirSync, statSync, unlinkSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
export class DiskHealthPlugin {
|
|
5
|
+
name = 'disk-health';
|
|
6
|
+
description = 'Monitor disk space, clean temporary files';
|
|
7
|
+
defaultInterval = 1800000;
|
|
8
|
+
config = {
|
|
9
|
+
enabled: true,
|
|
10
|
+
interval: 1800000,
|
|
11
|
+
autoFix: true,
|
|
12
|
+
thresholds: { warningPct: 80, criticalPct: 90, tempFileAgeDays: 7 },
|
|
13
|
+
};
|
|
14
|
+
configure(opts) {
|
|
15
|
+
this.config = { ...this.config, ...opts };
|
|
16
|
+
}
|
|
17
|
+
async check() {
|
|
18
|
+
const platform = getPlatform();
|
|
19
|
+
const disks = await platform.getDiskInfo();
|
|
20
|
+
const primary = disks[0];
|
|
21
|
+
if (!primary) {
|
|
22
|
+
return {
|
|
23
|
+
status: 'critical',
|
|
24
|
+
metrics: {},
|
|
25
|
+
message: 'No disk information available',
|
|
26
|
+
suggestedActions: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const diskUsedPct = primary.usedPct;
|
|
30
|
+
const diskFreeGB = primary.freeGB;
|
|
31
|
+
const diskTotalGB = primary.totalGB;
|
|
32
|
+
const warningPct = this.config.thresholds['warningPct'] ?? 80;
|
|
33
|
+
const criticalPct = this.config.thresholds['criticalPct'] ?? 90;
|
|
34
|
+
let status;
|
|
35
|
+
const suggestedActions = [];
|
|
36
|
+
if (diskUsedPct >= criticalPct) {
|
|
37
|
+
status = 'critical';
|
|
38
|
+
suggestedActions.push('Disk critically full — run fix() to clean temp files');
|
|
39
|
+
}
|
|
40
|
+
else if (diskUsedPct >= warningPct) {
|
|
41
|
+
status = 'warning';
|
|
42
|
+
suggestedActions.push('Disk usage elevated — consider cleaning temp files');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
status = 'healthy';
|
|
46
|
+
}
|
|
47
|
+
const message = `Disk ${primary.drive}: ${diskUsedPct.toFixed(1)}% used, ${diskFreeGB.toFixed(2)} GB free of ${diskTotalGB.toFixed(2)} GB`;
|
|
48
|
+
return {
|
|
49
|
+
status,
|
|
50
|
+
metrics: { diskUsedPct, diskFreeGB, diskTotalGB },
|
|
51
|
+
message,
|
|
52
|
+
suggestedActions,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
async fix() {
|
|
56
|
+
const platform = getPlatform();
|
|
57
|
+
const disksBefore = await platform.getDiskInfo();
|
|
58
|
+
const primaryBefore = disksBefore[0];
|
|
59
|
+
const beforeMetrics = primaryBefore
|
|
60
|
+
? {
|
|
61
|
+
diskUsedPct: primaryBefore.usedPct,
|
|
62
|
+
diskFreeGB: primaryBefore.freeGB,
|
|
63
|
+
diskTotalGB: primaryBefore.totalGB,
|
|
64
|
+
}
|
|
65
|
+
: {};
|
|
66
|
+
const tempDirs = platform.getTempDirs();
|
|
67
|
+
const tempFileAgeDays = this.config.thresholds['tempFileAgeDays'] ?? 7;
|
|
68
|
+
const ageThresholdMs = tempFileAgeDays * 24 * 60 * 60 * 1000;
|
|
69
|
+
const now = Date.now();
|
|
70
|
+
const actionsKept = [];
|
|
71
|
+
let filesDeleted = 0;
|
|
72
|
+
for (const dir of tempDirs) {
|
|
73
|
+
let entries;
|
|
74
|
+
try {
|
|
75
|
+
entries = readdirSync(dir);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
for (const entry of entries) {
|
|
81
|
+
const filePath = join(dir, entry);
|
|
82
|
+
try {
|
|
83
|
+
const st = statSync(filePath);
|
|
84
|
+
if (st.isFile() && now - st.mtimeMs > ageThresholdMs) {
|
|
85
|
+
unlinkSync(filePath);
|
|
86
|
+
filesDeleted++;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// skip files we can't stat or delete
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (filesDeleted > 0) {
|
|
95
|
+
actionsKept.push(`Deleted ${filesDeleted} temp file(s) older than ${tempFileAgeDays} days`);
|
|
96
|
+
}
|
|
97
|
+
const disksAfter = await platform.getDiskInfo();
|
|
98
|
+
const primaryAfter = disksAfter[0];
|
|
99
|
+
const afterMetrics = primaryAfter
|
|
100
|
+
? {
|
|
101
|
+
diskUsedPct: primaryAfter.usedPct,
|
|
102
|
+
diskFreeGB: primaryAfter.freeGB,
|
|
103
|
+
diskTotalGB: primaryAfter.totalGB,
|
|
104
|
+
}
|
|
105
|
+
: {};
|
|
106
|
+
const freedGB = primaryBefore && primaryAfter ? primaryAfter.freeGB - primaryBefore.freeGB : 0;
|
|
107
|
+
const resourcesFreed = `Freed ~${(freedGB * 1024).toFixed(0)} MB disk space`;
|
|
108
|
+
return { actionsKept, resourcesFreed, beforeMetrics, afterMetrics };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=disk-health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-health.js","sourceRoot":"","sources":["../../src/plugins/disk-health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,OAAO,gBAAgB;IAC3B,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAAG,2CAA2C,CAAC;IAC1D,eAAe,GAAG,OAAO,CAAC;IAClB,MAAM,GAAiB;QAC7B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,EAAE;KACpE,CAAC;IAEF,SAAS,CAAC,IAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEzB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO;gBACL,MAAM,EAAE,UAAU;gBAClB,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,+BAA+B;gBACxC,gBA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;QAED,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACrB,WAAW,CAAC,IAAI,CAAC,WAAW,YAAY,4BAA4B,eAAe,OAAO,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,YAAY,GAA2B,YAAY;YACvD,CAAC,CAAC;gBACE,WAAW,EAAE,YAAY,CAAC,OAAO;gBACjC,UAAU,EAAE,YAAY,CAAC,MAAM;gBAC/B,WAAW,EAAE,YAAY,CAAC,OAAO;aAClC;YACH,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,OAAO,GACX,aAAa,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACjF,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;QAE7E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WatchdogPlugin, HealthCheck, FixResult, PluginConfig } from './plugin.interface.js';
|
|
2
|
+
export declare class MemoryMonitorPlugin implements WatchdogPlugin {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultInterval: number;
|
|
6
|
+
private config;
|
|
7
|
+
configure(opts: PluginConfig): void;
|
|
8
|
+
check(): Promise<HealthCheck>;
|
|
9
|
+
fix(): Promise<FixResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=memory-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-monitor.d.ts","sourceRoot":"","sources":["../../src/plugins/memory-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG7F,qBAAa,mBAAoB,YAAW,cAAc;IACxD,IAAI,SAAoB;IACxB,WAAW,SAA2D;IACtE,eAAe,SAAU;IACzB,OAAO,CAAC,MAAM,CAKZ;IAEF,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAI7B,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAwC7B,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;CAWhC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getPlatform } from '../platform/index.js';
|
|
2
|
+
export class MemoryMonitorPlugin {
|
|
3
|
+
name = 'memory-monitor';
|
|
4
|
+
description = 'Track RAM and page file usage, alert on high pressure';
|
|
5
|
+
defaultInterval = 120000;
|
|
6
|
+
config = {
|
|
7
|
+
enabled: true,
|
|
8
|
+
interval: 120000,
|
|
9
|
+
autoFix: false,
|
|
10
|
+
thresholds: { warningPct: 85, criticalPct: 95 },
|
|
11
|
+
};
|
|
12
|
+
configure(opts) {
|
|
13
|
+
this.config = { ...this.config, ...opts };
|
|
14
|
+
}
|
|
15
|
+
async check() {
|
|
16
|
+
const platform = getPlatform();
|
|
17
|
+
const mem = await platform.getMemoryInfo();
|
|
18
|
+
const ramUsedPct = mem.usedPct;
|
|
19
|
+
const ramFreeMB = mem.freeMB;
|
|
20
|
+
const ramTotalMB = mem.totalMB;
|
|
21
|
+
const pageFileMB = mem.pageFileUsageMB;
|
|
22
|
+
const metrics = {
|
|
23
|
+
ramUsedPct,
|
|
24
|
+
ramFreeMB,
|
|
25
|
+
ramTotalMB,
|
|
26
|
+
pageFileMB,
|
|
27
|
+
};
|
|
28
|
+
const warningPct = this.config.thresholds['warningPct'] ?? 85;
|
|
29
|
+
const criticalPct = this.config.thresholds['criticalPct'] ?? 95;
|
|
30
|
+
let status;
|
|
31
|
+
if (ramUsedPct >= criticalPct) {
|
|
32
|
+
status = 'critical';
|
|
33
|
+
}
|
|
34
|
+
else if (ramUsedPct >= warningPct) {
|
|
35
|
+
status = 'warning';
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
status = 'healthy';
|
|
39
|
+
}
|
|
40
|
+
const message = `RAM: ${Math.round(ramUsedPct)}% used (${Math.round(ramFreeMB)} MB free of ${Math.round(ramTotalMB)} MB)`;
|
|
41
|
+
const suggestedActions = [];
|
|
42
|
+
if (status === 'critical') {
|
|
43
|
+
suggestedActions.push('RAM usage is critically high — consider closing applications or adding more memory');
|
|
44
|
+
}
|
|
45
|
+
else if (status === 'warning') {
|
|
46
|
+
suggestedActions.push('RAM usage is elevated — monitor for further increases');
|
|
47
|
+
}
|
|
48
|
+
return { status, metrics, message, suggestedActions };
|
|
49
|
+
}
|
|
50
|
+
async fix() {
|
|
51
|
+
const result = await this.check();
|
|
52
|
+
const metrics = result.metrics;
|
|
53
|
+
return {
|
|
54
|
+
actionsKept: ['Alert pushed (no auto-fix for memory)'],
|
|
55
|
+
resourcesFreed: '0 MB (alert only)',
|
|
56
|
+
beforeMetrics: metrics,
|
|
57
|
+
afterMetrics: metrics,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=memory-monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-monitor.js","sourceRoot":"","sources":["../../src/plugins/memory-monitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,OAAO,mBAAmB;IAC9B,IAAI,GAAG,gBAAgB,CAAC;IACxB,WAAW,GAAG,uDAAuD,CAAC;IACtE,eAAe,GAAG,MAAM,CAAC;IACjB,MAAM,GAAiB;QAC7B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,EAAE,UAAU,EA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,MAAM,KAAK,UAAU,EAAE,CAAC;YAC1B,gBAAgB,CAAC,IAAI,CAAC,oFAAoF,CAAC,CAAC;QAC9G,CAAC;aAAM,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,gBAAgB,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACjF,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE/B,OAAO;YACL,WAAW,EAAE,CAAC,uCAAuC,CAAC;YACtD,cAAc,EAAE,mBAAmB;YACnC,aAAa,EAAE,OAAO;YACtB,YAAY,EAAE,OAAO;SACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-loader.d.ts","sourceRoot":"","sources":["../../src/plugins/plugin-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAe9C,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,EAAE,CAUpE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ProcessGuardPlugin } from './process-guard.js';
|
|
2
|
+
import { MemoryMonitorPlugin } from './memory-monitor.js';
|
|
3
|
+
import { DiskHealthPlugin } from './disk-health.js';
|
|
4
|
+
import { StartupOptimizerPlugin } from './startup-optimizer.js';
|
|
5
|
+
import { CpuMonitorPlugin } from './cpu-monitor.js';
|
|
6
|
+
const pluginRegistry = {
|
|
7
|
+
'process-guard': ProcessGuardPlugin,
|
|
8
|
+
'memory-monitor': MemoryMonitorPlugin,
|
|
9
|
+
'disk-health': DiskHealthPlugin,
|
|
10
|
+
'startup-optimizer': StartupOptimizerPlugin,
|
|
11
|
+
'cpu-monitor': CpuMonitorPlugin,
|
|
12
|
+
};
|
|
13
|
+
export function loadPlugins(config) {
|
|
14
|
+
const plugins = [];
|
|
15
|
+
for (const [name, PluginClass] of Object.entries(pluginRegistry)) {
|
|
16
|
+
const pluginConfig = config.plugins[name];
|
|
17
|
+
if (!pluginConfig || !pluginConfig.enabled)
|
|
18
|
+
continue;
|
|
19
|
+
const plugin = new PluginClass();
|
|
20
|
+
plugin.configure(pluginConfig);
|
|
21
|
+
plugins.push(plugin);
|
|
22
|
+
}
|
|
23
|
+
return plugins;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=plugin-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-loader.js","sourceRoot":"","sources":["../../src/plugins/plugin-loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,cAAc,GAA6C;IAC/D,eAAe,EAAE,kBAAkB;IACnC,gBAAgB,EAAE,mBAAmB;IACrC,aAAa,EAAE,gBAAgB;IAC/B,mBAAmB,EAAE,sBAAsB;IAC3C,aAAa,EAAE,gBAAgB;CAChC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,MAAsB;IAChD,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QACjE,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,OAAO;YAAE,SAAS;QACrD,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type HealthStatus = 'healthy' | 'warning' | 'critical';
|
|
2
|
+
export interface HealthCheck {
|
|
3
|
+
status: HealthStatus;
|
|
4
|
+
metrics: Record<string, number>;
|
|
5
|
+
message: string;
|
|
6
|
+
suggestedActions: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface FixResult {
|
|
9
|
+
actionsKept: string[];
|
|
10
|
+
resourcesFreed: string;
|
|
11
|
+
beforeMetrics: Record<string, number>;
|
|
12
|
+
afterMetrics: Record<string, number>;
|
|
13
|
+
}
|
|
14
|
+
export interface PluginConfig {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
interval: number;
|
|
17
|
+
thresholds: Record<string, number>;
|
|
18
|
+
autoFix: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface WatchdogPlugin {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
defaultInterval: number;
|
|
24
|
+
check(): Promise<HealthCheck>;
|
|
25
|
+
fix(): Promise<FixResult>;
|
|
26
|
+
configure(opts: PluginConfig): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=plugin.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.interface.d.ts","sourceRoot":"","sources":["../../src/plugins/plugin.interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1B,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.interface.js","sourceRoot":"","sources":["../../src/plugins/plugin.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WatchdogPlugin, HealthCheck, FixResult, PluginConfig } from './plugin.interface.js';
|
|
2
|
+
export declare class ProcessGuardPlugin implements WatchdogPlugin {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultInterval: number;
|
|
6
|
+
private config;
|
|
7
|
+
configure(opts: PluginConfig): void;
|
|
8
|
+
check(): Promise<HealthCheck>;
|
|
9
|
+
fix(): Promise<FixResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=process-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-guard.d.ts","sourceRoot":"","sources":["../../src/plugins/process-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAe7F,qBAAa,kBAAmB,YAAW,cAAc;IACvD,IAAI,SAAmB;IACvB,WAAW,SAA+D;IAC1E,eAAe,SAAU;IACzB,OAAO,CAAC,MAAM,CAKZ;IAEF,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAI7B,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAwD7B,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;CA8EhC"}
|