218
}
219
220
>
export async function readPluginManifest(pluginUri: URI, format: IPluginFormatConfig, fileService: IFileService): Promise<Record<string, unknown> | undefined> {
pluginParsers.ts
221
>
if (format.format === PluginFormat.AgentPlugin) {
222
const manifest = await readAgentPluginManifest(pluginUri, fileService);
223
return manifest ? { ...manifest } : undefined;
224
}
225
const json = await readJsonFile(joinPath(pluginUri, format.manifestPath), fileService);
226
>
return json && typeof json === 'object' && !Array.isArray(json) ? json as Record<string, unknown> : undefined;
pluginParsers.ts
227
>
}
228
229
export function getPluginManifestComponent(format: IPluginFormatConfig, component: PluginComponent, manifest: Record<string, unknown> | undefined): unknown {
230
>
return format.componentPaths && Object.hasOwn(format.componentPaths, component) ? undefined : manifest?.[component];
pluginParsers.ts
231
>
}
232
233
export function resolvePluginComponentDirs(
235
>
format: IPluginFormatConfig,
236
>
component: PluginComponent,
237
>
fallbackPath: string,
238
>
manifestSection: unknown,
239
>
boundaryUri?: URI,
240
>
): readonly URI[] {
241
>
const componentPath = format.componentPaths?.[component];
242
>
if (format.componentPaths && Object.hasOwn(format.componentPaths, component)) {
243
return typeof componentPath === 'string'
244
? resolveComponentDirs(pluginUri, componentPath, emptyComponentPathConfig, boundaryUri)