{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://limecloud.github.io/agentapp/schemas/app-projection.schema.json",
  "title": "Agent App Projection",
  "type": "object",
  "required": [
    "app",
    "entries",
    "provenance"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "command": {
      "type": "string"
    },
    "app": {
      "type": "object"
    },
    "capabilityRequirements": {
      "type": "object"
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "ui": {
      "type": "object"
    },
    "storage": {
      "type": "object"
    },
    "services": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "workflows": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "knowledgeTemplates": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "toolRequirements": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "artifactTypes": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "evals": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "secrets": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "overlayTemplates": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "lifecycle": {
      "type": "object"
    },
    "triggers": {
      "type": "object",
      "description": "v0.5: AI auto-discovery hints projected from manifest.",
      "properties": {
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "scenarios": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "quickstart": {
      "type": "object",
      "description": "v0.5: first-launch onboarding hints projected from manifest.",
      "properties": {
        "entry": {
          "type": "string"
        },
        "sampleWorkflow": {
          "type": "string"
        },
        "setupSteps": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "additionalProperties": true
    },
    "skills": {
      "type": "object",
      "description": "v0.5: bundled and referenced Agent Skills projected from manifest.",
      "properties": {
        "bundled": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "references": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "additionalProperties": false
    },
    "publisher": {
      "type": "object",
      "description": "v0.5: publisher identity projected from manifest.",
      "additionalProperties": true
    },
    "author": {
      "description": "v0.5: author info; string or object form passed through.",
      "oneOf": [
        { "type": "string" },
        { "type": "object", "additionalProperties": true }
      ]
    },
    "maintainers": {
      "type": "array",
      "description": "v0.5: maintainers projected from manifest.",
      "items": { "type": "object" }
    },
    "contributors": {
      "type": "array",
      "description": "v0.5: contributors projected from manifest.",
      "items": { "type": "object" }
    },
    "timeline": {
      "type": "object",
      "description": "v0.5: lifecycle timestamps projected from manifest.",
      "properties": {
        "createdAt": { "type": "string" },
        "updatedAt": { "type": "string" },
        "releasedAt": { "type": "string" },
        "deprecatedAt": { "type": "string" },
        "endOfLifeAt": { "type": "string" }
      },
      "additionalProperties": true
    },
    "supportWindow": {
      "type": "object",
      "additionalProperties": true
    },
    "links": {
      "type": "object",
      "description": "v0.5: aggregated catalog links (homepage, repository, documentation, issues, changelog).",
      "properties": {
        "homepage": { "type": "string" },
        "repository": {
          "oneOf": [
            { "type": "string" },
            { "type": "object", "additionalProperties": true }
          ]
        },
        "documentation": { "type": "string" },
        "issues": { "type": "string" },
        "changelog": { "type": "string" }
      },
      "additionalProperties": true
    },
    "license": {
      "type": "object",
      "description": "v0.5: license metadata projected from manifest.",
      "properties": {
        "spdx": { "type": "string" },
        "licenseUrl": { "type": "string" },
        "copyright": { "type": "string" }
      },
      "additionalProperties": true
    },
    "support": {
      "type": "object",
      "description": "v0.5: support channels projected from manifest.",
      "additionalProperties": true
    },
    "distribution": {
      "type": "object",
      "description": "v0.5: distribution and pricing metadata projected from manifest.",
      "additionalProperties": true
    },
    "compliance": {
      "type": "object",
      "description": "v0.5: privacy and compliance metadata projected from manifest.",
      "additionalProperties": true
    },
    "errors": {
      "type": "array",
      "description": "v0.5: standardized error catalog projected from app.errors.yaml.",
      "items": {
        "type": "object"
      }
    },
    "i18n": {
      "type": "object",
      "description": "v0.5: i18n configuration projected from app.i18n.yaml.",
      "properties": {
        "defaultLocale": {
          "type": "string"
        },
        "supportedLocales": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fallback": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    },
    "signature": {
      "type": "object",
      "description": "v0.5: signature, trust chain, and revocation projected from app.signature.yaml.",
      "additionalProperties": true
    },
    "health": {
      "type": "object",
      "description": "v0.5: runtime health checks projected from evals/health.yaml.",
      "additionalProperties": true
    },
    "agentRuntime": {
      "type": "object",
      "description": "v0.6: Agent task runtime control plane projected from APP.md or app.runtime.yaml.",
      "additionalProperties": true
    },
    "requirements": {
      "type": "object",
      "description": "v0.7: business requirement, MVP, non-goal, and acceptance projection.",
      "additionalProperties": true
    },
    "boundary": {
      "type": "object",
      "description": "v0.7: responsibility boundary projection across App, Host, Cloud, connectors, external systems, and humans.",
      "additionalProperties": true
    },
    "integrations": {
      "type": "array",
      "description": "v0.7: host/cloud managed integration requirements.",
      "items": { "type": "object", "additionalProperties": true }
    },
    "operations": {
      "type": "array",
      "description": "v0.7: operation side effect and approval contracts.",
      "items": { "type": "object", "additionalProperties": true }
    },
    "install": {
      "type": "object",
      "description": "v0.8: install modes, runtime relationship, standalone shell metadata, and runtime-backed constraints.",
      "additionalProperties": true
    },
    "provenance": {
      "$ref": "#/$defs/provenance"
    }
  },
  "$defs": {
    "provenance": {
      "type": "object",
      "required": [
        "appName",
        "appVersion",
        "packageHash",
        "manifestHash",
        "standard",
        "standardVersion"
      ],
      "properties": {
        "appName": {
          "type": "string",
          "minLength": 1
        },
        "appVersion": {
          "type": "string",
          "minLength": 1
        },
        "packageHash": {
          "type": "string"
        },
        "manifestHash": {
          "type": "string"
        },
        "standard": {
          "const": "agentapp"
        },
        "standardVersion": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
