{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hackshop-dev/json-schema/hackshop-dev-plan-request-schema.json",
  "title": "PlanRequest",
  "description": "Give an idea, intake answers or needs (at least one).",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hackshop-dev-openapi.json#/components/schemas/PlanRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "idea": {
      "type": "string",
      "minLength": 3,
      "maxLength": 2000,
      "description": "The gadget idea in plain words. Optional when answers or needs are given."
    },
    "answers": {
      "$ref": "#/$defs/IntakeAnswers"
    },
    "platform": {
      "type": "string",
      "enum": [
        "muse-esp32",
        "muse-linux",
        "any"
      ],
      "default": "any"
    },
    "budget_usd": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 100000,
      "description": "All-in hardware budget in USD. Wins over answers.budget."
    },
    "owned_device_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 50
    },
    "needs": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "voice",
          "screen",
          "images",
          "touch",
          "camera",
          "air-sensors",
          "e-ink",
          "battery",
          "round",
          "home-tunnel",
          "big-screen",
          "compute",
          "linux"
        ]
      }
    },
    "size": {
      "type": "string",
      "enum": [
        "pocket",
        "desk",
        "wall",
        "hidden",
        "any"
      ],
      "default": "any",
      "description": "Wins over answers.size."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5,
      "default": 3
    }
  },
  "$defs": {
    "IntakeAnswers": {
      "type": "object",
      "additionalProperties": false,
      "description": "The human's intake answers. Each value maps to needs, size or budget exactly as the planner's intake questions declare.",
      "properties": {
        "size": {
          "type": "string",
          "enum": [
            "pocket",
            "desk",
            "wall",
            "hidden"
          ],
          "description": "Where it lives. pocket adds need battery; wall adds big-screen; hidden adds home-tunnel. Also sets the size."
        },
        "interaction": {
          "type": "string",
          "enum": [
            "voice",
            "touch",
            "light-button"
          ],
          "description": "voice adds need voice; touch adds screen and touch; light-button adds home-tunnel."
        },
        "sensing": {
          "type": "string",
          "enum": [
            "camera",
            "air-quality",
            "none"
          ],
          "description": "camera adds need camera; air-quality adds air-sensors."
        },
        "budget": {
          "type": "string",
          "enum": [
            "under-25",
            "under-50",
            "under-100",
            "no-limit"
          ],
          "description": "Sets budget_usd to 25, 50 or 100; no-limit leaves it unset."
        }
      }
    }
  }
}