{
  "id": "mattermost",
  "activation": {
    "onStartup": false
  },
  "channels": [
    "mattermost"
  ],
  "channelEnvVars": {
    "mattermost": [
      "MATTERMOST_BOT_TOKEN",
      "MATTERMOST_URL"
    ]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {}
  },
  "channelConfigs": {
    "mattermost": {
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dangerouslyAllowNameMatching": {
            "type": "boolean"
          },
          "markdown": {
            "type": "object",
            "properties": {
              "tables": {
                "type": "string",
                "enum": [
                  "off",
                  "bullets",
                  "code",
                  "block"
                ]
              }
            },
            "additionalProperties": false
          },
          "enabled": {
            "type": "boolean"
          },
          "configWrites": {
            "type": "boolean"
          },
          "botToken": {
            "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": "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
                  }
                ]
              }
            ]
          },
          "baseUrl": {
            "type": "string"
          },
          "chatmode": {
            "type": "string",
            "enum": [
              "oncall",
              "onmessage",
              "onchar"
            ]
          },
          "oncharPrefixes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requireMention": {
            "type": "boolean"
          },
          "dmPolicy": {
            "default": "pairing",
            "type": "string",
            "enum": [
              "pairing",
              "allowlist",
              "open",
              "disabled"
            ]
          },
          "allowFrom": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "groupAllowFrom": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "groupPolicy": {
            "default": "allowlist",
            "type": "string",
            "enum": [
              "open",
              "disabled",
              "allowlist"
            ]
          },
          "textChunkLimit": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "chunkMode": {
            "type": "string",
            "enum": [
              "length",
              "newline"
            ]
          },
          "streaming": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "off",
                  "partial",
                  "block",
                  "progress"
                ]
              },
              {
                "type": "boolean"
              },
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "partial",
                      "block",
                      "progress"
                    ]
                  },
                  "chunkMode": {
                    "type": "string",
                    "enum": [
                      "length",
                      "newline"
                    ]
                  },
                  "preview": {
                    "type": "object",
                    "properties": {
                      "toolProgress": {
                        "type": "boolean"
                      }
                    },
                    "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
                      },
                      "toolProgress": {
                        "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
              }
            ]
          },
          "blockStreaming": {
            "type": "boolean"
          },
          "blockStreamingCoalesce": {
            "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
          },
          "replyToMode": {
            "type": "string",
            "enum": [
              "off",
              "first",
              "all",
              "batched"
            ]
          },
          "responsePrefix": {
            "type": "string"
          },
          "actions": {
            "type": "object",
            "properties": {
              "reactions": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "commands": {
            "type": "object",
            "properties": {
              "native": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "string",
                    "const": "auto"
                  }
                ]
              },
              "nativeSkills": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "string",
                    "const": "auto"
                  }
                ]
              },
              "callbackPath": {
                "type": "string"
              },
              "callbackUrl": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "interactions": {
            "type": "object",
            "properties": {
              "callbackBaseUrl": {
                "type": "string"
              },
              "allowedSourceIps": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "groups": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "requireMention": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "network": {
            "type": "object",
            "properties": {
              "dangerouslyAllowPrivateNetwork": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "dmChannelRetry": {
            "type": "object",
            "properties": {
              "maxRetries": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10
              },
              "initialDelayMs": {
                "type": "integer",
                "minimum": 100,
                "maximum": 60000
              },
              "maxDelayMs": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 60000
              },
              "timeoutMs": {
                "type": "integer",
                "minimum": 5000,
                "maximum": 120000
              }
            },
            "additionalProperties": false
          },
          "accounts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "capabilities": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "dangerouslyAllowNameMatching": {
                  "type": "boolean"
                },
                "markdown": {
                  "type": "object",
                  "properties": {
                    "tables": {
                      "type": "string",
                      "enum": [
                        "off",
                        "bullets",
                        "code",
                        "block"
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "enabled": {
                  "type": "boolean"
                },
                "configWrites": {
                  "type": "boolean"
                },
                "botToken": {
                  "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": "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
                        }
                      ]
                    }
                  ]
                },
                "baseUrl": {
                  "type": "string"
                },
                "chatmode": {
                  "type": "string",
                  "enum": [
                    "oncall",
                    "onmessage",
                    "onchar"
                  ]
                },
                "oncharPrefixes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "requireMention": {
                  "type": "boolean"
                },
                "dmPolicy": {
                  "default": "pairing",
                  "type": "string",
                  "enum": [
                    "pairing",
                    "allowlist",
                    "open",
                    "disabled"
                  ]
                },
                "allowFrom": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ]
                  }
                },
                "groupAllowFrom": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ]
                  }
                },
                "groupPolicy": {
                  "default": "allowlist",
                  "type": "string",
                  "enum": [
                    "open",
                    "disabled",
                    "allowlist"
                  ]
                },
                "textChunkLimit": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "chunkMode": {
                  "type": "string",
                  "enum": [
                    "length",
                    "newline"
                  ]
                },
                "streaming": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "off",
                        "partial",
                        "block",
                        "progress"
                      ]
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "enum": [
                            "off",
                            "partial",
                            "block",
                            "progress"
                          ]
                        },
                        "chunkMode": {
                          "type": "string",
                          "enum": [
                            "length",
                            "newline"
                          ]
                        },
                        "preview": {
                          "type": "object",
                          "properties": {
                            "toolProgress": {
                              "type": "boolean"
                            }
                          },
                          "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
                            },
                            "toolProgress": {
                              "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
                    }
                  ]
                },
                "blockStreaming": {
                  "type": "boolean"
                },
                "blockStreamingCoalesce": {
                  "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
                },
                "replyToMode": {
                  "type": "string",
                  "enum": [
                    "off",
                    "first",
                    "all",
                    "batched"
                  ]
                },
                "responsePrefix": {
                  "type": "string"
                },
                "actions": {
                  "type": "object",
                  "properties": {
                    "reactions": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "commands": {
                  "type": "object",
                  "properties": {
                    "native": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "string",
                          "const": "auto"
                        }
                      ]
                    },
                    "nativeSkills": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "string",
                          "const": "auto"
                        }
                      ]
                    },
                    "callbackPath": {
                      "type": "string"
                    },
                    "callbackUrl": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "interactions": {
                  "type": "object",
                  "properties": {
                    "callbackBaseUrl": {
                      "type": "string"
                    },
                    "allowedSourceIps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "groups": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "requireMention": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "network": {
                  "type": "object",
                  "properties": {
                    "dangerouslyAllowPrivateNetwork": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "dmChannelRetry": {
                  "type": "object",
                  "properties": {
                    "maxRetries": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 10
                    },
                    "initialDelayMs": {
                      "type": "integer",
                      "minimum": 100,
                      "maximum": 60000
                    },
                    "maxDelayMs": {
                      "type": "integer",
                      "minimum": 1000,
                      "maximum": 60000
                    },
                    "timeoutMs": {
                      "type": "integer",
                      "minimum": 5000,
                      "maximum": 120000
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "dmPolicy",
                "groupPolicy"
              ],
              "additionalProperties": false
            }
          },
          "defaultAccount": {
            "type": "string"
          }
        },
        "required": [
          "dmPolicy",
          "groupPolicy"
        ],
        "additionalProperties": false
      },
      "label": "Mattermost",
      "description": "self-hosted Slack-style chat; install the plugin to enable.",
      "uiHints": {
        "": {
          "label": "Mattermost",
          "help": "Mattermost channel provider configuration for bot auth, access policy, slash commands, and preview streaming."
        },
        "dmPolicy": {
          "label": "Mattermost DM Policy",
          "help": "Direct message access control (\"pairing\" recommended). \"open\" requires channels.mattermost.allowFrom=[\"*\"]."
        },
        "streaming": {
          "label": "Mattermost Streaming Mode",
          "help": "Unified Mattermost stream preview mode: \"off\" | \"partial\" | \"block\" | \"progress\". \"progress\" keeps a single editable progress draft until final delivery."
        },
        "streaming.mode": {
          "label": "Mattermost Streaming Mode",
          "help": "Canonical Mattermost preview mode: \"off\" | \"partial\" | \"block\" | \"progress\"."
        },
        "streaming.progress.label": {
          "label": "Mattermost Progress Label",
          "help": "Initial progress draft title. Use \"auto\" for built-in single-word labels, a custom string, or false to hide the title."
        },
        "streaming.progress.labels": {
          "label": "Mattermost Progress Label Pool",
          "help": "Candidate labels for streaming.progress.label=\"auto\". Leave unset to use OpenClaw built-in progress labels."
        },
        "streaming.progress.maxLines": {
          "label": "Mattermost Progress Max Lines",
          "help": "Maximum number of compact progress lines to keep below the draft label (default: 8)."
        },
        "streaming.progress.toolProgress": {
          "label": "Mattermost Progress Tool Lines",
          "help": "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery."
        },
        "streaming.progress.commandText": {
          "label": "Mattermost Progress Command Text",
          "help": "Command/exec detail in progress draft lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
        },
        "streaming.preview.toolProgress": {
          "label": "Mattermost Draft Tool Progress",
          "help": "Show tool/progress activity in the live draft preview post (default: true). Set false to hide interim tool updates while the draft preview stays active."
        },
        "streaming.preview.commandText": {
          "label": "Mattermost Draft Command Text",
          "help": "Command/exec detail in preview tool-progress lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
        },
        "streaming.block.enabled": {
          "label": "Mattermost Block Streaming Enabled",
          "help": "Enable chunked block-style Mattermost preview delivery when channels.mattermost.streaming.mode=\"block\"."
        },
        "streaming.block.coalesce": {
          "label": "Mattermost Block Streaming Coalesce",
          "help": "Merge streamed Mattermost block replies before final delivery."
        }
      }
    }
  }
}
