{
  "$defs": {
    "distribution": {
      "additionalProperties": false,
      "properties": {
        "sha256": {
          "$ref": "#/$defs/sha256"
        },
        "url": {
          "$ref": "#/$defs/url"
        }
      },
      "required": [
        "url",
        "sha256"
      ],
      "type": "object"
    },
    "privateDistribution": {
      "additionalProperties": false,
      "properties": {
        "offerUrl": {
          "$ref": "#/$defs/url"
        },
        "publicDownload": {
          "const": false
        },
        "purchaseUrl": {
          "$ref": "#/$defs/url"
        },
        "type": {
          "const": "PRIVATE_DELIVERY"
        }
      },
      "required": [
        "type",
        "publicDownload",
        "purchaseUrl",
        "offerUrl"
      ],
      "type": "object"
    },
    "product": {
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "const": "LIVE_FREE_UTILITY"
              }
            }
          },
          "then": {
            "properties": {
              "license": {
                "properties": {
                  "name": {
                    "const": "MIT"
                  },
                  "url": {
                    "const": "https://opensource.org/license/mit"
                  }
                }
              },
              "price": {
                "properties": {
                  "amount": {
                    "const": 0
                  },
                  "currency": {
                    "const": "USD"
                  },
                  "model": {
                    "const": "FREE"
                  }
                }
              }
            },
            "required": [
              "package",
              "source",
              "repository"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "LIVE_PAID_PRIVATE_DELIVERY"
              }
            }
          },
          "then": {
            "properties": {
              "price": {
                "properties": {
                  "amount": {
                    "exclusiveMinimum": 0
                  },
                  "currency": {
                    "const": "USD"
                  },
                  "model": {
                    "enum": [
                      "ONE_TIME_ONE_ORGANIZATION_INTERNAL_USE",
                      "ONE_TIME_ONE_BUYER_INTERNAL_USE"
                    ]
                  }
                }
              }
            },
            "required": [
              "distribution"
            ]
          }
        }
      ],
      "properties": {
        "audience": {
          "items": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "boundaries": {
          "items": {
            "maxLength": 800,
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "canonicalUrl": {
          "$ref": "#/$defs/url"
        },
        "decision": {
          "maxLength": 500,
          "minLength": 1,
          "type": "string"
        },
        "distribution": {
          "$ref": "#/$defs/privateDistribution"
        },
        "id": {
          "pattern": "^KALDENFRAME-[A-Z0-9-]+-V[0-9]+$",
          "type": "string"
        },
        "input": {
          "maxLength": 600,
          "minLength": 1,
          "type": "string"
        },
        "license": {
          "additionalProperties": false,
          "properties": {
            "name": {
              "minLength": 1,
              "type": "string"
            },
            "url": {
              "format": "uri",
              "type": "string"
            }
          },
          "required": [
            "name",
            "url"
          ],
          "type": "object"
        },
        "name": {
          "maxLength": 120,
          "minLength": 1,
          "type": "string"
        },
        "output": {
          "maxLength": 600,
          "minLength": 1,
          "type": "string"
        },
        "package": {
          "$ref": "#/$defs/distribution"
        },
        "price": {
          "additionalProperties": false,
          "properties": {
            "amount": {
              "minimum": 0,
              "type": "number"
            },
            "currency": {
              "const": "USD"
            },
            "model": {
              "enum": [
                "FREE",
                "ONE_TIME_ONE_ORGANIZATION_INTERNAL_USE",
                "ONE_TIME_ONE_BUYER_INTERNAL_USE"
              ]
            }
          },
          "required": [
            "model",
            "amount",
            "currency"
          ],
          "type": "object"
        },
        "repository": {
          "$ref": "#/$defs/repository"
        },
        "resources": {
          "items": {
            "$ref": "#/$defs/resource"
          },
          "minItems": 1,
          "type": "array"
        },
        "runtime": {
          "maxLength": 300,
          "minLength": 1,
          "type": "string"
        },
        "runtimeNetworkRequests": {
          "type": "boolean"
        },
        "source": {
          "$ref": "#/$defs/distribution"
        },
        "status": {
          "enum": [
            "LIVE_FREE_UTILITY",
            "LIVE_PAID_PRIVATE_DELIVERY"
          ]
        },
        "version": {
          "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "version",
        "status",
        "price",
        "license",
        "decision",
        "audience",
        "input",
        "output",
        "runtime",
        "runtimeNetworkRequests",
        "canonicalUrl",
        "resources",
        "boundaries"
      ],
      "type": "object"
    },
    "repository": {
      "additionalProperties": false,
      "properties": {
        "commit": {
          "pattern": "^[a-f0-9]{40}$",
          "type": "string"
        },
        "releaseUrl": {
          "format": "uri",
          "pattern": "^https://github\\.com/kaldenframelabs/[a-z0-9-]+/releases/tag/v[0-9]+\\.[0-9]+\\.[0-9]+$",
          "type": "string"
        },
        "url": {
          "format": "uri",
          "pattern": "^https://github\\.com/kaldenframelabs/[a-z0-9-]+$",
          "type": "string"
        }
      },
      "required": [
        "url",
        "commit",
        "releaseUrl"
      ],
      "type": "object"
    },
    "resource": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "worksheet",
            "schema",
            "example",
            "release-notes",
            "checksums",
            "package",
            "source",
            "offer",
            "terms",
            "privacy",
            "docs",
            "fit-check",
            "evaluation-pack"
          ]
        },
        "sha256": {
          "$ref": "#/$defs/sha256"
        },
        "url": {
          "$ref": "#/$defs/url"
        }
      },
      "required": [
        "kind",
        "url"
      ],
      "type": "object"
    },
    "sha256": {
      "pattern": "^[A-F0-9]{64}$",
      "type": "string"
    },
    "url": {
      "format": "uri",
      "pattern": "^https://kaldenframelabs\\.com/",
      "type": "string"
    }
  },
  "$id": "https://kaldenframelabs.com/schemas/product-catalog-v1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Machine-readable contract for public KaldenFrame product discovery. Catalog records describe published interfaces and claim boundaries; they are not attestations, endorsements, or guarantees.",
  "properties": {
    "$schema": {
      "const": "https://kaldenframelabs.com/schemas/product-catalog-v1.schema.json"
    },
    "catalogBoundary": {
      "items": {
        "maxLength": 800,
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    },
    "catalogUrl": {
      "const": "https://kaldenframelabs.com/products/"
    },
    "catalogVersion": {
      "const": "1.9.0"
    },
    "generatedUtc": {
      "format": "date-time",
      "type": "string"
    },
    "products": {
      "items": {
        "$ref": "#/$defs/product"
      },
      "minItems": 1,
      "type": "array"
    },
    "publisher": {
      "additionalProperties": false,
      "properties": {
        "contactUrl": {
          "const": "https://kaldenframelabs.com/contact/"
        },
        "name": {
          "const": "KaldenFrame Labs"
        },
        "url": {
          "const": "https://kaldenframelabs.com/"
        }
      },
      "required": [
        "name",
        "url",
        "contactUrl"
      ],
      "type": "object"
    },
    "schema": {
      "const": "kaldenframe.product-catalog.v1"
    },
    "workflow": {
      "additionalProperties": false,
      "properties": {
        "automaticInteroperability": {
          "const": false
        },
        "combinedAssuranceBoundary": {
          "maxLength": 1200,
          "minLength": 1,
          "type": "string"
        },
        "sequence": {
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "sequence",
        "automaticInteroperability",
        "combinedAssuranceBoundary"
      ],
      "type": "object"
    },
    "workflowUrl": {
      "const": "https://kaldenframelabs.com/products/workflow/"
    }
  },
  "required": [
    "$schema",
    "schema",
    "catalogVersion",
    "generatedUtc",
    "publisher",
    "catalogUrl",
    "workflowUrl",
    "products",
    "workflow",
    "catalogBoundary"
  ],
  "title": "KaldenFrame Labs product catalog v1",
  "type": "object"
}
