UNPKG

@microsoft/m365agentstoolkit-cli

Version:
213 lines 135 kB
[ { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "no", "optionLabel": "No Action" } ], "templateName": "copilot-gpt-basic", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create declarative agent only", "readme": "# Overview of the Declarative Agent template\n\nWith the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot.\n\n## Get started with the template\n\n> **Prerequisites**\n>\n> To run this app template in your local dev machine, you will need:\n>\n> - [Node.js](https://nodejs.org/), supported versions: 18, 20, 22\n> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts).\n> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Microsoft 365 Agents Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli)\n> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)\n\n![image](https://github.com/user-attachments/assets/51a221bb-a2c6-4dbf-8009-d2aa20a1638f)\n\n1. First, select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar.\n2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.\n3. Select `Preview Local in Copilot (Edge)` or `Preview Local in Copilot (Chrome)` from the launch configuration dropdown.\n4. Select your declarative agent from the `Copilot` app.\n5. Ask a question to your declarative agent and it should respond based on the instructions provided.\n\n## What's included in the template\n\n| Folder | Contents |\n| ------------ | ---------------------------------------------------------------------------------------- |\n| `.vscode` | VSCode files for debugging |\n| `appPackage` | Templates for the application manifest, the GPT manifest and the API specification |\n| `env` | Environment files |\n\nThe following files can be customized and demonstrate an example implementation to get you started.\n\n| File | Contents |\n| ---------------------------------- | ---------------------------------------------------------------------------- |\n| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |\n| `appPackage/manifest.json` | application manifest that defines metadata for your declarative agent. |\n\nThe following are Microsoft 365 Agents 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 Microsoft 365 Agents Toolkit works.\n\n| File | Contents |\n| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| `m365agents.yml` | This is the main Microsoft 365 Agents Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |\n\n## Extend the template\n\n- [Add conversation starters](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=3): Conversation starters are hints that are displayed to the user to demonstrate how they can get started using the declarative agent.\n- [Add web content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=4) for the ability to search web information.\n- [Add OneDrive and SharePoint content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=5) as grounding knowledge for the agent.\n- [Add Microsoft Copilot connectors content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=6) to ground agent with enterprise knowledge.\n- [Add API plugins](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=7) for agent to interact with REST APIs.\n\n## Addition information and references\n\n- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)\n", "supportedLanguages": [ "common" ], "templateIds": [ "declarative-agent-basic" ] }, { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "yes", "optionLabel": "Add an Action" }, { "nodeId": "api-plugin-type", "optionId": "new-api", "optionLabel": "Start with a New API" }, { "nodeId": "api-auth", "optionId": "none", "optionLabel": "None" } ], "templateName": "api-plugin-from-scratch", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create a declarative agent with an action - Create an action with a new API from Azure Functions", "readme": "# Overview of the Declarative Agent with API Plugin template\n\n## Build a Declarative Agent with API Plugin from a new API with Azure Functions\n\nWith the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot.\n\nYou can extend declarative agents using plugins to retrieve data and execute tasks on external systems. A declarative agent can utilize multiple plugins at the same time.\n![image](https://github.com/user-attachments/assets/9939972e-0449-410c-b237-d9d748cd6628)\n\n## Get started with the template\n\n> **Prerequisites**\n>\n> To run this app template in your local dev machine, you will need:\n>\n> - [Node.js](https://nodejs.org/), supported versions: 18, 20, 22\n> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts)\n> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Microsoft 365 Agents Toolkit CLI](https://aka.ms/teams-toolkit-cli)\n> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)\n\n1. First, select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar.\n2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.\n3. Select `Debug in Copilot (Edge)` or `Debug in Copilot (Chrome)` from the launch configuration dropdown.\n4. Select your declarative agent from the `Copilot` app.\n5. Send a message to Copilot to find a repair record.\n\n## What's included in the template\n\n| Folder | Contents |\n| ------------ | ------------------------------------------------------------------------------------------- |\n| `.vscode` | VSCode files for debugging |\n| `appPackage` | Templates for the application manifest, the plugin manifest and the API specification |\n| `env` | Environment files |\n| `infra` | Templates for provisioning Azure resources |\n| `src` | The source code for the repair API |\n\nThe following files can be customized and demonstrate an example implementation to get you started.\n\n| File | Contents |\n| ----------------------------------------------- | ------------------------------------------------------------------------------------------------- |\n| `src/functions/repairs.js` | The main file of a function in Azure Functions. |\n| `src/repairsData.json` | The data source for the repair API. |\n| `appPackage/apiSpecificationFile/repair.yml` | A file that describes the structure and behavior of the repair API. |\n| `appPackage/manifest.json` | application manifest that defines metadata for your plugin inside Microsoft Teams. |\n| `appPackage/ai-plugin.json` | The manifest file for your API Plugin that contains information for your API and used by LLM. |\n| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |\n| `appPackage/adaptiveCards/listRepairs.json` | Adaptive Card file used to render a result from the plugin response. |\n| `appPackage/adaptiveCards/listRepairs.data.json`| Sample mock data file for adaptive card. |\n\nThe following are Microsoft 365 Agents 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 Microsoft 365 Agents Toolkit works.\n\n| File | Contents |\n| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| `m365agents.yml` | This is the main Microsoft 365 Agents Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |\n| `m365agents.local.yml` | This overrides `m365agents.yml` with actions that enable local execution and debugging. |\n\n## Extend the template\n\n- [Add conversation starters](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=3): Conversation starters are hints that are displayed to the user to demonstrate how they can get started using the declarative agent.\n- [Add web content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=4) for the ability to search web information.\n- [Add OneDrive and SharePoint content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=5) as grounding knowledge for the agent.\n- [Add Microsoft Copilot connectors content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=6) to ground agent with enterprise knowledge.\n- [Add API plugins](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=7) for agent to interact with REST APIs.\n\n\n## Addition information and references\n\n- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)\n- [Extend Microsoft 365 Copilot](https://aka.ms/teamsfx-copilot-plugin)\n- [Message extensions for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-message-extension-bot)\n- [Microsoft Copilot connectors for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-graph-connector)\n- [Microsoft 365 Copilot extensibility samples](https://learn.microsoft.com/microsoft-365-copilot/extensibility/samples)\n", "supportedLanguages": [ "typescript", "javascript" ], "templateIds": [ "declarative-agent-with-action-from-scratch-ts", "declarative-agent-with-action-from-scratch-js" ] }, { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "yes", "optionLabel": "Add an Action" }, { "nodeId": "api-plugin-type", "optionId": "new-api", "optionLabel": "Start with a New API" }, { "nodeId": "api-auth", "optionId": "api-key", "optionLabel": "API Key" } ], "templateName": "api-plugin-from-scratch-bearer", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create a declarative agent with an action - Create an action with a new API from Azure Functions", "readme": "# Overview of the Declarative Agent with API Plugin template\n\n## Build a Declarative Agent with API Plugin from a new API with Azure Functions\n\nWith the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot.\n\nYou can extend declarative agents using plugins to retrieve data and execute tasks on external systems. A declarative agent can utilize multiple plugins at the same time.\n![image](https://github.com/user-attachments/assets/9939972e-0449-410c-b237-d9d748cd6628)\n\n## Get started with the template\n\n> **Prerequisites**\n>\n> To run this app template in your local dev machine, you will need:\n>\n> - [Node.js](https://nodejs.org/), supported versions: 18, 20, 22\n> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts)\n> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Microsoft 365 Agents Toolkit CLI](https://aka.ms/teams-toolkit-cli)\n> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)\n\n1. First, select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar.\n2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.\n3. Select `Debug in Copilot (Edge)` or `Debug in Copilot (Chrome)` from the launch configuration dropdown.\n4. Select your declarative agent from the `Copilot` app.\n5. Send a message to Copilot to find a repair record.\n\n### How to add your own API Key\n\n1. Open terminal and run command `npm install` to install all dependency packages\n\n ```\n > npm install\n ```\n\n2. After `npm install` completed, run command `npm run keygen`\n ```\n > npm run keygen\n ```\n3. The above command will output something like \"Generated a new API Key: xxx...\"\n4. Fill in API Key into `env/.env.*.user`\n ```\n SECRET_API_KEY=<your-api-key>\n ```\n\n## What's included in the template\n\n| Folder | Contents |\n| ------------ | ------------------------------------------------------------------------------------------- |\n| `.vscode` | VSCode files for debugging |\n| `appPackage` | Templates for the application manifest, the plugin manifest and the API specification |\n| `env` | Environment files |\n| `infra` | Templates for provisioning Azure resources |\n| `src` | The source code for the repair API |\n\nThe following files can be customized and demonstrate an example implementation to get you started.\n\n| File | Contents |\n| ----------------------------------------------- | ------------------------------------------------------------------------------------------------- |\n| `src/functions/repairs.js` | The main file of a function in Azure Functions. |\n| `src/repairsData.json` | The data source for the repair API. |\n| `appPackage/apiSpecificationFile/repair.yml` | A file that describes the structure and behavior of the repair API. |\n| `appPackage/manifest.json` | application manifest that defines metadata for your plugin inside Microsoft Teams. |\n| `appPackage/ai-plugin.json` | The manifest file for your API Plugin that contains information for your API and used by LLM. |\n| `appPackage/adaptiveCards/listRepairs.json` | Adaptive Card file used to render a result from the plugin response. |\n| `appPackage/adaptiveCards/listRepairs.data.json`| Sample mock data file for adaptive card. |\n\nThe following are Microsoft 365 Agents 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 Microsoft 365 Agents Toolkit works.\n\n| File | Contents |\n| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| `m365agents.yml` | This is the main Microsoft 365 Agents Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |\n| `m365agents.local.yml` | This overrides `m365agents.yml` with actions that enable local execution and debugging. |\n\n## Extend the template\n\n- [Add conversation starters](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=3): Conversation starters are hints that are displayed to the user to demonstrate how they can get started using the declarative agent.\n- [Add web content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=4) for the ability to search web information.\n- [Add OneDrive and SharePoint content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=5) as grounding knowledge for the agent.\n- [Add Microsoft Copilot connectors content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=6) to ground agent with enterprise knowledge.\n- [Add API plugins](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=7) for agent to interact with REST APIs.\n\n## Addition information and references\n\n- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)\n- [Extend Microsoft 365 Copilot](https://aka.ms/teamsfx-copilot-plugin)\n- [Message extensions for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-message-extension-bot)\n- [Microsoft CopilotcConnectors for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-graph-connector)\n- [Microsoft 365 Copilot extensibility samples](https://learn.microsoft.com/microsoft-365-copilot/extensibility/samples)\n", "supportedLanguages": [ "typescript", "javascript" ], "templateIds": [ "declarative-agent-with-action-from-scratch-bearer-ts", "declarative-agent-with-action-from-scratch-bearer-js" ] }, { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "yes", "optionLabel": "Add an Action" }, { "nodeId": "api-plugin-type", "optionId": "new-api", "optionLabel": "Start with a New API" }, { "nodeId": "api-auth", "optionId": "microsoft-entra", "optionLabel": "Microsoft Entra" } ], "templateName": "api-plugin-from-scratch-oauth", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create a declarative agent with an action - Create an action with a new API from Azure Functions", "readme": "# Overview of the Declarative Agent with API Plugin template\r\n\r\n## Build a Declarative Agent with API Plugin from a new API with Azure Functions\r\n\r\nWith the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot.\r\n\r\nYou can extend declarative agents using plugins to retrieve data and execute tasks on external systems. A declarative agent can utilize multiple plugins at the same time.\r\n![image](https://github.com/user-attachments/assets/9939972e-0449-410c-b237-d9d748cd6628)\r\n\r\n## Get started with the template\r\n\r\n> **Prerequisites**\r\n>\r\n> To run this app template in your local dev machine, you will need:\r\n>\r\n> - [Node.js](https://nodejs.org/), supported versions: 18, 20, 22\r\n> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts)\r\n> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Microsoft 365 Agents Toolkit CLI](https://aka.ms/teams-toolkit-cli)\r\n> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)\r\n\r\n1. First, select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar.\r\n2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.\r\n3. Select `Debug in Copilot (Edge)` or `Debug in Copilot (Chrome)` from the launch configuration dropdown.\r\n4. Select your declarative agent from the `Copilot` app.\r\n5. Send a message to Copilot to find a repair record.\r\n\r\n## What's included in the template\r\n\r\n| Folder | Contents |\r\n| ------------ | ------------------------------------------------------------------------------------------- |\r\n| `.vscode` | VSCode files for debugging |\r\n| `appPackage` | Templates for the application manifest, the plugin manifest and the API specification |\r\n| `env` | Environment files |\r\n| `infra` | Templates for provisioning Azure resources |\r\n| `src` | The source code for the repair API |\r\n\r\nThe following files can be customized and demonstrate an example implementation to get you started.\r\n\r\n| File | Contents |\r\n| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\r\n| `src/functions/repairs.ts` | The main file of a function in Azure Functions. |\r\n| `src/functions/middleware/tokenCacheWrapper.ts` | A wrapper class that handles caching of JWT signing keys to improve performance of token validation. |\r\n| `src/functions/middleware/tokenValidator.ts` | Core class for validating JWT tokens from Microsoft Entra, including checks for claims, scopes, roles and tenant validation. |\r\n| `src/functions/middleware/authMiddleware.ts` | Middleware function that handles authorization using JWT tokens, integrating with the token validator. |\r\n| `src/functions/middleware/utils.ts` | Utility functions for authentication, including retrieving JWKS URIs for different cloud environments. |\r\n| `src/functions/middleware/config.ts` | Configuration file that exports Microsoft Entra app settings from environment variables. |\r\n| `src/repairsData.json` | The data source for the repair API. |\r\n| `appPackage/apiSpecificationFile/repair.yml` | A file that describes the structure and behavior of the repair API. |\r\n| `appPackage/manifest.json` | application manifest that defines metadata for your plugin inside Microsoft Teams. |\r\n| `appPackage/ai-plugin.json` | The manifest file for your API plugin that contains information for your API and used by LLM. |\r\n| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |\r\n| `appPackage/adaptiveCards/listRepairs.json` | Adaptive Card file used to render a result from the plugin response. |\r\n| `appPackage/adaptiveCards/listRepairs.data.json`| Sample mock data file for adaptive Card. |\r\n\r\nThe following are Microsoft 365 Agents 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 Microsoft 365 Agents Toolkit works.\r\n\r\n| File | Contents |\r\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `m365agents.yml` | This is the main Microsoft 365 Agents Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |\r\n| `m365agents.local.yml` | This overrides `m365agents.yml` with actions that enable local execution and debugging. |\r\n| `aad.manifest.json` | This file defines the configuration of Microsoft Entra app. This template will only provision [single tenant](https://learn.microsoft.com/azure/active-directory/develop/single-and-multi-tenant-apps#who-can-sign-in-to-your-app) Microsoft Entra app. |\r\n{{^MicrosoftEntra}}\r\n\r\n## Extend the template\r\n\r\n- [Add conversation starters](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=3): Conversation starters are hints that are displayed to the user to demonstrate how they can get started using the declarative agent.\r\n- [Add web content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=4) for the ability to search web information.\r\n- [Add OneDrive and SharePoint content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=5) as grounding knowledge for the agent.\r\n- [Add Microsoft Copilot connectors content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=6) to ground agent with enterprise knowledge.\r\n- [Add API plugins](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=7) for agent to interact with REST APIs.\r\n\r\n## How OAuth works in the API plugin\r\n\r\n![oauth-flow](https://github.com/OfficeDev/teams-toolkit/assets/107838226/f074abbe-d9e3-4a46-8e08-feb66b17a539)\r\n{{/MicrosoftEntra}}\r\n\r\n## Addition information and references\r\n\r\n- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)\r\n- [Extend Microsoft 365 Copilot](https://aka.ms/teamsfx-copilot-plugin)\r\n- [Message extensions for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-message-extension-bot)\r\n- [Microsoft Copilot connectors for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-graph-connector)\r\n- [Microsoft 365 Copilot extensibility samples](https://learn.microsoft.com/microsoft-365-copilot/extensibility/samples)\r\n", "supportedLanguages": [ "typescript", "javascript" ], "templateIds": [ "declarative-agent-with-action-from-scratch-oauth-ts", "declarative-agent-with-action-from-scratch-oauth-js" ] }, { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "yes", "optionLabel": "Add an Action" }, { "nodeId": "api-plugin-type", "optionId": "new-api", "optionLabel": "Start with a New API" }, { "nodeId": "api-auth", "optionId": "oauth", "optionLabel": "OAuth" } ], "templateName": "api-plugin-from-scratch-oauth", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create a declarative agent with an action - Create an action with a new API from Azure Functions", "readme": "# Overview of the Declarative Agent with API Plugin template\r\n\r\n## Build a Declarative Agent with API Plugin from a new API with Azure Functions\r\n\r\nWith the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot.\r\n\r\nYou can extend declarative agents using plugins to retrieve data and execute tasks on external systems. A declarative agent can utilize multiple plugins at the same time.\r\n![image](https://github.com/user-attachments/assets/9939972e-0449-410c-b237-d9d748cd6628)\r\n\r\n## Get started with the template\r\n\r\n> **Prerequisites**\r\n>\r\n> To run this app template in your local dev machine, you will need:\r\n>\r\n> - [Node.js](https://nodejs.org/), supported versions: 18, 20, 22\r\n> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts)\r\n> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Microsoft 365 Agents Toolkit CLI](https://aka.ms/teams-toolkit-cli)\r\n> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)\r\n\r\n1. First, select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar.\r\n2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.\r\n3. Select `Debug in Copilot (Edge)` or `Debug in Copilot (Chrome)` from the launch configuration dropdown.\r\n4. Select your declarative agent from the `Copilot` app.\r\n5. Send a message to Copilot to find a repair record.\r\n\r\n## What's included in the template\r\n\r\n| Folder | Contents |\r\n| ------------ | ------------------------------------------------------------------------------------------- |\r\n| `.vscode` | VSCode files for debugging |\r\n| `appPackage` | Templates for the application manifest, the plugin manifest and the API specification |\r\n| `env` | Environment files |\r\n| `infra` | Templates for provisioning Azure resources |\r\n| `src` | The source code for the repair API |\r\n\r\nThe following files can be customized and demonstrate an example implementation to get you started.\r\n\r\n| File | Contents |\r\n| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\r\n| `src/functions/repairs.ts` | The main file of a function in Azure Functions. |\r\n| `src/functions/middleware/tokenCacheWrapper.ts` | A wrapper class that handles caching of JWT signing keys to improve performance of token validation. |\r\n| `src/functions/middleware/tokenValidator.ts` | Core class for validating JWT tokens from Microsoft Entra, including checks for claims, scopes, roles and tenant validation. |\r\n| `src/functions/middleware/authMiddleware.ts` | Middleware function that handles authorization using JWT tokens, integrating with the token validator. |\r\n| `src/functions/middleware/utils.ts` | Utility functions for authentication, including retrieving JWKS URIs for different cloud environments. |\r\n| `src/functions/middleware/config.ts` | Configuration file that exports Microsoft Entra app settings from environment variables. |\r\n| `src/repairsData.json` | The data source for the repair API. |\r\n| `appPackage/apiSpecificationFile/repair.yml` | A file that describes the structure and behavior of the repair API. |\r\n| `appPackage/manifest.json` | application manifest that defines metadata for your plugin inside Microsoft Teams. |\r\n| `appPackage/ai-plugin.json` | The manifest file for your API plugin that contains information for your API and used by LLM. |\r\n| `appPackage/repairDeclarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |\r\n| `appPackage/adaptiveCards/listRepairs.json` | Adaptive Card file used to render a result from the plugin response. |\r\n| `appPackage/adaptiveCards/listRepairs.data.json`| Sample mock data file for adaptive Card. |\r\n\r\nThe following are Microsoft 365 Agents 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 Microsoft 365 Agents Toolkit works.\r\n\r\n| File | Contents |\r\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `m365agents.yml` | This is the main Microsoft 365 Agents Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |\r\n| `m365agents.local.yml` | This overrides `m365agents.yml` with actions that enable local execution and debugging. |\r\n| `aad.manifest.json` | This file defines the configuration of Microsoft Entra app. This template will only provision [single tenant](https://learn.microsoft.com/azure/active-directory/develop/single-and-multi-tenant-apps#who-can-sign-in-to-your-app) Microsoft Entra app. |\r\n{{^MicrosoftEntra}}\r\n\r\n## Extend the template\r\n\r\n- [Add conversation starters](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=3): Conversation starters are hints that are displayed to the user to demonstrate how they can get started using the declarative agent.\r\n- [Add web content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=4) for the ability to search web information.\r\n- [Add OneDrive and SharePoint content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=5) as grounding knowledge for the agent.\r\n- [Add Microsoft Copilot connectors content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=6) to ground agent with enterprise knowledge.\r\n- [Add API plugins](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=7) for agent to interact with REST APIs.\r\n\r\n## How OAuth works in the API plugin\r\n\r\n![oauth-flow](https://github.com/OfficeDev/teams-toolkit/assets/107838226/f074abbe-d9e3-4a46-8e08-feb66b17a539)\r\n{{/MicrosoftEntra}}\r\n\r\n## Addition information and references\r\n\r\n- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)\r\n- [Extend Microsoft 365 Copilot](https://aka.ms/teamsfx-copilot-plugin)\r\n- [Message extensions for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-message-extension-bot)\r\n- [Microsoft Copilot connectors for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-graph-connector)\r\n- [Microsoft 365 Copilot extensibility samples](https://learn.microsoft.com/microsoft-365-copilot/extensibility/samples)\r\n", "supportedLanguages": [ "typescript", "javascript" ], "templateIds": [ "declarative-agent-with-action-from-scratch-oauth-ts", "declarative-agent-with-action-from-scratch-oauth-js" ] }, { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "yes", "optionLabel": "Add an Action" }, { "nodeId": "api-plugin-type", "optionId": "api-spec", "optionLabel": "Start with an OpenAPI Description Document" } ], "templateName": "api-plugin-from-existing-api", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create a declarative agent with an action - Create an action from your existing API", "readme": "# Overview of the basic declarative agent with API plugin template\r\n\r\n## Build a basic declarative agent with API plugin\r\n\r\nWith the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot.\r\n\r\nYou can extend declarative agents using plugins to retrieve data and execute tasks on external systems. A declarative agent can utilize multiple plugins at the same time.\r\n\r\n![image](https://github.com/user-attachments/assets/9939972e-0449-410c-b237-d9d748cd6628)\r\n\r\n\r\n## Get started with the template\r\n\r\n> **Prerequisites**\r\n>\r\n> To run this app template in your local dev machine, you will need:\r\n>\r\n> - [Node.js](https://nodejs.org/), supported versions: 18, 20, 22\r\n> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts).\r\n> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Microsoft 365 Agents Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli)\r\n> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)\r\n\r\n1. First, select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar.\r\n2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.\r\n3. Select `Preview Local in Copilot (Edge)` or `Preview Local in Copilot (Chrome)` from the launch configuration dropdown.\r\n4. Select your declarative agent from the `Copilot` app.\r\n5. Send a prompt.\r\n\r\n{{#ApiKey}}\r\n> [!NOTE]\r\n> Microsoft 365 Agents Toolkit will ask you for your API key during provision. The API key will be securely stored with [Developer Portal](https://dev.teams.microsoft.com/home) and used by Teams client to access your API in runtime. Microsoft 365 Agents Toolkit will not store your API key.\r\n{{/ApiKey}}\r\n\r\n{{#OAuth}}\r\n> [!NOTE]\r\n> If your identity server needs Proof of Key Code Exchange (PKCE) for token exchange, uncomment the `isPKCEEnabled` property in the` oauth/register` section of the `m365agents.yml` file shown as below:\r\n```yaml\r\n - uses: oauth/register\r\n with:\r\n name: {{ApiSpecAuthName}}\r\n flow: authorizationCode\r\n # app ID\r\n appId: ${{TEAMS_APP_ID}}\r\n # Path to OpenAPI description document\r\n apiSpecPath: {{{ApiSpecPath}}}\r\n # Uncomment below property to use proof key for code exchange (PKCE)\r\n isPKCEEnabled: true\r\n writeToEnvironmentFile:\r\n configurationId: {{ApiSpecAuthRegistrationIdEnvName}}\r\n```\r\n> Microsoft 365 Agents Toolkit will ask you for your Client ID and Client Secret for Oauth2 during provision. These information will be securely stored with [Developer Portal](https://dev.teams.microsoft.com/home) and used by Teams client to access your API in runtime. Microsoft 365 Agents Toolkit will not store your Client ID and Client Secret.\r\n{{/OAuth}}\r\n\r\n## What's included in the template\r\n\r\n| Folder | Contents |\r\n| ------------ | -------------------------------------------- |\r\n| `.vscode` | VSCode files for debugging |\r\n| `appPackage` | Templates for the application manifest, the plugin manifest and the API specification |\r\n| `env` | Environment files |\r\n\r\nThe following files can be customized and demonstrate an example implementation to get you started.\r\n\r\n| File | Contents |\r\n| ------------------------------------ | ------------------------------------------------------------------------------ |\r\n| `appPackage/declarativeCopilot.json` | Define the behaviour and configurations of the declarative agent. |\r\n| `appPackage/manifest.json` | application manifest that defines metadata for your declarative agent. |\r\n\r\nThe following are Microsoft 365 Agents 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 Microsoft 365 Agents Toolkit works.\r\n\r\n| File | Contents |\r\n| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `m365agents.yml` | This is the main Microsoft 365 Agents Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |\r\n\r\n## Addition information and references\r\n\r\n- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)\r\n- [Extend Microsoft 365 Copilot](https://aka.ms/teamsfx-copilot-plugin)\r\n- [Message extensions for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-message-extension-bot)\r\n- [Microsoft Copilot connectors for Microsoft 365 Copilot](https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-graph-connector)\r\n- [Microsoft 365 Copilot extensibility samples](https://learn.microsoft.com/microsoft-365-copilot/extensibility/samples)", "supportedLanguages": [ "none" ], "templateIds": [ "declarative-agent-with-action-from-existing-api" ] }, { "nodes": [ { "nodeId": "project-type", "optionId": "copilot-agent-type", "optionLabel": "Declarative Agent" }, { "nodeId": "with-plugin", "optionId": "yes", "optionLabel": "Add an Action" }, { "nodeId": "api-plugin-type", "optionId": "mcp", "optionLabel": "Start with an MCP server" } ], "templateName": "declarative-agent-with-action-from-mcp", "description": "Create your own agent by declaring instructions, actions, & knowledge to suit your needs. - Create a declarative agent with an action - Create actions from your existing MCP server", "readme": "# Declarative Agent + MCP in VS Code \n\nThis template shows how to wrap your existing MCP Server into a Microsoft 365 Copilot Declarative Agent (DA) using the Agents Toolkit (ATK) in VS Code. Instead of hand‑authoring an OpenAPI spec, you point ATK at your MCP discovery URL and let the toolkit generate all manifests, wiring in authentication and function definitions automatically. \n\n## Get started with the template\n\n> **Pr