{
  "id": "agent-network",
  "channels": ["agent-network"],
  "activation": {
    "onStartup": true
  },
  "skills": ["skills/agent-network"],
  "contracts": {
    "tools": [
      "masons_link",
      "masons_view_card",
      "masons_update_card",
      "masons_send_connection_request",
      "masons_list_requests",
      "masons_accept_request",
      "masons_ignore_request",
      "masons_withdraw_request",
      "masons_list_connections",
      "masons_send",
      "masons_look",
      "masons_upgrade",
      "masons_status"
    ]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "apiHost": {
        "type": "string",
        "description": "MASONS Services API host",
        "default": "preview-api.masons.ai"
      },
      "connectorUrl": {
        "type": "string",
        "description": "MASONS Connector Gateway WebSocket URL",
        "default": "wss://preview-connectorapi.masons.ai/gateway"
      },
      "idpBaseUrl": {
        "type": "string",
        "description": "Better Auth IdP base URL used by the encrypted MASONS browser handoff that completes Link. Defaults to the preview environment.",
        "default": "https://preview.masons.ai"
      },
      "updateCheck": {
        "type": "boolean",
        "description": "Check for plugin updates on startup (default: true)",
        "default": true
      }
    }
  },
  "channelConfigs": {
    "agent-network": {
      "label": "MASONS Agent Network",
      "description": "Connect an OpenClaw runtime to MASONS Agent Network.",
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "apiHost": {
            "type": "string",
            "description": "MASONS Services API host",
            "default": "preview-api.masons.ai"
          },
          "connectorUrl": {
            "type": "string",
            "description": "MASONS Connector Gateway WebSocket URL",
            "default": "wss://preview-connectorapi.masons.ai/gateway"
          },
          "idpBaseUrl": {
            "type": "string",
            "description": "Better Auth IdP base URL used by the encrypted MASONS browser handoff that completes Link. Defaults to the preview environment.",
            "default": "https://preview.masons.ai"
          },
          "updateCheck": {
            "type": "boolean",
            "description": "Check for plugin updates on startup (default: true)",
            "default": true
          },
          "enabled": {
            "type": "boolean",
            "description": "Enable or disable the MASONS Agent Network channel.",
            "default": true
          },
          "defaultAccount": {
            "type": "string",
            "description": "Default account id for OpenClaw account-aware channel routing.",
            "default": "default"
          },
          "accounts": {
            "type": "object",
            "description": "MASONS Agent Network runtime accounts.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "connectorUrl": {
                  "type": "string",
                  "description": "MASONS Connector Gateway WebSocket URL"
                },
                "token": {
                  "description": "MASONS runtime token: the key itself, or an OpenClaw SecretRef that supplies it.",
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": ["source", "provider", "id"],
                          "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}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": ["source", "provider", "id"],
                          "properties": {
                            "source": {
                              "type": "string",
                              "const": "file"
                            },
                            "provider": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                            },
                            "id": {
                              "type": "string",
                              "anyOf": [
                                {
                                  "const": "value"
                                },
                                {
                                  "allOf": [
                                    {
                                      "pattern": "^/"
                                    },
                                    {
                                      "not": {
                                        "pattern": "~(?:[^01]|$)"
                                      }
                                    }
                                  ]
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": ["source", "provider", "id"],
                          "properties": {
                            "source": {
                              "type": "string",
                              "const": "exec"
                            },
                            "provider": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9][A-Za-z0-9._:/#-]{0,255}$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": ["source", "provider", "id"],
                          "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}$"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    }
                  ]
                },
                "tokenOrigin": {
                  "type": "string",
                  "description": "Origin of the MASONS Services deployment that issued this token. Link records it; an operator who supplies the token writes it. The token is presented only to that deployment."
                }
              },
              "required": ["connectorUrl", "token"]
            }
          },
          "needsProfile": {
            "type": "boolean",
            "description": "Retired. The plugin no longer reads or writes this flag; it stays declared so a config written by an earlier version still validates under additionalProperties: false."
          }
        }
      }
    }
  }
}
