Install portable agent-neutral Hop skill and documentation

Hop-State: A_06FN69X2VW0BAXG4A4DT6V0
Hop-Proposal: R_06FN69VET1STZNKPWK913K8
Hop-Task: T_06FN637799RW5Q7WH9H6PJR
Hop-Attempt: AT_06FN63779BJRBK1VFQ94GRR
This commit is contained in:
Hop
2026-07-11 14:48:54 -07:00
parent 2f00b2dd3f
commit 68d8bf2f7d
20 changed files with 649 additions and 124 deletions
+4 -1
View File
@@ -73,11 +73,14 @@ try {
if (-not $SkipSkill) {
& $installedBinary skill install --force
if ($LASTEXITCODE -ne 0) {
throw "Hop skill installation failed with exit code $LASTEXITCODE"
}
}
Write-Host "Installed $(& $installedBinary version)"
Write-Host "Binary: $installedBinary"
if (-not $SkipSkill) {
Write-Host "Restart Codex if it is open, then use it normally in any Git repository."
Write-Host "Restart any open agent application, then use it normally in any Git repository."
}
} finally {
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $tempDir
+1 -1
View File
@@ -103,5 +103,5 @@ fi
printf 'Installed %s\n' "$("$install_dir/hop" version)"
printf 'Binary: %s\n' "$install_dir/hop"
if [ "$install_skill" = 1 ]; then
printf 'Restart Codex if it is open, then use it normally in any Git repository.\n'
printf 'Restart any open agent application, then use it normally in any Git repository.\n'
fi
+70 -2
View File
@@ -7,11 +7,16 @@ $tempDir = Join-Path ([System.IO.Path]::GetTempPath()) ("hop-installer-test-" +
$fixtures = Join-Path $tempDir "fixtures"
$payload = Join-Path $tempDir "payload"
$installDir = Join-Path $tempDir "install"
$testHome = Join-Path $tempDir "home"
$testCodexHome = Join-Path $testHome ".codex"
$testArch = if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString() -eq "Arm64") { "arm64" } else { "amd64" }
$asset = "hop_windows_${testArch}.zip"
$originalHome = $env:HOME
$originalUserProfile = $env:USERPROFILE
$originalCodexHome = $env:CODEX_HOME
New-Item -ItemType Directory -Path $tempDir | Out-Null
New-Item -ItemType Directory -Path $fixtures, $payload | Out-Null
New-Item -ItemType Directory -Path $fixtures, $payload, $testHome | Out-Null
try {
$binary = Join-Path $payload "hop.exe"
& go build -trimpath `
@@ -53,11 +58,14 @@ try {
}
}
$env:HOME = $testHome
$env:USERPROFILE = $testHome
$env:CODEX_HOME = $testCodexHome
& (Join-Path $root "scripts/install.ps1") `
-GiteaUrl "https://gitea.test" `
-Repository "GnosysLabs/Hop" `
-InstallDir $installDir `
-SkipSkill `
-SkipPath
$installed = Join-Path $installDir "hop.exe"
@@ -66,7 +74,67 @@ try {
if ($LASTEXITCODE -ne 0 -or $version -ne "hop 9.9.9-installer-test") {
throw "Unexpected installed version: $version"
}
$sharedBundle = Join-Path $testHome ".agents\skills\hop"
$codexBundle = Join-Path $testCodexHome "skills\hop"
$sharedSkill = Join-Path $sharedBundle "SKILL.md"
$codexSkill = Join-Path $codexBundle "SKILL.md"
if (-not (Test-Path -LiteralPath $sharedSkill -PathType Leaf) -or (Get-Item -LiteralPath $sharedSkill).Length -eq 0) {
throw "Installer did not install the shared Hop skill"
}
if (-not (Test-Path -LiteralPath $codexSkill -PathType Leaf) -or (Get-Item -LiteralPath $codexSkill).Length -eq 0) {
throw "Installer did not install the Codex Hop skill"
}
function Get-BundleHashes {
param([Parameter(Mandatory)][string]$BundlePath)
$hashes = @{}
Get-ChildItem -LiteralPath $BundlePath -File -Recurse | ForEach-Object {
$relative = $_.FullName.Substring($BundlePath.Length).TrimStart(
[System.IO.Path]::DirectorySeparatorChar,
[System.IO.Path]::AltDirectorySeparatorChar
)
$hashes[$relative] = (Get-FileHash -Algorithm SHA256 -LiteralPath $_.FullName).Hash
}
return $hashes
}
$sharedHashes = Get-BundleHashes $sharedBundle
$codexHashes = Get-BundleHashes $codexBundle
$sharedFiles = @($sharedHashes.Keys | Sort-Object)
$codexFiles = @($codexHashes.Keys | Sort-Object)
if ($sharedFiles.Count -eq 0 -or (Compare-Object -ReferenceObject $sharedFiles -DifferenceObject $codexFiles)) {
throw "Shared and Codex Hop skill bundles contain different files"
}
foreach ($relative in $sharedFiles) {
if ($sharedHashes[$relative] -ne $codexHashes[$relative]) {
throw "Shared and Codex Hop skill bundles differ at $relative"
}
}
$blockedCodexHome = Join-Path $testHome "blocked-codex"
$blockedSkills = Join-Path $blockedCodexHome "skills"
New-Item -ItemType Directory -Path $blockedSkills | Out-Null
"blocked" | Set-Content -Encoding ascii (Join-Path $blockedSkills "hop")
$env:CODEX_HOME = $blockedCodexHome
$installFailed = $false
try {
& (Join-Path $root "scripts/install.ps1") `
-GiteaUrl "https://gitea.test" `
-Repository "GnosysLabs/Hop" `
-InstallDir $installDir `
-SkipPath
} catch {
$installFailed = $true
}
if (-not $installFailed) {
throw "Installer did not fail when skill installation failed"
}
$env:CODEX_HOME = $testCodexHome
Write-Host "PowerShell installer smoke test passed."
} finally {
$env:HOME = $originalHome
$env:USERPROFILE = $originalUserProfile
$env:CODEX_HOME = $originalCodexHome
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $tempDir
}
+13 -2
View File
@@ -64,6 +64,7 @@ MOCK_CURL
chmod 0755 "$tmp_dir/mock-bin/curl"
HOME="$tmp_dir/home" \
CODEX_HOME="$tmp_dir/home/.codex" \
PATH="$tmp_dir/mock-bin:$PATH" \
HOP_TEST_FIXTURES="$tmp_dir/fixtures" \
HOP_GITEA_URL="https://gitea.test" \
@@ -77,7 +78,17 @@ version=$($tmp_dir/home/bin/hop version)
printf 'unexpected installed version: %s\n' "$version" >&2
exit 1
}
[ -s "$tmp_dir/home/.codex/skills/hop/SKILL.md" ] || {
printf 'installer did not install the embedded Hop skill\n' >&2
shared_bundle="$tmp_dir/home/.agents/skills/hop"
codex_bundle="$tmp_dir/home/.codex/skills/hop"
[ -s "$shared_bundle/SKILL.md" ] || {
printf 'installer did not install the shared Hop skill\n' >&2
exit 1
}
[ -s "$codex_bundle/SKILL.md" ] || {
printf 'installer did not install the Codex Hop skill\n' >&2
exit 1
}
if ! diff -r "$shared_bundle" "$codex_bundle" >/dev/null; then
printf 'shared and Codex Hop skill bundles differ\n' >&2
exit 1
fi