{
  "id": "msteams",
  "categories": [
    "channels"
  ],
  "doctorContract": {
    "configRepair": true,
    "stateMigrations": [
      {
        "id": "msteams-conversations-json-to-plugin-state"
      },
      {
        "id": "msteams-polls-json-to-plugin-state"
      },
      {
        "id": "msteams-sso-tokens-json-to-plugin-state"
      },
      {
        "id": "msteams-delegated-token-json-to-plugin-state"
      },
      {
        "id": "msteams-feedback-learnings-json-to-plugin-state"
      }
    ]
  },
  "name": "Microsoft Teams",
  "description": "OpenClaw Microsoft Teams channel plugin for bot conversations.",
  "activation": {
    "onStartup": false
  },
  "channels": [
    "msteams"
  ],
  "qaRunners": [
    {
      "commandName": "msteams",
      "description": "Run Microsoft Teams Gateway QA against a local Bot Framework mock"
    }
  ],
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {}
  },
  "channelConfigs": {
    "msteams": {
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "markdown": {
            "type": "object",
            "properties": {
              "tables": {
                "type": "string",
                "enum": [
                  "off",
                  "bullets",
                  "code",
                  "block"
                ]
              }
            },
            "additionalProperties": false
          },
          "configWrites": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "dmPolicy": {
            "default": "pairing",
            "type": "string",
            "enum": [
              "pairing",
              "allowlist",
              "open",
              "disabled"
            ]
          },
          "allowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultTo": {
            "type": "string"
          },
          "groupAllowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groupPolicy": {
            "default": "allowlist",
            "type": "string",
            "enum": [
              "open",
              "disabled",
              "allowlist"
            ]
          },
          "contextVisibility": {
            "type": "string",
            "enum": [
              "all",
              "allowlist",
              "allowlist_quote"
            ]
          },
          "historyLimit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "dmHistoryLimit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "dms": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "historyLimit": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "textChunkLimit": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "streaming": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "off",
                  "partial",
                  "block",
                  "progress"
                ]
              },
              "chunkMode": {
                "type": "string",
                "enum": [
                  "length",
                  "newline"
                ]
              },
              "preview": {
                "type": "object",
                "properties": {
                  "chunk": {
                    "type": "object",
                    "properties": {
                      "minChars": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxChars": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "breakPreference": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "paragraph"
                          },
                          {
                            "type": "string",
                            "const": "newline"
                          },
                          {
                            "type": "string",
                            "const": "sentence"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "toolProgress": {
                    "type": "boolean"
                  },
                  "commandText": {
                    "type": "string",
                    "enum": [
                      "raw",
                      "status"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "progress": {
                "type": "object",
                "properties": {
                  "label": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "boolean",
                        "const": false
                      }
                    ]
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "maxLines": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "maxLineChars": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "toolProgress": {
                    "type": "boolean"
                  },
                  "commandText": {
                    "type": "string",
                    "enum": [
                      "raw",
                      "status"
                    ]
                  },
                  "commentary": {
                    "type": "boolean"
                  },
                  "narration": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "block": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "coalesce": {
                    "type": "object",
                    "properties": {
                      "minChars": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxChars": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "idleMs": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "heartbeatVisibility": {
            "type": "object",
            "properties": {
              "showOk": {
                "type": "boolean"
              },
              "showAlerts": {
                "type": "boolean"
              },
              "useIndicator": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "healthMonitor": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "responsePrefix": {
            "type": "string"
          },
          "mediaMaxMb": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "dangerouslyAllowNameMatching": {
            "type": "boolean"
          },
          "appId": {
            "type": "string"
          },
          "appPassword": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "const": "env"
                      },
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                      },
                      "id": {
                        "type": "string",
                        "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                      }
                    },
                    "required": [
                      "source",
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "const": "store"
                      },
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                      },
                      "id": {
                        "type": "string",
                        "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                      }
                    },
                    "required": [
                      "source",
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "const": "file"
                      },
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "source",
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "const": "exec"
                      },
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "source",
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            ]
          },
          "tenantId": {
            "type": "string"
          },
          "cloud": {
            "type": "string",
            "enum": [
              "Public",
              "USGov",
              "USGovDoD",
              "China"
            ]
          },
          "serviceUrl": {
            "type": "string",
            "format": "uri"
          },
          "authType": {
            "type": "string",
            "enum": [
              "secret",
              "federated"
            ]
          },
          "certificatePath": {
            "type": "string"
          },
          "certificateThumbprint": {
            "type": "string"
          },
          "useManagedIdentity": {
            "type": "boolean"
          },
          "managedIdentityClientId": {
            "type": "string"
          },
          "webhook": {
            "type": "object",
            "properties": {
              "port": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "path": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "typingIndicator": {
            "type": "boolean"
          },
          "mediaAllowHosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mediaAuthAllowHosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "graphMediaFallback": {
            "type": "boolean"
          },
          "requireMention": {
            "type": "boolean"
          },
          "replyStyle": {
            "type": "string",
            "enum": [
              "thread",
              "top-level"
            ]
          },
          "teams": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "requireMention": {
                  "type": "boolean"
                },
                "tools": {
                  "type": "object",
                  "properties": {
                    "allow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "alsoAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "deny": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "toolsBySender": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "allow": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "alsoAllow": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "deny": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "replyStyle": {
                  "type": "string",
                  "enum": [
                    "thread",
                    "top-level"
                  ]
                },
                "channels": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "requireMention": {
                        "type": "boolean"
                      },
                      "tools": {
                        "type": "object",
                        "properties": {
                          "allow": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "alsoAllow": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "deny": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "toolsBySender": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "allow": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "alsoAllow": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "deny": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "replyStyle": {
                        "type": "string",
                        "enum": [
                          "thread",
                          "top-level"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "sharePointSiteId": {
            "type": "string"
          },
          "welcomeCard": {
            "type": "boolean"
          },
          "promptStarters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groupWelcomeCard": {
            "type": "boolean"
          },
          "feedbackEnabled": {
            "type": "boolean"
          },
          "feedbackReflection": {
            "type": "boolean"
          },
          "feedbackReflectionCooldownMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "delegatedAuth": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "sso": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "connectionName": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "dmPolicy",
          "groupPolicy"
        ],
        "additionalProperties": false
      },
      "label": "Microsoft Teams",
      "description": "Teams SDK; enterprise support.",
      "uiHints": {
        "": {
          "label": "MS Teams",
          "help": "Microsoft Teams channel provider configuration and provider-specific policy toggles. Use this section to isolate Teams behavior from other enterprise chat providers."
        },
        "configWrites": {
          "label": "MS Teams Config Writes",
          "help": "Allow Microsoft Teams to write config in response to channel events/commands (default: true)."
        },
        "cloud": {
          "label": "MS Teams Cloud",
          "help": "Teams SDK cloud environment for auth, token validation, and token services: \"Public\", \"USGov\", \"USGovDoD\", or \"China\" (default: Public)."
        },
        "serviceUrl": {
          "label": "MS Teams Service URL",
          "help": "Bot Connector service URL for SDK proactive sends/edits/deletes. Set with cloud for USGov/DoD; set alone for GCC."
        },
        "graphMediaFallback": {
          "label": "MS Teams Graph Media Fallback",
          "help": "Query Microsoft Graph for unresolved channel or group-chat HTML media. Adds one lookup per matching message when enabled (default: false)."
        },
        "streaming": {
          "label": "MS Teams Streaming",
          "help": "Microsoft Teams preview/progress streaming mode: \"off\" | \"partial\" | \"block\" | \"progress\". Personal chats use Teams native streaminfo progress when available."
        },
        "streaming.progress.label": {
          "label": "MS Teams Progress Label",
          "help": "Initial progress title. Use \"auto\" for built-in single-word labels, a custom string, or false to hide the title."
        },
        "streaming.progress.labels": {
          "label": "MS Teams Progress Label Pool",
          "help": "Candidate labels for streaming.progress.label=\"auto\". Leave unset to use OpenClaw built-in progress labels."
        },
        "streaming.progress.maxLines": {
          "label": "MS Teams Progress Max Lines",
          "help": "Maximum number of compact progress lines to keep below the progress title (default: 8)."
        },
        "streaming.progress.maxLineChars": {
          "label": "MS Teams Progress Max Line Chars",
          "help": "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes."
        },
        "streaming.progress.toolProgress": {
          "label": "MS Teams Progress Tool Lines",
          "help": "Show individual tool activity, including intermediate failures, in progress drafts (default: false). Quiet drafts retain plans, approval requests, and authored progress text. Terminal task errors remain visible."
        },
        "streaming.progress.commandText": {
          "label": "MS Teams Progress Command Text",
          "help": "Command/exec detail in progress lines: \"status\" is the safe default; \"raw\" opts into command text."
        }
      }
    }
  }
}
