{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unpkg.com/@tenphi/harnesspm/schema/harnesspm.schema.json",
  "title": "harnesspm.json",
  "description": "Project configuration for harnesspm, the harness package manager. Every field is optional.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "exclude": {
      "description": "Packages or unit IDs to drop, such as \"@tenphi/glaze\" or \"tasty:rules/legacy\".",
      "type": "array",
      "items": { "type": "string" }
    },
    "replace": {
      "description": "Unit ID → path of a project file that takes its place.",
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "patch": {
      "description": "Rule ID → path of a patch that changes some of its sections.",
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "trust": {
      "description": "Packages whose executable units may run: true follows upgrades, \"pin\" needs an approval for each new version.",
      "type": "object",
      "additionalProperties": { "enum": [true, "pin"] }
    },
    "telemetry": {
      "description": "Events about how agents and people use the harness, sent to the project's handler. Off when missing. See spec chapter 14.",
      "type": "object",
      "additionalProperties": false,
      "required": ["send"],
      "properties": {
        "events": {
          "description": "The event types to send, or \"all\" (the default). \"read\", \"skill\" and \"session\" come from harnesspm's own agent hooks.",
          "oneOf": [
            { "const": "all" },
            { "type": "array", "uniqueItems": true, "items": { "enum": ["run", "mcp", "sync", "why", "read", "skill", "session"] } }
          ]
        },
        "send": {
          "description": "The handler: a command that gets each event as JSON on stdin, run from the project root, or { \"file\": \"<path>\" }, which appends one JSON line per event. It gets events only as a person's sync recorded it in harnesspm.lock.json.",
          "oneOf": [
            { "type": "string", "minLength": 1 },
            {
              "type": "object",
              "additionalProperties": false,
              "required": ["file"],
              "properties": { "file": { "type": "string", "minLength": 1, "description": "Path relative to the project root." } }
            }
          ]
        }
      }
    }
  }
}
