Files
codex-plugins/install.ps1
T

39 lines
1.6 KiB
PowerShell
Raw Normal View History

2026-07-26 16:26:55 +05:00
$ErrorActionPreference = "Stop"
2026-07-26 16:31:30 +05:00
$archiveUrl = "https://dev.ast.ltr.kz/Logos/codex-plugins/archive/main.zip"
$installRoot = Join-Path $env:LOCALAPPDATA "Logos\codex-plugins"
$tempRoot = Join-Path ([IO.Path]::GetTempPath()) ("logos-codex-plugins-" + [guid]::NewGuid())
$zipPath = Join-Path $tempRoot "marketplace.zip"
$extractRoot = Join-Path $tempRoot "extract"
2026-07-26 16:26:55 +05:00
2026-07-26 16:31:30 +05:00
New-Item -ItemType Directory -Path $tempRoot, $extractRoot -Force | Out-Null
try {
Invoke-WebRequest -UseBasicParsing -Uri $archiveUrl -OutFile $zipPath
Expand-Archive -Path $zipPath -DestinationPath $extractRoot -Force
$sourceRoot = Join-Path $extractRoot "codex-plugins"
$sourceMarketplace = Join-Path $sourceRoot ".agents\plugins\marketplace.json"
if (-not (Test-Path $sourceMarketplace)) {
throw "В загруженном архиве не найден marketplace.json."
2026-07-26 16:26:55 +05:00
}
2026-07-26 16:31:30 +05:00
New-Item -ItemType Directory -Path (Split-Path $installRoot -Parent) -Force | Out-Null
if (Test-Path $installRoot) {
Remove-Item -Path $installRoot -Recurse -Force
2026-07-26 16:26:55 +05:00
}
2026-07-26 16:31:30 +05:00
Move-Item -Path $sourceRoot -Destination $installRoot
}
finally {
if (Test-Path $tempRoot) {
Remove-Item -Path $tempRoot -Recurse -Force
2026-07-26 16:26:55 +05:00
}
}
2026-07-26 16:31:30 +05:00
$marketplacePath = Join-Path $installRoot ".agents\plugins\marketplace.json"
$encodedPath = [uri]::EscapeDataString($marketplacePath)
$pluginUrl = "codex://plugins/tax-code-research?marketplacePath=$encodedPath"
2026-07-26 16:26:55 +05:00
2026-07-26 16:31:30 +05:00
Start-Process $pluginUrl
Write-Host "Карточка плагина открыта. Нажмите «Установить», затем откройте новый рабочий чат." -ForegroundColor Green