{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.schemastore.org/urai-ecma.json",
  "title": "UraiEcmaConfig",
  "description": "Configuration schema for urai-ecma: AST commentary, pruning, and LLM context packaging engine for ECMAScript codebases (உரை - explanation & distillation).",
  "type": "object",
  "additionalProperties": false,
  "required": ["input_project", "output_file"],
  "properties": {
    "$schema": {
      "type": "string",
      "description": "Path or URL to the JSON schema definition for IDE validation and autocompletion."
    },
    "input_project": {
      "type": "string",
      "minLength": 1,
      "title": "Input Project Path",
      "description": "Path to the project directory or single source file to be processed.",
      "markdownDescription": "Path to the target **project root directory** or a **single source file** to analyze.\n\n*Supports relative paths (e.g. `./src`) and absolute paths.*",
      "examples": ["./src", "./apps/web", "./src/index.ts"]
    },
    "output_file": {
      "type": "string",
      "minLength": 1,
      "pattern": "^.*\\.(md|markdown|mdx|txt)$",
      "title": "Output File Path",
      "description": "Target output file path for the generated Markdown documentation.",
      "markdownDescription": "Destination path for the generated **Markdown documentation file**.\n\n*Must end with `.md`, `.markdown`, `.mdx` or `.txt`.*",
      "default": "./output.md",
      "examples": ["./output.md", "./docs/context.md"]
    },
    "ollama_endpoint": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?://.+",
      "title": "Ollama Endpoint URL",
      "description": "Local or remote Ollama server API base URL.",
      "markdownDescription": "Base URL of the **Ollama server** (e.g., `http://localhost:11434`). Required when AI summarization features are enabled.\n\n*Default:* `http://localhost:11434`",
      "default": "http://localhost:11434",
      "examples": [
        "http://localhost:11434",
        "http://127.0.0.1:11434",
        "https://ollama.internal.corp:11434"
      ]
    },
    "ollama_modelname": {
      "type": "string",
      "minLength": 1,
      "title": "Ollama Model Name",
      "description": "Ollama model identifier to use for analysis and summarization tasks.",
      "markdownDescription": "Identifier of the local **Ollama model** used for AST summarization and styling inference.\n\n*Default:* `gemma4`",
      "default": "gemma4",
      "examples": ["gemma4", "qwen2.5-coder:7b", "llama3.3:8b", "ornith"]
    },
    "tailwind_mode": {
      "type": "string",
      "title": "Tailwind CSS Pruning Mode",
      "description": "Strategy for pruning or summarizing Tailwind CSS / className strings to optimize token consumption.",
      "markdownDescription": "Strategy for pruning or condensing **Tailwind CSS utility classes** in JSX/TSX/HTML components to optimize LLM token usage:\n\n- `remove`: Strips static utility class strings exceeding `tailwind_threshold` while preserving dynamic expressions.\n- `remove_aggr`: Aggressively strips static class strings regardless of length.\n- `summarize`: Sends utility classes exceeding `tailwind_threshold` to Ollama for a 1-line semantic style summary.\n- `preserve`: Keeps all class names completely untouched.",
      "enum": ["remove", "remove_aggr", "summarize", "preserve"],
      "enumDescriptions": [
        "Strips static class strings exceeding threshold while keeping dynamic expressions.",
        "Aggressively removes class strings even if below character threshold.",
        "Sends class strings exceeding threshold to Ollama for 1-line style descriptions.",
        "Keeps classNames untouched."
      ],
      "markdownEnumDescriptions": [
        "**`remove`**: Strips static class strings exceeding `tailwind_threshold` while keeping dynamic expressions.",
        "**`remove_aggr`**: Aggressively removes class strings even if below character threshold.",
        "**`summarize`**: Sends class strings exceeding `tailwind_threshold` to Ollama for 1-line style descriptions.",
        "**`preserve`**: Keeps classNames completely untouched."
      ],
      "default": "remove"
    },
    "tailwind_threshold": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000,
      "title": "Tailwind Character Threshold",
      "description": "Character length threshold to trigger Tailwind pruning.",
      "markdownDescription": "Character length threshold for static `className` strings. If a class string exceeds this length, it is pruned or summarized based on `tailwind_mode`.\n\n*Default:* `96`",
      "default": 96,
      "examples": [64, 96, 128]
    },
    "summarize_functions": {
      "type": "boolean",
      "title": "Summarize Functions",
      "description": "Summarize function block bodies using local Ollama or fallback to JSDoc comments.",
      "markdownDescription": "When enabled, large function bodies are summarized using Ollama or extracted JSDoc comments, reducing AST token density.\n\n*Default:* `true`",
      "default": true
    },
    "summarize_functions_threshold": {
      "type": "integer",
      "minimum": 1,
      "maximum": 500,
      "title": "Function Summarization Line Threshold",
      "description": "Line count threshold to trigger function summarization.",
      "markdownDescription": "The minimum number of source lines a function must span to trigger LLM/JSDoc summarization.\n\n*Default:* `5`",
      "default": 5,
      "examples": [5, 10, 20]
    },
    "generate_route_table": {
      "type": "boolean",
      "title": "Generate Route Table",
      "description": "Extract and generate an API Route Table from Express, Fastify, Next.js, and NestJS source files.",
      "markdownDescription": "Scans ASTs to extract API routes (Express, Fastify, Next.js App/Pages router, NestJS) and outputs a markdown table.\n\n*Default:* `true`",
      "default": true
    },
    "analyze_react_components": {
      "type": "boolean",
      "title": "Analyze React Components",
      "description": "Analyze React and React Native components and output detailed explanations.",
      "markdownDescription": "Parses React and React Native components to document props contracts, hooks usage, and component hierarchy.\n\n*Default:* `true`",
      "default": true
    },
    "generate_file_graph": {
      "type": "boolean",
      "title": "Generate File Graph",
      "description": "Generate ASCII File Structure and Module Dependency Graph.",
      "markdownDescription": "Builds an ASCII directory tree along with an import/export module dependency graph.\n\n*Default:* `true`",
      "default": true
    }
  },
  "defaultSnippets": [
    {
      "label": "Complete Configuration",
      "description": "Production setup with AI summarization and full structural analysis enabled.",
      "body": {
        "\\$schema": "https://www.schemastore.org/urai-ecma.json",
        "input_project": "${1:./src}",
        "output_file": "${2:./output.md}",
        "ollama_endpoint": "http://localhost:11434",
        "ollama_modelname": "gemma4",
        "tailwind_mode": "remove",
        "tailwind_threshold": 96,
        "summarize_functions": true,
        "summarize_functions_threshold": 5,
        "generate_route_table": true,
        "analyze_react_components": true,
        "generate_file_graph": true
      }
    },
    {
      "label": "Minimal Configuration",
      "description": "Minimal configuration relying on standard defaults.",
      "body": {
        "\\$schema": "https://www.schemastore.org/urai-ecma.json",
        "input_project": "${1:./src}",
        "output_file": "${2:./output.md}"
      }
    }
  ]
}
