{
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://web64.nofs.ai/schemas/web64template/3",
    "title": "Portable Web64 template v3",
    "type": "object",
    "properties": {
      "kind": {
        "const": "web64.ide.template"
      },
      "version": {
        "const": 3
      },
      "manifest": {
        "type": "object",
        "properties": {
          "version": {
            "const": 1
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
          },
          "displayName": {
            "type": "string",
            "maxLength": 4096,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 4096,
            "minLength": 1
          },
          "category": {
            "enum": [
              "Beginner",
              "Game",
              "Demo",
              "Graphics",
              "Audio",
              "C / Mixed",
              "Disk / Cartridge",
              "Testing / SDK"
            ]
          },
          "language": {
            "enum": [
              "ASM",
              "C",
              "Mixed"
            ]
          },
          "difficulty": {
            "enum": [
              "Beginner",
              "Intermediate",
              "Advanced"
            ]
          },
          "architectureSummary": {
            "type": "string",
            "maxLength": 4096,
            "minLength": 1
          },
          "firstEdit": {
            "type": "string",
            "maxLength": 4096
          },
          "tags": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "targetTypes": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "projectFormatVersion": {
            "enum": [
              4,
              5
            ]
          },
          "compilerAbi": {
            "type": "string",
            "maxLength": 4096
          },
          "sdkModules": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "compatibilityModules": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "nativeAssets": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "palNtsc": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "memoryAssumptions": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "estimatedPrgBytes": {
            "type": "integer",
            "minimum": 0
          },
          "files": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            },
            "contains": {
              "const": "TEMPLATE.md"
            }
          },
          "documentation": {
            "type": "string",
            "maxLength": 4096
          },
          "templateVersion": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "recommendedNextTemplates": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "sourceProvenance": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "object",
              "properties": {
                "relationship": {
                  "type": "string",
                  "maxLength": 4096
                },
                "title": {
                  "type": "string",
                  "maxLength": 4096
                },
                "url": {
                  "type": "string",
                  "maxLength": 4096
                }
              },
              "required": [],
              "additionalProperties": false
            }
          },
          "performance": {
            "type": "object",
            "properties": {
              "bufferedFrameCycleCeiling": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "idleScreenWrites": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "activeScreenWrites": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "boundaryColorWrites": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "minimumSubpixelPixelsPerFrame": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "palCycleCeiling": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "colorRamCycleCeiling": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "maxContinuousPixelsPerFrame": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "hudRows": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "id",
          "displayName",
          "description",
          "category",
          "language",
          "difficulty",
          "architectureSummary",
          "files",
          "projectFormatVersion",
          "templateVersion"
        ],
        "additionalProperties": false
      },
      "parameters": {
        "type": "array",
        "maxItems": 16,
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$",
              "not": {
                "enum": [
                  "constructor",
                  "prototype"
                ]
              }
            },
            "type": {
              "enum": [
                "text",
                "number",
                "boolean",
                "select",
                "multiselect"
              ]
            },
            "label": {
              "type": "string",
              "maxLength": 120,
              "minLength": 1
            },
            "description": {
              "type": "string",
              "maxLength": 1000
            },
            "required": {
              "type": "boolean"
            },
            "defaultValue": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 256
                },
                {
                  "type": "number",
                  "minimum": -1000000000,
                  "maximum": 1000000000
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array",
                  "maxItems": 32,
                  "uniqueItems": true,
                  "items": {
                    "type": "string",
                    "maxLength": 120
                  }
                }
              ]
            },
            "maxLength": {
              "type": "integer",
              "minimum": 1,
              "maximum": 256
            },
            "min": {
              "type": "number",
              "minimum": -1000000000,
              "maximum": 1000000000
            },
            "max": {
              "type": "number",
              "minimum": -1000000000,
              "maximum": 1000000000
            },
            "choices": {
              "type": "array",
              "minItems": 1,
              "maxItems": 32,
              "items": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "value",
                  "label"
                ],
                "additionalProperties": false
              }
            },
            "integer": {
              "const": true
            }
          },
          "required": [
            "id",
            "type",
            "label",
            "defaultValue"
          ],
          "additionalProperties": false,
          "allOf": [
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "text"
                  }
                }
              },
              "then": {
                "required": [
                  "maxLength"
                ],
                "properties": {
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 256
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "number"
                  }
                }
              },
              "then": {
                "required": [
                  "min",
                  "max"
                ],
                "properties": {
                  "defaultValue": {
                    "type": "number"
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "boolean"
                  }
                }
              },
              "then": {
                "properties": {
                  "defaultValue": {
                    "type": "boolean"
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "enum": [
                      "select",
                      "multiselect"
                    ]
                  }
                }
              },
              "then": {
                "required": [
                  "choices"
                ]
              },
              "else": {
                "not": {
                  "required": [
                    "choices"
                  ]
                }
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "select"
                  }
                }
              },
              "then": {
                "properties": {
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 120
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "multiselect"
                  }
                }
              },
              "then": {
                "properties": {
                  "defaultValue": {
                    "type": "array",
                    "uniqueItems": true,
                    "maxItems": 32,
                    "items": {
                      "type": "string",
                      "maxLength": 120
                    }
                  }
                }
              }
            }
          ]
        }
      },
      "variants": {
        "type": "array",
        "minItems": 1,
        "maxItems": 64,
        "items": {
          "type": "object",
          "properties": {
            "when": {
              "type": "object",
              "maxProperties": 16,
              "propertyNames": {
                "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 256
                  },
                  {
                    "type": "number",
                    "minimum": -1000000000,
                    "maximum": 1000000000
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "array",
                    "maxItems": 32,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "maxLength": 120
                    }
                  }
                ]
              }
            },
            "project": {
              "type": "object",
              "required": [
                "kind",
                "version",
                "main",
                "files"
              ],
              "properties": {
                "kind": {
                  "const": "web64.ide.project"
                },
                "version": {
                  "enum": [
                    4,
                    5
                  ]
                },
                "main": {
                  "type": "object"
                },
                "files": {
                  "type": "array"
                }
              }
            }
          },
          "required": [
            "when",
            "project"
          ],
          "additionalProperties": false
        }
      },
      "substitutions": {
        "type": "array",
        "maxItems": 64,
        "items": {
          "type": "object",
          "properties": {
            "parameter": {
              "type": "string",
              "maxLength": 64
            },
            "files": {
              "type": "array",
              "minItems": 1,
              "maxItems": 64,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              }
            },
            "separator": {
              "type": "string",
              "maxLength": 8
            }
          },
          "required": [
            "parameter",
            "files"
          ],
          "additionalProperties": false
        }
      },
      "images": {
        "type": "object",
        "properties": {
          "logo": {
            "type": "object",
            "properties": {
              "mimeType": {
                "const": "image/png"
              },
              "data": {
                "type": "string",
                "maxLength": 699052,
                "pattern": "^[A-Za-z0-9+/]*={0,2}$"
              },
              "alt": {
                "type": "string",
                "maxLength": 160
              }
            },
            "required": [
              "mimeType",
              "data",
              "alt"
            ],
            "additionalProperties": false
          },
          "screenshot": {
            "type": "object",
            "properties": {
              "mimeType": {
                "const": "image/png"
              },
              "data": {
                "type": "string",
                "maxLength": 699052,
                "pattern": "^[A-Za-z0-9+/]*={0,2}$"
              },
              "alt": {
                "type": "string",
                "maxLength": 160
              }
            },
            "required": [
              "mimeType",
              "data",
              "alt"
            ],
            "additionalProperties": false
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "script": {
        "type": "object",
        "properties": {
          "version": {
            "const": 1
          },
          "blocks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "items": {
              "type": "object",
              "properties": {
                "file": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                },
                "anchor": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "body": {
                  "type": "array",
                  "maxItems": 256,
                  "items": {
                    "$ref": "#/definitions/scriptNode"
                  }
                }
              },
              "required": [
                "file",
                "anchor",
                "body"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "blocks"
        ],
        "additionalProperties": false
      },
      "inlineSource": {
        "type": "object",
        "properties": {
          "version": {
            "const": 1
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "\\.(?:asm|s|inc|c|h)$"
            }
          }
        },
        "required": [
          "version",
          "files"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "kind",
      "version",
      "manifest",
      "variants"
    ],
    "additionalProperties": false,
    "x-web64": {
      "policy": "Unknown fields and unsupported format versions reject; no implicit migration. Cloud storage may retain these same bytes, but ownership/listings/install receipts are external to the portable artifact.",
      "validation": "Version 3 schema plus typed generator bindings, inline source parsing, native generator numeric/range/overflow/size checks and whole-project validation before publication. Each result is ordinary editable source. V1/V2 and existing V3 remain supported.",
      "transformations": "Version 2 rendering plus native table/matrix generation from JSON script anchors or optional inline source directives in authored C/ASM. Options are literals or typed parameter references. No arbitrary expressions, host execution, network, binary output or live bindings.",
      "limits": "Implementation allocation policy: local JSON 256 MiB; each native project 32 MiB; PNG 512 KiB and 2048x2048. MCP staging is independently limited to 16 MiB per upload. Limits are not evidence of tested gigabyte support.",
      "references": "Project v4 variants use the versioned native import reader; v5 variants use the published web64proj/5, build/2 and media/3 schemas. Container validation alone does not certify a variant.",
      "lifecycle": "Creation yields a normal unsaved editable Web64 project. It does not save, build, run or access Cloud. The original template is not required afterwards."
    },
    "definitions": {
      "scriptNode": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "text"
              },
              "value": {
                "type": "string",
                "maxLength": 2097152
              }
            },
            "required": [
              "op",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "if"
              },
              "test": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "parameter": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                      },
                      "equals": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 256
                          },
                          {
                            "type": "number",
                            "minimum": -1000000000,
                            "maximum": 1000000000
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "array",
                            "maxItems": 32,
                            "uniqueItems": true,
                            "items": {
                              "type": "string",
                              "maxLength": 120
                            }
                          }
                        ]
                      }
                    },
                    "required": [
                      "parameter",
                      "equals"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "parameter": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                      },
                      "contains": {
                        "type": "string",
                        "maxLength": 120
                      }
                    },
                    "required": [
                      "parameter",
                      "contains"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "then": {
                "type": "array",
                "maxItems": 256,
                "items": {
                  "$ref": "#/definitions/scriptNode"
                }
              },
              "else": {
                "type": "array",
                "maxItems": 256,
                "items": {
                  "$ref": "#/definitions/scriptNode"
                }
              }
            },
            "required": [
              "op",
              "test",
              "then"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "switch"
              },
              "parameter": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
              },
              "cases": {
                "type": "array",
                "minItems": 1,
                "maxItems": 32,
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "number",
                          "minimum": -1000000000,
                          "maximum": 1000000000
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "maxItems": 32,
                          "uniqueItems": true,
                          "items": {
                            "type": "string",
                            "maxLength": 120
                          }
                        }
                      ]
                    },
                    "body": {
                      "type": "array",
                      "maxItems": 256,
                      "items": {
                        "$ref": "#/definitions/scriptNode"
                      }
                    }
                  },
                  "required": [
                    "value",
                    "body"
                  ],
                  "additionalProperties": false
                }
              },
              "default": {
                "type": "array",
                "maxItems": 256,
                "items": {
                  "$ref": "#/definitions/scriptNode"
                }
              }
            },
            "required": [
              "op",
              "parameter",
              "cases"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "for"
              },
              "variable": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
              },
              "count": {
                "type": "object",
                "properties": {
                  "parameter": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                  }
                },
                "required": [
                  "parameter"
                ],
                "additionalProperties": false
              },
              "each": {
                "type": "object",
                "properties": {
                  "parameter": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                  }
                },
                "required": [
                  "parameter"
                ],
                "additionalProperties": false
              },
              "body": {
                "type": "array",
                "maxItems": 256,
                "items": {
                  "$ref": "#/definitions/scriptNode"
                }
              }
            },
            "required": [
              "op",
              "variable",
              "body"
            ],
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "count"
                ]
              },
              {
                "required": [
                  "each"
                ]
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "emit"
              },
              "variable": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
              }
            },
            "required": [
              "op",
              "variable"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "generate"
              },
              "kind": {
                "const": "table"
              },
              "options": {
                "type": "object",
                "properties": {
                  "numericType": {
                    "anyOf": [
                      {
                        "enum": [
                          "uint8",
                          "int8",
                          "web64_fix8_8",
                          "web64_ufix8_8"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "overflow": {
                    "anyOf": [
                      {
                        "enum": [
                          "error",
                          "clamp",
                          "wrap"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "layout": {
                    "anyOf": [
                      {
                        "enum": [
                          "interleaved",
                          "separate"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "asmEncoding": {
                    "anyOf": [
                      {
                        "enum": [
                          "word",
                          "pairs",
                          "planes"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "cArrayShape": {
                    "anyOf": [
                      {
                        "enum": [
                          "flat",
                          "multidimensional"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "storage": {
                    "anyOf": [
                      {
                        "enum": [
                          "static",
                          "global"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "handedness": {
                    "anyOf": [
                      {
                        "enum": [
                          "left",
                          "right"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "eulerOrder": {
                    "anyOf": [
                      {
                        "enum": [
                          "xyz",
                          "xzy",
                          "yxz",
                          "yzx",
                          "zxy",
                          "zyx"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "count": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "length": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "amplitude": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "center": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "phase": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "cycles": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "duty": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "start": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "end": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "inputStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "inputEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "numerator": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "steps": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleXStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleXEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleYStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleYEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "shearX": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "shearY": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "translateX": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "translateY": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleXOffset": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleYOffset": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleZOffset": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "fovStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "fovEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aspect": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "near": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "far": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "zoomStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "zoomEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "left": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "right": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bottom": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "top": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "dimension": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "rows": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "columns": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "cyclic": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "uniformScale": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "preset": {
                    "anyOf": [
                      {
                        "enum": [
                          "sine",
                          "cosine",
                          "triangle",
                          "saw",
                          "square",
                          "ramp",
                          "easing",
                          "reciprocal",
                          "multiplication"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 256
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "easing": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 256
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "preset",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "op",
              "kind",
              "options"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "const": "generate"
              },
              "kind": {
                "const": "matrix"
              },
              "options": {
                "type": "object",
                "properties": {
                  "numericType": {
                    "anyOf": [
                      {
                        "enum": [
                          "uint8",
                          "int8",
                          "web64_fix8_8",
                          "web64_ufix8_8"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "overflow": {
                    "anyOf": [
                      {
                        "enum": [
                          "error",
                          "clamp",
                          "wrap"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "layout": {
                    "anyOf": [
                      {
                        "enum": [
                          "interleaved",
                          "separate"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "asmEncoding": {
                    "anyOf": [
                      {
                        "enum": [
                          "word",
                          "pairs",
                          "planes"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "cArrayShape": {
                    "anyOf": [
                      {
                        "enum": [
                          "flat",
                          "multidimensional"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "storage": {
                    "anyOf": [
                      {
                        "enum": [
                          "static",
                          "global"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "handedness": {
                    "anyOf": [
                      {
                        "enum": [
                          "left",
                          "right"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "eulerOrder": {
                    "anyOf": [
                      {
                        "enum": [
                          "xyz",
                          "xzy",
                          "yxz",
                          "yzx",
                          "zxy",
                          "zyx"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "count": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "length": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "amplitude": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "center": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "phase": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "cycles": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "duty": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "start": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "end": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "inputStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "inputEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "numerator": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "steps": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleXStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleXEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleYStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "scaleYEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "shearX": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "shearY": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "translateX": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "translateY": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleXOffset": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleYOffset": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "angleZOffset": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "fovStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "fovEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "aspect": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "near": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "far": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "zoomStart": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "zoomEnd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "left": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "right": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "bottom": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "top": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "dimension": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "rows": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "columns": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "cyclic": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "uniformScale": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "preset": {
                    "anyOf": [
                      {
                        "enum": [
                          "rotation2d",
                          "scale2d",
                          "affine2d",
                          "rotation3d-x",
                          "rotation3d-y",
                          "rotation3d-z",
                          "euler3d",
                          "perspective",
                          "orthographic",
                          "identity",
                          "custom"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 256
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "easing": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 256
                      },
                      {
                        "type": "object",
                        "properties": {
                          "parameter": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                          }
                        },
                        "required": [
                          "parameter"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "customValues": {
                    "type": "array",
                    "minItems": 4,
                    "maxItems": 16,
                    "items": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "parameter": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9]{0,63}$"
                            }
                          },
                          "required": [
                            "parameter"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "preset",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "op",
              "kind",
              "options"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "referencedSchemas": [
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "https://web64.nofs.ai/schemas/web64proj/5",
      "title": "Native portable Web64 project v5 envelope",
      "type": "object",
      "properties": {
        "kind": {
          "const": "web64.ide.project"
        },
        "version": {
          "const": 5
        },
        "savedAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "main": {
          "type": "object",
          "properties": {
            "fileName": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
            },
            "origin": {
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "selectedEntryLabel": {
              "type": "string"
            }
          },
          "required": [
            "fileName",
            "origin",
            "source",
            "selectedEntryLabel"
          ],
          "additionalProperties": false
        },
        "c": {
          "type": "object",
          "description": "Native-owned settings/asset metadata; apply the matching native format/configuration validator as well as envelope round-trip validation. Not an MCP extension bag."
        },
        "build": {
          "$ref": "https://web64.nofs.ai/schemas/build/2"
        },
        "emulator": {
          "type": "object",
          "properties": {
            "emulatorScale": {
              "enum": [
                "1",
                "2",
                "fit"
              ]
            },
            "livePatchEnabled": {
              "type": "boolean"
            },
            "audioEnabled": {
              "type": "boolean"
            },
            "audioMuted": {
              "type": "boolean"
            },
            "audioVolume": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "sidQuality": {
              "enum": [
                "fastsid",
                "realtime",
                "balanced",
                "accurate"
              ]
            },
            "scanlinesEnabled": {
              "type": "boolean"
            },
            "warpEnabled": {
              "type": "boolean"
            },
            "drive9Enabled": {
              "type": "boolean"
            },
            "gamepadEnabled": {
              "type": "boolean"
            },
            "joystickPort": {
              "enum": [
                1,
                2
              ]
            },
            "speedMultiplier": {
              "enum": [
                1,
                2,
                4,
                8,
                16
              ]
            },
            "driveSoundEnabled": {
              "type": "boolean"
            }
          },
          "required": [
            "emulatorScale",
            "livePatchEnabled",
            "audioEnabled",
            "audioMuted",
            "audioVolume",
            "sidQuality",
            "scanlinesEnabled",
            "warpEnabled",
            "drive9Enabled",
            "gamepadEnabled",
            "joystickPort"
          ],
          "additionalProperties": false
        },
        "settings": {
          "type": "object",
          "properties": {
            "version": {
              "const": 2
            },
            "live": {
              "type": "object",
              "description": "Native-owned settings/asset metadata; apply the matching native format/configuration validator as well as envelope round-trip validation. Not an MCP extension bag."
            },
            "diagnostics": {
              "type": "object",
              "description": "Native-owned settings/asset metadata; apply the matching native format/configuration validator as well as envelope round-trip validation. Not an MCP extension bag."
            },
            "emulator": {
              "type": "object",
              "properties": {
                "emulatorScale": {
                  "enum": [
                    "1",
                    "2",
                    "fit"
                  ]
                },
                "livePatchEnabled": {
                  "type": "boolean"
                },
                "audioEnabled": {
                  "type": "boolean"
                },
                "audioMuted": {
                  "type": "boolean"
                },
                "audioVolume": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "sidQuality": {
                  "enum": [
                    "fastsid",
                    "realtime",
                    "balanced",
                    "accurate"
                  ]
                },
                "scanlinesEnabled": {
                  "type": "boolean"
                },
                "warpEnabled": {
                  "type": "boolean"
                },
                "drive9Enabled": {
                  "type": "boolean"
                },
                "gamepadEnabled": {
                  "type": "boolean"
                },
                "joystickPort": {
                  "enum": [
                    1,
                    2
                  ]
                },
                "speedMultiplier": {
                  "enum": [
                    1,
                    2,
                    4,
                    8,
                    16
                  ]
                },
                "driveSoundEnabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "emulatorScale",
                "livePatchEnabled",
                "audioEnabled",
                "audioMuted",
                "audioVolume",
                "sidQuality",
                "scanlinesEnabled",
                "warpEnabled",
                "drive9Enabled",
                "gamepadEnabled",
                "joystickPort"
              ],
              "additionalProperties": false
            },
            "compiler": {
              "type": "object",
              "description": "Native-owned settings/asset metadata; apply the matching native format/configuration validator as well as envelope round-trip validation. Not an MCP extension bag."
            }
          },
          "required": [
            "version",
            "live",
            "diagnostics",
            "emulator",
            "compiler"
          ],
          "additionalProperties": false
        },
        "workspace": {
          "type": "object",
          "properties": {
            "selectedFile": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "scope": {
                      "enum": [
                        "root",
                        "project",
                        "header",
                        "include"
                      ]
                    },
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                    }
                  },
                  "required": [
                    "scope",
                    "path"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "editor": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "file": {
                      "type": "object",
                      "properties": {
                        "scope": {
                          "enum": [
                            "root",
                            "project",
                            "header",
                            "include"
                          ]
                        },
                        "path": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                        }
                      },
                      "required": [
                        "scope",
                        "path"
                      ],
                      "additionalProperties": false
                    },
                    "selectionStart": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "selectionEnd": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "scrollTop": {
                      "type": "number",
                      "minimum": 0
                    },
                    "scrollLeft": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "file",
                    "selectionStart",
                    "selectionEnd",
                    "scrollTop",
                    "scrollLeft"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "emulatorCollapsed": {
              "type": "boolean"
            }
          },
          "required": [
            "selectedFile",
            "editor",
            "emulatorCollapsed"
          ],
          "additionalProperties": false
        },
        "debugger": {
          "type": "object",
          "properties": {
            "version": {
              "const": 1
            },
            "breakpoints": {
              "type": "array",
              "maxItems": 128,
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "kind": {
                    "enum": [
                      "source",
                      "machine"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "label": {
                    "type": "string"
                  },
                  "target": {
                    "type": "object"
                  },
                  "condition": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "version",
                      "text"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "enabled",
                  "label",
                  "target"
                ],
                "additionalProperties": false
              }
            },
            "watches": {
              "type": "array",
              "maxItems": 64,
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "kind": {
                    "enum": [
                      "memory",
                      "expression",
                      "scalar"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "label": {
                    "type": "string"
                  },
                  "format": {
                    "enum": [
                      "hex",
                      "u8",
                      "s8",
                      "u16le",
                      "s16le",
                      "u32le",
                      "s32le",
                      "typed"
                    ]
                  },
                  "space": {
                    "const": "cpu"
                  },
                  "address": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  },
                  "length": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  },
                  "expression": {
                    "type": "string"
                  },
                  "binding": {
                    "type": "object",
                    "properties": {
                      "recordId": {
                        "type": "string"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "contributionId": {
                        "type": "string"
                      },
                      "signature": {
                        "type": "string"
                      },
                      "sourcePath": {
                        "type": "string"
                      },
                      "sourceLine": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "recordId",
                      "targetId",
                      "contributionId",
                      "signature",
                      "sourcePath",
                      "sourceLine"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "enabled",
                  "label",
                  "format",
                  "space"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "version",
            "breakpoints",
            "watches"
          ],
          "additionalProperties": false
        },
        "template": {
          "type": "object",
          "properties": {
            "templateId": {
              "type": "string",
              "minLength": 1
            },
            "templateVersion": {
              "type": "integer",
              "minimum": 1
            },
            "catalogVersion": {
              "type": "integer",
              "minimum": 1
            },
            "contentHash": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "templateId",
            "templateVersion",
            "catalogVersion",
            "contentHash"
          ],
          "additionalProperties": false
        },
        "media": {
          "$ref": "https://web64.nofs.ai/schemas/media/3"
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1,
                "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "minLength": 1
              },
              "mode": {},
              "width": {},
              "height": {},
              "count": {},
              "colors": {},
              "includePath": {},
              "generated": {},
              "generatedFrom": {},
              "generatedFromHash": {},
              "dirty": {},
              "lastCompiledHash": {},
              "lastPatchedHash": {},
              "asset": {},
              "charsetPath": {},
              "blocksetPath": {},
              "blockWidthChars": {},
              "blockHeightChars": {},
              "blockCount": {},
              "labels": {},
              "mapWidth": {},
              "mapHeight": {},
              "indexSize": {},
              "mapName": {},
              "sidMode": {},
              "titleOverride": {},
              "authorOverride": {},
              "releasedOverride": {},
              "derivedFrom": {},
              "sourceKind": {},
              "assetId": {},
              "charsetAssetId": {},
              "blocksetAssetId": {},
              "cellKind": {},
              "mapPlane": {},
              "schemaVersion": {},
              "cloudDependencies": {},
              "cloudProvenance": {},
              "source": {
                "type": "string"
              },
              "encoding": {
                "const": "base64"
              },
              "bytes": {
                "type": "string",
                "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
              }
            },
            "required": [
              "path",
              "name",
              "kind"
            ],
            "additionalProperties": false,
            "oneOf": [
              {
                "properties": {
                  "kind": {
                    "const": "folder"
                  }
                },
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "source"
                      ]
                    },
                    {
                      "required": [
                        "bytes"
                      ]
                    },
                    {
                      "required": [
                        "encoding"
                      ]
                    }
                  ]
                }
              },
              {
                "properties": {
                  "kind": {
                    "not": {
                      "const": "folder"
                    }
                  }
                },
                "required": [
                  "source"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "bytes"
                      ]
                    },
                    {
                      "required": [
                        "encoding"
                      ]
                    }
                  ]
                }
              },
              {
                "properties": {
                  "kind": {
                    "not": {
                      "const": "folder"
                    }
                  }
                },
                "required": [
                  "bytes",
                  "encoding"
                ],
                "not": {
                  "required": [
                    "source"
                  ]
                }
              }
            ]
          }
        }
      },
      "required": [
        "kind",
        "version",
        "savedAt",
        "main",
        "c",
        "build",
        "emulator",
        "settings",
        "workspace",
        "media",
        "files"
      ],
      "additionalProperties": false,
      "x-web64": {
        "representation": "Actual .web64proj JSON produced by the native IDE serializer. Root source is main.source; virtual file records carry text, base64 bytes or folders and native metadata.",
        "unknownFields": "Unknown envelope/file/workspace fields reject. Native configuration objects require lossless canonical round trip; unknown settings discarded by their normalizers reject semantically. File metadata belongs to its native asset schema. Cloud provenance/dependencies remain opaque JSON, never remote authority.",
        "migration": "Strict current v5 envelope. Known older v1–v4 envelopes use version-dispatched readers, pure in-memory migration, then current validation before workspace replacement. Unknown future versions reject.",
        "validation": "JSON Schema with build v2/media v3 schemas, then validateProjectSerializationSemantics. Validate each native asset using its own published schema and semantic validator; this container schema alone does not certify pixels, table programs, references or executable correctness.",
        "configuration": "c/settings.compiler are native Web64-C configuration, not generic RPC arguments. See the C compiler manual for ABI, stack, zero-page and optimization contracts; compilation verifies actual address-space safety.",
        "lifecycle": "A codec fixture proves persistence only. Create/edit/save/reopen/build through the IDE remains the authoring authority. Imported project fields cannot grant MCP, initiate Cloud traffic or run the emulator."
      }
    },
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "https://web64.nofs.ai/schemas/build/2",
      "title": "Native Web64 build manifest v2",
      "type": "object",
      "properties": {
        "version": {
          "const": 2
        },
        "activeTargetId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
        },
        "compatibilityDefaults": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "targets": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "label": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "prg",
                  "packed-data",
                  "test",
                  "magic-desk-crt"
                ]
              },
              "rootPath": {
                "type": "string",
                "minLength": 1,
                "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
              },
              "inputs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                },
                "minItems": 1,
                "uniqueItems": true
              },
              "entrySymbol": {
                "type": "string"
              },
              "origin": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  },
                  {
                    "type": "string",
                    "pattern": "^(?:\\$[0-9a-fA-F]{1,4}|0[xX][0-9a-fA-F]{1,4}|[0-9]{1,5})$"
                  }
                ]
              },
              "outputName": {
                "type": "string",
                "minLength": 1
              },
              "artifactContribution": {
                "type": "string"
              },
              "dependencies": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "targetId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                    },
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                    },
                    "representation": {
                      "enum": [
                        "body",
                        "raw-prg",
                        "artifact"
                      ]
                    }
                  },
                  "required": [
                    "targetId",
                    "path",
                    "representation"
                  ],
                  "additionalProperties": false
                }
              },
              "defines": {
                "type": "object",
                "propertyNames": {
                  "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "compatibilityModules": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              },
              "assemblyDialect": {
                "enum": [
                  "web64-native",
                  "kick5"
                ]
              },
              "kickDiagnosticsTelemetry": {
                "type": "boolean"
              },
              "kickLibraryRoots": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              },
              "c": {
                "type": "object",
                "description": "Existing native target option bag, preserved verbatim. Its compiler/test/cartridge owner validates executable options at build time; this envelope does not certify them."
              },
              "cartridge": {
                "type": "object",
                "description": "Existing native target option bag, preserved verbatim. Its compiler/test/cartridge owner validates executable options at build time; this envelope does not certify them."
              },
              "reu": {
                "type": "object",
                "properties": {
                  "version": {
                    "const": 1
                  },
                  "layoutId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                  },
                  "buffers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "integer",
                          "minimum": 512,
                          "maximum": 53247
                        },
                        "length": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 52736
                        }
                      },
                      "required": [
                        "address",
                        "length"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 16
                  },
                  "probeOffset": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 16777215
                  }
                },
                "required": [
                  "version",
                  "layoutId",
                  "buffers"
                ],
                "additionalProperties": false
              },
              "test": {
                "type": "object",
                "description": "Existing native target option bag, preserved verbatim. Its compiler/test/cartridge owner validates executable options at build time; this envelope does not certify them."
              },
              "packedData": {
                "type": "object",
                "properties": {
                  "stagingAddress": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  },
                  "blockSize": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  },
                  "maximumBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  },
                  "independentBlocks": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "stagingAddress",
                  "blockSize",
                  "maximumBytes",
                  "independentBlocks"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "label",
              "kind",
              "rootPath",
              "inputs",
              "entrySymbol",
              "origin",
              "outputName",
              "artifactContribution",
              "defines",
              "compatibilityModules",
              "assemblyDialect",
              "kickDiagnosticsTelemetry",
              "kickLibraryRoots",
              "c",
              "cartridge",
              "test",
              "packedData"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        },
        "cartridges": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "version": {
                "const": 1
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "label": {
                "type": "string"
              },
              "profile": {
                "enum": [
                  "standard-8k",
                  "standard-16k",
                  "magic-desk",
                  "easyflash"
                ]
              },
              "outputName": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*\\.crt$"
              },
              "fillByte": {
                "type": "integer",
                "minimum": 0,
                "maximum": 255
              },
              "managed": {
                "type": "object",
                "properties": {
                  "version": {
                    "const": 1
                  },
                  "residentTargetId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                  },
                  "directoryRamAddress": {
                    "type": "integer",
                    "minimum": 512,
                    "maximum": 32767
                  },
                  "writableRanges": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "integer",
                          "minimum": 512,
                          "maximum": 32767
                        },
                        "length": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 32256
                        }
                      },
                      "required": [
                        "address",
                        "length"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 16
                  },
                  "resources": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                        },
                        "source": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "const": "project-file"
                                },
                                "path": {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                                }
                              },
                              "required": [
                                "kind",
                                "path"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "const": "target-output"
                                },
                                "targetId": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                                }
                              },
                              "required": [
                                "kind",
                                "targetId"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "representation": {
                          "enum": [
                            "raw",
                            "prg-payload",
                            "packed-stream"
                          ]
                        },
                        "alignment": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 8192
                        },
                        "window": {
                          "enum": [
                            "roml",
                            "romh"
                          ]
                        },
                        "bank": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 63
                        },
                        "offset": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 8191
                        }
                      },
                      "required": [
                        "id",
                        "source",
                        "representation",
                        "alignment"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 255
                  }
                },
                "required": [
                  "version",
                  "residentTargetId",
                  "directoryRamAddress",
                  "writableRanges",
                  "resources"
                ],
                "additionalProperties": false
              },
              "placements": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                    },
                    "source": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "const": "project-file"
                            },
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                            }
                          },
                          "required": [
                            "kind",
                            "path"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "const": "target-output"
                            },
                            "targetId": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                            }
                          },
                          "required": [
                            "kind",
                            "targetId"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "representation": {
                      "enum": [
                        "raw",
                        "prg-payload",
                        "packed-stream",
                        "wrapped-prg"
                      ]
                    },
                    "window": {
                      "enum": [
                        "roml",
                        "romh"
                      ]
                    },
                    "role": {
                      "type": "string"
                    },
                    "alignment": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 8192
                    },
                    "bank": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 63
                    },
                    "offset": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8191
                    },
                    "ramDestination": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 65535
                        },
                        "length": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 65536
                        }
                      },
                      "required": [
                        "address",
                        "length"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "source",
                    "representation",
                    "window",
                    "role",
                    "alignment"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1
              }
            },
            "required": [
              "version",
              "id",
              "label",
              "profile",
              "outputName",
              "fillByte",
              "placements"
            ],
            "additionalProperties": false
          }
        },
        "reuLayouts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "version": {
                "const": 1
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "label": {
                "type": "string"
              },
              "outputName": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*\\.reu$"
              },
              "capacityKiB": {
                "enum": [
                  128,
                  256,
                  512,
                  1024,
                  2048,
                  4096,
                  8192,
                  16384
                ]
              },
              "fillByte": {
                "type": "integer",
                "minimum": 0,
                "maximum": 255
              },
              "placements": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                    },
                    "source": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "const": "project-file"
                            },
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                            }
                          },
                          "required": [
                            "kind",
                            "path"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "const": "target-output"
                            },
                            "targetId": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                            }
                          },
                          "required": [
                            "kind",
                            "targetId"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "representation": {
                      "enum": [
                        "raw",
                        "raw-prg",
                        "prg-payload",
                        "packed-stream"
                      ]
                    },
                    "alignment": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 65536
                    },
                    "offset": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 16777215
                    }
                  },
                  "required": [
                    "id",
                    "source",
                    "representation",
                    "alignment"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 1024
              }
            },
            "required": [
              "version",
              "id",
              "label",
              "outputName",
              "capacityKiB",
              "fillByte",
              "placements"
            ],
            "additionalProperties": false
          },
          "maxItems": 16
        }
      },
      "required": [
        "version",
        "activeTargetId",
        "compatibilityDefaults",
        "targets"
      ],
      "additionalProperties": false,
      "x-web64": {
        "unknownFields": "Envelope/target fields reject. Native c/test/cartridge option bags are preserved and validated by their native execution owners, not certified by this schema.",
        "migration": "Canonical v2 only. Known v1 manifests migrate through the project version dispatcher; validate both old and new envelopes before workspace replacement. Unknown future versions reject.",
        "validation": "JSON Schema plus validateBuildManifestSerializationSemantics with complete local VFS and root settings. Build compilation, address ownership and packed-data capacity remain executable gates.",
        "targetKinds": "Lists existing native kinds, including legacy Magic Desk. New cartridge layouts live in optional build.cartridges; they do not reinterpret the old magic-desk-crt target."
      }
    },
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "https://web64.nofs.ai/schemas/media/3",
      "title": "Native Web64 disk/media manifest v3",
      "type": "object",
      "properties": {
        "version": {
          "const": 3
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "label": {
                "type": "string"
              },
              "dosName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16
              },
              "type": {
                "enum": [
                  "prg",
                  "seq",
                  "usr"
                ]
              },
              "source": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "project-file"
                      },
                      "path": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\\\:\\u0000-\\u001f]+$"
                      }
                    },
                    "required": [
                      "kind",
                      "path"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "target-output"
                      },
                      "targetId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                      }
                    },
                    "required": [
                      "kind",
                      "targetId"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "injectSysLoader": {
                "type": "boolean"
              },
              "sysAddress": {
                "type": "integer",
                "minimum": 0,
                "maximum": 65535
              }
            },
            "required": [
              "id",
              "label",
              "dosName",
              "type",
              "source",
              "injectSysLoader"
            ],
            "additionalProperties": false
          }
        },
        "disks": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16
              },
              "diskId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 5
              },
              "unit": {
                "type": "integer",
                "minimum": 8,
                "maximum": 11
              },
              "markerName": {
                "type": "string"
              },
              "entries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "fileId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                    },
                    "placement": {
                      "type": "object",
                      "properties": {
                        "interleave": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 21
                        },
                        "alignment": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 21
                        },
                        "preferredTracks": {
                          "anyOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "min": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 35
                                },
                                "max": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 35
                                }
                              },
                              "required": [
                                "min",
                                "max"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "sectors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "track": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 35
                              },
                              "sector": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 20
                              }
                            },
                            "required": [
                              "track",
                              "sector"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "interleave",
                        "alignment",
                        "preferredTracks",
                        "sectors"
                      ],
                      "additionalProperties": false
                    },
                    "order": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "fileId",
                    "placement",
                    "order"
                  ],
                  "additionalProperties": false
                }
              },
              "placement": {
                "type": "object",
                "properties": {
                  "interleave": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 21
                  },
                  "reservedSectors": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "track": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 35
                        },
                        "sector": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 20
                        }
                      },
                      "required": [
                        "track",
                        "sector"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "trackOrder": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 35
                    },
                    "uniqueItems": true
                  }
                },
                "required": [
                  "interleave",
                  "reservedSectors",
                  "trackOrder"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "title",
              "diskId",
              "unit",
              "markerName",
              "entries",
              "placement"
            ],
            "additionalProperties": false
          }
        },
        "diskSets": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "label": {
                "type": "string"
              },
              "diskIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                },
                "uniqueItems": true
              },
              "bootDiskId": {
                "type": "string"
              },
              "bootFileId": {
                "type": "string"
              },
              "unit": {
                "type": "integer",
                "minimum": 8,
                "maximum": 11
              },
              "assisted": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "label",
              "diskIds",
              "bootDiskId",
              "bootFileId",
              "unit",
              "assisted"
            ],
            "additionalProperties": false
          }
        },
        "launches": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "version": {
                "const": 1
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
              },
              "label": {
                "type": "string"
              },
              "program": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "target"
                      },
                      "targetId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                      }
                    },
                    "required": [
                      "kind",
                      "targetId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "disk-set"
                      },
                      "diskSetId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                      }
                    },
                    "required": [
                      "kind",
                      "diskSetId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "cartridge"
                      },
                      "layoutId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                      }
                    },
                    "required": [
                      "kind",
                      "layoutId"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "machine": {
                "type": "object",
                "properties": {
                  "family": {
                    "const": "c64"
                  },
                  "video": {
                    "enum": [
                      "pal",
                      "ntsc"
                    ]
                  },
                  "cpu": {
                    "const": "standard"
                  }
                },
                "required": [
                  "family",
                  "video",
                  "cpu"
                ],
                "additionalProperties": false
              },
              "reu": {
                "type": "object",
                "properties": {
                  "layoutId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                  },
                  "initialize": {
                    "const": "replace"
                  }
                },
                "required": [
                  "layoutId",
                  "initialize"
                ],
                "additionalProperties": false
              },
              "workspace": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "integer",
                    "minimum": 512,
                    "maximum": 53247
                  },
                  "length": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 52736
                  }
                },
                "required": [
                  "address",
                  "length"
                ],
                "additionalProperties": false
              },
              "drives": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "unit": {
                      "enum": [
                        8,
                        9
                      ]
                    },
                    "diskId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
                    }
                  },
                  "required": [
                    "unit",
                    "diskId"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 2
              }
            },
            "required": [
              "version",
              "id",
              "label",
              "program",
              "machine",
              "drives"
            ],
            "additionalProperties": false
          },
          "maxItems": 32
        },
        "activeLaunchId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,47}$"
        }
      },
      "required": [
        "version",
        "files",
        "disks",
        "diskSets",
        "launches"
      ],
      "additionalProperties": false,
      "x-web64": {
        "unknownFields": "Unknown fields reject; all IDs/references are project-local, never Cloud IDs.",
        "migration": "Canonical v3 only. Known v1/v2 media manifests migrate through the project version dispatcher; unknown future versions reject.",
        "validation": "JSON Schema plus validateMediaManifestSerializationSemantics with actual VFS/build targets. PETSCII names, IDs, references, boot placement and track geometry require semantic checks. Mastering still validates allocation, overlaps, output freshness and disk capacity against real bytes.",
        "packedData": "Packed targets normally use injectSysLoader=false so the W64X PRG staging header is retained. Disk mastering is not emulator mounting or execution."
      }
    }
  ],
  "authoringGuide": "docs/web64-template-format.html",
  "example": {
    "kind": "web64.ide.template",
    "version": 3,
    "manifest": {
      "version": 1,
      "id": "generator-example",
      "displayName": "Generator example",
      "description": "A native-codec schema fixture.",
      "category": "Graphics",
      "language": "ASM",
      "difficulty": "Beginner",
      "architectureSummary": "A parameterized sine table.",
      "files": [
        "main.asm",
        "TEMPLATE.md"
      ],
      "projectFormatVersion": 4,
      "templateVersion": 1
    },
    "parameters": [
      {
        "id": "samples",
        "type": "number",
        "label": "Samples",
        "integer": true,
        "defaultValue": 64,
        "min": 8,
        "max": 256
      }
    ],
    "variants": [
      {
        "when": {},
        "project": {
          "kind": "web64.ide.project",
          "version": 5,
          "savedAt": "2026-09-21T00:00:00.000Z",
          "main": {
            "fileName": "main.asm",
            "origin": "$c000",
            "source": "start: rts\n// @web64template generate table {\"preset\":\"sine\",\"name\":\"wave\",\"count\":{\"parameter\":\"samples\"},\"amplitude\":64,\"center\":128,\"numericType\":\"uint8\",\"overflow\":\"error\"}\n",
            "selectedEntryLabel": "auto"
          },
          "c": {
            "enabled": false,
            "dialect": "web64-c-v0.1",
            "abi": "web64-static-v0",
            "entry": "main.c",
            "entrySymbol": "",
            "predefinedDefines": {},
            "includePaths": [
              "include",
              "assets"
            ],
            "stdout": "screen",
            "stdin": "keyboard",
            "runtimeProfile": "tiny",
            "compilerBackend": "web64-native",
            "startup": {
              "processorPort": null,
              "disableInterrupts": false
            },
            "stack": {
              "size": 512,
              "address": null
            },
            "zeroPage": {
              "reserved": []
            },
            "ir": {
              "schemaVersion": 1,
              "enabled": false,
              "verifyLegacyEquivalence": true,
              "emitSnapshots": false
            },
            "optimize": {
              "schemaVersion": 2,
              "mode": "debug",
              "enabled": false,
              "passGates": {
                "generatorPeephole": false,
                "registerTemporaryStack": false,
                "constantStrengthReduction": false,
                "fixedPointSpecialization": false,
                "booleanBranch": false,
                "controlFlowLoop": false,
                "cc65Peephole": false,
                "zeroPagePromotion": false,
                "deadCode": false,
                "conditionalInlining": false,
                "hardwareAware": false,
                "runtimeData": false
              },
              "frameCriticalFunctions": [],
              "zeroPageReserved": [],
              "budgets": {
                "maxBuildByteGrowth": 0,
                "maxFunctionByteGrowth": 0,
                "maxWorstCaseCycles": null
              },
              "diagnostics": {
                "trace": "summary",
                "missedOptimizationRemarks": false
              }
            }
          },
          "build": {
            "version": 2,
            "activeTargetId": "main",
            "compatibilityDefaults": [],
            "targets": [
              {
                "id": "main",
                "label": "Main",
                "kind": "prg",
                "rootPath": "main.asm",
                "inputs": [
                  "main.asm"
                ],
                "entrySymbol": "",
                "origin": "$c000",
                "outputName": "main.prg",
                "artifactContribution": "",
                "defines": {},
                "compatibilityModules": [],
                "assemblyDialect": "web64-native",
                "kickDiagnosticsTelemetry": false,
                "kickLibraryRoots": [],
                "c": {},
                "cartridge": {},
                "test": {},
                "packedData": {
                  "stagingAddress": 57344,
                  "blockSize": 0,
                  "maximumBytes": 0,
                  "independentBlocks": false
                }
              }
            ]
          },
          "emulator": {
            "emulatorScale": "fit",
            "livePatchEnabled": true,
            "audioEnabled": false,
            "audioMuted": false,
            "audioVolume": 1,
            "sidQuality": "fastsid",
            "scanlinesEnabled": true,
            "warpEnabled": false,
            "drive9Enabled": true,
            "gamepadEnabled": false,
            "joystickPort": 2
          },
          "settings": {
            "version": 2,
            "live": {
              "compilationEnabled": false,
              "compileOnSave": false,
              "compileOnImport": false,
              "debounceProfile": "balanced",
              "staleResultPolicy": "mark-stale"
            },
            "diagnostics": {
              "automatic": true,
              "showInfo": true,
              "showWarnings": true,
              "showErrors": true,
              "gutterDensity": "normal"
            },
            "emulator": {
              "emulatorScale": "fit",
              "livePatchEnabled": true,
              "audioEnabled": false,
              "audioMuted": false,
              "audioVolume": 1,
              "sidQuality": "fastsid",
              "scanlinesEnabled": true,
              "warpEnabled": false,
              "drive9Enabled": true,
              "gamepadEnabled": false,
              "joystickPort": 2
            },
            "compiler": {
              "enabled": false,
              "dialect": "web64-c-v0.1",
              "abi": "web64-static-v0",
              "entry": "main.c",
              "entrySymbol": "",
              "predefinedDefines": {},
              "includePaths": [
                "include",
                "assets"
              ],
              "stdout": "screen",
              "stdin": "keyboard",
              "runtimeProfile": "tiny",
              "compilerBackend": "web64-native",
              "startup": {
                "processorPort": null,
                "disableInterrupts": false
              },
              "stack": {
                "size": 512,
                "address": null
              },
              "zeroPage": {
                "reserved": []
              },
              "ir": {
                "schemaVersion": 1,
                "enabled": false,
                "verifyLegacyEquivalence": true,
                "emitSnapshots": false
              }
            }
          },
          "workspace": {
            "selectedFile": null,
            "editor": null,
            "emulatorCollapsed": false
          },
          "media": {
            "version": 3,
            "files": [],
            "disks": [],
            "diskSets": [],
            "launches": []
          },
          "files": [
            {
              "path": "TEMPLATE.md",
              "name": "TEMPLATE.md",
              "kind": "source",
              "source": "# Generator example\nEdit the generated table, then build and run."
            }
          ]
        }
      }
    ],
    "inlineSource": {
      "version": 1,
      "files": [
        "main.asm"
      ]
    }
  },
  "validation": "Version 3 schema plus typed inline source and generator validation, bounded rendering and native project validation. Source output only; no host expressions or live template dependency."
}
