Sync third-party and MCP marketplace plugins
Constraint: Public skills are published only by explicit administrator action unless they are tracked third-party market sources. Confidence: high Scope-risk: narrow Directive: Keep private/internal skills out of the public marketplace and preserve normal incremental market Git history. Tested: Marketplace validation passed.
This commit is contained in:
1 parent
ebe8c7d892
commit
5589889631
179 files changed
+51
-25001
No files matched your search
@@ -1196,13 +1196,14 @@ function Update-Marketplace {
|
||||
param(
|
||||
[string]$MarketplacePath,
|
||||
[object[]]$Sources,
|
||||
[string]$PathPrefix
|
||||
[string]$PathPrefix,
|
||||
[string[]]$RetiredPluginNames = @()
|
||||
)
|
||||
$marketplace = ConvertTo-Hashtable (Read-JsonFile $MarketplacePath)
|
||||
$sourceNames = @($Sources | ForEach-Object { $_.pluginName })
|
||||
$plugins = @()
|
||||
foreach ($plugin in $marketplace.plugins) {
|
||||
if ($sourceNames -notcontains $plugin.name) {
|
||||
if ($sourceNames -notcontains $plugin.name -and $RetiredPluginNames -notcontains $plugin.name) {
|
||||
$plugin.category = ConvertTo-OfficialCategory ([string]$plugin.category)
|
||||
$plugins += $plugin
|
||||
}
|
||||
@@ -1304,17 +1305,41 @@ foreach ($source in $sources) {
|
||||
}
|
||||
}
|
||||
|
||||
Update-Marketplace -MarketplacePath (Join-Path $repoRoot ".agents\plugins\marketplace.json") -Sources $sources -PathPrefix "./plugins/codex/plugins"
|
||||
Update-Marketplace -MarketplacePath (Join-Path $repoRoot "plugins\codex\.agents\plugins\marketplace.json") -Sources $sources -PathPrefix "./plugins"
|
||||
|
||||
$updatedIds = @($lockSources | ForEach-Object { $_.id })
|
||||
$mergedLockSources = @()
|
||||
foreach ($entry in @($existingLock.sources)) {
|
||||
if ($updatedIds -notcontains $entry.id) {
|
||||
$mergedLockSources += $entry
|
||||
$retiredPluginNames = @()
|
||||
if (-not $Only) {
|
||||
$activeIds = @($sources | ForEach-Object { $_.id })
|
||||
$activePluginNames = @($sources | ForEach-Object { $_.pluginName })
|
||||
foreach ($entry in @($existingLock.sources)) {
|
||||
if ($activeIds -contains $entry.id -or $activePluginNames -contains $entry.pluginName) {
|
||||
continue
|
||||
}
|
||||
$pluginDir = Join-Path $pluginsRoot ([string]$entry.pluginName)
|
||||
if (Test-Path -LiteralPath $pluginDir) {
|
||||
$provenancePath = Join-Path $pluginDir "THIRD_PARTY_SOURCE.json"
|
||||
$provenance = Read-JsonFile $provenancePath
|
||||
if ([string]$provenance.sourceId -ne [string]$entry.id) {
|
||||
throw "Refusing to delete third-party plugin with mismatched source: $($entry.pluginName)"
|
||||
}
|
||||
Remove-PathIfExists -Path $pluginDir -Within $pluginsRoot
|
||||
}
|
||||
$retiredPluginNames += [string]$entry.pluginName
|
||||
}
|
||||
}
|
||||
$mergedLockSources += $lockSources
|
||||
|
||||
Update-Marketplace -MarketplacePath (Join-Path $repoRoot ".agents\plugins\marketplace.json") -Sources $sources -PathPrefix "./plugins/codex/plugins" -RetiredPluginNames $retiredPluginNames
|
||||
Update-Marketplace -MarketplacePath (Join-Path $repoRoot "plugins\codex\.agents\plugins\marketplace.json") -Sources $sources -PathPrefix "./plugins" -RetiredPluginNames $retiredPluginNames
|
||||
|
||||
$updatedIds = @($lockSources | ForEach-Object { $_.id })
|
||||
$mergedLockSources = @($lockSources)
|
||||
if ($Only) {
|
||||
$mergedLockSources = @()
|
||||
foreach ($entry in @($existingLock.sources)) {
|
||||
if ($updatedIds -notcontains $entry.id) {
|
||||
$mergedLockSources += $entry
|
||||
}
|
||||
}
|
||||
$mergedLockSources += $lockSources
|
||||
}
|
||||
Write-JsonFile -Path $lockPath -Value ([ordered]@{ sources = $mergedLockSources })
|
||||
|
||||
if (-not $KeepTemp) {
|
||||
|
||||
Reference in new issue
Block a user