@microsoft/m365-spec-parser 0.2.2-beta.2024092901.0 → 0.2.2-beta.2024092902.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1603,16 +1603,28 @@ class ManifestUpdater {
1603
1603
  static async updateManifestWithAiPlugin(manifestPath, outputSpecPath, apiPluginFilePath, spec, options, authInfo, existingPluginManifestInfo) {
1604
1604
  const manifest = await fs.readJSON(manifestPath);
1605
1605
  const apiPluginRelativePath = ManifestUpdater.getRelativePath(manifestPath, apiPluginFilePath);
1606
- manifest.copilotExtensions = manifest.copilotExtensions || {};
1607
- // Insert plugins in manifest.json if it is plugin for Copilot.
1608
- if (!options.isGptPlugin) {
1609
- manifest.copilotExtensions.plugins = [
1610
- {
1611
- file: apiPluginRelativePath,
1612
- id: ConstantString.DefaultPluginId,
1613
- },
1614
- ];
1615
- ManifestUpdater.updateManifestDescription(manifest, spec);
1606
+ if (manifest.copilotExtensions) {
1607
+ if (!options.isGptPlugin) {
1608
+ manifest.copilotExtensions.plugins = [
1609
+ {
1610
+ file: apiPluginRelativePath,
1611
+ id: ConstantString.DefaultPluginId,
1612
+ },
1613
+ ];
1614
+ ManifestUpdater.updateManifestDescription(manifest, spec);
1615
+ }
1616
+ }
1617
+ else {
1618
+ manifest.copilotAgents = manifest.copilotAgents || {};
1619
+ if (!options.isGptPlugin) {
1620
+ manifest.copilotAgents.plugins = [
1621
+ {
1622
+ file: apiPluginRelativePath,
1623
+ id: ConstantString.DefaultPluginId,
1624
+ },
1625
+ ];
1626
+ ManifestUpdater.updateManifestDescription(manifest, spec);
1627
+ }
1616
1628
  }
1617
1629
  const appName = this.removeEnvs(manifest.name.short);
1618
1630
  const specRelativePath = ManifestUpdater.getRelativePath(manifestPath, outputSpecPath);