Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(spec-parser): update copilotExtensions to copilotAgents #12471

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading