Skip to content

Commit

Permalink
refactor: template file rename
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqizhou77 committed Sep 13, 2024
1 parent b709961 commit 3db2e0f
Show file tree
Hide file tree
Showing 33 changed files with 42 additions and 42 deletions.
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
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
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 templates/common/copilot-gpt-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The following files can be customized and demonstrate an example implementation

| File | Contents |
| ------------------------------------ | ------------------------------------------------------------------------------ |
| `appPackage/declarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. |

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"copilotExtensions": {
"declarativeCopilots": [
{
"id": "declarativeCopilot",
"file": "declarativeCopilot.json"
"id": "declarativeAgent",
"file": "declarativeAgent.json"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"copilotExtensions": {
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion templates/js/api-plugin-from-scratch-bearer/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your plugin inside Microsoft Teams. |
| `appPackage/ai-plugin.json` | The manifest file for your API Plugin that contains information for your API and used by LLM. |
{{#DeclarativeCopilot}}
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
{{/DeclarativeCopilot}}
The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
{{#DeclarativeCopilot}}
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
]
{{/DeclarativeCopilot}}
Expand Down
2 changes: 1 addition & 1 deletion templates/js/api-plugin-from-scratch-oauth/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/ai-plugin.dev.json` | The manifest file for your API Plugin that contains information for your API and used by LLM. |
| `appPackage/ai-plugin.local.json` | The manifest file for your API Plugin for local execution and debugging. |
{{#DeclarativeCopilot}}
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
{{/DeclarativeCopilot}}

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
{{#DeclarativeCopilot}}
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
]
{{/DeclarativeCopilot}}
Expand Down
2 changes: 1 addition & 1 deletion templates/js/api-plugin-from-scratch/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your plugin inside Microsoft Teams. |
| `appPackage/ai-plugin.json` | The manifest file for your API Plugin that contains information for your API and used by LLM. |
{{#DeclarativeCopilot}}
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
{{/DeclarativeCopilot}}

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
{{#DeclarativeCopilot}}
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
]
{{/DeclarativeCopilot}}
Expand Down
2 changes: 1 addition & 1 deletion templates/js/copilot-gpt-from-scratch-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/apiSpecificationFile/repair.yml` | A file that describes the structure and behavior of the repair API. |
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your API plugin and declarative agent. |
| `appPackage/ai-plugin.json` | The manifest file for your declarative agent that contains information for your API and used by LLM. |
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"copilotExtensions": {
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion templates/ts/api-plugin-from-scratch-bearer/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your plugin inside Microsoft Teams. |
| `appPackage/ai-plugin.json` | The manifest file for your API plugin that contains information for your API and used by LLM. |
{{#DeclarativeCopilot}}
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
{{/DeclarativeCopilot}}

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
{{#DeclarativeCopilot}}
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
]
{{/DeclarativeCopilot}}
Expand Down
2 changes: 1 addition & 1 deletion templates/ts/api-plugin-from-scratch-oauth/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/ai-plugin.dev.json` | The manifest file for your API plugin that contains information for your API and used by LLM. |
| `appPackage/ai-plugin.local.json` | The manifest file for your API plugin for local execution and debugging. |
{{#DeclarativeCopilot}}
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
{{/DeclarativeCopilot}}

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
{{#DeclarativeCopilot}}
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
]
{{/DeclarativeCopilot}}
Expand Down
2 changes: 1 addition & 1 deletion templates/ts/api-plugin-from-scratch/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your plugin inside Microsoft Teams. |
| `appPackage/ai-plugin.json` | The manifest file for your API Plugin that contains information for your API and used by LLM. |
{{#DeclarativeCopilot}}
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
{{/DeclarativeCopilot}}

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
{{#DeclarativeCopilot}}
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
]
{{/DeclarativeCopilot}}
Expand Down
2 changes: 1 addition & 1 deletion templates/ts/copilot-gpt-from-scratch-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The following files can be customized and demonstrate an example implementation
| `appPackage/apiSpecificationFile/repair.yml` | A file that describes the structure and behavior of the repair API. |
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your API plugin and declarative agent. |
| `appPackage/ai-plugin.json` | The manifest file for your declarative agent that contains information for your API and used by LLM. |
| `appPackage/repairDeclarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"copilotExtensions": {
"declarativeCopilots": [
{
"id": "repairDeclarativeCopilot",
"file": "repairDeclarativeCopilot.json"
"id": "repairDeclarativeAgent",
"file": "repairDeclarativeAgent.json"
}
],
"plugins": [
Expand Down

0 comments on commit 3db2e0f

Please sign in to comment.