{
  "name": "Shastaratech contact intake",
  "description": "Tell Shastaratech about a project: NoETL adoption or support, a custom build on the NoETL platform, a domain-specific language model, quantum or research collaboration, or something else. Humans use the chat at /#contact. Agents can POST a structured request to /api/scope, or hold a conversation through /api/scope/chat. Each submission is emailed to the Shastaratech team; nothing is stored.",
  "endpoints": {
    "POST /api/scope": {
      "content_type": "application/json",
      "description": "One-shot submission. No model call. Use this when you already know the details.",
      "body": {
        "project": "string, required (min 10 chars): what is being built or needed, and why",
        "engagement_type": "string: chief architect / AI architect / technology leadership role | full-time role | fractional/leadership | advisory | consulting | research or open-source collaboration | speaking | other",
        "timeline": "string",
        "constraints": "string: team, stack, location/remote, compliance, etc.",
        "budget": "string",
        "name": "string: the person to call back",
        "email": "string",
        "phone": "string",
        "organization": "string",
        "notes": "string",
        "agent": "object, optional: { name, on_behalf_of } when an AI agent submits for a person"
      },
      "response": "201 { id, status: 'received', contact_provided, email_sent, email_id }",
      "notes": "Include name plus email or phone if you want a callback; without them the email says 'no contact provided'."
    },
    "POST /api/scope/chat": {
      "content_type": "application/json",
      "description": "One conversational turn with the intake assistant. The server keeps nothing: send the whole conversation, and the `state` from the previous response, each time.",
      "body": {
        "thread_id": "string, optional: returned by the first call; send it back on later calls",
        "messages": "array of { role: 'user' | 'assistant', content: string }, last one from the user; max 40, 2000 chars each",
        "state": "object, optional: the `state` from the previous response (prevents duplicate emails)"
      },
      "response": "200 { thread_id, reply, scope, contact, contact_declined, complete, state, email_sent, email_id }",
      "notes": "The assistant asks for a name and email/phone early. The conversation is complete once it has the project scope AND a valid email or phone; the team is then emailed [COMPLETE] (and [UPDATE] if contact details change later)."
    },
    "POST /api/scope/chat/close": {
      "content_type": "application/json",
      "description": "The conversation was dropped before it was complete. the team gets an [INCOMPLETE] email with whatever was gathered (once per stage of the chat), so drop-off can be analysed.",
      "body": {
        "thread_id": "string",
        "messages": "the conversation",
        "state": "the last state",
        "scope": "the last scope",
        "contact": "the last contact",
        "contact_declined": "boolean",
        "reason": "navigated_away | tab_hidden | timeout",
        "idle_seconds": "number"
      },
      "response": "200 { sent, email_sent, email_id, state }"
    }
  },
  "limits": "20 requests per minute per IP.",
  "contact_fallback": "mailto:shastaratech@gmail.com"
}