{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/goosybear-ai/json-schema/goosybear-ai-pages-deploy-manifest-schema.json",
  "title": "PagesDeployManifest",
  "description": "`pages.deploy.json` — the one file a bundle uses to say what it is and what it needs. Put it at the bundle root.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/goosybear-ai-openapi.yml#/components/schemas/PagesDeployManifest",
  "type": "object",
  "properties": {
    "entry": {
      "description": "The Worker module that answers `routes`, relative to the bundle root. Omit it for a static site.",
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "assets": {
      "description": "The directory holding the site's static files, relative to the bundle root.",
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "routes": {
      "description": "Which paths the Worker answers; everything else is served as a static file. A route whose `access` is `members` is gated by the platform before anything answers it, so a static site with no `entry` may declare members routes and nothing else.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "A site-root-relative path the Worker answers. `*` is allowed only as a trailing `/*`."
          },
          "access": {
            "description": "Who may reach this route. `members` requires a member of this site's workspace, signed in to Goosy; the platform enforces it before your code runs. Defaults to `public`.",
            "type": "string",
            "enum": [
              "public",
              "members"
            ]
          }
        },
        "required": [
          "pattern"
        ],
        "additionalProperties": false
      }
    },
    "bindings": {
      "description": "What this bundle asks to be wired to.",
      "type": "object",
      "properties": {
        "database": {
          "description": "The site's own database. Declaring it provisions one on the first build.",
          "type": "object",
          "properties": {
            "migrations": {
              "description": "Directory of `.sql` migrations for this site's own database, applied in filename order.",
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            "tables": {
              "description": "The tables this site's code owns.",
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 63
              }
            },
            "stagedMigrationsPrefix": {
              "description": "PLATFORM-WRITTEN. Where the migrations above were actually staged, once the bundle was relocated into the reserved prefix. Never write this yourself — a manifest that carries it on upload is refused.",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "additionalProperties": false
        },
        "projectDatabase": {
          "description": "How this site reaches the PROJECT database shared by its project's sites. Defaults to `none`.",
          "type": "string",
          "enum": [
            "none",
            "read",
            "readwrite"
          ]
        },
        "secrets": {
          "description": "Secret NAMES this Worker reads. Values are set on the site, never in this file.",
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "submissions": {
          "description": "A table that platform form posts are also written to, so a static site keeps its own entries.",
          "type": "string",
          "minLength": 1,
          "maxLength": 63
        },
        "storage": {
          "description": "The site's own object store. Declaring it provisions one bucket on the first publish and binds it.",
          "type": "object",
          "properties": {
            "name": {
              "description": "The identifier your Worker reads the bucket through. Defaults to `BUCKET`.",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "additionalProperties": false
        },
        "images": {
          "description": "Attach the image-transform binding, so your Worker can resize and re-encode bytes it already holds. Defaults to `false`.",
          "type": "boolean"
        },
        "kv": {
          "description": "The site's own key-value store. Declaring it provisions one namespace on the first publish and binds it.",
          "type": "object",
          "properties": {
            "name": {
              "description": "The identifier your Worker reads the key-value store through. Defaults to `KV`.",
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "limits": {
      "description": "The caps this bundle asks for. The platform decides the ceilings and refuses anything over them.",
      "type": "object",
      "properties": {
        "cpuMs": {
          "description": "CPU milliseconds per invocation. Defaults to 10000; the platform ceiling is 30000.",
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "subRequests": {
          "description": "Outbound sub-requests per invocation. Defaults to 20; the platform ceiling is 50.",
          "type": "integer",
          "exclusiveMinimum": 0
        }
      },
      "additionalProperties": false
    },
    "runtime": {
      "description": "What this bundle's Worker needs from the Workers runtime. Read from your bundle's own `wrangler.json` when it ships one; declare it here otherwise.",
      "type": "object",
      "properties": {
        "compatibilityFlags": {
          "description": "Workers compatibility flags your Worker needs to start — global_fetch_strictly_public, nodejs_compat. Anything else is refused by name. Set this only when your bundle ships no JSON Wrangler config for us to read it from.",
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "compatibilityDate": {
          "description": "The Workers compatibility date your bundle was COMPILED against, as `YYYY-MM-DD`. It is ignored unless it is newer than the platform's own pin — it can only move the date forward, never back.",
          "type": "string",
          "minLength": 1,
          "maxLength": 10
        }
      },
      "additionalProperties": false
    },
    "forms": {
      "description": "The forms whose leads start an automation. A lead from a form named here raises its `event` beside `pages.lead.captured`; a form not named here raises only `pages.lead.captured`.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The form's name, as its lead carries it in the `form` field: lowercase letters, digits, `-` and `_`."
          },
          "event": {
            "type": "string",
            "minLength": 1,
            "maxLength": 71,
            "description": "The automation event a lead from this form starts: `custom.` then a lowercase name of letters, digits and underscores, starting with a letter."
          }
        },
        "required": [
          "name",
          "event"
        ],
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}