fix(plugin): remediate ML-07 R2 findings
This commit is contained in:
@@ -113,7 +113,10 @@ export interface CodingCapabilityRegistryPort {
|
||||
export type CodingCapabilityRegistry = CodingCapabilityRegistryPort;
|
||||
|
||||
export interface CodingCapabilityRegistryOptions {
|
||||
policyClient: Pick<{ getState(): PluginPolicyClientState }, 'getState'>;
|
||||
policyClient: {
|
||||
getState(): PluginPolicyClientState;
|
||||
refresh(): Promise<void>;
|
||||
};
|
||||
getEnabledPluginIds?: (projectPath: string) => Promise<readonly string[]>;
|
||||
projectPlugins?: {
|
||||
getEnabledPluginIds(projectPath: string): Promise<readonly string[]>;
|
||||
@@ -375,6 +378,21 @@ export class CodingCapabilityRegistryImpl implements CodingCapabilityRegistryPor
|
||||
tools: [],
|
||||
};
|
||||
}
|
||||
const hasAssignedServerPlugin = this.definitions.some((definition) => (
|
||||
definition.requiresBackend
|
||||
&& this.adaptersByPluginId.has(definition.id)
|
||||
&& definition.skills.some(({ id }) => assigned.includes(id))
|
||||
));
|
||||
if (!hasAssignedServerPlugin) {
|
||||
return {
|
||||
catalogRevision: this.options.policyClient.getState().revision,
|
||||
pluginIds: [],
|
||||
effectiveSkillIds: effectiveCoreSkills,
|
||||
skillEntries: effectiveCoreSkills.map((id) => ({ id, entryPath: `${id}/SKILL.md` })),
|
||||
tools: [],
|
||||
};
|
||||
}
|
||||
await this.options.policyClient.refresh();
|
||||
const enabled = await this.enabledPluginIds(input.projectPath);
|
||||
const state = this.options.policyClient.getState();
|
||||
const pluginIds: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user