feat(runtime): enforce native tool calls and web-only stack scripts

Apply a global native tool_calls-only prompt rule to prevent DSML/textual protocol outputs, and expand start_web/stop_web to manage gateway, sidecars, and wiki worker without launching desktop.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-10 20:08:03 +08:00
parent 4335040a27
commit 2c7b318561
4 changed files with 100 additions and 7 deletions

View file

@ -1,8 +1,52 @@
param(
[int]$Port = 8787,
[switch]$Force = $false
[switch]$Force = $false,
[switch]$WithoutWeixin = $false,
[switch]$WithoutWhatsApp = $false,
[bool]$WithWikiWorker = $true,
[string]$WeixinChannelId = "oclaw-weixin",
[string]$WhatsAppChannelId = "whatsapp"
)
# 网页端(/admin、/chat)由网关进程提供,这里只是一个语义化别名。
& "$PSScriptRoot/stop_gateway.ps1" -Port $Port -Force:$Force
function Write-Step([string]$msg) {
Write-Host "==> $msg" -ForegroundColor Cyan
}
Write-Step "Stopping web stack (gateway + sidecars; desktop excluded)"
if (-not $WithoutWeixin) {
Write-Step "Stopping weixin sidecar"
try {
& "$PSScriptRoot/weixin_stop.ps1" -ChannelId $WeixinChannelId -Force:$Force
} catch {
if (-not $Force) { throw }
}
}
if (-not $WithoutWhatsApp) {
Write-Step "Stopping whatsapp sidecar"
try {
& "$PSScriptRoot/whatsapp_stop.ps1" -ChannelId $WhatsAppChannelId -Force:$Force
} catch {
if (-not $Force) { throw }
}
}
Write-Step "Stopping gateway/web"
try {
& "$PSScriptRoot/stop_gateway.ps1" -Port $Port -Force:$Force
} catch {
if (-not $Force) { throw }
}
if ($WithWikiWorker) {
Write-Step "Stopping wiki worker"
try {
& "$PSScriptRoot/stop_wiki_worker.ps1" -Force:$Force
} catch {
if (-not $Force) { throw }
}
}
Write-Host ""
Write-Host "Web stack stopped." -ForegroundColor Green