# Mosaic Bootstrap — Windows Installer # PowerShell equivalent of install.sh # # Usage: # powershell -ExecutionPolicy Bypass -File install.ps1 # $ErrorActionPreference = "Stop" $SourceDir = $PSScriptRoot $TargetDir = if ($env:MOSAIC_HOME) { $env:MOSAIC_HOME } else { Join-Path $env:USERPROFILE ".config\mosaic" } if (-not (Test-Path $TargetDir)) { New-Item -ItemType Directory -Path $TargetDir -Force | Out-Null } # Sync files: remove old content, copy new Write-Host "[mosaic-install] Copying framework to $TargetDir..." Get-ChildItem $TargetDir -Exclude ".git" | Remove-Item -Recurse -Force Get-ChildItem $SourceDir -Exclude ".git" | ForEach-Object { $dest = Join-Path $TargetDir $_.Name if ($_.PSIsContainer) { Copy-Item $_.FullName $dest -Recurse -Force } else { Copy-Item $_.FullName $dest -Force } } Write-Host "[mosaic-install] Installed framework to $TargetDir" # Run post-install scripts (PowerShell versions) $binDir = Join-Path $TargetDir "bin" Write-Host "[mosaic-install] Linking runtime compatibility assets" try { & "$binDir\mosaic-link-runtime-assets.ps1" } catch { Write-Host "[mosaic-install] WARNING: runtime asset linking failed (framework install still complete)" -ForegroundColor Yellow } Write-Host "[mosaic-install] Syncing universal skills" if ($env:MOSAIC_SKIP_SKILLS_SYNC -eq "1") { Write-Host "[mosaic-install] Skipping skills sync (MOSAIC_SKIP_SKILLS_SYNC=1)" } else { try { & "$binDir\mosaic-sync-skills.ps1" } catch { Write-Host "[mosaic-install] WARNING: skills sync failed (framework install still complete)" -ForegroundColor Yellow } } Write-Host "[mosaic-install] Migrating runtime-local skills to Mosaic junctions" try { & "$binDir\mosaic-migrate-local-skills.ps1" -Apply } catch { Write-Host "[mosaic-install] WARNING: local skill migration failed (framework install still complete)" -ForegroundColor Yellow } Write-Host "[mosaic-install] Running health audit" try { & "$binDir\mosaic-doctor.ps1" } catch { Write-Host "[mosaic-install] WARNING: doctor reported issues (run mosaic-doctor.ps1 -FailOnWarn)" -ForegroundColor Yellow } Write-Host "[mosaic-install] Done." Write-Host "[mosaic-install] Add to PATH: `$env:USERPROFILE\.config\mosaic\bin" $soulPath = Join-Path $TargetDir "SOUL.md" if (-not (Test-Path $soulPath)) { Write-Host "" Write-Host "[mosaic-install] Set up your agent identity by running: mosaic init" Write-Host "[mosaic-install] This generates SOUL.md - the universal behavioral contract for all agent sessions." }