forked from CopilotKit/open-multi-agent-canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop-app.ps1
More file actions
59 lines (51 loc) · 2.27 KB
/
stop-app.ps1
File metadata and controls
59 lines (51 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# KB-multi-agent Application Stopper
# This script stops all KB-multi-agent application components
# Display header
Write-Host "KB-multi-agent Application Manager" -ForegroundColor Green
Write-Host "==============================" -ForegroundColor Green
Write-Host ""
Write-Host "Stopping application components..." -ForegroundColor Cyan
Write-Host ""
# Kill any Python processes related to the backend
$backendProcesses = Get-Process -Name "python" -ErrorAction SilentlyContinue | Where-Object {
$_.CommandLine -match "langgraph" -or $_.CommandLine -match "custom-server" -or $_.CommandLine -match "agent"
}
$backendStopped = 0
if ($backendProcesses) {
foreach ($process in $backendProcesses) {
Write-Host "Stopping Python process with ID $($process.Id)..." -ForegroundColor Yellow
Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue
$backendStopped++
}
}
# Kill any Node.js processes related to the frontend
$frontendProcesses = Get-Process -Name "node" -ErrorAction SilentlyContinue | Where-Object {
$_.CommandLine -match "next" -or $_.CommandLine -match "dev" -or $_.CommandLine -match "frontend"
}
$frontendStopped = 0
if ($frontendProcesses) {
foreach ($process in $frontendProcesses) {
Write-Host "Stopping Node.js process with ID $($process.Id)..." -ForegroundColor Yellow
Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue
$frontendStopped++
}
}
# Also find and stop any cmd.exe processes that might be hosting the backend or frontend
$cmdProcesses = Get-Process -Name "cmd" -ErrorAction SilentlyContinue | Where-Object {
$_.MainWindowTitle -match "KB-multi-agent"
}
$cmdStopped = 0
if ($cmdProcesses) {
foreach ($process in $cmdProcesses) {
Write-Host "Stopping cmd process with ID $($process.Id)..." -ForegroundColor Yellow
Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue
$cmdStopped++
}
}
# Display summary
Write-Host ""
Write-Host "KB-multi-agent services have been stopped." -ForegroundColor Green
Write-Host "- Backend processes stopped: $backendStopped" -ForegroundColor Cyan
Write-Host "- Frontend processes stopped: $frontendStopped" -ForegroundColor Cyan
Write-Host "- Command windows closed: $cmdStopped" -ForegroundColor Cyan
Write-Host ""