{
  "id": "clickclack",
  "activation": {
    "onStartup": false
  },
  "channels": [
    "clickclack"
  ],
  "channelEnvVars": {
    "clickclack": [
      "CLICKCLACK_BOT_TOKEN"
    ]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {}
  },
  "channelConfigs": {
    "clickclack": {
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "baseUrl": {
            "type": "string",
            "format": "uri"
          },
          "token": {
            "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
                  }
                ]
              }
            ]
          },
          "workspace": {
            "type": "string"
          },
          "botUserId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "replyMode": {
            "type": "string",
            "enum": [
              "agent",
              "model"
            ]
          },
          "model": {
            "type": "string"
          },
          "systemPrompt": {
            "type": "string"
          },
          "timeoutSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3600
          },
          "toolsAllow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultTo": {
            "type": "string"
          },
          "allowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reconnectMs": {
            "type": "integer",
            "minimum": 100,
            "maximum": 60000
          },
          "accounts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "baseUrl": {
                  "type": "string",
                  "format": "uri"
                },
                "token": {
                  "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
                        }
                      ]
                    }
                  ]
                },
                "workspace": {
                  "type": "string"
                },
                "botUserId": {
                  "type": "string"
                },
                "agentId": {
                  "type": "string"
                },
                "replyMode": {
                  "type": "string",
                  "enum": [
                    "agent",
                    "model"
                  ]
                },
                "model": {
                  "type": "string"
                },
                "systemPrompt": {
                  "type": "string"
                },
                "timeoutSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "defaultTo": {
                  "type": "string"
                },
                "allowFrom": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "reconnectMs": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 60000
                }
              },
              "additionalProperties": false
            }
          },
          "defaultAccount": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "label": "ClickClack",
      "description": "self-hosted chat via first-class ClickClack bot tokens."
    }
  }
}
