Sync Superpowers 6 manifest components
Publish the completed third-party sync output for Superpowers 6.0.2 and keep the marketplace PowerShell sync script aligned with the Python adapter's manifest-declared component copying. Constraint: Superpowers now ships Codex hooks through .codex-plugin/plugin.json, and marketplace validation requires the referenced hook path to exist. Rejected: Commit the partially synced tree without hooks | Codex install would carry a manifest pointing at a missing hooks file. Confidence: high Scope-risk: moderate Directive: Preserve normal incremental marketplace history; do not rewrite history for ordinary source updates. Tested: /Users/eapil/git/keyinfo/.venv/bin/python3 scripts/validate_marketplace.py; rg public-secret scan; Codex temp CODEX_HOME marketplace add/list/add superpowers and hook cache checks. Not-tested: PowerShell script execution because pwsh/powershell is not installed locally; live hook execution inside an interactive Codex session.
This commit is contained in:
@@ -67,6 +67,104 @@ function Copy-PathIfExists {
|
||||
}
|
||||
}
|
||||
|
||||
function Get-ManifestPathValues {
|
||||
param([object]$Value)
|
||||
if ($null -eq $Value) {
|
||||
return @()
|
||||
}
|
||||
if ($Value -is [string]) {
|
||||
return @([string]$Value)
|
||||
}
|
||||
$values = @()
|
||||
foreach ($item in @($Value)) {
|
||||
if ($item -is [string]) {
|
||||
$values += [string]$item
|
||||
}
|
||||
}
|
||||
return $values
|
||||
}
|
||||
|
||||
function Resolve-ManifestRelativePath {
|
||||
param([string]$Path)
|
||||
$raw = $Path.Trim()
|
||||
if (-not $raw.StartsWith("./")) {
|
||||
return $null
|
||||
}
|
||||
$normalized = $raw.Substring(2).Split("#")[0].Split("?")[0].Replace("\", "/").Trim("/")
|
||||
if (-not $normalized) {
|
||||
return $null
|
||||
}
|
||||
Assert-RelativePathValue -Path $normalized
|
||||
return $normalized
|
||||
}
|
||||
|
||||
function Copy-ManifestDeclaredPath {
|
||||
param(
|
||||
[string]$SourceRoot,
|
||||
[string]$PluginDir,
|
||||
[string]$Path,
|
||||
[string]$Within,
|
||||
[switch]$CopyParentForFile
|
||||
)
|
||||
$relative = Resolve-ManifestRelativePath -Path $Path
|
||||
if (-not $relative) {
|
||||
return
|
||||
}
|
||||
$sourcePath = Join-Path $SourceRoot $relative
|
||||
if ($CopyParentForFile -and (Test-Path -LiteralPath $sourcePath -PathType Leaf)) {
|
||||
$parent = Split-Path -Path $relative -Parent
|
||||
if ($parent) {
|
||||
$relative = $parent
|
||||
$sourcePath = Join-Path $SourceRoot $relative
|
||||
}
|
||||
}
|
||||
if (Test-Path -LiteralPath $sourcePath) {
|
||||
Copy-PathIfExists -Source $sourcePath -Destination (Join-Path $PluginDir $relative) -Within $Within
|
||||
}
|
||||
}
|
||||
|
||||
function Copy-CodexManifestDeclaredPaths {
|
||||
param(
|
||||
[string]$SourceRoot,
|
||||
[string]$PluginDir,
|
||||
[string]$Within
|
||||
)
|
||||
$manifestPath = Join-Path $SourceRoot ".codex-plugin\plugin.json"
|
||||
if (-not (Test-Path -LiteralPath $manifestPath)) {
|
||||
return
|
||||
}
|
||||
$manifest = Read-JsonFile $manifestPath
|
||||
foreach ($field in @("skills", "mcpServers", "apps")) {
|
||||
foreach ($path in Get-ManifestPathValues $manifest.$field) {
|
||||
Copy-ManifestDeclaredPath -SourceRoot $SourceRoot -PluginDir $PluginDir -Path $path -Within $Within
|
||||
}
|
||||
}
|
||||
foreach ($path in Get-ManifestPathValues $manifest.hooks) {
|
||||
Copy-ManifestDeclaredPath -SourceRoot $SourceRoot -PluginDir $PluginDir -Path $path -Within $Within -CopyParentForFile
|
||||
}
|
||||
|
||||
$interface = $manifest.interface
|
||||
if ($null -eq $interface) {
|
||||
return
|
||||
}
|
||||
foreach ($field in @("logo", "composerIcon")) {
|
||||
foreach ($path in Get-ManifestPathValues $interface.$field) {
|
||||
Copy-ManifestDeclaredPath -SourceRoot $SourceRoot -PluginDir $PluginDir -Path $path -Within $Within
|
||||
}
|
||||
}
|
||||
foreach ($screenshot in @($interface.screenshots)) {
|
||||
if ($screenshot -is [string]) {
|
||||
Copy-ManifestDeclaredPath -SourceRoot $SourceRoot -PluginDir $PluginDir -Path $screenshot -Within $Within
|
||||
} elseif ($null -ne $screenshot) {
|
||||
foreach ($key in @("src", "path", "url")) {
|
||||
foreach ($path in Get-ManifestPathValues $screenshot.$key) {
|
||||
Copy-ManifestDeclaredPath -SourceRoot $SourceRoot -PluginDir $PluginDir -Path $path -Within $Within
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Copy-DirectoryFiltered {
|
||||
param(
|
||||
[string]$Source,
|
||||
@@ -578,6 +676,7 @@ function Sync-CodexPlugin {
|
||||
$dst = Join-Path $pluginDir $include
|
||||
Copy-PathIfExists -Source $src -Destination $dst -Within $RepoRoot
|
||||
}
|
||||
Copy-CodexManifestDeclaredPaths -SourceRoot $sourcePath -PluginDir $pluginDir -Within $RepoRoot
|
||||
Remove-ConfiguredExcludes -Root $pluginDir -ExcludePaths $Source.excludePaths -Within $RepoRoot
|
||||
Remove-ReadmeImageReferences -Root $pluginDir -ImagePathPrefixes $Source.readmeImageExcludes
|
||||
Remove-ReadmeLines -Root $pluginDir -LineExcludes $Source.readmeLineExcludes
|
||||
|
||||
Reference in New Issue
Block a user