1
0
Fork 0
Code Issues Pull requests Projects Releases 2 Packages Wiki Activity Actions Pages
DocForge2/schemas/project.schema.json

112 lines
4.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/project-v1.json",
"title": "DocForge project descriptor",
"type": "object",
"required": ["schema_version", "project_id", "title", "adapter", "sources", "derived", "changesets", "graph"],
"properties": {
"schema_version": { "const": 1 },
"project_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"title": { "type": "string", "minLength": 1 },
"adapter": { "type": "string", "minLength": 1 },
"sources": {
"type": "object",
"required": ["content_roots", "authority_files"],
"properties": {
"content_roots": { "$ref": "#/$defs/pathList" },
"authority_files": { "$ref": "#/$defs/pathList" }
},
"additionalProperties": false
},
"derived": {
"type": "object",
"required": ["cache_root", "index"],
"properties": {
"cache_root": { "$ref": "#/$defs/relativePath" },
"index": { "$ref": "#/$defs/relativePath" }
},
"additionalProperties": false
},
"changesets": {
"type": "object",
"required": ["root", "writers"],
"properties": {
"root": { "$ref": "#/$defs/relativePath" },
"writers": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "families", "operations"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"families": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
"operations": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["create", "update", "move", "delete"] } }
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"render": {
"type": "object",
"required": ["template_root", "preview_root", "views"],
"properties": {
"template_root": { "$ref": "#/$defs/relativePath" },
"preview_root": { "$ref": "#/$defs/relativePath" },
"views": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "renderer", "template", "output", "title", "families"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"renderer": { "const": "generic_html" },
"template": { "$ref": "#/$defs/relativePath" },
"output": { "allOf": [{ "$ref": "#/$defs/relativePath" }, { "pattern": "\\.html$" }] },
"title": { "type": "string", "minLength": 1 },
"families": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"graph": {
"type": "object",
"required": ["allowed_relations"],
"properties": {
"allowed_relations": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" } }
},
"additionalProperties": false
},
"limits": {
"type": "object",
"properties": {
"max_source_bytes": { "$ref": "#/$defs/positiveInteger" },
"max_nodes": { "$ref": "#/$defs/positiveInteger" },
"max_query_chars": { "$ref": "#/$defs/positiveInteger" },
"max_results": { "$ref": "#/$defs/positiveInteger" },
"max_traversal_depth": { "$ref": "#/$defs/positiveInteger" },
"max_context_tokens": { "$ref": "#/$defs/positiveInteger" },
"max_tool_output_chars": { "$ref": "#/$defs/positiveInteger" },
"max_changesets": { "$ref": "#/$defs/positiveInteger" },
"max_changeset_operations": { "$ref": "#/$defs/positiveInteger" },
"max_changeset_bytes": { "$ref": "#/$defs/positiveInteger" },
"max_render_views": { "$ref": "#/$defs/positiveInteger" },
"max_template_bytes": { "$ref": "#/$defs/positiveInteger" },
"max_render_bytes": { "$ref": "#/$defs/positiveInteger" }
},
"additionalProperties": false
},
"profiles": { "type": "array" }
},
"$defs": {
"relativePath": { "type": "string", "minLength": 1, "not": { "pattern": "(^/|(^|/)\\.\\.(/|$))" } },
"pathList": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/relativePath" } },
"positiveInteger": { "type": "integer", "minimum": 1 }
},
"additionalProperties": false
}