{
 "openapi": "3.1.0",
 "info": {
  "title": "Vibe Codes listing API",
  "version": "1.0.0",
  "description": "List an app or code kit on https://vibe-codes.com on someone's behalf with their email address and their project. Read https://vibe-codes.com/agents first. Everything an agent creates stays an unclaimed draft until the owner signs in and publishes it."
 },
 "servers": [
  {
   "url": "https://vibe-codes.com",
   "description": "Site (start)"
  },
  {
   "url": "https://gymdfumwimifoglegkfs.supabase.co/functions/v1",
   "description": "Functions (upload)"
  }
 ],
 "paths": {
  "/api/start": {
   "servers": [
    {
     "url": "https://vibe-codes.com"
    }
   ],
   "post": {
    "operationId": "start",
    "summary": "Create or find the account for an email and get a private pack link.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "email",
         "agent"
        ],
        "properties": {
         "email": {
          "type": "string",
          "format": "email"
         },
         "agent": {
          "type": "boolean",
          "const": true
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "pack_url (GET it for the full instructions) and token (use as x-pack-token)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "pack_url": {
           "type": "string"
          },
          "token": {
           "type": "string"
          },
          "unverified": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many links today for this address"
     }
    }
   }
  },
  "/upload?action=begin": {
   "servers": [
    {
     "url": "https://gymdfumwimifoglegkfs.supabase.co/functions/v1"
    }
   ],
   "post": {
    "operationId": "begin",
    "summary": "Create the draft listing from the package manifest (vibecodes.json).",
    "parameters": [
     {
      "name": "x-pack-token",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "manifest"
        ],
        "properties": {
         "manifest": {
          "type": "object",
          "description": "The exact contents of vibecodes.json (shape in the pack prompt)."
         },
         "url": {
          "type": "string",
          "format": "uri"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "listing_slug and review_url"
     },
     "400": {
      "description": "Manifest problems"
     },
     "401": {
      "description": "Bad or expired pack link"
     }
    }
   }
  },
  "/upload": {
   "servers": [
    {
     "url": "https://gymdfumwimifoglegkfs.supabase.co/functions/v1"
    }
   ],
   "post": {
    "operationId": "reserve",
    "summary": "Reserve an upload; returns a signed URL to PUT the zip to.",
    "parameters": [
     {
      "name": "x-pack-token",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "listing_slug"
        ],
        "properties": {
         "listing_slug": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "upload_id and upload_url (PUT the raw zip with Content-Type: application/zip, x-upsert: false)"
     }
    }
   }
  },
  "/upload?action=finalize": {
   "servers": [
    {
     "url": "https://gymdfumwimifoglegkfs.supabase.co/functions/v1"
    }
   ],
   "post": {
    "operationId": "finalize",
    "summary": "Scan the uploaded zip (secrets, unsafe paths, malicious code) and attach it, or refuse it with findings.",
    "parameters": [
     {
      "name": "x-pack-token",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "upload_id"
        ],
        "properties": {
         "upload_id": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Accepted; fields filled from the manifest"
     },
     "422": {
      "description": "Refused; findings with file and line, and next steps"
     }
    }
   }
  }
 }
}