diff --git a/scripts/commands/build.sh b/scripts/commands/build.sh index 8e3ce7c..889972f 100644 --- a/scripts/commands/build.sh +++ b/scripts/commands/build.sh @@ -11,8 +11,11 @@ done root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd) shared="$root/shared" output="$root/generated" +plugin_manifest="$root/adapters/plugins.tsv" capability_manifest="$root/adapters/claude/capabilities.tsv" +[ -f "$plugin_manifest" ] || { printf 'Missing plugin manifest: %s\n' "$plugin_manifest" >&2; exit 1; } +awk -F '\t' 'NR == 1 { next } NF == 0 { next } $1 == "" || $3 == "" || $6 == "" { print "Invalid plugin manifest row." > "/dev/stderr"; exit 1 } seen[$1]++ { print "Duplicate plugin name in manifest: " $1 > "/dev/stderr"; exit 1 }' "$plugin_manifest" [ -f "$capability_manifest" ] || { printf 'Missing capability manifest: %s\n' "$capability_manifest" >&2; exit 1; } declare -A agent_tools while IFS=$'\t' read -r role tools; do diff --git a/scripts/commands/doctor.ps1 b/scripts/commands/doctor.ps1 index 92ecbcf..33e9031 100644 --- a/scripts/commands/doctor.ps1 +++ b/scripts/commands/doctor.ps1 @@ -3,19 +3,16 @@ param([switch]$Summary) $ErrorActionPreference = 'Stop' $root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent . (Join-Path $root 'scripts/lib/manifest.ps1') -$homePath = [Environment]::GetFolderPath('UserProfile') -$script:fail = $false -$script:checkCount = 0 -$script:passBuffer = @() -function Result($state, $message) { - $script:checkCount++ - if ($state -eq 'FAIL') { $script:fail = $true } - if ($Summary -and $state -eq 'PASS') { - $script:passBuffer += "$state $message" - } else { - Write-Output ("$state $message") - } -} +$homePath = [Environment]::GetFolderPath('UserProfile') +$script:fail = $false +$script:checkCount = 0 +function Result($state, $message) { + $script:checkCount++ + if ($state -eq 'FAIL') { $script:fail = $true } + if (-not ($Summary -and $state -eq 'PASS')) { + Write-Output ("$state $message") + } +} foreach ($tool in @('codex','claude')) { if (Get-Command $tool -ErrorAction SilentlyContinue) { $version = & $tool --version 2>&1 | Select-Object -First 1; Result 'PASS' "$tool available ($version)" } else { Result 'WARN' "$tool unavailable" } } if (Get-Command jq -ErrorAction SilentlyContinue) { Result 'PASS' 'jq available for Claude Bash status line' } else { Result 'WARN' 'jq unavailable; Claude Bash status line is disabled' } @@ -88,11 +85,10 @@ foreach ($client in @('codex','claude')) { if ($registered) { Result 'PASS' "$client Stop hook is registered" } else { Result 'WARN' "$client ships hook utilities, but no Stop hook is registered" } } -if ($Summary) { - if ($script:fail) { - $script:passBuffer | ForEach-Object { Write-Output $_ } - Write-Output "Doctor: FAIL | $script:checkCount checks" - exit 1 +if ($Summary) { + if ($script:fail) { + Write-Output "Doctor: FAIL | $script:checkCount checks" + exit 1 } Write-Output "Doctor: PASS | $script:checkCount checks" } else { diff --git a/scripts/commands/doctor.sh b/scripts/commands/doctor.sh index d628043..247f6d7 100644 --- a/scripts/commands/doctor.sh +++ b/scripts/commands/doctor.sh @@ -14,14 +14,11 @@ root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd) home_path=${HOME:?HOME is required} failed=false check_count=0 -pass_buffer=() result() { check_count=$((check_count + 1)) [ "$1" != FAIL ] || failed=true - if [ "$summary" = true ] && [ "$1" = PASS ]; then - pass_buffer+=("$1 $2") - else + if [ "$summary" != true ] || [ "$1" != PASS ]; then printf '%s %s\n' "$1" "$2" fi } @@ -111,7 +108,6 @@ done if [ "$summary" = true ]; then if [ "$failed" = true ]; then - for line in "${pass_buffer[@]}"; do printf '%s\n' "$line"; done printf 'Doctor: FAIL | %s checks\n' "$check_count" exit 1 fi