Files
bruno d71c3dd34d
release / release (push) Successful in 13m21s
release / macos (push) Canceled after 0s
feat: epique v1.1.0 — onboarding, copilot & roles aichat (am setup)
F1 — Wizard d'onboarding (src/setup.rs) :
- am setup : provider (anthropic, openai, deepseek, google, ollama, custom),
  token masque (rpassword) -> keyring OS (jamais en clair), modele par defaut
  (liste declaree + champ libre), ping API non-bloquant
- Declencheurs non-bloquants : am ai / am ask et banner REPL proposent
  am setup quand aucun provider n'est configure ; re-executable (mode revoir)
- settings.default_provider + providers.* ecrits via persist_setting

F2 — Integration aichat :
- Etape wizard 'Installer le moteur IA (aichat) ? [Y/n]' -> am install aichat
- am ai sans aichat -> 'aichat est manquant. Installer ? [Y/n]'
- install.ps1/install.sh enchainent sur am setup si stdin interactif

F3 — Roles copilot aichat (src/roles.rs) :
- 6 agents generes dans ~/.config/aichat/agents (ou %APPDATA%\aichat\agents) :
  am-copilot, am-operator, am-dev, am-do, am-analyst, am-orchestrator
- Prompts bilingues (FR defaut) privilegiant les contrats --json ; le prompt
  am-copilot embarque la liste des commandes am
- am ai --role <nom> (valide le fichier genere, passe --agent a aichat),
  completion REPL ; config aichat creee seulement si absente
- Câblage complet : cli, dispatch, help, REPL, tip, man (am-setup.1), i18n

Tests : 450 verts (roles + setup unitaires, ai_test ajustes locale-agnostic)
v1.1.0 ; ROADMAP axe 14 + maintenance note ; README Premier lancement
2026-08-20 23:09:21 -04:00

92 lines
4.2 KiB
PowerShell

# agent-manager (am) — installateur Windows (PowerShell 5.1+)
#
# One-liner :
# powershell -ExecutionPolicy Bypass -Command "irm https://git.dracodev.net/Projets/agent-manager/raw/branch/main/install.ps1 | iex"
#
# Télécharge le binaire de la dernière release Gitea ; à défaut, compile via
# cargo install --git. Relancez le script pour mettre à jour.
param(
[string]$BaseUrl = "https://git.dracodev.net/Projets/agent-manager",
[string]$ApiUrl = "https://git.dracodev.net/api/v1/repos/Projets/agent-manager",
[string]$InstallDir = ""
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
# PowerShell 5.1 : forcer TLS 1.2 pour les serveurs modernes
try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {}
function Fail([string]$msg) { Write-Host "erreur: $msg" -ForegroundColor Red; exit 1 }
function Install-FromSource {
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) {
Fail "pas de binaire precompile et cargo est absent - installez Rust (https://rustup.rs) puis relancez"
}
Write-Host "Installation depuis les sources (cargo install --git $BaseUrl.git) ..."
cargo install --git "$BaseUrl.git" --locked
if ($LASTEXITCODE -ne 0) { Fail "cargo install a echoue" }
$bin = Join-Path $env:USERPROFILE ".cargo\bin\am.exe"
Write-Host ""
Write-Host "OK - am est installe dans $bin"
Write-Host "Essayez : am list | am doctor (mise a jour : relancez ce script)"
exit 0
}
$arch = if ($env:PROCESSOR_ARCHITECTURE -match "ARM") { "arm64" } else { "x86_64" }
$binDir = if ($InstallDir) { $InstallDir } else { Join-Path $env:LOCALAPPDATA "agent-manager\bin" }
if ($arch -eq "x86_64") {
$ok = $false
try {
$release = Invoke-RestMethod -Uri "$ApiUrl/releases/latest" -UseBasicParsing -TimeoutSec 20
$tag = $release.tag_name
$asset = "am-windows-x86_64.zip"
$url = "$BaseUrl/releases/download/$tag/$asset"
$tmp = Join-Path $env:TEMP "am-$tag.zip"
Write-Host "Telechargement de $url ..."
Invoke-WebRequest -Uri $url -OutFile $tmp -UseBasicParsing -TimeoutSec 300
$tmpDir = Join-Path $env:TEMP "am-$tag"
Remove-Item $tmpDir -Recurse -Force -ErrorAction SilentlyContinue
Expand-Archive -Path $tmp -DestinationPath $tmpDir -Force
# L'entrée de l'archive varie selon le pipeline : « am.exe » ou
# « am-windows-x86_64.exe » (nom de l'asset). Accepter les deux.
$exe = Join-Path $tmpDir "am.exe"
if (-not (Test-Path $exe)) { $exe = Join-Path $tmpDir "am-windows-x86_64.exe" }
if (Test-Path $exe) {
New-Item -ItemType Directory -Force -Path $binDir | Out-Null
Copy-Item $exe (Join-Path $binDir "am.exe") -Force
Remove-Item $tmp -Force -ErrorAction SilentlyContinue
Remove-Item $tmpDir -Recurse -Force -ErrorAction SilentlyContinue
$ok = $true
} else { throw "am.exe absent de l'archive" }
} catch {
Write-Host "Binaire precompile indisponible ($($_.Exception.Message)) - installation depuis les sources ..."
}
if (-not $ok) { Install-FromSource }
} else {
Write-Host "Architecture $arch : pas de binaire precompile - installation depuis les sources ..."
Install-FromSource
}
# Ajout au PATH utilisateur (permanent) uniquement pour le dossier par defaut
if (-not $InstallDir) {
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($userPath -notlike "*$binDir*") {
[Environment]::SetEnvironmentVariable("Path", "$binDir;$userPath", "User")
Write-Host "Ajout de $binDir au PATH utilisateur (rouvrez votre terminal pour en profiter)"
}
}
$env:Path = "$binDir;$env:Path"
& (Join-Path $binDir "am.exe") --version
Write-Host ""
# Épique v1.1.0 : wizard d'onboarding (provider + token + aichat + rôles)
# uniquement quand stdin est un terminal interactif (pas en CI).
if ([Console]::IsInputRedirected -eq $false) {
Write-Host "Configuration initiale (provider, token, aichat) :"
& (Join-Path $binDir "am.exe") setup
}
Write-Host ""
Write-Host "OK - 'am' est installe. Essayez :"
Write-Host " am list"
Write-Host " am doctor"
Write-Host "Mise a jour : relancez ce script."