@lifeaitools/clauth 1.30.22 → 1.30.24
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/.clauth-skill/SKILL.md +111 -111
- package/README.md +25 -0
- package/cli/api.classify.test.js +75 -75
- package/cli/assets/codevelop/launcher-active.cmd.template +20 -20
- package/cli/assets/codevelop/launcher-static.cmd.template +7 -7
- package/cli/assets/codevelop/windows-terminal.profiles.json +48 -48
- package/cli/assets/watchdog.ps1 +42 -42
- package/cli/commands/agent-cron.js +396 -396
- package/cli/commands/agent-pool.js +1962 -1962
- package/cli/commands/codevelop.js +1190 -1190
- package/cli/commands/doctor.js +302 -302
- package/cli/commands/install.js +10 -10
- package/cli/commands/invite.js +175 -175
- package/cli/commands/join.js +179 -179
- package/cli/commands/npm.js +182 -182
- package/cli/commands/scrub.js +327 -327
- package/cli/commands/scrub.test.js +115 -115
- package/cli/commands/serve.js +43 -86
- package/cli/commands/watchdog.js +209 -209
- package/cli/conf-path.js +21 -21
- package/cli/enrollment-script.js +82 -82
- package/cli/fingerprint.js +143 -143
- package/cli/index.js +1053 -1053
- package/cli/lib/fs-git.js +282 -282
- package/cli/recovery.js +101 -101
- package/cli/studio-debug.js +1095 -1095
- package/cli/supervisor-registry.js +594 -589
- package/cli/supervisor-registry.test.js +397 -397
- package/cli/supervisor-ui.test.js +5 -83
- package/cli/watchdog-registry.js +209 -209
- package/cli/watchdog-registry.test.js +89 -89
- package/install.ps1 +21 -21
- package/package.json +2 -2
- package/scripts/bin/bootstrap-linux +0 -0
- package/scripts/bin/bootstrap-macos +0 -0
- package/scripts/bin/bootstrap-win.exe +0 -0
- package/supabase/migrations/001_clauth_schema.sql +12 -12
- package/supabase/migrations/003_clauth_config.sql +13 -13
- package/supabase/migrations/003_machine_enrollments.sql +39 -39
- package/cli/served-script-syntax.test.mjs +0 -54
package/cli/assets/watchdog.ps1
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# clauth-watchdog.ps1
|
|
2
|
-
# Monitors clauth daemon on port 52437. Restarts it if not responding.
|
|
3
|
-
# Installed by: npm install -g @lifeaitools/clauth
|
|
4
|
-
# Managed by: clauth watchdog [install|uninstall|status]
|
|
5
|
-
|
|
6
|
-
$clauth = "$env:APPDATA\npm\clauth.cmd"
|
|
7
|
-
$logFile = "$env:APPDATA\clauth\watchdog.log"
|
|
8
|
-
$pingUrl = "http://127.0.0.1:52437/ping"
|
|
9
|
-
$interval = 15
|
|
10
|
-
|
|
11
|
-
function Write-Log($msg) {
|
|
12
|
-
$ts = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
|
13
|
-
$line = "[$ts] $msg"
|
|
14
|
-
Add-Content -Path $logFile -Value $line -ErrorAction SilentlyContinue
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
Write-Log "Watchdog started (PID $PID, clauth=$clauth)"
|
|
18
|
-
|
|
19
|
-
while ($true) {
|
|
20
|
-
$alive = $false
|
|
21
|
-
try {
|
|
22
|
-
$r = Invoke-WebRequest -Uri $pingUrl -TimeoutSec 3 -UseBasicParsing -ErrorAction Stop
|
|
23
|
-
if ($r.StatusCode -eq 200) { $alive = $true }
|
|
24
|
-
} catch { }
|
|
25
|
-
|
|
26
|
-
if (-not $alive) {
|
|
27
|
-
Write-Log "Daemon not responding — restarting..."
|
|
28
|
-
Start-Process -FilePath "cmd.exe" `
|
|
29
|
-
-ArgumentList "/c `"$clauth`" serve start" `
|
|
30
|
-
-WindowStyle Hidden
|
|
31
|
-
Start-Sleep -Seconds 5
|
|
32
|
-
try {
|
|
33
|
-
$r = Invoke-WebRequest -Uri $pingUrl -TimeoutSec 5 -UseBasicParsing -ErrorAction Stop
|
|
34
|
-
if ($r.StatusCode -eq 200) { Write-Log "Daemon restarted OK." }
|
|
35
|
-
else { Write-Log "WARNING: Daemon still not responding." }
|
|
36
|
-
} catch {
|
|
37
|
-
Write-Log "WARNING: Daemon still not responding after restart."
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Start-Sleep -Seconds $interval
|
|
42
|
-
}
|
|
1
|
+
# clauth-watchdog.ps1
|
|
2
|
+
# Monitors clauth daemon on port 52437. Restarts it if not responding.
|
|
3
|
+
# Installed by: npm install -g @lifeaitools/clauth
|
|
4
|
+
# Managed by: clauth watchdog [install|uninstall|status]
|
|
5
|
+
|
|
6
|
+
$clauth = "$env:APPDATA\npm\clauth.cmd"
|
|
7
|
+
$logFile = "$env:APPDATA\clauth\watchdog.log"
|
|
8
|
+
$pingUrl = "http://127.0.0.1:52437/ping"
|
|
9
|
+
$interval = 15
|
|
10
|
+
|
|
11
|
+
function Write-Log($msg) {
|
|
12
|
+
$ts = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
|
13
|
+
$line = "[$ts] $msg"
|
|
14
|
+
Add-Content -Path $logFile -Value $line -ErrorAction SilentlyContinue
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Write-Log "Watchdog started (PID $PID, clauth=$clauth)"
|
|
18
|
+
|
|
19
|
+
while ($true) {
|
|
20
|
+
$alive = $false
|
|
21
|
+
try {
|
|
22
|
+
$r = Invoke-WebRequest -Uri $pingUrl -TimeoutSec 3 -UseBasicParsing -ErrorAction Stop
|
|
23
|
+
if ($r.StatusCode -eq 200) { $alive = $true }
|
|
24
|
+
} catch { }
|
|
25
|
+
|
|
26
|
+
if (-not $alive) {
|
|
27
|
+
Write-Log "Daemon not responding — restarting..."
|
|
28
|
+
Start-Process -FilePath "cmd.exe" `
|
|
29
|
+
-ArgumentList "/c `"$clauth`" serve start" `
|
|
30
|
+
-WindowStyle Hidden
|
|
31
|
+
Start-Sleep -Seconds 5
|
|
32
|
+
try {
|
|
33
|
+
$r = Invoke-WebRequest -Uri $pingUrl -TimeoutSec 5 -UseBasicParsing -ErrorAction Stop
|
|
34
|
+
if ($r.StatusCode -eq 200) { Write-Log "Daemon restarted OK." }
|
|
35
|
+
else { Write-Log "WARNING: Daemon still not responding." }
|
|
36
|
+
} catch {
|
|
37
|
+
Write-Log "WARNING: Daemon still not responding after restart."
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Start-Sleep -Seconds $interval
|
|
42
|
+
}
|