初始化: 完成Git Skill测试基线

Co-authored-by: 旅行呀~ <travelxiao@qq.com>
This commit is contained in:
2026-08-20 23:42:02 +08:00
commit 2cddf06b6c
30 changed files with 3422 additions and 0 deletions
@@ -0,0 +1,34 @@
# Agent-safe: report whether an encrypted token exists. Never prints it.
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'common.ps1')
if (-not (Test-Path -LiteralPath $script:TokenPath)) {
Write-StatusLine -Key 'token' -Value 'missing'
exit 0
}
$info = Get-Item -LiteralPath $script:TokenPath
if ($info.Length -lt 1) {
Write-StatusLine -Key 'token' -Value 'invalid'
exit 0
}
try {
$data = [System.IO.File]::ReadAllBytes($script:TokenPath)
$plain = Unprotect-SecretBytes -Data $data
if ([string]::IsNullOrWhiteSpace($plain)) {
Write-StatusLine -Key 'token' -Value 'invalid'
exit 0
}
}
catch {
Write-StatusLine -Key 'token' -Value 'invalid'
exit 0
}
finally {
$plain = $null
$data = $null
}
Write-StatusLine -Key 'token' -Value 'present'