{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xavidop.github.io/kojo/schema/kit.schema.json",
  "$ref": "#/$defs/Kit",
  "$defs": {
    "CredentialRef": {
      "properties": {
        "name": {
          "type": "string"
        },
        "hosts": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "scope": {
          "type": "string",
          "description": "Scope documents what the credential is for (\"contents:read\"). It is\nnot enforced from here: a forge's clone credential is read-only by\nconstruction (see HostCredential.ReadOnly), whatever a kit writes."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "CredentialRef names a credential the deployment holds."
    },
    "Egress": {
      "properties": {
        "allow": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Allow lists the hosts the sandbox may reach: \"host\" or \"*.domain\",\nfor ports 443 and 80, or \"host:port\" for another port."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Egress is the kit's allowlist."
    },
    "Kit": {
      "properties": {
        "image": {
          "type": "string",
          "description": "Image is the container image. Empty means the deployment's default\ntoolchain image."
        },
        "resources": {
          "$ref": "#/$defs/Resources"
        },
        "needs_docker": {
          "type": "boolean"
        },
        "egress": {
          "$ref": "#/$defs/Egress"
        },
        "credentials": {
          "items": {
            "$ref": "#/$defs/CredentialRef"
          },
          "type": "array",
          "description": "Credentials name the credentials the proxy injects."
        },
        "setup": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Setup are commands run in the sandbox before the skill's first run in\na session (install a toolchain, warm a cache). They run once per\nskill and session, with the kit's egress allowlist in force."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Kit is kit.yaml: the sandbox a skill runs in."
    },
    "Resources": {
      "properties": {
        "cpu": {
          "type": "string",
          "description": "CPU in cores (\"4\", \"0.5\") or millicores (\"500m\")."
        },
        "memory": {
          "type": "string",
          "description": "Memory in bytes with a binary or decimal suffix (\"8Gi\", \"512Mi\")."
        },
        "disk": {
          "type": "string",
          "description": "Disk is the size of the workspace (\"40Gi\")."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Resources are requests, in Kubernetes quantity syntax (\"4\", \"8Gi\")."
    }
  },
  "title": ".factory/skills/\u003cname\u003e/kit.yaml: the sandbox of a skill"
}
