Files
BaiLongma/start_background.ps1
chengjiaxi 664ffb3834 小白龙 Bailongma - 初始提交
自主操作员与思考搭档系统。
包含 orchestrator-v2 多Agent编排层、后台意识引擎、记忆系统、ACUI 组件。
2026-05-22 19:22:06 +08:00

43 lines
1.3 KiB
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Bailongma 后台进程管理器
# 启动powershell -File start_background.ps1
# 停止Stop-Job -Name BailongmaEngine; Remove-Job -Name BailongmaEngine
param(
[switch]$Stop,
[int]$CycleSeconds = 120
)
$jobName = "BailongmaEngine"
if ($Stop) {
$job = Get-Job -Name $jobName -ErrorAction SilentlyContinue
if ($job) {
Stop-Job -Job $job
Remove-Job -Job $job
Write-Host "Bailongma 意识引擎后台进程已停止"
} else {
Write-Host "没有运行中的后台进程"
}
return
}
# 检查是否已在运行
$existing = Get-Job -Name $jobName -ErrorAction SilentlyContinue
if ($existing -and $existing.State -eq "Running") {
Write-Host "Bailongma 意识引擎已经在运行中 (Job ID: $($existing.Id))"
return
}
$enginePath = Join-Path $PSScriptRoot "background_engine.ps1"
$scriptBlock = {
param($Path, $Cycle)
Set-Location (Split-Path $Path -Parent)
& $Path -StateFile (Join-Path (Split-Path $Path -Parent) "consciousness.json") -BackgroundMode -CycleSeconds $Cycle -UseMemoryBridge
}
$job = Start-Job -Name $jobName -ScriptBlock $scriptBlock -ArgumentList $enginePath, $CycleSeconds
Write-Host "Bailongma 意识引擎后台进程已启动 (Job ID: $($job.Id))"
Write-Host " 周期: ${CycleSeconds}s"
Write-Host " 停止: .\start_background.ps1 -Stop"