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

build: cherry-pick for 5.9 prerelase #12393

Merged
merged 7 commits into from
Sep 14, 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
24 changes: 12 additions & 12 deletions packages/fx-core/resource/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,22 +303,22 @@
"core.createProjectQuestion.projectType.officeAddin.framework.placeholder": "Select a framework",
"core.createProjectQuestion.projectType.tab.detail": "Embed your own web content in Teams, Outlook, and the Microsoft 365 app",
"core.createProjectQuestion.projectType.tab.title": "App Features Using a Tab",
"core.createProjectQuestion.projectType.copilotExtension.label": "Copilot Extension",
"core.createProjectQuestion.projectType.copilotExtension.title": "App Features using Copilot Extension",
"core.createProjectQuestion.projectType.copilotExtension.detail": "Create declarative Copilot, API plugin, or both with Microsoft Copilot orchestrator and LLM.",
"core.createProjectQuestion.projectType.copilotPlugin.detail": "Create a plugin to extend Microsoft Copilot for Microsoft 365 using your APIs",
"core.createProjectQuestion.projectType.copilotExtension.label": "Copilot Agent",
"core.createProjectQuestion.projectType.copilotExtension.title": "App Features using Copilot Agent",
"core.createProjectQuestion.projectType.copilotExtension.detail": "Create declarative agent, API plugin, or both with Microsoft Copilot orchestrator and LLM.",
"core.createProjectQuestion.projectType.copilotPlugin.detail": "Create a plugin to extend Microsoft 365 Copilot using your APIs",
"core.createProjectQuestion.projectType.copilotPlugin.label": "API Plugin",
"core.createProjectQuestion.projectType.copilotExtension.placeholder": "Select an option",
"core.createProjectQuestion.projectType.customCopilot.detail": "Build intelligent chatbot with Teams AI Library where you manage orchestration and provide your own LLM.",
"core.createProjectQuestion.projectType.customCopilot.label": "Custom Engine Copilot",
"core.createProjectQuestion.projectType.customCopilot.label": "Custom Engine Agent",
"core.createProjectQuestion.projectType.customCopilot.title": "App Features Using Teams AI Library",
"core.createProjectQuestion.projectType.customCopilot.placeholder": "Select an option",
"core.createProjectQuestion.projectType.copilotHelp.label": "Don't know how to start? Use GitHub Copilot Chat",
"core.createProjectQuestion.projectType.copilotHelp.detail": "Chat with GitHub Copilot and get step-by-step instructions to develop your Teams app",
"core.createProjectQuestion.projectType.copilotGroup.title": "Use Copilot",
"core.createProjectQuestion.projectType.createGroup.title": "Create",
"core.createProjectQuestion.projectType.declarativeCopilot.label": "Declarative Copilot",
"core.createProjectQuestion.projectType.declarativeCopilot.detail": "Create your own Copilot by declaring instructions, actions, & knowledge to suit your needs.",
"core.createProjectQuestion.projectType.declarativeCopilot.label": "Declarative Agent",
"core.createProjectQuestion.projectType.declarativeCopilot.detail": "Create your own copilot by declaring instructions, actions, & knowledge to suit your needs.",
"core.createProjectQuestion.title": "New Project",
"core.createProjectQuestion.capability.botMessageExtension.label": "Start with a Bot",
"core.createProjectQuestion.capability.botMessageExtension.detail": "Create a message extension using Bot Framework",
Expand Down Expand Up @@ -389,15 +389,15 @@
"core.createProjectQuestion.apiSpec.multipleValidationErrors.message": "Incompatible OpenAPI description document. Check output panel for details.",
"core.createProjectQuestion.apiSpec.multipleValidationErrors.vscode.message": "Incompatible OpenAPI description document. Check [output panel](command:fx-extension.showOutputChannel) for details.",
"core.createProjectQuestion.meArchitecture.title": "Architecture of Search Based Message Extension",
"core.createProjectQuestion.declarativeCopilot.title": "Create Declarative Copilot",
"core.createProjectQuestion.declarativeCopilot.placeholder": "Add API plugin to your declarative Copilot",
"core.createProjectQuestion.declarativeCopilot.title": "Create Declarative Agent",
"core.createProjectQuestion.declarativeCopilot.placeholder": "Add API plugin to your declarative agent",
"core.createProjectQuestion.createApiPlugin.title": "Create API Plugin",
"core.createProjectQuestion.addApiPlugin.title": "Add API Plugin",
"core.createProjectQuestion.addApiPlugin.placeholder": "Select how to add plugin",
"core.createProjectQuestion.noPlugin.label": "No plugin",
"core.createProjectQuestion.noPlugin.detail": "Create declarative Copilot only",
"core.createProjectQuestion.noPlugin.detail": "Create declarative agent only",
"core.createProjectQuestion.addPlugin.label": "Add plugin",
"core.createProjectQuestion.addPlugin.detail": "Create declarative Copilot with API plugin",
"core.createProjectQuestion.addPlugin.detail": "Create declarative agent with API plugin",
"core.createProjectQuestion.addExistingPlugin.pluginManifest.title": "Import Manifest File",
"core.createProjectQuestion.addExistingPlugin.apiSpec.title": "Import OpenAPI Description Document",
"core.createProjectQuestion.addExistingPlugin.pluginManifest.placeholder": "Select your plugin manifest file",
Expand Down Expand Up @@ -787,7 +787,7 @@
"driver.teamsApp.summary.validate.checkPath": "You can check and update your Teams app package at %s.\n",
"driver.teamsApp.summary.validateManifest": "Teams Toolkit has checked manifest(s) with the corresponding schema:\n\nSummary:\n%s.",
"driver.teamsApp.summary.validateTeamsManifest.checkPath": "You can check and update your Teams manifest at %s.",
"driver.teamsApp.summary.validateDeclarativeCopilotManifest.checkPath": "You can check and update your Declarative Copilot manifest at %s.",
"driver.teamsApp.summary.validateDeclarativeCopilotManifest.checkPath": "You can check and update your declarative agent manifest at %s.",
"driver.teamsApp.summary.validatePluginManifest.checkPath": "You can check and update your API Plugin manifest at %s.",
"driver.teamsApp.summary.validate.succeed": "%s passed",
"driver.teamsApp.summary.validate.failed": "%s failed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const copilotPluginExistingApiSpecUrlTelemetryEvent = "copilot-plugin-existing-a
const apiPluginFromApiSpecTemplateName = "api-plugin-existing-api";

const failedToUpdateCustomApiTemplateErrorName = "failed-to-update-custom-api-template";
const defaultDeclarativeCopilotManifestFileName = "declarativeCopilot.json";
const defaultDeclarativeCopilotManifestFileName = "declarativeAgent.json";

const enum telemetryProperties {
templateName = "template-name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class CopilotExtensionGenerator extends DefaultTemplateGenerator {
};

const filterFn = (fileName: string) => {
if (fileName.toLowerCase().includes("declarativecopilot.json")) {
if (fileName.toLowerCase().includes("declarativeagent.json")) {
return isDeclarativeCopilot;
} else if (fileName.includes(declarativeCopilotInstructionFileName)) {
return isDeclarativeCopilot && featureFlagManager.getBooleanValue(FeatureFlags.EnvFileFunc);
Expand Down
4 changes: 2 additions & 2 deletions packages/fx-core/src/question/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class ProjectTypeOptions {

static copilotExtension(platform?: Platform): OptionItem {
return {
id: "copilot-extension-type",
id: "copilot-agent-type",
label: `${
platform === Platform.VSCode ? "$(teamsfx-copilot-plugin) " : ""
}${getLocalizedString("core.createProjectQuestion.projectType.copilotExtension.label")}`,
Expand Down Expand Up @@ -725,7 +725,7 @@ export class CapabilityOptions {
// copilot extension - declarative copilot
static declarativeCopilot(): OptionItem {
return {
id: "declarative-copilot",
id: "declarative-agent",
label: getLocalizedString("core.createProjectQuestion.projectType.declarativeCopilot.label"),
detail: getLocalizedString(
"core.createProjectQuestion.projectType.declarativeCopilot.detail"
Expand Down
4 changes: 2 additions & 2 deletions packages/fx-core/src/question/inputs/CreateProjectInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface CreateProjectInputs extends Inputs {
| "search-message-extension"
| "link-unfurling"
| "api-plugin"
| "declarative-copilot"
| "declarative-agent"
| "custom-copilot-basic"
| "custom-copilot-rag"
| "custom-copilot-agent"
Expand Down Expand Up @@ -59,7 +59,7 @@ export interface CreateProjectInputs extends Inputs {
"spfx-folder"?: string;
/** @description Architecture of Search Based Message Extension */
"me-architecture"?: "new-api" | "api-spec" | "bot-plugin" | "bot";
/** @description Create Declarative Copilot */
/** @description Create Declarative Agent */
"with-plugin"?: "no" | "yes";
/** @description Create API Plugin */
"api-plugin-type"?: "new-api" | "api-spec" | "existing-plugin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const CreateProjectOptions: CLICommandOption[] = [
"search-message-extension",
"link-unfurling",
"api-plugin",
"declarative-copilot",
"declarative-agent",
"custom-copilot-basic",
"custom-copilot-rag",
"custom-copilot-agent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ describe("SpecGenerator", async () => {
assert.equal(res.value[0].templateName, "api-plugin-existing-api");
assert.equal(res.value[0].replaceMap!["DeclarativeCopilot"], "");

let filterResult = res.value[0].filterFn!("declarativeCopilot.json.tpl");
let filterResult = res.value[0].filterFn!("declarativeAgent.json.tpl");
assert.isFalse(filterResult);
filterResult = res.value[0].filterFn!("test.json");
assert.isTrue(filterResult);
Expand All @@ -1439,7 +1439,7 @@ describe("SpecGenerator", async () => {
assert.equal(res.value[0].templateName, "api-plugin-existing-api");
assert.equal(res.value[0].replaceMap!["DeclarativeCopilot"], "true");

let filterResult = res.value[0].filterFn!("declarativeCopilot.json.tpl");
let filterResult = res.value[0].filterFn!("declarativeAgent.json.tpl");
assert.isTrue(filterResult);
filterResult = res.value[0].filterFn!("instruction.txt");
assert.isTrue(filterResult);
Expand Down Expand Up @@ -1486,7 +1486,7 @@ describe("SpecGenerator", async () => {
assert.equal(res.value[0].templateName, "api-plugin-existing-api");
assert.equal(res.value[0].replaceMap!["DeclarativeCopilot"], "true");

let filterResult = res.value[0].filterFn!("declarativeCopilot.json.tpl");
let filterResult = res.value[0].filterFn!("declarativeAgent.json.tpl");
assert.isTrue(filterResult);
filterResult = res.value[0].filterFn!("instruction.txt");
assert.isFalse(filterResult);
Expand Down Expand Up @@ -1553,7 +1553,7 @@ describe("SpecGenerator", async () => {
assert.equal(res.value[0].templateName, "api-plugin-existing-api");
assert.equal(res.value[0].replaceMap!["DeclarativeCopilot"], "");

let filterResult = res.value[0].filterFn!("declarativeCopilot.json.tpl");
let filterResult = res.value[0].filterFn!("declarativeAgent.json.tpl");
assert.isFalse(filterResult);
filterResult = res.value[0].filterFn!("test.json");
assert.isTrue(filterResult);
Expand Down Expand Up @@ -1597,7 +1597,7 @@ describe("SpecGenerator", async () => {
assert.equal(res.value[0].templateName, "api-plugin-existing-api");
assert.equal(res.value[0].replaceMap!["DeclarativeCopilot"], "");

let filterResult = res.value[0].filterFn!("declarativeCopilot.json.tpl");
let filterResult = res.value[0].filterFn!("declarativeAgent.json.tpl");
assert.isFalse(filterResult);
filterResult = res.value[0].filterFn!("test.json");
assert.isTrue(filterResult);
Expand Down Expand Up @@ -2335,7 +2335,7 @@ describe("SpecGenerator", async () => {
[QuestionNames.Capabilities]: CapabilityOptions.apiPlugin().id,
[QuestionNames.ApiPluginType]: ApiPluginStartOptions.apiSpec().id,
[QuestionNames.ApiPluginManifestPath]: "test.json",
[QuestionNames.ProjectType]: "copilot-extension-type",
[QuestionNames.ProjectType]: "copilot-agent-type",
getTemplateInfosState: {
templateName: "api-plugin-existing-api",
isPlugin: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("copilotExtension", async () => {

if (info.isOk()) {
const filterFn = info.value[0].filterFn;
assert.isFalse(filterFn?.("repairDeclarativeCopilot.json"));
assert.isFalse(filterFn?.("repairDeclarativeAgent.json"));
assert.isFalse(filterFn?.("instruction.txt"));
assert.isTrue(filterFn?.("test.json"));
}
Expand Down Expand Up @@ -118,7 +118,7 @@ describe("copilotExtension", async () => {

if (info.isOk()) {
const filterFn = info.value[0].filterFn;
assert.isTrue(filterFn?.("repairDeclarativeCopilot.json"));
assert.isTrue(filterFn?.("repairDeclarativeAgent.json"));
assert.isTrue(filterFn?.("instruction.txt"));
assert.isTrue(filterFn?.("test.json"));
}
Expand All @@ -143,7 +143,7 @@ describe("copilotExtension", async () => {

if (info.isOk()) {
const filterFn = info.value[0].filterFn;
assert.isTrue(filterFn?.("repairDeclarativeCopilot.json"));
assert.isTrue(filterFn?.("repairDeclarativeAgent.json"));
assert.isFalse(filterFn?.("instruction.txt"));
assert.isTrue(filterFn?.("test.json"));
}
Expand All @@ -164,7 +164,7 @@ describe("copilotExtension", async () => {

sandbox
.stub(copilotGptManifestUtils, "getManifestPath")
.resolves(ok("declarativeCopilot.json"));
.resolves(ok("declarativeAgent.json"));
sandbox
.stub(generatorHelper, "addExistingPlugin")
.resolves(ok({ destinationPluginManifestPath: "test.json", warnings: [] }));
Expand Down Expand Up @@ -194,7 +194,7 @@ describe("copilotExtension", async () => {
const logStub = sandbox.stub(MockLogProvider.prototype, "info").resolves();
sandbox
.stub(copilotGptManifestUtils, "getManifestPath")
.resolves(ok("declarativeCopilot.json"));
.resolves(ok("declarativeAgent.json"));
sandbox.stub(generatorHelper, "addExistingPlugin").resolves(
ok({
destinationPluginManifestPath: "test.json",
Expand Down Expand Up @@ -246,7 +246,7 @@ describe("copilotExtension", async () => {

sandbox
.stub(copilotGptManifestUtils, "getManifestPath")
.resolves(ok("declarativeCopilot.json"));
.resolves(ok("declarativeAgent.json"));
sandbox
.stub(generatorHelper, "addExistingPlugin")
.resolves(err(new UserError("fakeError", "fakeError", "fakeError", "fakeError")));
Expand Down
2 changes: 1 addition & 1 deletion packages/spec-parser/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,5 @@ export class ConstantString {
static readonly FunctionDescriptionMaxLens = 100;
static readonly DefaultPluginId = "plugin_1";
static readonly PluginManifestSchema =
"https://aka.ms/json-schemas/copilot-extensions/v2.1/plugin.schema.json";
"https://aka.ms/json-schemas/copilot/plugin/v2.1/schema.json";
}
Loading
Loading