{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/shruggietech/insonic/v1.0.3/schemas/v1.0.3/media-tools.schema.json",
  "title": "insonic metadata extraction tools",
  "description": "Workspace metadata extractor configuration. Every configured executable has an absolute selected path, exact version and SHA-256. Hash/version qualification happens before extraction, and child processes use hidden noninteractive I/O. Missing or failed extractors record explicit capture outcomes while retaining usable original media.",
  "type": "object",
  "properties": {
    "kind": {
      "const": "media-tools",
      "description": "Workspace extractor-configuration discriminator."
    },
    "schema_version": {
      "const": "1.0.3",
      "description": "Insonic contract release version."
    },
    "exiftool": {
      "$ref": "#/$defs/tool",
      "description": "Selected embedded-metadata extractor, preserving qualified groups, repeated tags and structured values."
    },
    "ffprobe": {
      "$ref": "#/$defs/tool",
      "description": "Selected complementary stream/container probe, supplying measured source duration and clock facts."
    },
    "ffmpeg": {
      "$ref": "#/$defs/tool",
      "description": "Optional exact mapped-audio decoder required only by selected processing operations."
    }
  },
  "$defs": {
    "tool": {
      "type": "object",
      "additionalProperties": false,
      "description": "One exact local executable selected for metadata extraction.",
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "Absolute executable path on this machine; executable selection is explicit and never inferred from an ambient PATH."
        },
        "sha256": {
          "$ref": "common.schema.json#/$defs/sha256",
          "description": "Expected lowercase SHA-256 of the selected executable bytes."
        },
        "version": {
          "type": "string",
          "minLength": 1,
          "description": "Exact expected upstream version reported by the selected executable."
        },
        "support_files": {
          "type": "array",
          "description": "Exact selected support files used by a launcher or interpreter bundle. Each file hash is checked before execution so launcher delegation cannot bypass the pinned package identity.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1,
                "description": "Absolute selected support-file path within the installed extractor bundle."
              },
              "sha256": {
                "$ref": "common.schema.json#/$defs/sha256",
                "description": "Expected lowercase SHA-256 of this exact support file."
              }
            },
            "required": [
              "path",
              "sha256"
            ],
            "description": "Optional exact absolute interpreter executable used to run the selected tool script, independently hash-qualified without ambient PATH or shebang lookup."
          }
        },
        "interpreter": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1,
              "description": "Absolute selected support-file path within the installed extractor bundle."
            },
            "sha256": {
              "$ref": "common.schema.json#/$defs/sha256",
              "description": "Expected lowercase SHA-256 of this exact support file."
            }
          },
          "required": [
            "path",
            "sha256"
          ],
          "description": "Optional exact absolute interpreter executable used to run the selected tool script, independently hash-qualified without ambient PATH or shebang lookup."
        }
      },
      "required": [
        "path",
        "sha256",
        "version"
      ]
    }
  },
  "required": [
    "kind",
    "schema_version",
    "exiftool",
    "ffprobe"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "kind": "media-tools",
      "schema_version": "1.0.3",
      "exiftool": {
        "path": "/opt/insonic/tools/exiftool",
        "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "version": "13.37"
      },
      "ffprobe": {
        "path": "/opt/insonic/tools/ffprobe",
        "sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
        "version": "8.0"
      }
    }
  ]
}
