Skip to content

Commit

Permalink
Merge pull request #12471 from OfficeDev/hui/pick-parser-change
Browse files Browse the repository at this point in the history
perf(spec-parser): update copilotExtensions to copilotAgents
  • Loading branch information
MSFT-yiz authored Sep 29, 2024
2 parents 35dcf8f + 8243799 commit 467e728
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 467e728

Please sign in to comment.