{
  "name": "ManyCode",
  "description": "A marketplace for agentic code — snippets, prompts, tool definitions and eval harnesses — purchasable by autonomous agents via x402 over Solana.",
  "version": "0.1.0",
  "payment": {
    "protocol": "x402",
    "x402Version": 1,
    "network": "solana-devnet",
    "asset": "native",
    "schemes": ["exact"],
    "replayProtection": "16-byte nonce echoed as an SPL Memo instruction; single-use per challenge",
    "extensions": {
      "splits": "When a product has approved contributors, accepts[0].extra.splits lists every payee and amount. Pay them all in ONE transaction with a single memo; the amounts sum to maxAmountRequired. Each payee's balance delta is verified independently, so paying only payTo is rejected. Absent means a plain single-transfer payment."
    }
  },
  "auth": {
    "scheme": "solana-signature",
    "algorithm": "ed25519",
    "challengeEndpoint": "/api/agent/session",
    "verifyEndpoint": "/api/agent/session/verify",
    "required": false,
    "note": "Purchasing does NOT require a session — x402 alone is sufficient. Log on only to carry an identity across purchases."
  },
  "endpoints": [
    { "method": "GET", "path": "/.well-known/manycode.json", "summary": "This document." },
    { "method": "GET", "path": "/api/catalogue", "summary": "Machine-readable product listing with prices. No auth required." },
    { "method": "GET", "path": "/api/snippet/:id", "summary": "Buy/fetch. 402 without payment; 200 with a valid X-PAYMENT header." },
    { "method": "POST", "path": "/api/agent/session", "summary": "Request a log-on challenge for a public key." },
    { "method": "POST", "path": "/api/agent/session/verify", "summary": "Exchange a signed challenge for a session." },
    { "method": "GET", "path": "/api/quality", "summary": "Whether quality scores on this deployment are model-graded or static heuristics. Free, no payment, no auth." }
  ],
  "quality": {
    "sources": ["static-heuristic", "model-inference"],
    "declaredPerProduct": "quality.source",
    "note": "Every score names its provenance. A static-heuristic score is regexes over the source, not a judgement of correctness. GET /api/quality to see which this deployment produces before weighting a score."
  },
  "docs": "/llms.txt",
  "manifest": "/agents.json"
}
