// This file is automatically generated by Microsoft 365 Agents Toolkit.
// The teamsfx tasks defined in this file require Microsoft 365 Agents Toolkit version >= 5.0.0.
// See https://aka.ms/teamsfx-tasks for details on how to customize each task.
{
    "version": "2.0.0",
    "tasks": [
      {{#DeclarativeCopilot}}
      {
        "label": "Prepare DA",
        "dependsOn": [
          "Deploy"
        ],
        "dependsOrder": "sequence"
      },
      {
        // Build project.
        // See https://aka.ms/teamsfx-tasks/deploy to know the details and how to customize the args.
        "label": "Deploy",
        "type": "teamsfx",
        "command": "deploy",
        "args": {
          "env": "local"
        }
      },
      {{/DeclarativeCopilot}}
      {
        "label": "TTK",
        "dependsOn": [
          "Install Dependencies",
          "Start Azurite emulator",
          "Provision"
        ],
        "dependsOrder": "sequence"
      },
      {
        "type": "shell",
        "label": "Install Dependencies",
        "command": "npm install"
      },
      {
        "type": "shell",
        "label": "Run watch",
        "command": "npm run watch",
        "isBackground": true,
        "problemMatcher": "$tsc-watch"
      },
      {
        "label": "Start Website",
        "type": "shell",
        "command": "docfx content/docfx.json --serve -p 8000",
        "isBackground": true,
        "problemMatcher": {
          "pattern": [
            {
              "regexp": "^.*$",
              "file": 0,
              "location": 1,
              "message": 2
            }
          ],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "Searching built-in",
            "endsPattern": "Press Ctrl+C to shut down"
          }
        },
        "options": {
          "cwd": "${workspaceFolder}"
        }
      },
      {
        "label": "Start Azurite emulator",
        "type": "shell",
        "command": "npm run storage",
        "isBackground": true,
        "problemMatcher": {
          "pattern": [
            {
              "regexp": "^.*$",
              "file": 0,
              "location": 1,
              "message": 2
            }
          ],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "Azurite",
            "endsPattern": "successfully listening"
          }
        },
        "options": {
          "cwd": "${workspaceFolder}"
        }
      },
      {
        "label": "Provision",
        "type": "teamsfx",
        "command": "provision",
        "args": {
          "env": "local"
        }
      },
      {
        "label": "Terminate All Tasks",
        "command": "echo ${input:terminate}",
        "type": "shell",
        "problemMatcher": []
      },
      {
        "type": "func",
        "label": "func: host start",
        "command": "host start",
        "problemMatcher": "$func-node-watch",
        "isBackground": true,
        "dependsOn": "npm watch (functions)"
      },
      {
        "type": "shell",
        "label": "npm build (functions)",
        "command": "npm run build",
        "dependsOn": "npm clean (functions)",
        "problemMatcher": "$tsc"
      },
      {
        "type": "shell",
        "label": "npm watch (functions)",
        "command": "npm run watch",
        "dependsOn": "npm clean (functions)",
        "problemMatcher": "$tsc-watch",
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "isBackground": true
      },
      {
        "type": "shell",
        "label": "npm install (functions)",
        "command": "npm install"
      },
      {
        "type": "shell",
        "label": "npm prune (functions)",
        "command": "npm prune --production",
        "dependsOn": "npm build (functions)",
        "problemMatcher": []
      },
      {
        "type": "shell",
        "label": "npm clean (functions)",
        "command": "npm run clean",
        "dependsOn": "npm install (functions)"
      }
    ],
    "inputs": [
      {
        "id": "terminate",
        "type": "command",
        "command": "workbench.action.tasks.terminate",
        "args": "terminateAll"
      }
    ]
  }