{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/oss-agent-service.v1.json",
  "title": "Agoragentic OSS Agent Service",
  "description": "Private-first first-party OSS service draft artifact for Contributor Workspace workflows. This schema does not grant publication, GitHub write, PR/comment, shell, spend, x402, settlement, or provider-trust authority.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "schema",
    "service_id",
    "name",
    "default_exposure_mode",
    "input_schema",
    "output_schema",
    "first_proof",
    "receipt_type",
    "approval_policy",
    "publication_policy",
    "marketplace_readiness_requirements",
    "x402_eligibility"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.oss-agent-service.v1"
    },
    "service_id": {
      "type": "string",
      "minLength": 1
    },
    "name": {
      "enum": [
        "OSS Issue Triage Agent",
        "Spec Writer Agent",
        "Codebase Security Scanner",
        "PR Review Agent",
        "Dependency Update Agent",
        "Release Notes Agent",
        "MCP Safety Scanner",
        "x402 Canary Tester"
      ]
    },
    "default_exposure_mode": {
      "const": "private_only"
    },
    "input_schema": {
      "type": "object"
    },
    "output_schema": {
      "type": "object"
    },
    "first_proof": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "required"
      ],
      "properties": {
        "required": {
          "const": true
        },
        "description": {
          "type": "string"
        }
      }
    },
    "receipt_type": {
      "type": "string",
      "minLength": 1
    },
    "approval_policy": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "owner_approval_required_for_public_action",
        "owner_approval_required_for_pr_open",
        "owner_approval_required_for_marketplace_listing"
      ],
      "properties": {
        "owner_approval_required_for_public_action": {
          "const": true
        },
        "owner_approval_required_for_pr_open": {
          "const": true
        },
        "owner_approval_required_for_marketplace_listing": {
          "const": true
        },
        "owner_approval_required_for_x402": {
          "const": true
        }
      }
    },
    "publication_policy": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "private_context_publication_allowed",
        "receipt_required_before_marketplace_candidate",
        "auto_publish_allowed"
      ],
      "properties": {
        "private_context_publication_allowed": {
          "const": false
        },
        "receipt_required_before_marketplace_candidate": {
          "const": true
        },
        "auto_publish_allowed": {
          "const": false
        },
        "official_provider_partnership_claimed": {
          "const": false
        }
      }
    },
    "marketplace_readiness_requirements": {
      "type": "array",
      "items": {
        "enum": [
          "owner_approval",
          "receipt_written",
          "private_context_removed",
          "listing_readiness_check",
          "canary_receipt",
          "security_receipt",
          "x402_paid_canary_receipt"
        ]
      },
      "uniqueItems": true,
      "contains": {
        "const": "owner_approval"
      }
    },
    "x402_eligibility": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "eligible",
        "owner_approval_required",
        "paid_canary_receipt_required"
      ],
      "properties": {
        "eligible": {
          "type": "boolean"
        },
        "owner_approval_required": {
          "const": true
        },
        "paid_canary_receipt_required": {
          "const": true
        }
      }
    },
    "public_boundary": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "github_comment_written": {
          "const": false
        },
        "pr_opened": {
          "const": false
        },
        "marketplace_listing_published": {
          "const": false
        },
        "x402_route_created": {
          "const": false
        },
        "settlement_mutated": {
          "const": false
        }
      }
    }
  }
}
