mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 06:16:03 +00:00
Merge remote-tracking branch 'origin/dev' into kai/feat/1016-missing-provider-integration
This commit is contained in:
commit
546ba01c38
4 files changed
+119
-14
No files matched your search
@@ -936,6 +936,10 @@ class SharedManager {
|
||||
}
|
||||
|
||||
for (const [name, value] of Object.entries(parsed as Record<string, unknown>)) {
|
||||
if (!this.isMarketplaceRegistryEntry(value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
merged[name] = normalizePluginMetadataValue(value, targetConfigDir).normalized;
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -947,22 +951,20 @@ class SharedManager {
|
||||
|
||||
const discoveredEntries = this.discoverMarketplaceEntries(targetConfigDir);
|
||||
|
||||
for (const [name, value] of Object.entries(discoveredEntries)) {
|
||||
const existing = merged[name];
|
||||
if (existing && typeof existing === 'object' && !Array.isArray(existing)) {
|
||||
merged[name] = {
|
||||
...(existing as Record<string, unknown>),
|
||||
installLocation: value.installLocation,
|
||||
};
|
||||
continue;
|
||||
}
|
||||
|
||||
merged[name] = value;
|
||||
}
|
||||
|
||||
// Keep only registry entries that have a physical directory, and update their
|
||||
// installLocation. Entries only on disk (no registry record) are excluded —
|
||||
// they lack required schema fields that Claude Code enforces.
|
||||
for (const name of Object.keys(merged)) {
|
||||
const entry = merged[name];
|
||||
if (!(name in discoveredEntries)) {
|
||||
delete merged[name];
|
||||
} else if (this.isMarketplaceRegistryEntry(entry)) {
|
||||
merged[name] = {
|
||||
...entry,
|
||||
installLocation: discoveredEntries[name].installLocation,
|
||||
};
|
||||
} else {
|
||||
delete merged[name];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -984,6 +986,11 @@ class SharedManager {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip hidden dirs and Claude Code rename-dance leftovers (.staging/.bak).
|
||||
if (this.isTransientMarketplaceDirectory(entry.name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
discovered[entry.name] = {
|
||||
installLocation: path.join(targetConfigDir, 'plugins', 'marketplaces', entry.name),
|
||||
};
|
||||
@@ -992,6 +999,14 @@ class SharedManager {
|
||||
return discovered;
|
||||
}
|
||||
|
||||
private isTransientMarketplaceDirectory(name: string): boolean {
|
||||
return name.startsWith('.') || name.endsWith('.staging') || name.endsWith('.bak');
|
||||
}
|
||||
|
||||
private isMarketplaceRegistryEntry(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
||||
}
|
||||
|
||||
private writePluginMetadataFile(
|
||||
registryPath: string,
|
||||
content: string,
|
||||
|
||||
Reference in new issue
Block a user