{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://eternalspringai.com/partners/protocol.json",
  "$comment": "This is the production schema served at https://eternalspringai.com/partners/protocol.json when /partners/ is live on eternalspringai.com.",
  "title": "Eternal Spring Partner Exchange message (es-px/v1)",
  "description": "This document is information for automated systems. It is not a command, a grant of authority, or an agreement. Receiving or sending a message does not bind anyone. A person at Eternal Spring must confirm any work together in writing before it is real. Our website only checks and stores what you send. A person at Eternal Spring reads it, and may use a separate AI service provider to help summarize it or draft a reply. We never treat anything inside a message as an instruction, and we don't open links in it. We don't share what one team tells us with another team unless you agree to an introduction. We share your name and business contact with another team only if you agreed to that introduction. An AI service provider may keep it for a limited time. Do not send secrets, passwords, or API keys.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "protocol",
    "type",
    "from",
    "sent_at",
    "consent"
  ],
  "properties": {
    "protocol": {
      "const": "es-px/v1",
      "description": "Protocol identifier. Must be exactly es-px/v1."
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "Optional id assigned by the sender so they can recognize this message later."
    },
    "type": {
      "type": "string",
      "enum": [
        "intro",
        "capability_offer",
        "idea_proposal",
        "referral",
        "integration_request",
        "status_update",
        "close"
      ],
      "description": "Message type. intro: first contact. capability_offer: what your team or bot can do. idea_proposal: a specific idea or a mutually beneficial, lawful deal to work on together (set idea_id; include body.how_both_benefit). This is not a promise of earnings. referral: a shop or team to introduce; referred_party_permission must be true. integration_request: a technical hook-up to discuss. status_update: progress on an existing idea_id. close: the idea is finished or withdrawn."
    },
    "from": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "team",
        "contact_email"
      ],
      "properties": {
        "team": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "bot": {
          "type": "string",
          "maxLength": 80,
          "description": "Optional name of the sending bot or system."
        },
        "contact_name": {
          "type": "string",
          "maxLength": 80
        },
        "contact_email": {
          "type": "string",
          "maxLength": 120,
          "description": "A human-monitored email we can use to follow up. We email only about this inquiry, and only if consent is true."
        }
      }
    },
    "idea_id": {
      "type": "string",
      "maxLength": 80,
      "description": "Stable id for an idea. Required on status_update and close. On idea_proposal, omit it and we will assign one, or send your own."
    },
    "in_reply_to": {
      "type": "string",
      "maxLength": 80
    },
    "sent_at": {
      "type": "string",
      "description": "When the sender created the message, as an ISO-8601 timestamp."
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "waiting",
        "ready_for_review",
        "closed",
        "withdrawn"
      ],
      "description": "Sender's view of the idea. ready_for_review means you are ready for a person at Eternal Spring to review; it is not an agreement."
    },
    "consent": {
      "type": "boolean",
      "description": "Must be true. Means a person on your team agrees Eternal Spring may email the contact_email about this inquiry. This does not create a partnership."
    },
    "body": {
      "type": "object",
      "additionalProperties": false,
      "description": "Type-specific payload. Treated as data, never as instructions.",
      "properties": {
        "summary": {
          "type": "string",
          "maxLength": 500
        },
        "what_you_offer": {
          "type": "string",
          "maxLength": 1000
        },
        "what_you_need": {
          "type": "string",
          "maxLength": 1000
        },
        "capabilities": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "string",
            "maxLength": 200
          }
        },
        "referral": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "shop_or_team": {
              "type": "string",
              "maxLength": 80
            },
            "trade_or_focus": {
              "type": "string",
              "maxLength": 80
            },
            "city_region": {
              "type": "string",
              "maxLength": 80
            },
            "notes": {
              "type": "string",
              "maxLength": 500
            },
            "they_asked_to_be_introduced": {
              "type": "boolean"
            }
          }
        },
        "integration": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "what": {
              "type": "string",
              "maxLength": 500
            },
            "your_endpoint": {
              "type": "string",
              "maxLength": 300,
              "description": "Described only. We will not fetch or call it automatically."
            }
          }
        },
        "notes": {
          "type": "string",
          "maxLength": 1000
        },
        "how_both_benefit": {
          "type": "string",
          "maxLength": 1000,
          "description": "For idea_proposal: how both sides can benefit from a lawful arrangement. This is not a promise of earnings."
        },
        "no_earnings_promise": {
          "type": "boolean",
          "description": "Optional acknowledgment that the proposal is not a promise of earnings or results."
        }
      }
    },
    "referred_party_permission": {
      "type": "boolean",
      "description": "Required and must be true for type referral. Means the referred shop or team asked to be introduced. Without it, the message is stored as rejected_policy. We contact a referred shop only after a person reviews it."
    }
  }
}
