{
  "schema_version": "1.1",
  "updated_at": "2026-09-01",
  "name": "ElectroIA universal AI design bridge",
  "status": "private_remote_ready",
  "provider_neutral": true,
  "purpose": "Permitir que una IA interna o externa diseñe y calcule un circuito y que ElectroIA valide, represente y documente el mismo proyecto neutral.",
  "architecture": {
    "single_contract": "diagram-document.schema.json",
    "calling_ai": [
      "understand_user_intent",
      "ask_only_missing_requirements",
      "calculate_and_select_components",
      "resolve_reviewed_symbol_ids",
      "return_an_ai_friendly_specification_or_structured_diagram_document"
    ],
    "electroia": [
      "validate_document_shape_and_limits",
      "compile_symbol_queries_terminal_aliases_and_references",
      "resolve_normalized_symbols_and_terminals",
      "route_on_common_grid",
      "render_single_canvas_svg",
      "generate_bom_wires_terminals_cables_io_and_cross_references",
      "return_machine_readable_diagnostics"
    ],
    "professional_review": [
      "verify_input_assumptions",
      "confirm_exact_models_and_pinouts",
      "check_protections_and_conductor_sizes",
      "approve_applicable_regulations_before_installation"
    ]
  },
  "entry_modes": [
    {
      "id": "internal_ai_gateway",
      "state": "contract_ready_provider_not_configured",
      "description": "La futura IA integrada producirá el mismo documento neutral; ningún cálculo quedará acoplado al proveedor."
    },
    {
      "id": "external_ai_mcp",
      "state": "local_and_remote_private_ready",
      "description": "Una IA compatible con MCP puede usar STDIO local o Streamable HTTP privado con Bearer, cuotas persistentes, auditoría y parada de emergencia."
    },
    {
      "id": "external_ai_json",
      "state": "private_lab_ready",
      "description": "Cualquier IA puede devolver JSON para importarlo, validarlo y dibujarlo desde ElectroIA Studio."
    },
    {
      "id": "image_or_sketch",
      "state": "external_vision_required",
      "description": "Una IA con visión extrae símbolos, terminales y redes; ElectroIA recibe el documento estructurado y no interpreta directamente la imagen."
    }
  ],
  "public_resources": {
    "status": "../../api/index.php?action=electroia-public-status",
    "symbol_search": "../../api/index.php?action=electroia-symbol-search&q={query}",
    "tool_manifest": "tool-manifest.json",
    "openapi": "discovery.openapi.json",
    "document_schema": "diagram-document.schema.json",
    "diagram_spec_schema": "diagram-spec.schema.json",
    "symbol_library": "symbol-library.json",
    "document_profiles": "document-profiles.json",
    "execution_policy": "public-execution-policy.json"
  },
  "response_contract": {
    "accepted_wrappers": ["document", "diagram_document", "structuredContent.document"],
    "preferred_response": "Prefer one JSON specification that validates against diagram-spec.schema.json and call electroia_compile_diagram; use diagram-document.schema.json only for exact low-level control.",
    "required_fields": ["schema_version", "document_kind", "standard_profile", "title", "components", "nets"],
    "electroia_outputs": ["project", "document", "diagram.svg", "diagram.diagnostics", "technical_package", "operational", "artifact_links"],
    "preferred_ai_workflow": ["electroia_design_project", "electroia_patch_project", "electroia_validate_project", "electroia_export_project"],
    "default_response_mode": "compact",
    "operational_envelope": {
      "statuses": ["needs_input", "review_required", "ready_for_professional_review"],
      "trace_fields": ["request_id", "request_fingerprint"],
      "recovery_fields": ["blocking_diagnostics", "questions", "next_action"],
      "assurances": ["missing_values_invented=false", "pinouts_inferred=false", "installation_authorized=false", "public_remote_execution=false"]
    },
    "error_envelope": {
      "required_fields": ["ok", "tool", "error.code", "error.message", "error.retryable", "error.recovery_questions", "safety"],
      "plain_text_only_errors": false
    }
  },
  "launch_boundary": {
    "public_discovery": true,
    "public_symbol_search": true,
    "public_anonymous_render": false,
    "remote_render_requires": [
      "field_validation_complete",
      "api_keys_hashed",
      "persistent_quotas",
      "diagnostic_logging",
      "load_and_abuse_tests",
      "explicit_runtime_enable_and_emergency_stop_release"
    ]
  },
  "analytics": {
    "client_type_header": "X-ST-Client-Type",
    "allowed_values": ["human", "ai", "software"],
    "note": "Solo se contabilizan llamadas a la API. Las lecturas directas de archivos estáticos de descubrimiento no pueden atribuirse con fiabilidad."
  }
}
