Files
boss/scripts/codex_executor.ps1
2026-03-23 13:55:46 +08:00

38 lines
1.1 KiB
PowerShell

$ErrorActionPreference = "Stop"
$workspace = if ($env:BOSS_WORKSPACE) { $env:BOSS_WORKSPACE } else { (Get-Location).Path }
$taskTitle = if ($env:BOSS_TASK_TITLE) { $env:BOSS_TASK_TITLE } else { "Untitled task" }
$taskKind = if ($env:BOSS_TASK_KIND) { $env:BOSS_TASK_KIND } else { "general" }
$taskDescription = if ($env:BOSS_TASK_DESCRIPTION) { $env:BOSS_TASK_DESCRIPTION } else { "No description provided." }
if (-not (Get-Command codex -ErrorAction SilentlyContinue)) {
Write-Error "codex CLI not found in PATH"
}
Set-Location $workspace
$prompt = @"
You are the device-side execution worker for Boss.
Task title: $taskTitle
Task kind: $taskKind
Task description:
$taskDescription
Work only inside this workspace:
$workspace
Expectations:
- Make the smallest correct change that moves the task forward.
- If you modify code, mention validation or remaining risks in the final summary.
- If the task is research-only, summarize findings and next steps instead of forcing edits.
"@
$extraFlags = @()
if ($env:BOSS_CODEX_FLAGS) {
$extraFlags = $env:BOSS_CODEX_FLAGS -split "\s+"
}
& codex exec @extraFlags $prompt
exit $LASTEXITCODE