Skip to content

Commit

Permalink
perf(spec-parser): update copilotExtensions to copilotAgents
Browse files Browse the repository at this point in the history
  • Loading branch information
rentu authored and huimiu committed Sep 27, 2024
1 parent 36df05c commit fab9a69
Show file tree
Hide file tree
Showing 2 changed files with 385 additions and 34 deletions.
33 changes: 23 additions & 10 deletions packages/spec-parser/src/manifestUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,29 @@ export class ManifestUpdater {
): Promise<[TeamsAppManifest, PluginManifestSchema, WarningResult[]]> {
const manifest: TeamsAppManifest = await fs.readJSON(manifestPath);
const apiPluginRelativePath = ManifestUpdater.getRelativePath(manifestPath, apiPluginFilePath);
manifest.copilotExtensions = manifest.copilotExtensions || {};
// Insert plugins in manifest.json if it is plugin for Copilot.
if (!options.isGptPlugin) {
manifest.copilotExtensions.plugins = [
{
file: apiPluginRelativePath,
id: ConstantString.DefaultPluginId,
},
];
ManifestUpdater.updateManifestDescription(manifest, spec);

if (manifest.copilotExtensions) {
if (!options.isGptPlugin) {
manifest.copilotExtensions.plugins = [
{
file: apiPluginRelativePath,
id: ConstantString.DefaultPluginId,
},
];
ManifestUpdater.updateManifestDescription(manifest, spec);
}
} else {
(manifest as any).copilotAgents = (manifest as any).copilotAgents || {};

if (!options.isGptPlugin) {
(manifest as any).copilotAgents.plugins = [
{
file: apiPluginRelativePath,
id: ConstantString.DefaultPluginId,
},
];
ManifestUpdater.updateManifestDescription(manifest, spec);
}
}

const appName = this.removeEnvs(manifest.name.short);
Expand Down
Loading

0 comments on commit fab9a69

Please sign in to comment.