- Add SOUL.md.template with {{PLACEHOLDERS}} for interactive generation
- Add mosaic-init (bash + PS1) for interactive SOUL.md creation with flag overrides
- Add mosaic launcher (bash + PS1) — unified CLI for claude/opencode/codex with SOUL.md injection
- Add codex runtime adapter (runtime/codex/instructions.md)
- Update runtime adapters (claude, opencode) with SOUL.md read directive
- Update mosaic-link-runtime-assets to push codex adapter to ~/.codex/
- Update installers to prompt for mosaic init when SOUL.md is missing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
78 lines
2.5 KiB
PowerShell
78 lines
2.5 KiB
PowerShell
# 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."
|
|
}
|