{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-create-table-request-schema.json",
  "title": "CreateTableRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-table-management-api-openapi.yml#/components/schemas/CreateTableRequest",
  "type": "object",
  "properties": {
    "tablespace_name": {
      "type": "string",
      "description": "Explicit tablespace policy for the new table, overriding namespace and database defaults.",
      "maxLength": 128
    },
    "storage": {
      "$ref": "#/$defs/TableStorageSettings"
    },
    "num_shards": {
      "type": "integer",
      "format": "uint",
      "description": "Number of shards to create for the table. Data is partitioned across shards based on key ranges.\n\n**Sizing Guidelines:**\n- Small datasets (<100K docs): 1-3 shards\n- Medium datasets (100K-1M docs): 3-10 shards\n- Large datasets (>1M docs): 10+ shards\n\nMore shards enable better parallelism but increase overhead. Choose based on expected data size and query patterns.\n\n**When to Add More Shards:**\n\nAntfly supports **online shard reallocation** without downtime. Add more shards when:\n- Individual shards exceed size thresholds (configurable)\n- Query latency increases due to large shard size\n- Need better parallelism for write-heavy workloads\n\nUse the internal `/reallocate` endpoint to trigger automatic shard splitting:\n```bash\nPOST /internal/v1/reallocate\n```\n\nThis enqueues a reallocation request that the leader processes asynchronously, splitting\nlarge shards and redistributing data without service interruption.\n\n**Advantages over Elasticsearch:**\n- Automatic shard splitting (no manual reindexing required)\n- Online operation (no downtime)\n- Transparent to applications (keys remain accessible during reallocation)\n"
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "description": "Optional human-readable description of the table and its purpose.\nUseful for documentation and team collaboration.\n"
    },
    "indexes": {
      "type": "object",
      "description": "Map of index name to create-index configuration. The map key owns the\nindex name; do not repeat `name` inside the configuration. Indexes enable\ndifferent query capabilities:\n- Full-text indexes for BM25 search\n- Vector indexes for semantic similarity\n- Multimodal indexes for images/audio/video\n\nYou can add multiple indexes to support different query patterns.\n",
      "additionalProperties": {
        "$ref": "#/$defs/CreateIndexRequest"
      }
    },
    "schema": {
      "description": "Optional schema definition specifying field types, primary key, and TTL configuration.\nWhile optional, defining a schema provides type safety, optimized indexing, and better search performance.\n\n**Schema Features:**\n- **Field Types**: Define document structure using JSON Schema with `x-antfly-types` extensions\n- **Document TTL**: Configure automatic expiration with a `ttl` policy\n- **Primary Keys**: Specify unique identifier fields\n- **Validation**: Enforce schema constraints on writes\n\n**TTL Example:**\n```json\n{\n  \"ttl\": {\"duration\": \"7d\", \"field\": \"_timestamp\"},\n  \"document_schemas\": {...}\n}\n```\n\nSee the Table Management documentation for comprehensive TTL configuration and use cases.\n",
      "$ref": "#/$defs/TableSchema"
    },
    "replication_sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReplicationSource"
      },
      "description": "PostgreSQL CDC replication sources. Streams INSERT/UPDATE/DELETE changes from\nPostgreSQL tables into this Antfly table via logical replication.\n\nMultiple sources can feed into a single table (e.g., `users` + `scores` → Antfly `users`).\nEach source uses `on_update`/`on_delete` transforms to control how PG events map to\nAntfly document operations. Requires `wal_level=logical` on the PostgreSQL source.\n"
    }
  },
  "$defs": {
    "AlgebraicAggregateConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "op"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "op": {
          "type": "string",
          "enum": [
            "count",
            "sum",
            "avg",
            "min",
            "max"
          ]
        },
        "group_by": {
          "type": "array",
          "maxItems": 32,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "measure": {
          "type": "string",
          "minLength": 1,
          "description": "Required except for count. Omitted count means COUNT(*); a supplied column means COUNT(column), excluding SQL NULL values."
        }
      }
    },
    "AlgebraicIndexConfig": {
      "type": "object",
      "description": "Schema-derived algebraic index capabilities with optional declarative aggregate recipes. Physical materialization state remains engine-owned.",
      "properties": {
        "derive_from_schema": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "When true, derive typed fields and capabilities from the table schema. Physical fields, laws, joins and state remain engine-owned."
        },
        "aggregates": {
          "type": "array",
          "maxItems": 64,
          "description": "Desired exact aggregate recipes over schema column names. Eligible SQL automatically reuses complete, snapshot-bound materializations; unsupported SQL shapes retain scanning.",
          "items": {
            "$ref": "#/$defs/AlgebraicAggregateConfig"
          }
        }
      }
    },
    "AntflyChunkerConfig": {
      "description": "Configuration for the Antfly inference chunking provider.\n\nAntfly inference is Antfly's built-in ML service for local chunking.\n\n**Chunking Models:**\n- fixed: Fixed-size chunking by token count, with fixed time windows for audio\n  (aliases `fixed_bert`, `fixed_bpe`, and `fixed-bert-tokenizer`). This is the\n  only chunking model Antfly inference implements; other model names are\n  rejected as unsupported.\n\n**Deduplication:**\n- Within a single document write, chunk results are deduplicated when multiple\n  indexes share the same source text and chunker configuration, so the source\n  is chunked at most once per write.\n",
      "allOf": [
        {
          "$ref": "#/$defs/ChunkOptions"
        },
        {
          "type": "object",
          "properties": {
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint (e.g., 'http://localhost:8080'). Can also be set via ANTFLY_INFERENCE_URL environment variable."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            }
          }
        }
      ]
    },
    "AntflyEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the Antfly inference embedding provider.\n\nAntfly inference is Antfly's built-in ML service for local embeddings using ONNX models.\n\n**Features:**\n- Local ONNX-based embedding generation\n- Query-time embeddings are served from an in-memory cache (64 MiB budget,\n  5-minute TTL by default) with concurrent identical requests coalesced onto\n  a single computation; there is no persistent on-disk cache tier\n\n**Example Models:** bge-base-en-v1.5 (768 dims), all-MiniLM-L6-v2 (384 dims)\n\nModels are loaded from the `models/embedders/{name}/` directory.",
      "properties": {
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Immutable EmbeddingGemma 2 asset and recipe identity returned by /embed. Pin this when indexing; a changed checkpoint, tokenizer, or processor rejects embedding before vector publication."
        },
        "provider": {
          "type": "string",
          "enum": [
            "antfly"
          ]
        },
        "model": {
          "type": "string",
          "description": "The embedding model name (maps to models/embedders/{name}/ directory)."
        },
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL environment variable."
        },
        "retrieval": {
          "$ref": "#/$defs/EmbeddingRetrievalConfig"
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AntflyGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Antfly inference generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the generator model."
        },
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL environment variable."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Inference API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AntflySTTConfig": {
      "type": "object",
      "required": [
        "model"
      ],
      "description": "Configuration for Antfly inference STT (Whisper, Wav2Vec2, HuBERT) provider.\n\nUses the Antfly inference service for speech-to-text inference.\n\n**Supported Models:** openai/whisper-tiny, openai/whisper-base, facebook/wav2vec2-base\n\n**Supported Formats:** WAV (recommended), MP3, FLAC, M4A/AAC\n\n**Docs:** See inference documentation",
      "properties": {
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "Inference API URL. Falls back to ANTFLY_INFERENCE_URL environment variable."
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "description": "Explicit Antfly transcriber model name (e.g., 'openai/whisper-tiny')."
        }
      }
    },
    "AnthropicGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Anthropic generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "anthropic"
          ]
        },
        "workspace_id": {
          "type": "string",
          "description": "Anthropic workspace for keys not scoped to a workspace. Defaults to ANTHROPIC_WORKSPACE_ID."
        },
        "model": {
          "type": "string",
          "description": "The full model ID of the Anthropic model to use.",
          "default": "claude-sonnet-4-5-20250929"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "Anthropic API key or secret reference. Defaults to ANTHROPIC_API_KEY."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Messages API base URL. Defaults to https://api.anthropic.com/v1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AppleGeneratorConfig": {
      "type": "object",
      "description": "On-device Apple Foundation Models generation. Requires a macOS Apple provider build, Apple Intelligence enabled, and its system model ready. Supports text conversations; tool calling and media attachments are not supported.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "apple"
          ]
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 256
        },
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        }
      }
    },
    "AppleSTTConfig": {
      "type": "object",
      "description": "On-device SpeechAnalyzer file transcription. Requires a macOS Apple provider build and supported Speech assets. Diarization is unsupported.",
      "properties": {
        "language_code": {
          "type": "string",
          "default": "en-US",
          "description": "Supported Speech locale; Apple transcription does not infer a language."
        },
        "timestamps": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true
        },
        "download_assets": {
          "type": "boolean",
          "default": false,
          "description": "Explicitly permit preparing and installing the selected Speech assets."
        }
      }
    },
    "ArtifactIndexSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Named generated artifact stream consumed by an index. Producer inputs belong on the matching enrichment.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Stable name of a generated artifact stream."
        }
      }
    },
    "AudioChunkOptions": {
      "type": "object",
      "description": "Options specific to audio chunking.",
      "properties": {
        "window_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Window duration in milliseconds for fixed-window audio chunking (default: 30000)."
        },
        "overlap_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Overlap duration in milliseconds between audio chunks (default: 0)."
        }
      }
    },
    "AutocompleteQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Analyzed bool-prefix search on a logical field. The planner selects\ndeclared search-as-you-type root, shingle and prefix representations.\nRequires a compatible representation; never silently becomes raw prefix search.\n",
      "required": [
        "autocomplete",
        "field"
      ],
      "properties": {
        "autocomplete": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "BedrockEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the AWS Bedrock embedding provider.\n\nUses the AWS credential chain: environment variables, web identity, shared credentials, ECS task roles, and EC2 instance roles.\n\n**Example Models:** cohere.embed-v4:0, amazon.titan-embed-text-v2:0\n\n**Docs:** https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "bedrock"
          ]
        },
        "model": {
          "type": "string",
          "description": "The Bedrock model ID, inference profile ID, or ARN to invoke (e.g., 'cohere.embed-v4:0', 'amazon.titan-embed-text-v2:0', or an application inference profile ARN)."
        },
        "request_format": {
          "type": "string",
          "enum": [
            "auto",
            "titan_text",
            "titan_multimodal",
            "cohere_v3",
            "cohere_v4"
          ],
          "description": "Bedrock provider request schema. `auto` recognizes direct foundation-model IDs,\nfoundation-model ARNs, and system inference-profile IDs/ARNs. Set this explicitly\nfor application inference profiles, provisioned throughput, custom models, and\nother aliases whose invocation target does not identify the underlying model.",
          "default": "auto"
        },
        "region": {
          "type": "string",
          "description": "The AWS region for the Bedrock service (e.g., 'us-east-1')."
        },
        "dimension": {
          "type": "integer",
          "description": "Output dimension for Bedrock embedding models that support configurable dimensions."
        },
        "dimensions": {
          "type": "integer",
          "description": "Alias for output dimension when using OpenAI-compatible configuration fields."
        },
        "input_type": {
          "type": "string",
          "description": "Cohere Bedrock input type, such as search_document, search_query, classification, or clustering."
        },
        "truncate": {
          "type": "string",
          "description": "Cohere Bedrock truncate behavior."
        },
        "strip_new_lines": {
          "type": "boolean",
          "description": "Whether to strip new lines from the input text before embedding.",
          "default": false
        },
        "batch_size": {
          "type": "integer",
          "description": "The batch size for embedding requests to optimize throughput.",
          "default": 1
        },
        "retrieval": {
          "$ref": "#/$defs/EmbeddingRetrievalConfig"
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "BedrockGeneratorConfig": {
      "type": "object",
      "description": "AWS Bedrock Converse generation, including image inputs and tools for\nmodels that support them. Uses the AWS default credential chain unless\nan explicit Bedrock API key is configured. Image capability is declared\nper target through inference_capabilities; model IDs are not allowlisted.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "bedrock"
          ]
        },
        "url": {
          "type": "string",
          "description": "Optional Bedrock Runtime endpoint override. Defaults to the regional AWS endpoint."
        },
        "api_key": {
          "type": "string",
          "description": "Optional Bedrock bearer API key or secret reference. Omit to use signed AWS requests and the default credential chain."
        },
        "model": {
          "type": "string",
          "description": "The Bedrock model ID to use."
        },
        "region": {
          "type": "string",
          "description": "AWS region. Defaults to AWS_REGION, then AWS_DEFAULT_REGION, then us-east-1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "BoolFieldQuery": {
      "type": "object",
      "properties": {
        "bool": {
          "type": "boolean"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "bool"
      ]
    },
    "BoolQuery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "bool"
      ],
      "description": "Canonical Boolean wrapper. Must clauses score; filter clauses constrain without scoring.",
      "properties": {
        "bool": {
          "$ref": "#/$defs/BoolQueryBody"
        }
      }
    },
    "BoolQueryBody": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "must": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "should": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "must_not": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "filter": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "minimum_should_match": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "description": "Minimum optional clauses required; omission follows the runtime's required-clause defaults."
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "BoolQueryClause": {
      "oneOf": [
        {
          "$ref": "#/$defs/Query"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        }
      ]
    },
    "BooleanQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "must": {
          "$ref": "#/$defs/ConjunctionQuery"
        },
        "should": {
          "$ref": "#/$defs/DisjunctionQuery"
        },
        "must_not": {
          "$ref": "#/$defs/DisjunctionQuery"
        },
        "filter": {
          "$ref": "#/$defs/Query"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "Boost": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "description": "A floating-point number used to decrease or increase the relevance scores of a query.",
      "default": 1.0
    },
    "ChatGPTGeneratorConfig": {
      "type": "object",
      "description": "Personal ChatGPT plan for interactive generation. Credentials stay in the local runtime.",
      "required": [
        "provider",
        "model",
        "connection_id"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "chatgpt"
          ]
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort"
        },
        "model": {
          "type": "string"
        },
        "connection_id": {
          "type": "string",
          "description": "Opaque personal registration owned by the authenticated caller."
        }
      }
    },
    "ChoiceDecisionQuestion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "name",
        "instructions",
        "choices"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "choice"
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "instructions": {
          "type": "string",
          "minLength": 1
        },
        "choices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DecisionChoice"
          },
          "minItems": 2,
          "maxItems": 64
        },
        "embedding_options": {
          "$ref": "#/$defs/EmbeddingDecisionAcceptance"
        }
      }
    },
    "ChunkDiarizationConfig": {
      "type": "object",
      "description": "Source-wide online speaker clustering on a fixed 1.5 s grid with 3 s embedding windows. Identities are stable within a source and recipe. Silence and ambiguous voices remain unassigned. Analysis advances incrementally; admitted cached timelines and durable centroid/sample-position checkpoints are shared across matching outputs and continuations. Missing checkpoints reconstruct the required prefix deterministically.",
      "properties": {
        "model": {
          "type": "string",
          "description": "Speaker ONNX registry reference; defaults to 3D-Speaker CAM++. For kind=diarize the target model selects the speaker model."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional SHA-256 pin of the speaker ONNX file, including when paired with a transcription model."
        },
        "similarity_threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.45
        },
        "ambiguity_margin": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.03
        },
        "min_rms": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.01
        },
        "max_speakers": {
          "type": "integer",
          "minimum": 1,
          "maximum": 64,
          "default": 64
        }
      }
    },
    "ChunkEmbeddingTarget": {
      "type": "object",
      "required": [
        "model"
      ],
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1
        },
        "model_identity": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional required embedding-weight/recipe identity; a changed model is rejected before delivery."
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "execute": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true,
          "description": "False resolves model limits and plans descriptors without running embedding inference."
        },
        "allow_partial": {
          "type": "boolean",
          "default": false,
          "description": "Return explicit per-chunk failures and gaps instead of aborting on the first non-retryable embedding failure."
        }
      }
    },
    "ChunkOptions": {
      "type": "object",
      "description": "Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults.",
      "properties": {
        "max_chunks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4096,
          "description": "Maximum chunks in one response; zero requests the full result. Model-aware responses return continuation coverage when a page is full: follow next_continuation until source_complete. Embedded model-aware enrichment uses this as its page size and continues through the entire source. Fixed chunking without model-aware outputs retains its per-call truncation behavior."
        },
        "threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence threshold for model-based chunking (0.0-1.0)."
        },
        "text": {
          "$ref": "#/$defs/TextChunkOptions"
        },
        "audio": {
          "$ref": "#/$defs/AudioChunkOptions"
        },
        "embedding": {
          "$ref": "#/$defs/ChunkEmbeddingTarget"
        },
        "outputs": {
          "$ref": "#/$defs/ChunkOutputs"
        },
        "policy": {
          "$ref": "#/$defs/MediaChunkPolicy"
        }
      }
    },
    "ChunkOutputTarget": {
      "type": "object",
      "required": [
        "name",
        "kind",
        "model"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "kind": {
          "type": "string",
          "enum": [
            "embedding",
            "transcribe",
            "classify",
            "diarize"
          ]
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "execute": {
          "type": "boolean",
          "default": true,
          "description": "False retains this model as a planning boundary while skipping its inference; used for independent output repairs."
        },
        "skip_windows": {
          "type": "array",
          "maxItems": 4096,
          "description": "Execution-only repair mask for already accepted sub-windows; does not affect the model recipe or boundary plan. Skipped windows return receipts with status skipped.",
          "items": {
            "type": "object",
            "required": [
              "ordinal",
              "sub_index"
            ],
            "properties": {
              "ordinal": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              },
              "sub_index": {
                "type": "integer",
                "format": "uint32",
                "minimum": 0
              }
            }
          }
        },
        "required": {
          "type": "boolean",
          "default": true
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "language": {
          "type": "string"
        },
        "diarize": {
          "type": "boolean",
          "default": false,
          "description": "Convenience option on transcription outputs; enables source-wide diarization with the default speaker model."
        },
        "diarization": {
          "description": "Speaker settings for diarize or transcribe outputs; also accepted on the selected audio embedding boundary with audio_speaker_turns=true.",
          "$ref": "#/$defs/ChunkDiarizationConfig"
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 5
        }
      }
    },
    "ChunkOutputs": {
      "type": "object",
      "required": [
        "boundary_model",
        "targets"
      ],
      "description": "Named independent media outputs. The named boundary model alone determines the shared plan; adding or changing another output preserves parent IDs. The compatibility embedding target is named embedding. Smaller output windows are identified by the parent ordinal and sub_index.",
      "properties": {
        "boundary_model": {
          "type": "string",
          "minLength": 1
        },
        "targets": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/ChunkOutputTarget"
          }
        }
      }
    },
    "ChunkerConfig": {
      "description": "A unified configuration for a chunking provider.",
      "allOf": [
        {
          "$ref": "#/$defs/AntflyChunkerConfig"
        },
        {
          "type": "object",
          "properties": {
            "provider": {
              "$ref": "#/$defs/ChunkerProvider"
            },
            "store_chunks": {
              "x-go-type-skip-optional-pointer": true,
              "type": "boolean",
              "description": "Controls whether chunk data is persisted to storage. When false (default), fixed chunks are generated in memory and only embeddings are stored. Model-aware streams always retain descriptor recipes; false omits their payloads. When true, chunk payloads are also stored. Vectors remain in the embedding artifact family.",
              "default": false
            },
            "full_text_index": {
              "x-go-type-skip-optional-pointer": true,
              "type": "object",
              "description": "Configuration for full-text indexing of chunks.\nWhen present (even if empty), chunk artifacts are persisted and indexed in Antfly's native full-text index, queryable and projectable via the document's `_chunks` field.\nWhen absent, chunks are generated only to drive vector embeddings and are not indexed for full-text search (unless `store_chunks` is also set).\n",
              "additionalProperties": true
            },
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            },
            "max_chunks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4096,
              "description": "Maximum chunks per invocation. Model-aware enrichment treats this as a page size and resumes until source completion; zero selects the worker page size. Fixed chunking retains its per-document cap, with zero meaning unlimited."
            },
            "threshold": {
              "type": "number",
              "format": "float",
              "minimum": 0,
              "maximum": 1
            },
            "text": {
              "$ref": "#/$defs/TextChunkOptions"
            },
            "audio": {
              "$ref": "#/$defs/AudioChunkOptions"
            },
            "embedding": {
              "$ref": "#/$defs/ChunkEmbeddingTarget"
            },
            "outputs": {
              "$ref": "#/$defs/ChunkOutputs"
            },
            "policy": {
              "$ref": "#/$defs/MediaChunkPolicy"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "ChunkerProvider": {
      "type": "string",
      "enum": [
        "mock",
        "antfly"
      ],
      "description": "The chunking provider to use."
    },
    "CloudflareEmbedderConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI embedding. Uses CLOUDFLARE_API_TOKEN or an Antfly secret reference.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "gateway_id": {
          "type": "string",
          "minLength": 1,
          "description": "Optional AI Gateway ID, sent through cf-aig-gateway-id."
        },
        "model": {
          "type": "string",
          "default": "@cf/baai/bge-base-en-v1.5"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "url": {
          "type": "string",
          "description": "Optional deployment-owned endpoint override."
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1,
          "description": "Expected fixed model output dimension; the adapter validates returned vectors and never requests unsupported resizing."
        },
        "dimension": {
          "type": "integer",
          "minimum": 1,
          "description": "Alias of dimensions."
        }
      },
      "required": [
        "provider",
        "account_id",
        "model"
      ]
    },
    "CloudflareGeneratorConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI generation. Uses CLOUDFLARE_API_TOKEN or an Antfly secret reference.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "gateway_id": {
          "type": "string",
          "minLength": 1,
          "description": "Optional AI Gateway ID, sent through cf-aig-gateway-id."
        },
        "model": {
          "type": "string",
          "default": "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "url": {
          "type": "string",
          "description": "Optional deployment-owned endpoint override."
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 2
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        }
      },
      "required": [
        "provider",
        "account_id",
        "model"
      ]
    },
    "CloudflareSTTConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI native speech adapter. Credentials use CLOUDFLARE_API_TOKEN.",
      "required": [
        "provider",
        "account_id",
        "model"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string"
        },
        "gateway_id": {
          "type": "string"
        },
        "model": {
          "type": "string",
          "default": "@cf/openai/whisper-large-v3-turbo"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "base_url": {
          "type": "string",
          "description": "Optional deployment-owned full native endpoint override."
        },
        "language_code": {
          "type": "string"
        },
        "voice": {
          "type": "string"
        }
      }
    },
    "CohereEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the Cohere embedding provider.\n\nAPI key via `api_key` field or `COHERE_API_KEY` environment variable.\n\n**Example Models:** embed-english-v3.0 (default, 1024 dims), embed-multilingual-v3.0\n\n**Docs:** https://docs.cohere.com/reference/embed",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cohere"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Cohere embedding model to use.",
          "default": "embed-english-v3.0"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The Cohere API key. Can also be set via COHERE_API_KEY environment variable."
        },
        "input_type": {
          "type": "string",
          "deprecated": true,
          "description": "Legacy fixed input type applied to every embedding operation. When omitted,\nAntfly derives `search_query` for semantic searches and `search_document`\nfor indexed documents. Prefer the role-specific fields under `retrieval`.",
          "enum": [
            "search_document",
            "search_query",
            "classification",
            "clustering"
          ]
        },
        "truncate": {
          "type": "string",
          "description": "How to handle inputs longer than the max token length.",
          "enum": [
            "NONE",
            "START",
            "END"
          ],
          "default": "END"
        },
        "retrieval": {
          "$ref": "#/$defs/EmbeddingRetrievalConfig"
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "ConjunctionQuery": {
      "type": "object",
      "properties": {
        "conjuncts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "conjuncts"
      ]
    },
    "ConstrainedGenerationBatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "max_items_per_call": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 8
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 65536
        }
      }
    },
    "ConstrainedGeneratorProducerConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "generator",
        "output_schema"
      ],
      "properties": {
        "generator": {
          "$ref": "#/$defs/GeneratorConfig"
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output_schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON schema enforced before artifact publication. Unsupported schema vocabulary fails admission. Invalid or missing batch items receive one validation retry; successful siblings are retained."
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        }
      }
    },
    "ConstrainedOutput": {
      "type": "string",
      "enum": [
        "auto",
        "tool_call",
        "json_schema",
        "grammar"
      ],
      "default": "auto",
      "description": "Provider and model admission selects a supported constrained mechanism. Auto prefers forced tools, then provider JSON schema, then native grammar. Free-text parsing is not a mode."
    },
    "ConstrainedProbabilities": {
      "type": "string",
      "enum": [
        "token_logprobs",
        "verdict_only"
      ],
      "default": "token_logprobs",
      "description": "Token probabilities require complete decoder evidence for the allowed values. Verdict-only is explicit opt-in; model-reported confidence is never used."
    },
    "ContainsQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Contiguous substring search on the original logical field value, including whitespace and punctuation.\nNo normalization is applied. Case-sensitive by default; case_sensitive=false\nuses Unicode simple case folding, not locale-specific or multi-character folding.\nMissing, null, and non-string values do not match. Arrays use any-element\nsemantics; a match never spans array elements. Indexes select conservative\ncandidates and original values are verified before counting and pagination.\n",
      "required": [
        "contains",
        "field"
      ],
      "properties": {
        "contains": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Logical source field path, not a companion index name."
        },
        "case_sensitive": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "CreateAlgebraicIndexRequest": {
      "description": "Create a schema-derived algebraic index.",
      "allOf": [
        {
          "$ref": "#/$defs/CreateIndexCommon"
        },
        {
          "$ref": "#/$defs/AlgebraicIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "algebraic"
              ]
            }
          }
        }
      ]
    },
    "CreateEmbeddingsIndexRequest": {
      "description": "Create a dense or sparse embeddings index.",
      "allOf": [
        {
          "$ref": "#/$defs/CreateIndexCommon"
        },
        {
          "$ref": "#/$defs/EmbeddingsIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "embeddings"
              ]
            }
          }
        }
      ]
    },
    "CreateFullTextIndexRequest": {
      "description": "Create a full-text index.",
      "allOf": [
        {
          "$ref": "#/$defs/CreateIndexCommon"
        },
        {
          "$ref": "#/$defs/FullTextIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "full_text"
              ]
            }
          }
        }
      ]
    },
    "CreateGraphIndexRequest": {
      "description": "Create a graph index.",
      "allOf": [
        {
          "$ref": "#/$defs/CreateIndexCommon"
        },
        {
          "$ref": "#/$defs/GraphIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "graph"
              ]
            }
          }
        }
      ]
    },
    "CreateIndexCommon": {
      "type": "object",
      "description": "Fields shared by every create-index variant. The index name is owned by the request path.",
      "properties": {
        "description": {
          "type": "string",
          "description": "Optional description of the index and its purpose"
        },
        "version": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "default": 0,
          "description": "Version of the index implementation. Defaults to 0."
        },
        "enrichments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EnrichmentConfig"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Inline managed enrichment definitions required by this index."
        }
      }
    },
    "CreateIndexRequest": {
      "description": "Type-safe configuration for a new index. The index name is owned by the request path.",
      "x-antfly-sdk-alternative": {
        "description": "SDK builders also accept the named IndexConfig form and convert it to this path-identified request. This is an alternative construction API, not a deprecated wire request.",
        "schema": {
          "$ref": "#/$defs/IndexConfig"
        }
      },
      "oneOf": [
        {
          "$ref": "#/$defs/CreateFullTextIndexRequest"
        },
        {
          "$ref": "#/$defs/CreateEmbeddingsIndexRequest"
        },
        {
          "$ref": "#/$defs/CreateGraphIndexRequest"
        },
        {
          "$ref": "#/$defs/CreateAlgebraicIndexRequest"
        },
        {
          "$ref": "#/$defs/CreateRelationalIndexRequest"
        }
      ]
    },
    "CreateRelationalIndexRequest": {
      "description": "Create a composite ordered index through the shared index resource.",
      "allOf": [
        {
          "$ref": "#/$defs/RelationalIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "description": {
              "type": "string",
              "description": "Optional description of the index and its purpose."
            },
            "version": {
              "type": "integer",
              "default": 0,
              "minimum": 0,
              "maximum": 0,
              "x-go-type-skip-optional-pointer": true,
              "description": "Index implementation version. Only zero is supported; the schema epoch is managed by the server."
            },
            "type": {
              "type": "string",
              "enum": [
                "relational"
              ]
            }
          }
        }
      ]
    },
    "DateRangeStringQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": false
        },
        "end": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_start": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_end": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "datetime_parser": {
          "type": "string"
        }
      }
    },
    "DeciderConfig": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly",
            "jev",
            "openai",
            "cloudflare"
          ]
        },
        "decision_method": {
          "type": "string",
          "enum": [
            "typed",
            "embedding_similarity",
            "generated"
          ],
          "default": "typed",
          "description": "Explicit result contract. embedding_similarity is available with Antfly EmbeddingGemma 2 choice and multi_choice questions; rejects score and predicate requests and returns raw cosine similarities."
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig",
          "description": "Required with decision_method=generated. Provider configuration belongs here rather than in the outer typed-decider fields."
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "probabilities": {
          "$ref": "#/$defs/ConstrainedProbabilities"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        },
        "model": {
          "type": "string",
          "description": "Required for Antfly, OpenAI, and Cloudflare; Jev defaults to jev-latest. Cloudflare uses @cf/cloudflare/clef or @cf/cloudflare/clef-flash."
        },
        "account_id": {
          "type": "string",
          "description": "Required with the cloudflare provider; Workers AI account identifier."
        },
        "gateway_id": {
          "type": "string",
          "description": "Optional Cloudflare AI Gateway identifier."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Pin the exact EmbeddingGemma 2 assets and recipe. Requires embedding_similarity."
        },
        "embedder": {
          "type": "string",
          "minLength": 1,
          "description": "Named dense embedder for provider-neutral embedding_similarity routing. Specify matching embedding_options.dimensions. Native fitted calibrations require the original Antfly model path; hosted routes use explicit thresholds and estimated token admission."
        },
        "embedding_options": {
          "type": "object",
          "additionalProperties": false,
          "description": "Geometry and acceptance defaults for embedding_similarity decisions. Named embedders require dimensions matching their configured dense output. Direct Antfly model routes support EmbeddingGemma 2 dimensions and fitted calibrations. Acceptance is serialized onto each question and can be overridden per question. Raw cosine similarities never represent probabilities.",
          "properties": {
            "calibration_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$",
              "description": "Qualified fitted raw thresholds in model/calibrations/{id}.json. Bound to the exact asset identity, task, renderer, dimensions and category prototypes; mutually exclusive with manual thresholds. Does not produce probabilities."
            },
            "task_type": {
              "type": "string",
              "enum": [
                "CLUSTERING",
                "CLASSIFICATION"
              ],
              "default": "CLUSTERING"
            },
            "dimensions": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535,
              "default": 768,
              "description": "Must match the named embedder's configured dimensions. Without embedder, the direct EmbeddingGemma 2 route accepts only 768, 512, 256 or 128."
            },
            "min_similarity": {
              "type": "number",
              "minimum": -1,
              "maximum": 1
            },
            "min_margin": {
              "type": "number",
              "minimum": 0,
              "maximum": 2
            }
          }
        },
        "url": {
          "type": "string",
          "description": "Provider base URL; endpoint path is selected by provider. OpenAI defaults to https://api.openai.com/v1 and appends /decisions."
        },
        "api_key": {
          "type": "string",
          "description": "API key or secret reference. Defaults to the provider environment variable."
        },
        "max_rows": {
          "type": "integer",
          "minimum": 1,
          "default": 10000
        },
        "max_input_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 1000000
        },
        "max_image_input_tokens": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Provider/model upper bound on the input-token contribution of one image. Required when sending images through typed hosted or generated deciders, including native generators and image URLs. The runtime reserves this allowance per image in addition to serialized non-image request bytes; actual usage can add shared quota debt. Generated deciders apply the allowance to the selected generator's shared quota. Omit for text-only deciders."
        },
        "rate_limit": {
          "$ref": "#/$defs/RateLimitConfig"
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 32
        }
      }
    },
    "DecisionChoice": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "description": "Local decision models use string choice identifiers. Embedding category examples replace the description with their normalized centroid; trained models reject examples."
    },
    "DerivedCoveragePolicy": {
      "type": "string",
      "enum": [
        "strict",
        "partial",
        "best_effort"
      ],
      "default": "strict",
      "description": "How generation-scoped source outcomes determine derived-index completeness."
    },
    "DisjunctionQuery": {
      "type": "object",
      "properties": {
        "disjuncts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "min": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false,
          "description": "Minimum number of disjuncts that must match. Omit for conventional disjunction semantics; set to 0 to make a pure disjunction optional."
        }
      },
      "required": [
        "disjuncts"
      ]
    },
    "DistanceMetric": {
      "x-go-type-skip-optional-pointer": true,
      "type": "string",
      "enum": [
        "l2_squared",
        "inner_product",
        "cosine"
      ],
      "default": "l2_squared",
      "description": "Distance metric for the vector index (dense only). Use \"cosine\" for models trained with cosine similarity (e.g. CLIP, OpenAI). Use \"inner_product\" for models trained with dot product similarity. Use \"l2_squared\" for models trained with Euclidean distance. The default is \"l2_squared\"."
    },
    "DocIdQuery": {
      "type": "object",
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "ids"
      ]
    },
    "DocumentExtractionConfig": {
      "type": "object",
      "description": "Configuration for the `document_extraction` producer. It downloads the source URL and persists derived units such as PDF pages, sections, images, and audio.\n\nNative text (PDF text layers, Office documents, HTML, email, plain text) is extracted with no model. Scanned pages and images are read only when `ocr` names a reader or generator, and audio is transcribed only when `transcription` names a transcriber. Units that need a producer that is not configured report `extraction_status` `ocr_not_configured` or `transcription_not_configured`.\n\n**Example:**\n```json\n{\n  \"source\": {\"filename_field\": \"filename\", \"content_type_field\": \"mime_type\"},\n  \"ocr\": {\"reader\": {\"provider\": \"antfly\", \"model\": \"lightonai/LightOnOCR-3-0.8B\"}},\n  \"transcription\": {\"transcriber\": {\"provider\": \"antfly\", \"model\": \"openai/whisper-small\"}}\n}\n```",
      "properties": {
        "source": {
          "$ref": "#/$defs/DocumentExtractionSourceConfig"
        },
        "filename": {
          "type": "string",
          "description": "Static filename used for content detection when the row has none."
        },
        "content_type": {
          "type": "string",
          "description": "Static content type. Overrides the downloaded response's content type."
        },
        "etag": {
          "type": "string",
          "description": "Static ETag recorded as source version metadata."
        },
        "checksum": {
          "type": "string",
          "description": "Static checksum recorded as source version metadata."
        },
        "version": {
          "type": "string",
          "description": "Static source version. Together with the other metadata it lets extraction skip unchanged sources."
        },
        "last_modified": {
          "type": "string",
          "description": "Static last-modified timestamp recorded as source version metadata."
        },
        "credentials": {
          "type": "string",
          "description": "Credential reference used to download the source URL."
        },
        "html_strip_tags": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true,
          "description": "Strip HTML markup from HTML sources before storing their text."
        },
        "ocr": {
          "$ref": "#/$defs/DocumentExtractionOcrConfig"
        },
        "transcription": {
          "$ref": "#/$defs/DocumentExtractionTranscriptionConfig"
        },
        "route_preset": {
          "type": "string",
          "enum": [
            "mixed_files",
            "explicit_only"
          ],
          "default": "mixed_files",
          "description": "How sources that match no explicit route are handled. `mixed_files` (alias `default`) detects PDFs, HTML, email, Office documents, ZIP archives, images, audio, and text. `explicit_only` (alias `none`) records unmatched sources as unsupported. Detection never requests a producer: detected images and audio without a configured producer report `ocr_not_configured` or `transcription_not_configured`."
        },
        "routes": {
          "type": "array",
          "description": "Routes evaluated in order before the preset. The first route whose match applies selects the extractor.",
          "items": {
            "$ref": "#/$defs/DocumentExtractionRoute"
          }
        }
      }
    },
    "DocumentExtractionOcrConfig": {
      "type": "object",
      "description": "Reads scanned pages and images. Name exactly one of `reader` or `generator`. Readers run their own OCR task; generators receive a transcription instruction.",
      "x-antfly-exactly-one-of": [
        "reader",
        "generator"
      ],
      "properties": {
        "reader": {
          "$ref": "#/$defs/DocumentExtractionReaderConfig"
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig"
        },
        "mode": {
          "type": "string",
          "enum": [
            "auto",
            "always"
          ],
          "default": "auto",
          "description": "`auto` reads PDF pages whose native text fails the `quality` checks, and images. `always` reads every page."
        },
        "prompt": {
          "type": "string",
          "description": "Overrides the OCR prompt. Omit it to let the reader run its own OCR task. Apple readers reject prompts."
        },
        "render": {
          "$ref": "#/$defs/DocumentExtractionRenderConfig"
        },
        "quality": {
          "$ref": "#/$defs/DocumentExtractionOcrQualityConfig"
        }
      }
    },
    "DocumentExtractionOcrQualityConfig": {
      "type": "object",
      "description": "Thresholds that decide when a PDF page's native text is too poor to keep, in `auto` mode.",
      "properties": {
        "min_content_chars": {
          "type": "integer",
          "x-go-type-skip-optional-pointer": false,
          "minimum": 0,
          "default": 50,
          "description": "Pages with fewer meaningful characters are read with OCR."
        },
        "garbled_min_words": {
          "type": "integer",
          "x-go-type-skip-optional-pointer": false,
          "minimum": 0,
          "default": 20,
          "description": "Minimum words before the garbled-text check applies."
        },
        "garbled_sample_words": {
          "type": "integer",
          "minimum": 1,
          "default": 50,
          "description": "Words sampled by the garbled-text check."
        },
        "max_single_char_word_ratio": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.4,
          "description": "Maximum ratio of single-character words before text counts as garbled."
        },
        "substantial_line_min_chars": {
          "type": "integer",
          "minimum": 1,
          "default": 15,
          "description": "Minimum characters for a line to count in the corrupted-line check."
        },
        "max_corrupted_line_ratio": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.2,
          "description": "Maximum ratio of corrupted lines."
        },
        "font_corruption_score_threshold": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.5,
          "description": "Font corruption score at which text is replaced by OCR."
        },
        "max_replacement_char_ratio": {
          "type": "number",
          "x-go-type-skip-optional-pointer": false,
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "default": 0.05,
          "description": "Maximum ratio of Unicode replacement characters."
        }
      }
    },
    "DocumentExtractionReaderConfig": {
      "type": "object",
      "required": [
        "provider"
      ],
      "description": "Reader provider for OCR. Every provider except `apple` requires `model`; Apple uses Vision text recognition and accepts no model, credentials, or prompt.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly",
            "openai",
            "cloudflare",
            "vertex",
            "apple"
          ]
        },
        "model": {
          "type": "string",
          "description": "Reader model, such as `lightonai/LightOnOCR-3-0.8B`."
        },
        "prompt": {
          "type": "string",
          "description": "Provider-level prompt. Hosted readers send their own read instruction when it is omitted."
        },
        "max_tokens": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Maximum output tokens per page."
        },
        "api_url": {
          "type": "string",
          "description": "Reader endpoint URL."
        },
        "url": {
          "type": "string",
          "description": "Reader endpoint URL; takes precedence over `api_url`."
        },
        "base_url": {
          "type": "string",
          "description": "Provider API base URL."
        },
        "api_key": {
          "type": "string",
          "description": "API key, normally a `${secret:...}` reference."
        },
        "bearer_token": {
          "type": "string",
          "description": "Bearer token, normally a `${secret:...}` reference."
        },
        "capability_token": {
          "type": "string",
          "description": "Capability token for an Antfly inference endpoint."
        },
        "capability_revision": {
          "type": "string",
          "description": "Revision of the capability token."
        },
        "account_id": {
          "type": "string",
          "description": "Cloudflare account ID. Required for `cloudflare`."
        },
        "gateway_id": {
          "type": "string",
          "description": "Cloudflare AI Gateway ID."
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project for `vertex`."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud location for `vertex`."
        },
        "credentials_path": {
          "type": "string",
          "description": "Path to Google Cloud credentials for `vertex`."
        },
        "recognition_languages": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "type": "string"
          },
          "description": "Apple Vision recognition languages. Defaults to `en-US`."
        },
        "recognition_level": {
          "type": "string",
          "enum": [
            "accurate",
            "fast"
          ],
          "default": "accurate",
          "description": "Apple Vision recognition level."
        },
        "uses_language_correction": {
          "type": "boolean",
          "default": false,
          "description": "Apple Vision language correction."
        }
      }
    },
    "DocumentExtractionRenderConfig": {
      "type": "object",
      "description": "How PDF pages are rasterized for OCR.",
      "properties": {
        "dpi": {
          "type": "integer",
          "minimum": 72,
          "maximum": 600,
          "default": 150,
          "description": "Render resolution in dots per inch."
        },
        "resolution": {
          "type": "string",
          "enum": [
            "requested_dpi",
            "model_input"
          ],
          "default": "requested_dpi",
          "description": "`requested_dpi` renders at `dpi` within the caps. `model_input` renders near the model's preferred input size."
        },
        "max_pixels": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 100000000,
          "default": 40000000,
          "description": "Maximum pixels per rendered page."
        },
        "max_dimension": {
          "type": "integer",
          "minimum": 512,
          "maximum": 16384,
          "default": 4096,
          "description": "Maximum width or height of a rendered page."
        }
      }
    },
    "DocumentExtractionRoute": {
      "type": "object",
      "required": [
        "extractor"
      ],
      "properties": {
        "match": {
          "$ref": "#/$defs/DocumentExtractionRouteMatch"
        },
        "extractor": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "pdf",
                "html",
                "text",
                "email",
                "docx",
                "pptx",
                "xlsx",
                "archive",
                "ocr",
                "image",
                "audio",
                "transcript",
                "unsupported"
              ],
              "description": "Extractor for matching sources. `image` is an alias of `ocr` and `transcript` of `audio`. An `ocr` route requires an `ocr` block and an `audio` route requires a `transcription` block; otherwise the configuration is rejected with `DocumentExtractionModelRequired`."
            },
            "unit": {
              "type": "string",
              "description": "Unit type recorded for the extracted units, such as `page` or `transcript_segment`."
            }
          }
        }
      }
    },
    "DocumentExtractionRouteMatch": {
      "type": "object",
      "description": "Conditions a source must meet. Every condition given must match.",
      "properties": {
        "content_type": {
          "type": "string",
          "description": "Exact content type."
        },
        "content_type_prefix": {
          "type": "string",
          "description": "Content type prefix, such as `image/`."
        },
        "extension": {
          "description": "Filename extension or list of extensions.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "magic_prefix": {
          "description": "Leading bytes or list of leading-byte prefixes.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      }
    },
    "DocumentExtractionSourceConfig": {
      "type": "object",
      "description": "Names of row fields that carry source metadata. Each overrides the matching static field.",
      "properties": {
        "filename_field": {
          "type": "string",
          "description": "Row field holding the source filename."
        },
        "content_type_field": {
          "type": "string",
          "description": "Row field holding the source content type."
        },
        "etag_field": {
          "type": "string",
          "description": "Row field holding the source ETag."
        },
        "checksum_field": {
          "type": "string",
          "description": "Row field holding the source checksum."
        },
        "version_field": {
          "type": "string",
          "description": "Row field holding the source version."
        },
        "last_modified_field": {
          "type": "string",
          "description": "Row field holding the source last-modified timestamp."
        }
      }
    },
    "DocumentExtractionTranscriptionConfig": {
      "type": "object",
      "required": [
        "transcriber"
      ],
      "description": "Transcribes audio units.",
      "properties": {
        "transcriber": {
          "$ref": "#/$defs/STTConfig"
        }
      }
    },
    "DocumentFieldMapping": {
      "type": "object",
      "additionalProperties": false,
      "description": "Executable physical mapping used by a document property's `x-antfly-field` annotation. The mapping must accept the JSON Schema value type. Declarations for the same dotted path across document types must normalize to an identical physical mapping, and present values that cannot be encoded are rejected at write admission. Mappings contributed by `anyOf` or `oneOf` must normalize to the same mapping in every alternative; conditional and dynamically named mappings are rejected.",
      "properties": {
        "type": {
          "$ref": "#/$defs/FieldMappingType"
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name for text-oriented mappings."
        },
        "index": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "description": "Whether to index the field. Omit to use the server default of true."
        },
        "store": {
          "type": "boolean",
          "default": false,
          "description": "Whether to store the field value (default false)"
        },
        "include_in_all": {
          "type": "boolean",
          "default": false,
          "description": "Whether to include in the _all field for cross-field search"
        },
        "sortable": {
          "type": "boolean",
          "default": false,
          "description": "Whether this exact scalar field can be used in order_by. Supported\nsortable mapping types are keyword, numeric/number/integer,\nboolean/bool, datetime/date/timestamp, and link. Analyzed text,\nsearch_as_you_type, geo, embedding, blob, html, object, and array\nfields are not directly sortable; use an exact scalar subfield such\nas title.keyword for sorted string pagination. Antfly derives the\nrequired typed doc values when enabled.\n"
        },
        "missing_null_policy": {
          "type": "string",
          "enum": [
            "missing_rejected",
            "nulls_ordered"
          ],
          "default": "missing_rejected",
          "description": "Missing/null sort policy. The default missing_rejected rejects missing or null native sort values. Opt in to nulls_ordered for nulls first ascending and last descending, with JSON null cursor components. Nullable native layouts require a complete producer proof."
        },
        "fields": {
          "type": "object",
          "description": "Named one-level multifields emitted from this property's value. For example, a text title can expose a sortable keyword subfield.",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentSubfieldMapping"
          }
        }
      }
    },
    "DocumentSchema": {
      "type": "object",
      "description": "Defines the structure of a document type",
      "properties": {
        "description": {
          "type": "string",
          "description": "A description of the document type."
        },
        "schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "A valid JSON Schema defining the document's structure.\nThis is used to infer indexing rules and field types.\n",
          "x-antfly-field-mapping-schema": {
            "$ref": "#/$defs/DocumentFieldMapping"
          },
          "x-antfly-sql-type-schema": {
            "$ref": "#/$defs/SQLBuiltinType"
          },
          "x-antfly-sql-numeric-modifier-schema": {
            "$ref": "#/$defs/SQLNumericModifier"
          },
          "x-antfly-sql-array-column-schema": {
            "$ref": "#/$defs/SQLArrayColumnSchema"
          }
        }
      }
    },
    "DocumentSubfieldMapping": {
      "type": "object",
      "additionalProperties": false,
      "description": "Mapping for one named multifield emitted from its parent document property. Multifields are intentionally one level deep and read the parent property's JSON value rather than a nested JSON property.",
      "properties": {
        "type": {
          "$ref": "#/$defs/FieldMappingType"
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name for text-oriented mappings."
        },
        "index": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "description": "Whether to index the field. Omit to use the server default of true."
        },
        "store": {
          "type": "boolean",
          "default": false,
          "description": "Whether to store the field value (default false)"
        },
        "include_in_all": {
          "type": "boolean",
          "default": false,
          "description": "Whether to include in the _all field for cross-field search"
        },
        "sortable": {
          "type": "boolean",
          "default": false,
          "description": "Whether this exact scalar subfield can be used in order_by. Antfly derives the required typed doc values when enabled."
        },
        "missing_null_policy": {
          "type": "string",
          "enum": [
            "missing_rejected",
            "nulls_ordered"
          ],
          "default": "missing_rejected",
          "description": "Missing/null sort policy. The default missing_rejected rejects missing or null native sort values. Opt in to nulls_ordered for nulls first ascending and last descending, with JSON null cursor components. Nullable native layouts require a complete producer proof."
        }
      }
    },
    "DynamicTemplate": {
      "type": "object",
      "additionalProperties": false,
      "description": "A rule for mapping dynamically detected fields. Templates are checked in order\nand the first matching template's mapping is used.\n",
      "properties": {
        "name": {
          "type": "string",
          "description": "Optional identifier for the template (useful for debugging)"
        },
        "match": {
          "type": "string",
          "description": "Glob pattern for field name (last path element).\nSupports * and ** wildcards. Example: \"*_text\" matches \"title_text\", \"body_text\"\n"
        },
        "unmatch": {
          "type": "string",
          "description": "Exclusion pattern for field name. If it matches, the template is skipped.\nExample: \"skip_*\" would exclude fields like \"skip_this\"\n"
        },
        "path_match": {
          "type": "string",
          "description": "Glob pattern for the full dotted path. Supports ** for matching multiple segments.\nExample: \"metadata.**\" matches \"metadata.author\", \"metadata.tags.primary\"\n"
        },
        "path_unmatch": {
          "type": "string",
          "description": "Path exclusion pattern. If it matches the full path, the template is skipped."
        },
        "match_mapping_type": {
          "type": "string",
          "enum": [
            "string",
            "number",
            "boolean",
            "date",
            "object"
          ],
          "description": "Filter by detected JSON type"
        },
        "mapping": {
          "$ref": "#/$defs/TemplateFieldMapping"
        }
      }
    },
    "EdgeTypeConfig": {
      "type": "object",
      "description": "Configuration for a specific edge type",
      "properties": {
        "name": {
          "$ref": "#/$defs/GraphEdgeType"
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Document field containing target node key(s) for automatic edge creation.\nSupports string (single target) or array of strings (multiple targets).\nWhen omitted, edges must be provided explicitly via _edges.\n"
        },
        "topology": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "tree",
            "graph"
          ],
          "default": "graph",
          "description": "Topology constraint for this edge type:\n- tree: Single parent per node, no cycles\n- graph: No constraints (default)\n"
        }
      },
      "required": [
        "name"
      ]
    },
    "EmbeddingDecisionAcceptance": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "calibration_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$",
          "description": "Public API identifier for a server-side fitted threshold artifact at model/calibrations/{id}.json. The server verifies qualification and the exact asset identity, prompt profile, dimensions, renderer and this question's label/prototype set. Mutually exclusive with manual thresholds; never produces probabilities."
        },
        "min_similarity": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "For a single choice, abstain when the highest cosine similarity is below this value. It is a similarity threshold, not an accuracy or probability estimate."
        },
        "min_margin": {
          "type": "number",
          "minimum": 0,
          "maximum": 2,
          "description": "For a single choice, require this gap between the highest and second-highest cosine similarities. For multi_choice, require every score to be at least this distance from its own selection threshold; otherwise abstain."
        }
      },
      "description": "Question-specific acceptance policy for embedding similarity. Trained decision models reject it."
    },
    "EmbeddingRetrievalConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Advanced retrieval-role overrides. Antfly assigns canonical task intent\nautomatically: semantic-search inputs are `RETRIEVAL_QUERY`, while index\nand artifact writes are `RETRIEVAL_DOCUMENT`. These fields only override\nhow a provider or instruction-aware model represents that intent.",
      "properties": {
        "query_input_type": {
          "type": "string",
          "description": "Provider-specific query role, such as `search_query` for Cohere.\nWhen omitted, the provider adapter derives it from\n`RETRIEVAL_QUERY`."
        },
        "document_input_type": {
          "type": "string",
          "description": "Provider-specific document role, such as `search_document` for\nCohere. When omitted, the provider adapter derives it from\n`RETRIEVAL_DOCUMENT`."
        },
        "query_instruction": {
          "type": "string",
          "description": "Optional instruction sent only with retrieval-query embeddings by\ninstruction-aware Antfly inference models. Provider adapters that\ndo not support free-form instructions reject this field."
        }
      }
    },
    "EmbeddingsIndexConfig": {
      "type": "object",
      "description": "Unified configuration for embeddings indexes. When sparse is true, creates a sparse vector index (SPLADE inverted index). When sparse is false (default), creates a dense HBC vector index. For dense indexes, dimension can be omitted if an embedder is configured — it will be auto-detected.",
      "x-antfly-mutually-exclusive": [
        [
          "sources",
          "external"
        ],
        [
          "sources",
          "field"
        ],
        [
          "sources",
          "template"
        ],
        [
          "sources",
          "chunker"
        ],
        [
          "sources",
          "embedding_name"
        ],
        [
          "sources",
          "source_artifact_name"
        ]
      ],
      "x-antfly-dependent-required": {
        "source_artifact_name": [
          "embedding_name"
        ]
      },
      "properties": {
        "publication_policy": {
          "$ref": "#/$defs/IndexPublicationPolicy"
        },
        "coverage_policy": {
          "$ref": "#/$defs/DerivedCoveragePolicy",
          "description": "Source-unit completeness policy for managed embeddings. `strict` requires one produced outcome per source document; `partial` permits intentional skips; `best_effort` also treats terminal failures as complete while reporting the index unhealthy. External indexes use `external: true` and must not set this field."
        },
        "external": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "default": false,
          "description": "When true, embeddings are supplied externally via _embeddings and the index does not derive prompts from a field or template."
        },
        "sparse": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "default": false,
          "description": "When true, creates a sparse (SPLADE) inverted index. When false (default), creates a dense HBC vector index."
        },
        "dimension": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Vector dimension for dense indexes. Required for external dense indexes. Can be omitted for managed dense indexes when an embedder is configured (auto-detected via probe). Ignored for sparse indexes."
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Field to extract embeddings from (managed indexes only; not allowed when external=true)"
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/ArtifactIndexSource"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Embedding artifact streams indexed together. Each artifact record is an independent vector member identified by (artifact name, source key). All sources must use the same dense vector space or sparse token space. Not allowed with external, field, template, chunker, embedding_name, or source_artifact_name. Requires index_capabilities.artifact_sources=true and is rejected by serverless deployments."
        },
        "embedding_name": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "minLength": 1,
          "description": "Released v0.2 single-source alternative request form. Mutually exclusive with sources. Required when source_artifact_name is set. Responses also expose canonical sources while preserving these fields. Requires index_capabilities.artifact_sources=true and is rejected by serverless deployments."
        },
        "source_artifact_name": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "minLength": 1,
          "deprecated": true,
          "x-deprecated-reason": "Set source_artifact_name only on the matching embedding enrichment.",
          "description": "Deprecated v0.2 descriptive field. When supplied for compatibility, embedding_name is required and this value must exactly match the source_artifact_name on the authoritative embedding enrichment. New clients should declare the relationship only on that enrichment."
        },
        "template": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Handlebars template for generating prompts (managed indexes only; not allowed when external=true). See https://handlebarsjs.com/guide/ for more information."
        },
        "distance_metric": {
          "$ref": "#/$defs/DistanceMetric"
        },
        "mem_only": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether to use in-memory only storage (dense only)"
        },
        "embedder": {
          "description": "Configuration for the embeddings plugin (managed indexes only; not allowed when external=true)",
          "$ref": "#/$defs/IndexEmbedderConfig"
        },
        "chunker": {
          "description": "Configuration for the chunking plugin. When specified, documents are automatically chunked at write time before dense or sparse managed indexing.",
          "$ref": "#/$defs/ChunkerConfig"
        },
        "top_k": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "default": 10,
          "description": "Default number of results to return from search (sparse only)"
        },
        "min_weight": {
          "x-go-type-skip-optional-pointer": true,
          "type": "number",
          "format": "float",
          "default": 0.0,
          "description": "Minimum weight threshold for sparse vector entries (sparse only)"
        },
        "chunk_size": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 64,
          "default": 1024,
          "description": "Number of documents per posting list chunk (sparse only)"
        },
        "execution": {
          "$ref": "#/$defs/IndexExecutionConfig",
          "description": "Non-semantic execution policy for shorthand-created chunking or embedding producers."
        }
      }
    },
    "EnrichmentConfig": {
      "type": "object",
      "description": "Inline managed enrichment definition. Enrichments materialize generated artifacts before indexing and may target source rows or previously generated artifact streams.",
      "required": [
        "name",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Stable generated artifact name."
        },
        "kind": {
          "$ref": "#/$defs/EnrichmentKind"
        },
        "source": {
          "$ref": "#/$defs/GroupedArtifactSource",
          "description": "Required for kind=group. The covering membership index and ordinary unit artifacts are maintained from source row commits."
        },
        "prior_context": {
          "$ref": "#/$defs/PriorArtifactContext",
          "description": "Bounded earlier-segment context from an artifact sharing the same grouped source. Only valid for prompt-consuming asset producers."
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Source field to read from the source document or source artifact payload."
        },
        "template": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Optional template for generated text input."
        },
        "source_artifact_name": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Existing artifact stream this enrichment consumes. Chunk enrichments may consume asset artifacts; embedding enrichments may consume chunk artifacts; asset enrichments may consume other asset artifacts (the upstream asset's produced bytes become this producer's source, so field and template must be omitted and the producer must consume text: copy, generator, or extractor)."
        },
        "expected_dims": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "description": "Expected embedding dimension for embedding enrichments."
        },
        "vector_space": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "minLength": 1,
          "description": "Optional stable model/token-space identifier for embedding artifacts. When omitted on every source, Antfly requires the effective producers to be semantically equivalent. To combine intentionally compatible but distinct producers, set the same identifier on every source. Explicit and implicit modes cannot be mixed; dimensions are always validated independently."
        },
        "chunk_size": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "description": "Chunk size for chunk enrichments."
        },
        "chunk_overlap": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "description": "Chunk overlap for chunk enrichments."
        },
        "chunker": {
          "$ref": "#/$defs/ChunkerConfig",
          "description": "Chunker configuration for chunk enrichments. Cannot be combined with chunker_json."
        },
        "chunker_json": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the typed chunker field.",
          "description": "Legacy serialized chunker configuration for chunk enrichments. Cannot be combined with chunker."
        },
        "full_text_index": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "default": false,
          "description": "When true on a chunk or asset enrichment, route generated text into the table's default full-text index."
        },
        "content_type": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Produced asset content type for asset enrichments."
        },
        "producer": {
          "allOf": [
            {
              "$ref": "#/$defs/EnrichmentProducerConfig"
            }
          ],
          "writeOnly": true,
          "description": "Write-only producer configuration. Cannot be combined with producer_json or transcriber. Decision producers use type=decision and config={version, decider, questions}. A named-embedder similarity decider also requires embedders={name: frozen EmbedderConfig}; the dependency travels with the specification for deterministic replay instead of resolving mutable node configuration. Credentials use secret references or environment defaults. Outputs include answers, usage, resolved model, specification hash, version, and source fingerprint. Change version or specification to rebuild through the enrichment lifecycle."
        },
        "producer_json": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "writeOnly": true,
          "deprecated": true,
          "x-deprecated-reason": "Use the producer field.",
          "description": "Write-only serialized producer configuration. For managed embedding enrichments Antfly stores a canonical semantic producer identity here; credentials and execution policy are excluded."
        },
        "neighbor_context": {
          "$ref": "#/$defs/EnrichmentNeighborContextConfig",
          "description": "Optional bounded sample of the document's graph neighbors appended to the producer input. Only valid on asset enrichments whose producer consumes rendered prompt text (generator, extractor, or decision); producers that treat the source as a media locator (copy, reader, transcriber, document_extraction) reject it. Only same-shard graph state is sampled; a graph index without local state for a document yields empty neighbors at runtime while the graph index reference itself is validated at admission."
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Non-semantic execution policy for this enrichment producer. This does not participate in generated artifact identity."
        },
        "transcriber": {
          "$ref": "#/$defs/TranscriberEnrichmentConfig",
          "description": "Typed shorthand for a transcription asset enrichment. Only valid with kind=asset and without producer_json; Antfly expands it into a document_extraction producer whose audio route transcribes each recording with this speech-to-text provider. The produced units carry the transcript text, provider confidence, and per-phrase time offsets, and chunk enrichments that consume them emit _start_time_ms/_end_time_ms on every chunk. With diarization: true the phrases also carry who spoke them, and a chunk that does not straddle a turn emits _speaker. content_type defaults to application/json."
        }
      }
    },
    "EnrichmentKind": {
      "type": "string",
      "enum": [
        "chunk",
        "asset",
        "embedding",
        "group"
      ],
      "description": "Managed generated artifact kind."
    },
    "EnrichmentNeighborContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "graph_index"
      ],
      "description": "Bounded sample of the document's same-shard graph neighbors appended to an asset producer's rendered input as a compact JSON block ({\"neighbors\":[{\"edge_type\":...,\"direction\":...,\"target\":...,\"weight\":...}]}), ordered by edge type then target key. A conceptualizer enrichment on an entities table can thereby ground its abstractions in adjacent facts (\"started_by -> John Andrew Rice\"). The sampled block participates in the producer's skip state, so a changed adjacency re-runs the producer.",
      "properties": {
        "graph_index": {
          "type": "string",
          "minLength": 1,
          "description": "Name of a graph index on the same table whose local state is sampled. Validated at admission; cross-shard neighbors are not sampled."
        },
        "edge_types": {
          "x-go-type-skip-optional-pointer": true,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Edge types to sample. Empty admits every edge type."
        },
        "direction": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "out",
            "in",
            "both"
          ],
          "default": "both",
          "description": "Adjacency orientation to sample relative to the document."
        },
        "limit": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 64,
          "default": 8,
          "description": "Maximum neighbors rendered into the producer input, applied after deterministic ordering."
        }
      }
    },
    "EnrichmentProducerConfig": {
      "type": "object",
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "copy",
            "generator",
            "extractor",
            "decision",
            "reader",
            "transcriber",
            "document_extraction",
            "vector_labels",
            "media_output"
          ]
        },
        "config": {
          "description": "Producer-specific configuration. Generator schemas and generated extractors share constrained output admission, batching, validation retry, and immutable artifact replay.",
          "anyOf": [
            {
              "$ref": "#/$defs/ConstrainedGeneratorProducerConfig"
            },
            {
              "$ref": "#/$defs/GeneratedExtractorConfig"
            },
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "$ref": "#/$defs/VectorLabelsConfig"
            },
            {
              "$ref": "#/$defs/MediaOutputConfig"
            },
            {
              "$ref": "#/$defs/DocumentExtractionConfig"
            }
          ]
        }
      }
    },
    "EqualsQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Whole string equality on the original logical field value.\nNo normalization is applied. Case-sensitive by default; case_sensitive=false\nuses Unicode simple case folding, not locale-specific or multi-character folding.\nMissing, null, and non-string values do not match. Arrays use any-element\nsemantics; a match never spans array elements. Indexes select conservative\ncandidates and original values are verified before counting and pagination.\n",
      "required": [
        "equals",
        "field"
      ],
      "properties": {
        "equals": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Logical source field path, not a companion index name."
        },
        "case_sensitive": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "ExecutionPolicy": {
      "type": "object",
      "additionalProperties": false,
      "description": "Non-semantic execution policy for one producer or index maintenance operation. These fields tune how work is batched and do not change generated artifact identity.",
      "properties": {
        "batch_items": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Maximum items to process in one batch for this operation."
        },
        "batch_bytes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint64",
          "description": "Approximate maximum source bytes to process in one batch for this operation."
        },
        "max_document_pages": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint32",
          "description": "Maximum PDF pages admitted for one request-atomic document operation."
        }
      }
    },
    "ExternalLakeCredentialRef": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ref"
      ],
      "properties": {
        "ref": {
          "type": "string",
          "minLength": 1,
          "description": "Name of a configured external_io connection with lake.read capability."
        },
        "scope": {
          "type": "string",
          "description": "Allowed object prefix relative to the configured bucket or filesystem root."
        }
      }
    },
    "ExternalLakeSnapshotSelector": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "current",
            "snapshot_id",
            "object_version_digest"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "Required for snapshot_id; selects an Iceberg snapshot."
        },
        "digest": {
          "type": "string",
          "minLength": 1,
          "description": "Required for object_version_digest; pins a Parquet object inventory."
        }
      }
    },
    "ExternalLakeTableSource": {
      "type": "object",
      "additionalProperties": false,
      "description": "Authoritative Parquet or Iceberg source. A serving statement pins its inventory and object versions before returning rows. Iceberg catalog commits require an explicit writable catalog binding; ordinary row mutations remain unsupported.",
      "required": [
        "kind",
        "table_id",
        "format",
        "uri"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "external"
          ]
        },
        "table_id": {
          "type": "string",
          "minLength": 1
        },
        "format": {
          "type": "string",
          "enum": [
            "parquet",
            "iceberg"
          ]
        },
        "uri": {
          "type": "string",
          "minLength": 1,
          "description": "Parquet prefix, Iceberg table, or an explicit Parquet snapshot head ending in .parquet-manifest.json. Snapshot heads name immutable checksummed file-list chunks; each query revalidates the head without listing the data prefix."
        },
        "row_identity_version": {
          "type": "integer",
          "enum": [
            1,
            2
          ],
          "readOnly": true,
          "description": "Server-assigned public row identity version, fixed when the source is attached and preserved across index creation and schema updates."
        },
        "row_identity": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "key_columns"
          ],
          "description": "Optional verified stable identity for external rewrites. Keys must be non-null and unique in each published snapshot. Uses native typed equality; an unchanged key alone never authorizes index reuse.",
          "properties": {
            "key_columns": {
              "type": "array",
              "minItems": 1,
              "maxItems": 32,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "schema_fingerprint": {
          "type": "string",
          "default": "auto",
          "minLength": 1
        },
        "write_policy": {
          "type": "string",
          "enum": [
            "read_only",
            "iceberg_writer"
          ],
          "default": "read_only",
          "description": "iceberg_writer authorizes explicit Iceberg catalog commits and requires catalog plus a current snapshot selector. It does not enable ordinary row batch writes."
        },
        "object_mutability": {
          "type": "string",
          "enum": [
            "mutable",
            "immutable"
          ],
          "default": "mutable",
          "description": "Set immutable only when data files are never replaced at an existing URI. Allows authenticated provider-version proofs from retained index generations to be reused for unchanged data files. Metadata and delete files are still verified."
        },
        "credentials": {
          "$ref": "#/$defs/ExternalLakeCredentialRef"
        },
        "snapshot": {
          "$ref": "#/$defs/ExternalLakeSnapshotSelector"
        },
        "catalog": {
          "$ref": "#/$defs/LakeCatalogConfig"
        }
      }
    },
    "ExtractionAttributeGroup": {
      "type": "object",
      "required": [
        "labels"
      ],
      "properties": {
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "minItems": 1
        },
        "multi_label": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "applies_to": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "qualify_labels": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        }
      },
      "additionalProperties": false,
      "description": "Version 2 attributes are scored on retained entity spans using shared encoded states. Omitted applies_to selects all entities; [] selects none. Raw labels must be unique across groups, including when qualify_labels is true. Group names text,confidence,start,end are reserved."
    },
    "ExtractionClassificationConstraint": {
      "x-zig-type": "std.json.Value",
      "description": "Declarative, bounded constraint AST. Task and label references are validated before inference. Nesting is bounded by the server schema limit.",
      "oneOf": [
        {
          "$ref": "#/$defs/ExtractionConstraintLabelRef"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAnySelected"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAnyOtherSelected"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintIsDefault"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintCardinality"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintMinLevel"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintMaxLevel"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAtLevel"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintNot"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintAnd"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintOr"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintExactlyOneOf"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintImplies"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintIff"
        },
        {
          "$ref": "#/$defs/ExtractionConstraintExcludes"
        }
      ]
    },
    "ExtractionClassificationExample": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "input",
            "label"
          ],
          "properties": {
            "input": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "string"
          },
          "description": "A two-string [input,label] pair."
        }
      ]
    },
    "ExtractionClassificationSchema": {
      "type": "object",
      "required": [
        "name",
        "labels"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "multi_label": {
          "type": "boolean",
          "description": "The server uses false when omitted. Version 1: return highest-ranked labels up to top_k when false, or labels meeting options.threshold when true. Version 2: selects ordinary single or multi classification unless mode is specified; classification.threshold controls the decision threshold."
        },
        "hypothesis_template": {
          "type": "string",
          "description": "Version 1 NLI hypothesis template with {} as the label placeholder; the server uses \"This example is {}.\" when omitted. Version 2 GLiNER boundary extraction rejects an explicit hypothesis_template; use prompt/instruction and label_definitions for model conditioning."
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum labels for ordinary single-label classification; the server uses 1 when omitted. Version 2 constrained classification uses min_labels/max_labels. Advanced set-selection options or cross-task constraints on any classification in the collection reject every explicit top_k in that collection, including 1. Omit top_k when using these options."
        },
        "mode": {
          "type": "string",
          "enum": [
            "single",
            "multi"
          ],
          "description": "Version 2 ordinary classification mode. Standalone ordinal scores use the decision API.\nEach model rejects modes it does not support.\n",
          "x-go-type-skip-optional-pointer": false
        },
        "label_definitions": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionLabelDefinition"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "min_labels": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "max_labels": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "x-go-type": "stdjson.RawMessage",
          "x-go-type-import": {
            "path": "encoding/json",
            "name": "stdjson"
          },
          "description": "Version 2 maximum selected labels. Explicit null means no maximum; omission preserves mode defaults."
        },
        "ordered": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionClassificationThreshold"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "activation": {
          "type": "string",
          "enum": [
            "auto",
            "sigmoid",
            "softmax"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "temperature": {
          "type": "number",
          "format": "double",
          "x-go-type-skip-optional-pointer": false,
          "exclusiveMinimum": 0
        },
        "default": {
          "type": "string",
          "description": "Version 2 fallback label; must be declared in labels.",
          "x-go-type-skip-optional-pointer": false
        },
        "prompt": {
          "type": "string",
          "description": "Version 2 model-facing task instruction. Mutually exclusive with instruction.",
          "x-go-type-skip-optional-pointer": false
        },
        "instruction": {
          "type": "string",
          "description": "Alias of prompt.",
          "x-go-type-skip-optional-pointer": false
        }
      }
    },
    "ExtractionClassificationThreshold": {
      "type": "number",
      "format": "double",
      "x-go-type-skip-optional-pointer": false,
      "description": "Finite centered-logit decisions require a threshold strictly between zero and one.",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1
    },
    "ExtractionConstraintAnd": {
      "type": "object",
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "And"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "maxItems": 512
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintAnyOtherSelected": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AnyOtherSelected"
          ]
        },
        "task": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintAnySelected": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AnySelected"
          ]
        },
        "task": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintAtLevel": {
      "type": "object",
      "required": [
        "type",
        "task",
        "level"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AtLevel"
          ]
        },
        "task": {
          "type": "string"
        },
        "level": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0,
              "x-go-type-skip-optional-pointer": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintCardinality": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Cardinality"
          ]
        },
        "task": {
          "type": "string"
        },
        "minimum": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "maximum": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintExactlyOneOf": {
      "type": "object",
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "ExactlyOneOf"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "maxItems": 512
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintExcludes": {
      "type": "object",
      "required": [
        "type",
        "left",
        "right"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Excludes"
          ]
        },
        "left": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        },
        "right": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintIff": {
      "type": "object",
      "required": [
        "type",
        "left",
        "right"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Iff"
          ]
        },
        "left": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        },
        "right": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintImplies": {
      "type": "object",
      "required": [
        "type",
        "cond",
        "then"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Implies"
          ]
        },
        "cond": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        },
        "then": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintIsDefault": {
      "type": "object",
      "required": [
        "type",
        "task"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "IsDefault"
          ]
        },
        "task": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintLabelRef": {
      "type": "object",
      "required": [
        "type",
        "task",
        "label"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LabelRef"
          ]
        },
        "task": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintMaxLevel": {
      "type": "object",
      "required": [
        "type",
        "task",
        "level"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MaxLevel"
          ]
        },
        "task": {
          "type": "string"
        },
        "level": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0,
              "x-go-type-skip-optional-pointer": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintMinLevel": {
      "type": "object",
      "required": [
        "type",
        "task",
        "level"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MinLevel"
          ]
        },
        "task": {
          "type": "string"
        },
        "level": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0,
              "x-go-type-skip-optional-pointer": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintNot": {
      "type": "object",
      "required": [
        "type",
        "child"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Not"
          ]
        },
        "child": {
          "$ref": "#/$defs/ExtractionClassificationConstraint"
        }
      },
      "additionalProperties": false
    },
    "ExtractionConstraintOr": {
      "type": "object",
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Or"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "maxItems": 512
        }
      },
      "additionalProperties": false
    },
    "ExtractionDecoderOptions": {
      "type": "object",
      "properties": {
        "algorithm": {
          "type": "string",
          "enum": [
            "auto",
            "exact",
            "beam"
          ],
          "description": "Omit to use the model's per-task default. GLiNER2.5 uses source-compatible beam selection for single-window JointIE and automatic selection for classification. Windowed JointIE uses the native automatic global solver with independent window resources. Explicit values select the native bounded search algorithm.",
          "x-go-type-skip-optional-pointer": false
        },
        "beam_width": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1024,
          "x-go-type-skip-optional-pointer": false
        },
        "max_search_nodes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200000,
          "x-go-type-skip-optional-pointer": false
        },
        "max_local_assignments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "x-go-type-skip-optional-pointer": false
        },
        "best_effort": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        }
      },
      "additionalProperties": false,
      "description": "Bounded classification and JointIE selection. Exact optimality is with respect to admitted candidates. A completed beam may be feasible without an optimality proof. By default exhausted search is an error; best_effort permits only a validated feasible witness and reports exhausted:true."
    },
    "ExtractionEntityDefinition": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "dtype": {
          "type": "string",
          "enum": [
            "str",
            "list"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "type": {
          "type": "string",
          "enum": [
            "str",
            "string",
            "list",
            "array"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "validators": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionRegexValidator"
          },
          "maxItems": 64,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraint": {
      "x-zig-type": "std.json.Value",
      "oneOf": [
        {
          "$ref": "#/$defs/ExtractionJointConstraintTypedEndpoints"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintNoSelfLoops"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintUniqueRelationPair"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintUniqueRelationSlot"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintEntityOverlapPolicy"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintMaxRelationsPerHead"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintMaxRelationsPerTail"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintSymmetricRelation"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintAcyclicRelation"
        },
        {
          "$ref": "#/$defs/ExtractionJointConstraintInverseRelation"
        }
      ]
    },
    "ExtractionJointConstraintAcyclicRelation": {
      "type": "object",
      "required": [
        "type",
        "relation"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AcyclicRelation"
          ]
        },
        "relation": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintEntityOverlapPolicy": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "EntityOverlapPolicy"
          ]
        },
        "policy": {
          "type": "string",
          "enum": [
            "allow",
            "disallow",
            "nested"
          ],
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintInverseRelation": {
      "type": "object",
      "required": [
        "type",
        "relation",
        "inverse"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "InverseRelation"
          ]
        },
        "relation": {
          "type": "string"
        },
        "inverse": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintMaxRelationsPerHead": {
      "type": "object",
      "required": [
        "type",
        "limit"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MaxRelationsPerHead"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintMaxRelationsPerTail": {
      "type": "object",
      "required": [
        "type",
        "limit"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MaxRelationsPerTail"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintNoSelfLoops": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "NoSelfLoops"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintSymmetricRelation": {
      "type": "object",
      "required": [
        "type",
        "relation"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "SymmetricRelation"
          ]
        },
        "relation": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintTypedEndpoints": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TypedEndpoints"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "head_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "tail_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintUniqueRelationPair": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "UniqueRelationPair"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "directed": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointConstraintUniqueRelationSlot": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "UniqueRelationSlot"
          ]
        },
        "relation": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "slot": {
          "type": "string",
          "enum": [
            "head",
            "tail",
            "slot"
          ],
          "default": "head",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointEntity": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionClassificationThreshold"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "max_candidates": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "x-go-type-skip-optional-pointer": false
        },
        "allow_nested": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointOptions": {
      "type": "object",
      "properties": {
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "entity_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "relation_role_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "top_k_entities": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "x-go-type-skip-optional-pointer": false
        },
        "top_k_roles": {
          "type": "integer",
          "minimum": 1,
          "maximum": 32,
          "x-go-type-skip-optional-pointer": false
        },
        "relation_pair_cap": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "max_edges_per_type": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "x-go-type-skip-optional-pointer": false
        },
        "entity_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "relation_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false,
      "description": "JointIE proposal admission and utility calibration. Entity candidate caps are bypassed for endpoints of retained relation proposals, subject to server hard bounds. entity_threshold overrides candidate admission, not entity decision thresholds."
    },
    "ExtractionJointRelation": {
      "type": "object",
      "required": [
        "head",
        "tail"
      ],
      "properties": {
        "head": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "minItems": 1
        },
        "tail": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 128,
          "minItems": 1
        },
        "description": {
          "type": "string",
          "description": "Retained declarative metadata; model conditioning follows the pinned JointIE compiler.",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionClassificationThreshold"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "candidate_threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "directed": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true
        },
        "symmetric": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "inverse": {
          "type": "string",
          "x-go-type-skip-optional-pointer": false
        },
        "allow_self": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "max_per_head": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        },
        "max_per_tail": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionJointSchema": {
      "type": "object",
      "required": [
        "entities"
      ],
      "properties": {
        "entities": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 128,
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/ExtractionJointEntity"
              }
            ]
          }
        },
        "relations": {
          "type": "object",
          "maxProperties": 32,
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionJointRelation"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "constraints": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionJointConstraint"
          },
          "maxItems": 512,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false,
      "description": "Separate typed graph schema, mutually exclusive with ordinary extraction families. Hard typed endpoints, overlap, uniqueness and declared graph constraints apply to every returned edge, including derived companions."
    },
    "ExtractionLabelDefinition": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "Model-facing label description.",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false
    },
    "ExtractionLongDocumentOptions": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "reject",
            "window"
          ],
          "default": "reject",
          "x-go-type-skip-optional-pointer": false
        },
        "window_words": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "x-go-type-skip-optional-pointer": false,
          "description": "Maximum body words per window; also bounded by the checkpoint and encoded token limits."
        },
        "overlap_words": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4095,
          "x-go-type-skip-optional-pointer": false
        },
        "max_windows": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "x-go-type-skip-optional-pointer": false
        },
        "record_identity": {
          "type": "string",
          "enum": [
            "occurrence",
            "semantic"
          ],
          "default": "occurrence",
          "description": "Identity of latent, anchorless and legacy records across windows. Occurrence uses exact source spans; semantic explicitly merges equal field values. Natural records always use their exact source anchor. This is independent of annotation occurrence_policy.",
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": false,
      "description": "Version 2 never silently truncates. Reject is the default. Windowing requires an enabled runtime capability, reconstructs document-global offsets and revalidates all hard graph constraints after merging."
    },
    "ExtractionOffsetUnit": {
      "type": "string",
      "description": "Half-open offsets into the immutable caller text. Version 2 defaults to utf8_bytes. No normalization, lowercasing or synthetic suffix is included in these coordinates.",
      "enum": [
        "utf8_bytes",
        "unicode_codepoints",
        "utf16_codeunits"
      ]
    },
    "ExtractionOptions": {
      "type": "object",
      "properties": {
        "threshold": {
          "type": "number",
          "format": "float"
        },
        "flat_ner": {
          "type": "boolean"
        },
        "include_confidence": {
          "type": "boolean"
        },
        "include_spans": {
          "type": "boolean"
        },
        "word_splitter": {
          "type": "string",
          "enum": [
            "whitespace",
            "char"
          ],
          "description": "Version 2 source word splitting. char keeps ASCII alphanumeric and @._-+ runs together and splits other non-whitespace codepoints, preserving original source offsets. An input's options replace the shared options in full; omitted word_splitter uses whitespace. Explicit word_splitter is rejected by version 1.",
          "x-go-type-skip-optional-pointer": false
        },
        "overlap": {
          "type": "string",
          "enum": [
            "allow",
            "nested",
            "flat",
            "disallow",
            "longest"
          ],
          "description": "Version 2 overlap selection. flat/disallow prohibit overlap, nested permits containment, longest removes strictly contained spans.",
          "x-go-type-skip-optional-pointer": false
        },
        "offset_unit": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionOffsetUnit"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "long_document": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionLongDocumentOptions"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "decoder": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionDecoderOptions"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "joint_ie": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionJointOptions"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "reader": {
          "$ref": "#/$defs/ExtractionReaderOptions"
        },
        "resolver": {
          "$ref": "#/$defs/ExtractionResolverOptions"
        }
      },
      "additionalProperties": true
    },
    "ExtractionProbability": {
      "type": "number",
      "format": "double",
      "minimum": 0,
      "maximum": 1,
      "x-go-type-skip-optional-pointer": false
    },
    "ExtractionReaderOptions": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "api_url": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "ExtractionRegexValidator": {
      "type": "object",
      "required": [
        "pattern"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "regex"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "pattern": {
          "type": "string",
          "maxLength": 4096
        },
        "mode": {
          "type": "string",
          "enum": [
            "full",
            "partial"
          ],
          "default": "full",
          "x-go-type-skip-optional-pointer": false
        },
        "exclude": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": false
        },
        "flags": {
          "type": "integer",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false,
          "default": 2,
          "description": "Python-compatible regex flags supported by the active bounded validator engine; unsupported flags or syntax fail validation."
        }
      },
      "additionalProperties": false
    },
    "ExtractionRelationSchema": {
      "type": "object",
      "description": "Optional source and target labels constrain relation endpoints. A target requires a source.",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "target": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "description": "Version 2 model-facing relation description.",
          "x-go-type-skip-optional-pointer": false
        },
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionProbability"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        }
      }
    },
    "ExtractionResolverOptions": {
      "type": "object",
      "description": "Optional cross-input entity and relation deduplication.",
      "properties": {
        "similarity_threshold": {
          "type": "number",
          "format": "float",
          "default": 0.85,
          "minimum": 0,
          "maximum": 1
        },
        "type_must_match": {
          "type": "boolean",
          "default": true
        },
        "min_entity_confidence": {
          "type": "number",
          "format": "float",
          "default": 0,
          "minimum": 0,
          "maximum": 1
        },
        "min_relation_confidence": {
          "type": "number",
          "format": "float",
          "default": 0,
          "minimum": 0,
          "maximum": 1
        },
        "deduplicate_relations": {
          "type": "boolean",
          "default": true
        },
        "track_provenance": {
          "type": "boolean",
          "default": true
        }
      }
    },
    "ExtractionSchema": {
      "type": "object",
      "description": "Version 1 selects one extraction family; entities may accompany relations.\nWith schema_version 2, entities, attributes, classifications, structures,\nand ordinary relations may share one encoded input. joint_ie is a separate,\nmutually exclusive typed graph schema. The version 2 compiler rejects\nunknown fields and validates all references before model execution.\n",
      "properties": {
        "entities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "relations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionRelationSchema"
          }
        },
        "classifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExtractionClassificationSchema"
          }
        },
        "structures": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionStructureSchema"
          }
        },
        "entity_definitions": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionEntityDefinition"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "entity_attributes": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionAttributeGroup"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "classification_constraints": {
          "type": "array",
          "maxItems": 512,
          "items": {
            "$ref": "#/$defs/ExtractionClassificationConstraint"
          },
          "x-go-type-skip-optional-pointer": false
        },
        "joint_ie": {
          "allOf": [
            {
              "$ref": "#/$defs/ExtractionJointSchema"
            }
          ],
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": true
    },
    "ExtractionStructureField": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "str",
                "string",
                "list",
                "array",
                "text",
                "number",
                "date",
                "estimate"
              ]
            },
            "decimals": {
              "type": "integer",
              "minimum": 0,
              "maximum": 15,
              "description": "Decimal precision for compatible hosted number fields."
            },
            "unit": {
              "type": "string"
            },
            "min": {
              "type": "number",
              "description": "Minimum of a hosted estimate distribution."
            },
            "max": {
              "type": "number"
            },
            "step": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "enum": {
              "type": "array",
              "minItems": 2,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "dtype": {
              "type": "string",
              "enum": [
                "str",
                "list"
              ],
              "x-go-type-skip-optional-pointer": false
            },
            "choices": {
              "type": "array",
              "minItems": 2,
              "items": {
                "type": "string"
              },
              "x-go-type-skip-optional-pointer": false
            },
            "description": {
              "type": "string",
              "x-go-type-skip-optional-pointer": false
            },
            "threshold": {
              "allOf": [
                {
                  "$ref": "#/$defs/ExtractionProbability"
                }
              ],
              "x-go-type-skip-optional-pointer": false
            },
            "cardinality": {
              "type": "string",
              "enum": [
                "optional_one",
                "required_one",
                "zero_or_more",
                "one_or_more"
              ],
              "description": "Version 2 explicit cardinality. Required fields are validated after record assignment.",
              "x-go-type-skip-optional-pointer": false
            },
            "exclusive": {
              "type": "boolean",
              "description": "Version 2 field spans cannot be assigned to multiple record instances.",
              "x-go-type-skip-optional-pointer": false
            },
            "validators": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExtractionRegexValidator"
              },
              "x-go-type-skip-optional-pointer": false
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "ExtractionStructureSchema": {
      "type": "object",
      "required": [
        "fields"
      ],
      "properties": {
        "fields": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "$ref": "#/$defs/ExtractionStructureField"
          }
        },
        "mode": {
          "type": "string",
          "enum": [
            "natural",
            "latent",
            "anchorless"
          ],
          "description": "Version 2 record grouping. Omission preserves one-record extraction.",
          "x-go-type-skip-optional-pointer": false
        },
        "anchor": {
          "type": "string",
          "description": "Natural mode only; defaults to the first declared field.",
          "x-go-type-skip-optional-pointer": false
        },
        "occurrence_policy": {
          "type": "string",
          "enum": [
            "all",
            "first",
            "error_on_ambiguous",
            "latent_all"
          ],
          "x-go-type-skip-optional-pointer": false
        }
      },
      "additionalProperties": true
    },
    "FieldMappingType": {
      "type": "string",
      "description": "Field types accepted by detailed `x-antfly-field` and dynamic-template\nmappings. JSON-schema-oriented aliases are normalized to Antfly's\ncorresponding runtime type: number/integer to numeric, bool to boolean,\ndate/timestamp to datetime, geo_point to geopoint, and geo_shape to\ngeoshape.\n",
      "enum": [
        "text",
        "html",
        "keyword",
        "numeric",
        "number",
        "integer",
        "boolean",
        "bool",
        "datetime",
        "date",
        "timestamp",
        "geopoint",
        "geo_point",
        "geoshape",
        "geo_shape",
        "embedding",
        "blob",
        "link",
        "search_as_you_type",
        "substring"
      ]
    },
    "ForeignKeyAction": {
      "type": "string",
      "enum": [
        "restrict",
        "set_null",
        "cascade",
        "no_action"
      ],
      "description": "Action on referencing rows when a referenced row is changed or removed."
    },
    "ForeignKeyMatch": {
      "type": "string",
      "enum": [
        "simple",
        "full",
        "partial"
      ],
      "description": "Null matching semantics of a composite foreign key. Partial requires\nat least one parent matching every non-null child component; all-null\nchildren are exempt. Compatible parent witnesses are guarded through\ncommit, including concurrent deletion of alternative witnesses.\n"
    },
    "ForeignKeyTiming": {
      "type": "string",
      "enum": [
        "immediate",
        "deferred"
      ],
      "description": "Enforcement timing for atomic mutations and transaction sessions. Deferred\nrequires deferrable=true and validates the final transaction state.\nNO ACTION permits a valid final-state parent replacement; RESTRICT\nstill rejects referenced parent removal. Existing multi-request\ntransaction sessions retain deferred checks until commit; immediate\nchecks apply to each staged statement. SET CONSTRAINTS is not provided.\n"
    },
    "FullTextArtifactIndexSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Textual artifact stream consumed by a full-text index, with an optional source-local projection.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Stable name of a chunk or textual asset artifact stream. Artifact names must be unique within the index."
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Optional field selected from this artifact's records. When omitted, the index-level field is inherited; when both are omitted, Antfly indexes the default text projection."
        }
      }
    },
    "FullTextIndexConfig": {
      "type": "object",
      "x-antfly-mutually-exclusive": [
        [
          "sources",
          "artifact_name"
        ]
      ],
      "properties": {
        "store_source": {
          "type": "boolean",
          "default": false,
          "x-go-type-skip-optional-pointer": true,
          "description": "Opt in to retaining the indexed source projection in serverless full-text sidecars for cold highlighting. With field set, only that field is retained; otherwise the index source projection is retained. Increases index storage and build work. Omit or set false to hydrate highlights from the source table. Provisioned indexes already retain source independently."
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/FullTextArtifactIndexSource"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Chunk or textual asset streams indexed together; every artifact record is an independent full-text member. A source-local field overrides the shared index-level field for that stream. Artifact names must be unique. Requires index_capabilities.artifact_sources=true and is rejected by serverless deployments."
        },
        "mem_only": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether to use memory-only storage"
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "minLength": 1,
          "description": "Content field indexed as text. With an artifact source, this selects the field within each artifact record; without one, it selects a document field. String values and arrays of strings are indexed; missing, null, and non-text values produce no posting. Omit to index the default text projection."
        },
        "artifact_name": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "minLength": 1,
          "description": "Single-source convenience form. Mutually exclusive with sources; normalized responses use sources. Requires index_capabilities.artifact_sources=true and is rejected by serverless deployments."
        },
        "analysis_config": {
          "$ref": "#/$defs/TextAnalysisConfig"
        }
      }
    },
    "Fuzziness": {
      "description": "The fuzziness of the query. Can be an integer or \"auto\".",
      "anyOf": [
        {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "maximum": 2
        },
        {
          "type": "string",
          "enum": [
            "auto"
          ]
        }
      ]
    },
    "FuzzyQuery": {
      "type": "object",
      "properties": {
        "term": {
          "type": "string"
        },
        "prefix_length": {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "maximum": 255
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "term"
      ]
    },
    "GeneratedExtractorConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "method",
        "generator",
        "schema"
      ],
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "generated"
          ]
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig"
        },
        "schema": {
          "$ref": "#/$defs/ExtractionSchema"
        },
        "entity_definitions": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "probabilities": {
          "$ref": "#/$defs/ConstrainedProbabilities"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        },
        "options": {
          "$ref": "#/$defs/ExtractionOptions"
        }
      }
    },
    "GeneratorConfig": {
      "description": "A unified configuration for a generative AI provider.\n",
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudflareGeneratorConfig"
            },
            {
              "$ref": "#/$defs/GoogleGeneratorConfig"
            },
            {
              "$ref": "#/$defs/VertexGeneratorConfig"
            },
            {
              "$ref": "#/$defs/BedrockGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AnthropicGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OllamaGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AntflyGeneratorConfig"
            },
            {
              "$ref": "#/$defs/ChatGPTGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenAIGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenRouterGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AppleGeneratorConfig"
            }
          ]
        },
        {
          "properties": {
            "max_image_input_tokens": {
              "x-go-type-skip-optional-pointer": false,
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "description": "Conservative input-token ceiling per image. Required for image calls when tokens_per_minute is configured; choose a bound valid for the model and image policy."
            },
            "rate_limit": {
              "x-go-type-skip-optional-pointer": false,
              "$ref": "#/$defs/RateLimitConfig"
            },
            "provider": {
              "$ref": "#/$defs/GeneratorProvider"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "GeneratorProvider": {
      "type": "string",
      "enum": [
        "cloudflare",
        "gemini",
        "vertex",
        "bedrock",
        "anthropic",
        "ollama",
        "openai",
        "chatgpt",
        "openrouter",
        "antfly",
        "apple"
      ],
      "description": "Generator providers implemented by Antfly's generation runtime."
    },
    "GeoBoundingBoxQuery": {
      "type": "object",
      "description": "Geographic bounding box filter. The public query shape uses scalar latitude and longitude bounds to match structured filter_query.geo_bbox. Longitude ranges may cross the antimeridian by specifying a western/min longitude that is greater than the eastern/max longitude; for example, min_lon 179.5 and max_lon -179.5 matches points near +/-180 degrees longitude. Latitude bounds must be ordered with min_lat <= max_lat.\n",
      "properties": {
        "field": {
          "type": "string",
          "description": "Field or path containing geo_point values."
        },
        "min_lat": {
          "type": "number",
          "format": "double",
          "minimum": -90,
          "maximum": 90,
          "description": "Southern latitude bound."
        },
        "min_lon": {
          "type": "number",
          "format": "double",
          "minimum": -180,
          "maximum": 180,
          "description": "Western longitude bound. If greater than max_lon, the box crosses the antimeridian."
        },
        "max_lat": {
          "type": "number",
          "format": "double",
          "minimum": -90,
          "maximum": 90,
          "description": "Northern latitude bound. Must be greater than or equal to min_lat."
        },
        "max_lon": {
          "type": "number",
          "format": "double",
          "minimum": -180,
          "maximum": 180,
          "description": "Eastern longitude bound. May be less than min_lon for antimeridian-wrapped boxes."
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "field",
        "min_lat",
        "min_lon",
        "max_lat",
        "max_lon"
      ]
    },
    "GeoBoundingPolygonQuery": {
      "type": "object",
      "properties": {
        "polygon_points": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GeoPoint"
          }
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "polygon_points"
      ]
    },
    "GeoDistanceQuery": {
      "type": "object",
      "properties": {
        "location": {
          "type": "array",
          "items": {
            "type": "number",
            "format": "double"
          },
          "minItems": 2,
          "maxItems": 2,
          "description": "[lon, lat]"
        },
        "distance": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "location",
        "distance"
      ]
    },
    "GeoPoint": {
      "type": "object",
      "properties": {
        "lon": {
          "type": "number",
          "format": "double"
        },
        "lat": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "GeoShape": {
      "type": "object",
      "description": "A GeoJSON shape object. This is a simplified representation.",
      "properties": {
        "type": {
          "type": "string"
        },
        "coordinates": {
          "type": "array",
          "items": {}
        }
      },
      "required": [
        "type",
        "coordinates"
      ]
    },
    "GeoShapeGeometry": {
      "type": "object",
      "properties": {
        "shape": {
          "$ref": "#/$defs/GeoShape"
        },
        "relation": {
          "type": "string",
          "enum": [
            "intersects",
            "contains",
            "within"
          ]
        }
      },
      "required": [
        "shape",
        "relation"
      ]
    },
    "GeoShapeQuery": {
      "type": "object",
      "properties": {
        "geometry": {
          "$ref": "#/$defs/GeoShapeGeometry"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "geometry"
      ]
    },
    "GoogleEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the Google AI (Gemini) embedding provider.\n\nAPI key via `api_key` field or `GEMINI_API_KEY` environment variable.\n\n**Example Models:** gemini-embedding-2 (default, 3072 dims)\n\n**Docs:** https://ai.google.dev/gemini-api/docs/embeddings",
      "properties": {
        "request_format": {
          "type": "string",
          "enum": [
            "embed_content",
            "batch_embed_contents"
          ],
          "description": "Wire protocol. New configurations default to embed_content; existing catalogs retain their pinned protocol. No automatic fallback.",
          "default": "embed_content"
        },
        "task_encoding": {
          "type": "string",
          "enum": [
            "prompt",
            "task_type",
            "none"
          ],
          "description": "Retrieval task representation, independent of model name. Defaults to prompt with embed_content and task_type with legacy protocols. Changing it requires re-embedding."
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum inputs per upstream request. embed_content requires 1 so independent records never become one aggregated embedding."
        },
        "provider": {
          "type": "string",
          "enum": [
            "gemini"
          ]
        },
        "project_id": {
          "type": "string",
          "description": "The Google Cloud project ID (optional for Gemini API, required for Vertex AI)."
        },
        "location": {
          "type": "string",
          "description": "The Google Cloud location (e.g., 'us-central1'). Required for Vertex AI, optional for Gemini API."
        },
        "model": {
          "type": "string",
          "description": "The name of the embedding model to use.",
          "default": "gemini-embedding-2"
        },
        "dimension": {
          "type": "integer",
          "description": "The dimension of the embedding vector (768, 1536, or 3072 recommended).",
          "default": 3072
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The Google API key. Can also be set via GEMINI_API_KEY environment variable."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Google API endpoint (optional, uses default if not specified)."
        },
        "retrieval": {
          "$ref": "#/$defs/EmbeddingRetrievalConfig"
        }
      },
      "required": [
        "provider"
      ]
    },
    "GoogleGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Google generative AI provider (Gemini).\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "gemini"
          ]
        },
        "project_id": {
          "type": "string",
          "description": "The Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "The Google Cloud location (e.g., 'us-central1')."
        },
        "model": {
          "type": "string",
          "description": "The name of the generative model to use.",
          "default": "gemini-2.5-flash"
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The Google API key."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Google API endpoint."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "GraphAlgebraicPlanningConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Optional algebraic planning features for graph traversal.",
      "properties": {
        "bounded_traversal": {
          "$ref": "#/$defs/GraphBoundedTraversalConfig"
        }
      }
    },
    "GraphArtifactContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Document fields made available to graph mapping templates through `_doc.value`.",
      "properties": {
        "doc_fields": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "GraphArtifactEdgeMappingConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Maps each artifact item to a relationship identity, type, weight, and public metadata.",
      "properties": {
        "edge_id": {
          "$ref": "#/$defs/GraphTemplateValue",
          "description": "Stable application relationship ID. Required with nodes.source. Replays update the same identity; distinct IDs preserve parallel relationships."
        },
        "type": {
          "$ref": "#/$defs/GraphTemplateValue"
        },
        "weight": {
          "$ref": "#/$defs/GraphTemplateValue"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON metadata template copied onto each materialized edge. Sensitive keys are omitted from create responses."
        }
      }
    },
    "GraphArtifactNodeMappingConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Maps each artifact item to graph node identifiers.",
      "properties": {
        "model": {
          "type": "string",
          "enum": [
            "document",
            "external"
          ],
          "default": "document"
        },
        "source": {
          "$ref": "#/$defs/GraphTemplateValue",
          "description": "Logical source endpoint. When set, edge.edge_id is required; the artifact document remains the durable owner."
        },
        "target": {
          "$ref": "#/$defs/GraphTemplateValue"
        }
      }
    },
    "GraphArtifactProducerConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "kind",
        "source"
      ],
      "description": "Asset producer used by an artifact-backed graph index.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "asset"
          ]
        },
        "source": {
          "$ref": "#/$defs/GraphArtifactProducerSourceConfig"
        },
        "content_type": {
          "type": "string"
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy"
        },
        "producer": {
          "allOf": [
            {
              "$ref": "#/$defs/EnrichmentProducerConfig"
            }
          ],
          "writeOnly": true,
          "description": "Write-only producer configuration. Cannot be combined with producer_json."
        },
        "producer_json": {
          "type": "object",
          "additionalProperties": true,
          "writeOnly": true,
          "deprecated": true,
          "x-deprecated-reason": "Use the producer field.",
          "description": "Write-only producer configuration; it may contain credentials and is never returned."
        }
      }
    },
    "GraphArtifactProducerSourceConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "value"
      ],
      "description": "Document input used by an artifact producer. Field sources read one document field; template sources render a Handlebars template.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "field",
            "template"
          ]
        },
        "value": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "GraphArtifactSourceConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Artifact stream materialized into graph edges. Each source artifact is limited to 16 MiB and 1,000,000 relation items so live apply, repair, split, and restore share one bounded admission contract. Artifact-backed graph sources require index_capabilities.artifact_sources=true and are rejected by serverless deployments.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "pattern": "^(\\$|\\$\\.[A-Za-z0-9_]+(\\.[A-Za-z0-9_]+)*(\\[\\*\\])?)?$",
          "description": "Optional root path selecting the graph payload. Supports `$`, dot-separated ASCII field names such as `$.relations`, and an optional terminal `[*]` such as `$.relations[*]`."
        },
        "format": {
          "type": "string",
          "enum": [
            "extraction_relation",
            "extraction_graph"
          ],
          "default": "extraction_relation"
        },
        "mention_edge_type": {
          "$ref": "#/$defs/GraphEdgeType"
        },
        "nodes": {
          "$ref": "#/$defs/GraphArtifactNodeMappingConfig"
        },
        "edge": {
          "$ref": "#/$defs/GraphArtifactEdgeMappingConfig"
        },
        "context": {
          "$ref": "#/$defs/GraphArtifactContextConfig"
        }
      }
    },
    "GraphBoundedTraversalConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "law"
      ],
      "description": "Algebraic law used to combine bounded graph traversal provenance.",
      "properties": {
        "law": {
          "type": "string",
          "enum": [
            "provenance_semiring"
          ]
        }
      }
    },
    "GraphEdgeType": {
      "type": "string",
      "minLength": 1,
      "maxLength": 65536,
      "x-antfly-max-utf8-bytes": 65536,
      "description": "Durable graph edge type. Values must be valid UTF-8 and encode to at most 64 KiB; `maxLength` is the standard-schema code-point ceiling and `x-antfly-max-utf8-bytes` carries the exact wire-byte limit."
    },
    "GraphIndexConfig": {
      "type": "object",
      "description": "Configuration for graph index type",
      "x-antfly-mutually-exclusive": [
        [
          "sources",
          "source"
        ],
        [
          "ttl",
          "ttl_duration"
        ]
      ],
      "properties": {
        "ttl": {
          "$ref": "#/$defs/GraphTtlConfig",
          "description": "Creation-based edge expiration for this graph index. The duration is immutable within an index incarnation."
        },
        "ttl_duration": {
          "type": "string",
          "description": "Compatibility alias for ttl.duration. Do not specify together with ttl."
        },
        "metrics": {
          "type": "object",
          "description": "Named published graph metrics. Serverless supports background refresh only and limits configurations to 16 metrics per graph, 64 total per publication, 64 types per filter, and 128 UTF-8 bytes per metric name.",
          "additionalProperties": {
            "$ref": "#/$defs/GraphMetricConfig"
          }
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/GraphArtifactSourceConfig"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Ordered chunk or JSON asset streams whose edge-like values are unioned into this graph index. Artifact names must be unique within the array because the artifact name is the source identity. Earlier sources win when multiple sources materialize the same edge identity. Requires index_capabilities.artifact_sources=true and is rejected by serverless deployments."
        },
        "summarizer": {
          "description": "Configuration for generating node summaries (enables tree navigation in Retrieval Agent)",
          "$ref": "#/$defs/GeneratorConfig"
        },
        "template": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Handlebars template for generating summarizer input text.\nUses document fields as template variables.\nSame pattern as EmbeddingsConfig template.\n"
        },
        "edge_types": {
          "type": "array",
          "description": "List of edge types with their configurations",
          "items": {
            "$ref": "#/$defs/EdgeTypeConfig"
          }
        },
        "max_edges_per_document": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Maximum number of distinct visible edges materialized per document after source precedence and identity deduplication. Zero uses the server safety limit (currently 1,000,000). Independent aggregate reconciliation budgets bound work across overlapping source manifests."
        },
        "source": {
          "description": "Single-source convenience form. Mutually exclusive with sources; normalized responses use sources. Requires index_capabilities.artifact_sources=true and is rejected by serverless deployments.",
          "$ref": "#/$defs/GraphArtifactSourceConfig"
        },
        "artifact": {
          "$ref": "#/$defs/GraphArtifactProducerConfig",
          "description": "Single asset-producer shorthand. It must be paired with exactly one source selecting the same artifact name."
        },
        "algebraic_planning": {
          "$ref": "#/$defs/GraphAlgebraicPlanningConfig"
        },
        "resolvers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverConfig"
          }
        }
      }
    },
    "GraphMetricConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Published metric configuration. If kind is omitted, the metric name must be a supported kind.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": true
        },
        "kind": {
          "type": "string",
          "enum": [
            "pagerank",
            "degree",
            "eigenvector",
            "hits_authority",
            "hits_hub"
          ]
        },
        "refresh": {
          "type": "string",
          "enum": [
            "background",
            "manual"
          ],
          "default": "background",
          "description": "Serverless accepts background only."
        },
        "damping": {
          "type": "number",
          "format": "double",
          "default": 0.85,
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1
        },
        "tolerance": {
          "type": "number",
          "format": "double",
          "default": 1e-06,
          "exclusiveMinimum": 0
        },
        "max_iterations": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 1000,
          "default": 50
        },
        "edge_filter": {
          "$ref": "#/$defs/GraphMetricEdgeFilter"
        }
      }
    },
    "GraphMetricEdgeFilter": {
      "type": "object",
      "additionalProperties": false,
      "description": "Omitting this object selects all edge types. A types list selects only those types; mode and types cannot both be supplied.",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all"
          ]
        },
        "types": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/GraphEdgeType"
          }
        }
      }
    },
    "GraphResolverAdjudicationAcceptance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "choice",
        "min_probability"
      ],
      "properties": {
        "choice": {
          "type": "string",
          "minLength": 1,
          "description": "A choice identifier in the configured question. Accept and reject must differ."
        },
        "min_probability": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 1,
          "description": "Require this typed probability and a strict majority. Raw cosine is not a probability."
        }
      }
    },
    "GraphResolverAdjudicationConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "decider",
        "template",
        "question",
        "accept"
      ],
      "description": "Adjudicate the best deterministic REVIEW candidate with a typed decision. MATCH and NO_MATCH bypass the model. Evidence is authoritative resolution data, retained independently of work caches and reused on recovery. Changes trigger versioned re-resolution. This resolves mentions, not global key merges.",
      "properties": {
        "decider": {
          "$ref": "#/$defs/DeciderConfig",
          "description": "Frozen typed or generated decider configuration. Generated verdict-only thresholds must be zero or one."
        },
        "template": {
          "type": "string",
          "minLength": 1,
          "maxLength": 65536,
          "description": "Bounded interpolation of m.text, m.surface_form, m.canonical_text, m.label, m.description, c.canonical_name, c.label and c.description. Missing descriptions render empty text, allowing name-only decisions."
        },
        "question": {
          "$ref": "#/$defs/ChoiceDecisionQuestion"
        },
        "accept": {
          "$ref": "#/$defs/GraphResolverAdjudicationAcceptance"
        },
        "reject": {
          "$ref": "#/$defs/GraphResolverAdjudicationAcceptance",
          "description": "Optional confident negative choice. Without it, non-acceptance stays REVIEW."
        },
        "on_failure": {
          "type": "string",
          "enum": [
            "review",
            "mint"
          ],
          "default": "review",
          "description": "Failure or budget fallback. REVIEW remains unpromoted; mint explicitly permits a new identity."
        },
        "description_inputs": {
          "type": "object",
          "additionalProperties": false,
          "description": "Optional asset bindings. Resolution reads available data without waiting for promotion or producers.",
          "properties": {
            "mention_artifact": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Source-document asset containing a JSON object mapping local mention ids to description strings. Publication re-drives asset-scoped resolution."
            },
            "candidate_artifact": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Candidate-document text asset, such as a generated summary. Changes affect future decisions; explicitly re-resolve to revisit committed evidence."
            }
          }
        },
        "budget_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000,
          "default": 10000,
          "description": "Total model-time budget per source artifact. Each call also obeys timeout_ms."
        },
        "max_pairs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 32
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "timeout_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000,
          "default": 10000
        }
      }
    },
    "GraphResolverConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "table",
        "source_artifact",
        "resolution_artifact",
        "key_template"
      ],
      "description": "Versioned entity resolver attached to an artifact-backed graph index.",
      "properties": {
        "name": {
          "type": "string"
        },
        "table": {
          "type": "string"
        },
        "source_artifact": {
          "type": "string"
        },
        "source_artifact_kind": {
          "type": "string",
          "enum": [
            "asset",
            "chunk",
            "any"
          ],
          "default": "asset"
        },
        "resolution_artifact": {
          "type": "string"
        },
        "key_template": {
          "type": "string"
        },
        "promote": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false,
          "description": "Materialize canonical entity documents. False resolves graph keys without promotion."
        },
        "aliases": {
          "type": "array",
          "description": "Explicit redirects between fully rendered keys in this resolver's table; no entity documents required. Changes trigger corpus re-resolution.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "target"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "target": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Mention labels this resolver consumes; empty consumes every label (catch-all). Labeled resolvers sharing a source artifact must claim disjoint label sets, and every catch-all on that artifact skips the labels claimed by labeled siblings, so extraction labels stay open-vocabulary while each mention routes to exactly one labeled resolver (label-routed tables, e.g. event mentions to an events table)."
        },
        "type_must_match": {
          "type": "boolean",
          "default": true
        },
        "scorer": {
          "$ref": "#/$defs/GraphResolverScorerConfig",
          "description": "Typed matcher scorer. Cannot be combined with scorer_json."
        },
        "adjudicate": {
          "$ref": "#/$defs/GraphResolverAdjudicationConfig"
        },
        "suppress": {
          "$ref": "#/$defs/GraphResolverSuppressionConfig"
        },
        "scorer_json": {
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the scorer field."
        },
        "candidate_search": {
          "type": "string",
          "enum": [
            "",
            "exact_key",
            "prefix",
            "ann"
          ]
        },
        "candidate_ann_index": {
          "type": "string"
        },
        "candidate_limit": {
          "type": "integer",
          "format": "uint",
          "minimum": 0
        },
        "name_embedding": {
          "type": "string"
        },
        "name_embedding_dims": {
          "type": "integer",
          "format": "uint",
          "minimum": 0
        },
        "fusion_combine": {
          "type": "string",
          "enum": [
            "",
            "noisy_or",
            "max",
            "mean"
          ]
        },
        "fusion_trust": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "fusion_prior": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "fusion_prior_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0
        },
        "min_confidence": {
          "x-go-type-skip-optional-pointer": false,
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "description": "Mention admission floor: mentions whose extractor-asserted confidence is below this are never resolved — no canonical entity key, no mention edge, and relation endpoints referencing them are withheld. The cheap post-extraction junk filter for score-carrying extractors; omission defaults to 0 for trained extractors. Resolvers consuming verdict-only generated extraction must set this field explicitly, including when the chosen floor is zero."
        },
        "config_generation": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      }
    },
    "GraphResolverScorerComparison": {
      "type": "object",
      "required": [
        "name",
        "left",
        "right",
        "levels"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "left": {
          "type": "string"
        },
        "right": {
          "type": "string"
        },
        "levels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverScorerLevel"
          }
        }
      }
    },
    "GraphResolverScorerConfig": {
      "type": "object",
      "required": [
        "comparisons"
      ],
      "additionalProperties": false,
      "properties": {
        "comparisons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverScorerComparison"
          }
        },
        "combine": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "bias": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "decision": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "match": {
              "type": "number",
              "format": "double"
            },
            "review": {
              "type": "number",
              "format": "double"
            }
          }
        }
      }
    },
    "GraphResolverScorerLevel": {
      "type": "object",
      "required": [
        "weight"
      ],
      "additionalProperties": false,
      "properties": {
        "when": {
          "type": "string",
          "description": "Matcher condition, such as 'exact' or 'jaro_winkler >= 0.9'."
        },
        "else": {
          "type": "boolean",
          "description": "Catch-all level when no previous condition matched."
        },
        "weight": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "GraphResolverSuppressionConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Suppress mentions before candidate search, embedding, adjudication and promotion. Suppressed mentions remain explainable in resolution artifacts and contribute no canonical graph edges. Changes use the normal resolver generation and bounded backfill lifecycle. Redirects to suppressed keys are rejected. Runtime suppressions are additive and outlive index versions.",
      "properties": {
        "keys": {
          "type": "array",
          "maxItems": 100000,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "description": "Exact rendered canonical keys in this resolver namespace."
        },
        "texts": {
          "type": "array",
          "maxItems": 100000,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "description": "Mention texts normalized with the resolver Unicode slug rules."
        },
        "min_text_chars": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "default": 0,
          "description": "Minimum Unicode scalar count after trimming surrounding ASCII whitespace."
        }
      }
    },
    "GraphTemplateValue": {
      "description": "A literal string or finite numeric value, or a Handlebars template evaluated for each materialized graph item.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number",
          "format": "double"
        }
      ]
    },
    "GraphTtlConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "duration"
      ],
      "properties": {
        "duration": {
          "type": "string",
          "description": "Expiration duration using Antfly's integer-component duration format (ns, us, ms, s, m, h, d)."
        }
      }
    },
    "GroupedArtifactSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "group_by",
        "order_by",
        "field"
      ],
      "properties": {
        "group_by": {
          "type": "string",
          "minLength": 1
        },
        "order_by": {
          "type": "string",
          "minLength": 1,
          "description": "Field containing an integer ordinal. Ties use the document key."
        },
        "segment_by": {
          "type": "string",
          "minLength": 1
        },
        "field": {
          "type": "string",
          "minLength": 1
        },
        "filter": {
          "type": "object",
          "additionalProperties": true,
          "description": "Canonical row filter evaluated on the source projection."
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 32768,
          "description": "UTF-8 text bytes per unit, including joining newlines. An oversized single member fails explicitly."
        },
        "max_members": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 1024,
          "description": "Maximum members per unit; larger partitions emit multiple units."
        },
        "window_ordinals": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 128,
          "description": "Fixed ordinal cells bound repartitioning and incremental work for long groups."
        }
      }
    },
    "IPRangeQuery": {
      "type": "object",
      "properties": {
        "cidr": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "cidr"
      ]
    },
    "IndexConfig": {
      "type": "object",
      "description": "Configuration for an index",
      "oneOf": [
        {
          "$ref": "#/$defs/FullTextIndexConfig"
        },
        {
          "$ref": "#/$defs/EmbeddingsIndexConfig"
        },
        {
          "$ref": "#/$defs/GraphIndexConfig"
        },
        {
          "$ref": "#/$defs/AlgebraicIndexConfig"
        },
        {
          "$ref": "#/$defs/RelationalIndexConfig"
        }
      ],
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the index"
        },
        "description": {
          "type": "string",
          "description": "Optional description of the index and its purpose"
        },
        "type": {
          "$ref": "#/$defs/IndexType"
        },
        "version": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "default": 0,
          "description": "Version of the index implementation. Defaults to 0."
        },
        "enrichments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EnrichmentConfig"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Inline managed enrichment definitions required by this index. Enrichments are table-level generated artifacts such as chunks, asset-derived document units, or embeddings over an artifact stream."
        }
      }
    },
    "IndexEmbedderConfig": {
      "description": "Embedding provider configuration accepted when Antfly creates and\nmaintains an embeddings index. This purpose-specific subset reuses the\ncanonical provider configurations; it does not define a second provider\nnamespace.",
      "oneOf": [
        {
          "$ref": "#/$defs/CloudflareEmbedderConfig"
        },
        {
          "$ref": "#/$defs/OllamaEmbedderConfig"
        },
        {
          "$ref": "#/$defs/OpenAIEmbedderConfig"
        },
        {
          "$ref": "#/$defs/OpenRouterEmbedderConfig"
        },
        {
          "$ref": "#/$defs/BedrockEmbedderConfig"
        },
        {
          "$ref": "#/$defs/CohereEmbedderConfig"
        },
        {
          "$ref": "#/$defs/GoogleEmbedderConfig"
        },
        {
          "$ref": "#/$defs/VertexEmbedderConfig"
        },
        {
          "$ref": "#/$defs/AntflyEmbedderConfig"
        }
      ]
    },
    "IndexExecutionConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Namespaced execution policy for managed index shorthand. Only namespaces with runtime effects are accepted.",
      "properties": {
        "chunking": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Chunk producer batching for shorthand-created chunk enrichments."
        },
        "embedding": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Embedding producer batching for shorthand-created embedding enrichments."
        }
      }
    },
    "IndexPublicationPolicy": {
      "type": "string",
      "enum": [
        "progressive",
        "atomic"
      ],
      "default": "progressive",
      "description": "Publication behavior for a managed embeddings index. `progressive` makes a safely checkpointed active generation queryable before initial source coverage is complete. `atomic` keeps a new generation unavailable until complete validation and activation."
    },
    "IndexType": {
      "type": "string",
      "enum": [
        "full_text",
        "embeddings",
        "graph",
        "algebraic",
        "relational"
      ],
      "description": "The type of the index."
    },
    "LakeCatalogConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "description": "Catalog authority is independent of S3/GCS storage and deployment. managed uses a conditional durable head under the table root. rest uses a named HTTP connection; raw secrets are forbidden. Omit to retain explicit metadata URI/version-hint discovery.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "managed",
            "rest"
          ]
        },
        "connection": {
          "type": "string",
          "description": "Required for rest. Named external_io/http connection with lake_catalog_read and, for commits, lake_catalog_write capabilities."
        },
        "uri": {
          "type": "string",
          "description": "Required for rest; catalog base URI whose origin must be allowed by the named connection."
        },
        "namespace": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "string"
          },
          "description": "Required nonempty namespace components for rest."
        },
        "name": {
          "type": "string",
          "description": "Required table name for rest, distinct from Antfly's logical table name."
        },
        "warehouse": {
          "type": "string",
          "description": "Optional REST config warehouse selector. Other fields must be omitted for managed."
        }
      }
    },
    "MatchAllQuery": {
      "type": "object",
      "properties": {
        "match_all": {
          "type": "object"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "match_all"
      ]
    },
    "MatchNoneQuery": {
      "type": "object",
      "properties": {
        "match_none": {
          "type": "object"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "match_none"
      ]
    },
    "MatchPhraseQuery": {
      "type": "object",
      "description": "Match a phrase using the field's analyzer. On a `substring` companion,\none or two words match contained text across token separators. Three\nor more words are rejected because the suffix index cannot verify\ntheir word boundaries; lookups over 32 bytes are also rejected.\nNonzero or automatic fuzziness is rejected on substring fields; use a standalone fuzzy query instead.\n",
      "properties": {
        "match_phrase": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "analyzer": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        }
      },
      "required": [
        "match_phrase"
      ]
    },
    "MatchQuery": {
      "type": "object",
      "description": "Analyze the text with the field's analyzer and match any of the\nresulting terms. On a `substring` companion field (`fieldName._substring`)\nthe text is lowercased and matched as a contained substring instead:\n`{\"match\": \"g3we\", \"field\": \"sku._substring\"}` finds `RAG3-WEAVER`.\nSubstring lookups require at least two bytes and reject a token or\nadjacent token pair longer than 32 bytes.\n",
      "properties": {
        "match": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "analyzer": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "match"
      ]
    },
    "MatchesQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Unanchored native Unicode regular expression search on the original logical field value. Anchors refer to each complete value; indexed-term regexp semantics are unchanged.\nNo normalization is applied. Case-sensitive by default; case_sensitive=false\nuses Unicode simple case folding, not locale-specific or multi-character folding.\nMissing, null, and non-string values do not match. Arrays use any-element\nsemantics; a match never spans array elements. Indexes select conservative\ncandidates and original values are verified before counting and pagination.\n",
      "required": [
        "matches",
        "field"
      ],
      "properties": {
        "matches": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Logical source field path, not a companion index name."
        },
        "case_sensitive": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "MediaChunkPolicy": {
      "type": "object",
      "description": "Semantic chunk policy. Execution batch size and queue depth are deliberately separate.",
      "properties": {
        "max_text_bytes": {
          "type": "integer",
          "minimum": 4,
          "maximum": 16777216,
          "default": 1048576,
          "description": "Explicit byte ceiling per text chunk, independently of the target tokenizer budget."
        },
        "target_tokens": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000,
          "default": 500
        },
        "overlap_tokens": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "default": 50
        },
        "window_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 32000000000
        },
        "overlap_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0
        },
        "step_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 1000000000
        },
        "video_hold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1,
          "default": 1,
          "x-go-type-skip-optional-pointer": false,
          "description": "Select the displayed picture at each video cadence target, including VFR holds. Zero retains at-or-after timestamp sampling."
        },
        "max_frames": {
          "type": "integer",
          "minimum": 1,
          "maximum": 32,
          "default": 32
        },
        "tile_width": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_height": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_overlap": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "audio_speaker_turns": {
          "type": "boolean",
          "default": false,
          "description": "Split audio chunks at detected speaker transitions, additionally respecting the boundary model limits. Requires a diarization-enabled boundary target, zero overlap_ns and zero audio_pause_ns. The boundary diarization recipe participates in plan identity. Analysis runs even with execute=false because these boundaries depend on audio inference."
        },
        "audio_pause_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0,
          "description": "Optional minimum silence duration for choosing an earlier boundary; no samples are discarded."
        },
        "audio_pause_search_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 5000000000
        },
        "audio_silence_milli": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "maximum": 1000,
          "default": 10,
          "description": "Absolute normalized PCM amplitude threshold in thousandths."
        }
      }
    },
    "MediaOutputConfig": {
      "type": "object",
      "required": [
        "output_name"
      ],
      "description": "Publish a named shared media-pass output as a derived asset, retaining source coordinates and output recipe identity.",
      "properties": {
        "output_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      }
    },
    "MultiMatchBody": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string"
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "bool_prefix"
          ]
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "query",
        "fields",
        "type"
      ]
    },
    "MultiMatchQuery": {
      "type": "object",
      "properties": {
        "multi_match": {
          "$ref": "#/$defs/MultiMatchBody"
        }
      },
      "required": [
        "multi_match"
      ]
    },
    "MultiPhraseQuery": {
      "type": "object",
      "properties": {
        "terms": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        }
      },
      "required": [
        "terms"
      ]
    },
    "NumericRangeQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "min": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "x-go-type-skip-optional-pointer": false
        },
        "max": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_min": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_max": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "OllamaEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the Ollama embedding provider.\n\nLocal embeddings for privacy and offline use. URL via `url` field or `OLLAMA_HOST` env var.\n\n**Example Models:** nomic-embed-text (768 dims), mxbai-embed-large (1024 dims), all-minilm (384 dims)\n\n**Docs:** https://ollama.com/search?c=embedding",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "ollama"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Ollama model to use (e.g., 'nomic-embed-text', 'mxbai-embed-large')."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Ollama API endpoint. Can also be set via OLLAMA_HOST environment variable.",
          "default": "http://localhost:11434"
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OllamaGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Ollama generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "ollama"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Ollama model to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Ollama API endpoint."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Ollama API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the OpenAI embedding provider.\n\nAPI key via `api_key` field or `OPENAI_API_KEY` environment variable.\nSupports OpenAI-compatible APIs via `url` field.\n\n**Example Models:** text-embedding-3-small (default, 1536 dims), text-embedding-3-large (3072 dims)\n\n**Docs:** https://platform.openai.com/docs/guides/embeddings",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openai"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the OpenAI model to use.",
          "default": "text-embedding-3-small"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenAI API endpoint. Defaults to OpenAI's API. Can be set via OPENAI_BASE_URL environment variable.",
          "default": "https://api.openai.com"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenAI API key. Can also be set via OPENAI_API_KEY environment variable."
        },
        "dimensions": {
          "type": "integer",
          "description": "Output dimension for the embedding (uses MRL for dimension reduction). Recommended: 256, 512, 1024, 1536, or 3072."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenAI generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openai"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the OpenAI model to use.",
          "default": "gpt-4.1"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenAI API endpoint."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenAI API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "max_completion_tokens": {
          "type": "integer",
          "minimum": 1,
          "description": "OpenAI completion budget, including visible output and reasoning tokens.\nUse for reasoning models instead of max_tokens; the two are mutually exclusive.\n"
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort",
          "description": "Optional reasoning effort. Supported values depend on the selected OpenAI model."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIReasoningEffort": {
      "type": "string",
      "enum": [
        "none",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "description": "OpenAI reasoning effort; model support varies. Omit to use the model default."
    },
    "OpenAISTTConfig": {
      "type": "object",
      "description": "Configuration for OpenAI STT (Whisper) provider.\n\nAPI key via `api_key` field or `OPENAI_API_KEY` environment variable.\n\n**Model:** whisper-1\n\n**Supported Formats:** mp3, wav, webm, ogg, flac (max 25MB)\n\n**Docs:** https://platform.openai.com/docs/guides/speech-to-text",
      "properties": {
        "model": {
          "type": "string",
          "default": "whisper-1",
          "description": "Whisper model to use."
        },
        "api_key": {
          "type": "string",
          "description": "OpenAI API key. Falls back to OPENAI_API_KEY environment variable."
        },
        "base_url": {
          "type": "string",
          "format": "uri",
          "description": "API base URL. Falls back to OPENAI_BASE_URL environment variable."
        }
      }
    },
    "OpenRouterEmbedderConfig": {
      "type": "object",
      "description": "Configuration for the OpenRouter embedding provider.\n\nOpenRouter provides a unified API for multiple embedding models from different providers.\nAPI key via `api_key` field or `OPENROUTER_API_KEY` environment variable.\n\nAntfly currently supports dense text embeddings through this provider.\n\n**Example Models:** openai/text-embedding-3-small (default), openai/text-embedding-3-large,\ngoogle/gemini-embedding-001, qwen/qwen3-embedding-8b\n\n**Docs:** https://openrouter.ai/docs/api/reference/embeddings",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openrouter"
          ]
        },
        "model": {
          "type": "string",
          "description": "The OpenRouter model identifier (e.g., 'openai/text-embedding-3-small', 'google/gemini-embedding-001').",
          "default": "openai/text-embedding-3-small"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The OpenRouter API base URL. Defaults to OPENROUTER_BASE_URL or https://openrouter.ai/api/v1."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenRouter API key. Can also be set via OPENROUTER_API_KEY environment variable."
        },
        "dimensions": {
          "type": "integer",
          "description": "Output dimension for the embedding (if supported by the model)."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenRouterGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenRouter generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openrouter"
          ]
        },
        "model": {
          "type": "string",
          "description": "The OpenRouter model identifier to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenRouter API endpoint.",
          "default": "https://openrouter.ai/api/v1"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenRouter API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "PhraseQuery": {
      "type": "object",
      "properties": {
        "terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        }
      },
      "required": [
        "terms"
      ]
    },
    "PrefixQuery": {
      "type": "object",
      "description": "Match terms that start with the given bytes. On a `substring`\ncompanion field the prefix is lowercased and matched as a contained\nsubstring, exactly like `match` on that field.\n",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "prefix": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "prefix"
      ]
    },
    "PriorArtifactContext": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact",
        "render"
      ],
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Artifact providing earlier items, including this producer's own artifact."
        },
        "render": {
          "type": "string",
          "minLength": 1,
          "description": "Template rendered for each prior item, newest first."
        },
        "max_items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 40
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "horizon_segments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 8,
          "description": "Earlier segments available for context and the maximum later segments invalidated at each affected position of an original source change. A move invalidates the old and new neighborhoods independently; recomputed outputs never extend either interval."
        }
      }
    },
    "Query": {
      "oneOf": [
        {
          "$ref": "#/$defs/EqualsQuery"
        },
        {
          "$ref": "#/$defs/ContainsQuery"
        },
        {
          "$ref": "#/$defs/MatchesQuery"
        },
        {
          "$ref": "#/$defs/AutocompleteQuery"
        },
        {
          "$ref": "#/$defs/TermQuery"
        },
        {
          "$ref": "#/$defs/MatchQuery"
        },
        {
          "$ref": "#/$defs/MultiMatchQuery"
        },
        {
          "$ref": "#/$defs/MatchPhraseQuery"
        },
        {
          "$ref": "#/$defs/PhraseQuery"
        },
        {
          "$ref": "#/$defs/MultiPhraseQuery"
        },
        {
          "$ref": "#/$defs/FuzzyQuery"
        },
        {
          "$ref": "#/$defs/PrefixQuery"
        },
        {
          "$ref": "#/$defs/RegexpQuery"
        },
        {
          "$ref": "#/$defs/WildcardQuery"
        },
        {
          "$ref": "#/$defs/QueryStringQuery"
        },
        {
          "$ref": "#/$defs/NumericRangeQuery"
        },
        {
          "$ref": "#/$defs/TermRangeQuery"
        },
        {
          "$ref": "#/$defs/DateRangeStringQuery"
        },
        {
          "$ref": "#/$defs/BoolQuery"
        },
        {
          "$ref": "#/$defs/BooleanQuery"
        },
        {
          "$ref": "#/$defs/ConjunctionQuery"
        },
        {
          "$ref": "#/$defs/DisjunctionQuery"
        },
        {
          "$ref": "#/$defs/MatchAllQuery"
        },
        {
          "$ref": "#/$defs/MatchNoneQuery"
        },
        {
          "$ref": "#/$defs/DocIdQuery"
        },
        {
          "$ref": "#/$defs/BoolFieldQuery"
        },
        {
          "$ref": "#/$defs/IPRangeQuery"
        },
        {
          "$ref": "#/$defs/GeoBoundingBoxQuery"
        },
        {
          "$ref": "#/$defs/GeoDistanceQuery"
        },
        {
          "$ref": "#/$defs/GeoBoundingPolygonQuery"
        },
        {
          "$ref": "#/$defs/GeoShapeQuery"
        }
      ]
    },
    "QueryStringQuery": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "query"
      ]
    },
    "RateLimitConfig": {
      "type": "object",
      "x-go-type-skip-optional-pointer": false,
      "additionalProperties": false,
      "description": "Outbound provider limits shared within one Antfly process by effective\nendpoint, operation, model, credential source, project and region/location.\nConflicting policies for an active scope are rejected. These limits do\nnot coordinate across replicas or infer the provider's account quota.\n",
      "properties": {
        "pacing": {
          "$ref": "#/$defs/RequestPacing",
          "description": "Request pacing mode. Defaults to token_bucket. Legacy flat embedder RPM with burst=1 uses completion pacing."
        },
        "requests_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295
        },
        "burst": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "default": 1
        },
        "tokens_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Conservative text budget: each HTTP attempt reserves its serialized\nUTF-8 body byte count plus the configured generation output cap.\nReservations are not refunded. A request larger than this budget\nis rejected. This is not provider billing token accounting; media\nrequests are not supported with this limit.\n"
        },
        "max_concurrency": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "description": "Maximum in-flight HTTP attempts, held through response completion."
        }
      }
    },
    "RawQuery": {
      "oneOf": [
        {
          "$ref": "#/$defs/Query"
        }
      ],
      "x-go-type": "json.RawMessage",
      "x-zig-type": "raw_json",
      "description": "An Antfly query expression retained as syntactically validated JSON and compiled by the query engine."
    },
    "RegexpQuery": {
      "type": "object",
      "description": "Match post-analysis indexed terms. Patterns are not stemmed; use match for analyzed natural-language input.",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "regexp": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "regexp"
      ]
    },
    "RelationalCheckConstraint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "description": "A typed CHECK. Supply either expression or column and op (with optional\nvalue and collation), never both forms. Expressions must return boolean\nand use the shared bounded immutable scalar expression vocabulary.\nNew writes are checked from schema publication;\nexisting rows are validated separately. SQL UNKNOWN satisfies CHECK.\nComparison values must match the column type. Integer values may also\nuse exact decimal strings to avoid client-side floating-point rounding.\n",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "column": {
          "type": "string",
          "minLength": 1
        },
        "op": {
          "$ref": "#/$defs/RelationalComparisonOp"
        },
        "value": {
          "description": "Scalar comparison operand. Omission represents NULL. Null tests require a NULL operand."
        },
        "collation": {
          "type": "string",
          "description": "String comparison collation; uses the same rules as ordered indexes."
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        }
      }
    },
    "RelationalColumnExpression": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "column",
        "expression"
      ],
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        }
      }
    },
    "RelationalComparisonOp": {
      "type": "string",
      "enum": [
        "is_null",
        "is_not_null",
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "is_distinct",
        "is_not_distinct"
      ]
    },
    "RelationalExpressionOp": {
      "type": "string",
      "enum": [
        "literal",
        "column",
        "add",
        "subtract",
        "multiply",
        "divide",
        "negate",
        "concat",
        "coalesce",
        "lower_ascii",
        "upper_ascii",
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "is_null",
        "is_not_null",
        "is_distinct",
        "is_not_distinct",
        "and",
        "or",
        "not",
        "cast",
        "case_when",
        "modulo",
        "in_list",
        "not_in_list",
        "array"
      ]
    },
    "RelationalExpressionType": {
      "type": "string",
      "enum": [
        "string",
        "blob",
        "boolean",
        "datetime",
        "integer",
        "number",
        "numeric",
        "sql_array"
      ]
    },
    "RelationalForeignKeyConstraint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "child_columns",
        "parent_table",
        "parent_columns"
      ],
      "description": "Composite foreign key. Child and parent columns correspond by position\nand must have the same physical comparison types. The parent columns\nmust identify a unique key. Existing-row validation is independent of\nnew-write enforcement and is never client-writable.\nEnforcement and referential actions share the bounded distributed\ntransaction path, including TTL expiry. Partial matching uses ordered\nsupport indexes on the parent; activation waits until these are ready.\nSET NULL requires every child column to accept explicit NULL.\n",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "child_columns": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "parent_table": {
          "type": "string",
          "minLength": 1,
          "description": "Literal parent table name in the child table's database and namespace.\nResolved to an immutable table identity when the constraint is declared;\nrenaming a parent preserves the reference. Public schemas show its current name.\n"
        },
        "parent_columns": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "on_delete": {
          "$ref": "#/$defs/ForeignKeyAction"
        },
        "on_update": {
          "$ref": "#/$defs/ForeignKeyAction"
        },
        "timing": {
          "$ref": "#/$defs/ForeignKeyTiming"
        },
        "match": {
          "$ref": "#/$defs/ForeignKeyMatch"
        },
        "deferrable": {
          "type": "boolean"
        }
      }
    },
    "RelationalIndexConfig": {
      "type": "object",
      "required": [
        "keys"
      ],
      "description": "Schema-bound composite ordered index on a relational table. Keys use stable typed comparison semantics and independent direction, null placement, and string collation. Existing rows build asynchronously; indexed queries require complete owner coverage. The table schema is the single durable authority for these definitions.\n",
      "properties": {
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "include_columns": {
          "type": "array",
          "maxItems": 256,
          "uniqueItems": true,
          "description": "Non-key columns stored for index-only projection; distinct from keys.",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Optional conjunction selecting index members. Queries must explicitly include all typed conjuncts.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        }
      }
    },
    "RelationalIndexDefinition": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "keys"
      ],
      "description": "Declarative table-owned ordered index. Keys are compared lexicographically\nin the declared order, with independent direction, null placement, and\nstring collation. Creation builds existing rows asynchronously; queries\nmust wait for range-local coverage. Unique constraints and expression\nkeys are not implied by this object. Optional WHERE conjuncts select\nonly matching rows. INCLUDE columns\nstore typed values alongside keys for index-only projected reads.\n",
      "properties": {
        "description": {
          "type": "string",
          "description": "Optional human-readable description, also exposed by the shared indexes API."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "include_columns": {
          "type": "array",
          "maxItems": 256,
          "uniqueItems": true,
          "description": "Non-key columns stored in the index; must be distinct from key columns.",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Conjunction of typed predicates. Indexed queries must explicitly contain every conjunct with equivalent typed comparison semantics.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        }
      }
    },
    "RelationalIndexKey": {
      "type": "object",
      "additionalProperties": false,
      "description": "Ordered component of a relational ordered-tuple index key. Supply\neither a declared column or a deterministic typed scalar expression\nwith its result_type. Composite keys may mix both forms. Bounds use\nthe expression result type, not its input columns.\n",
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1,
          "description": "Declared relational column used by this key component."
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        },
        "result_type": {
          "$ref": "#/$defs/RelationalExpressionType"
        },
        "collation": {
          "type": "string",
          "minLength": 1,
          "description": "String-key collation. Omission selects binary ordering. Supported\nbinary aliases are C, POSIX, and binary. The aliases ci,\ncase_insensitive, and antfly.case_insensitive select ASCII-only\ncase folding, not locale-aware or Unicode case folding.\n"
        },
        "direction": {
          "$ref": "#/$defs/RelationalIndexKeyDirection"
        },
        "nulls": {
          "$ref": "#/$defs/RelationalIndexKeyNulls"
        }
      }
    },
    "RelationalIndexKeyDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ],
      "description": "Direction of one ordered index key component. Omission selects asc."
    },
    "RelationalIndexKeyNulls": {
      "type": "string",
      "enum": [
        "default",
        "first",
        "last"
      ],
      "description": "Null placement for one ordered index key component. The default is\nlast for ascending keys and first for descending keys. Omission selects default.\n"
    },
    "RelationalIndexPredicate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "column",
        "op"
      ],
      "description": "A typed partial-index conjunct. Only TRUE is indexed; FALSE and SQL UNKNOWN are excluded.",
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1
        },
        "op": {
          "$ref": "#/$defs/RelationalComparisonOp"
        },
        "value": {
          "description": "Typed scalar operand; integer columns also accept exact decimal strings. Omission means NULL."
        },
        "collation": {
          "type": "string",
          "description": "String comparison collation with the same semantics as ordered keys."
        }
      }
    },
    "RelationalScalarExpression": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "op"
      ],
      "description": "Immutable typed scalar expression, limited to 128 nodes and 16 levels.\nA literal requires type; omitted value means typed null. A column\nrequires column; other\noperations require args. Unknown or irrelevant fields are rejected.\nArithmetic operands have the same integer or number type. Integer\ndivision truncates toward zero. Overflow and division by zero reject\nthe write. Arithmetic and string operations propagate null. ASCII case\noperations leave non-ASCII bytes unchanged. No volatile functions are\naccepted. Allocated results are bounded to 1 MiB each. Allocations\nand byte-comparison operand work share a 4 MiB evaluation budget per\nrow and expression set. An integer literal may use a decimal string\nfor exact int64 transport; blob uses base64 and datetime uses the\nnormal relational datetime representation.\nComparisons require operands of compatible types (integer and number may mix) and return boolean or\nSQL UNKNOWN (null); is_distinct and is_not_distinct always return a\nboolean. Unary is_null and is_not_null test presence/null. AND and OR\nevaluate left to right with SQL three-valued short-circuit semantics;\nNOT preserves UNKNOWN. CHECK accepts TRUE and UNKNOWN, rejecting FALSE.\nNumeric literals and arithmetic operations may specify sql_type to\nretain PostgreSQL builtin overflow and float4 rounding semantics.\nWithout it, integer and number operations retain int64 and float64\nsemantics. Numeric cast requires type and sql_type, takes one numeric\nargument, and performs a checked conversion when evaluated (not when\nthe schema is compiled). Floating-to-integer casts round ties to even.\nThe numeric expression type uses exact PostgreSQL NUMERIC values and\nmay specify sql_type numeric. Its literals accept decimal strings or\nexact JSON numeric lexemes, including string-valued special values.\nExact NUMERIC programs require reader capability version 21 even when\ntheir result is boolean or integer. Float/integer assignment casts keep\ntheir declared PostgreSQL rounding and overflow semantics.\nA cast to numeric may specify numeric_modifier for PostgreSQL precision\nand signed-scale coercion. Overflow is checked when the selected cast\nexecutes; unselected lazy branches do not fail. Modifier-bearing programs\nrequire reader capability version 23 even with integer/boolean output.\nThe sql_array expression type requires sql_type on literals, including\ntyped NULL, to declare the element builtin. Non-null literals use the\nordinal SQL array envelope (dimensions with length/lower_bound, values,\nand sql_nulls), retaining shape and lower bounds. Array columns derive\ntheir exact element identity from the immutable schema. Comparisons,\nIN, COALESCE and CASE require matching array element identities; no\nelement type is inferred from values. Array-dependent programs require\nreader capability version 24 even with scalar output. Assignment to a\nNUMERIC array column applies its precision/signed-scale modifier to\neach element. Array casts require type sql_array and an explicit matching\nsql_type; identity casts borrow the immutable input. Casts of numeric\narrays may additionally specify numeric_modifier, coercing each non-NULL\nelement with PostgreSQL precision and signed-scale semantics while\npreserving dimensions, lower bounds and NULL slots. Coercion is lazy\nand shares invocation admission with the surrounding expression.\nArray-valued ordered index keys and element-changing array casts are\nnot supported by this expression contract.\nThe array constructor requires sql_type and zero to 32 arguments.\nConstructor programs additionally require reader capability version 25,\nincluding constructors hidden inside scalar/boolean expressions.\nScalar arguments must have the declared element domain, with explicit\nwidth-preserving numeric casts where needed. SQL NULL arguments become\nNULL elements. Array arguments must all have matching element types,\ndimensions and lower bounds; one leading dimension with lower bound 1\nis added. All empty/NULL subarrays produce an empty array; mixing an\nempty/NULL subarray with a nonempty one is a dimension mismatch. Child\nexpressions execute once, with shared work/cancellation and byte limits.\ncase_when takes alternating boolean conditions and result expressions,\nfollowed by a mandatory fallback result (3 to 31 arguments, at most\n15 branches). Conditions are evaluated in order; only the selected\nresult is evaluated, and a NULL condition is not TRUE. All result\nexpressions must have the same physical type. Numeric SQL lowering\nrecords builtin result-domain promotions as explicit casts. This\noperation requires schema capability version 18.\nmodulo takes two same-domain integer or NUMERIC operands and returns the signed\nremainder (minInt modulo -1 is zero); a zero divisor rejects the write.\nin_list and not_in_list take one probe followed by 1 to 127 same-domain\ncandidates. The probe is evaluated once; NULL probes return UNKNOWN.\nA matching candidate wins over NULL candidates; otherwise a NULL\ncandidate makes the result UNKNOWN. These operations require schema\ncapability version 19.\n",
      "properties": {
        "op": {
          "$ref": "#/$defs/RelationalExpressionOp"
        },
        "type": {
          "$ref": "#/$defs/RelationalExpressionType"
        },
        "sql_type": {
          "$ref": "#/$defs/SQLBuiltinType",
          "description": "Numeric builtin result identity on numeric literals, arithmetic, negate, and cast (capability version 18), or required array element identity on sql_array literals including typed NULL (capability version 24)."
        },
        "numeric_modifier": {
          "$ref": "#/$defs/SQLNumericModifier",
          "description": "Optional precision/signed-scale coercion; accepted only on cast with type numeric and sql_type numeric. Requires reader capability version 23."
        },
        "value": {
          "description": "Typed literal value, including null."
        },
        "column": {
          "type": "string",
          "minLength": 1
        },
        "collation": {
          "type": "string",
          "description": "Optional binary or ASCII case-insensitive collation for string comparisons and in_list; aliases match ordered indexes."
        },
        "args": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "$ref": "#/$defs/RelationalScalarExpression"
          }
        }
      }
    },
    "RelationalUniqueConstraint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "description": "A named, ordered composite unique key. Validation status is maintained\nby the server. TTL expiry uses the distributed integrity coordinator.\nReferenced unique keys are nondeferrable.\n",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "origin": {
          "$ref": "#/$defs/RelationalUniqueConstraintOrigin"
        },
        "primary": {
          "type": "boolean",
          "description": "SQL primary-key identity. At most one per relational table; all key columns must be required and nonnullable."
        },
        "columns": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "description": "Typed native unique keys. Specify either columns or keys.",
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Conjunction restricting uniqueness to matching rows.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        },
        "nulls_not_distinct": {
          "type": "boolean",
          "description": "When true, NULL components compare equal for uniqueness."
        },
        "deferrable": {
          "type": "boolean",
          "description": "Permit uniqueness checks at transaction commit. Never eligible as an ON CONFLICT arbiter or a referenced foreign key target."
        },
        "timing": {
          "$ref": "#/$defs/ForeignKeyTiming"
        }
      }
    },
    "RelationalUniqueConstraintOrigin": {
      "type": "string",
      "enum": [
        "constraint",
        "index"
      ],
      "default": "constraint",
      "description": "Durable ownership kind. Index-owned uniqueness participates in ON CONFLICT inference but is not a named SQL constraint. Human-readable index descriptions never determine ownership."
    },
    "ReplicationRoute": {
      "type": "object",
      "required": [
        "target_table"
      ],
      "properties": {
        "target_table": {
          "type": "string",
          "description": "Name of the Antfly table to write matching rows to. The table must\nalready exist.\n"
        },
        "where": {
          "$ref": "#/$defs/RawQuery",
          "description": "Antfly's native filter query (see `RawQuery`) evaluated against each CDC row. Only rows\nmatching this filter are written to `target_table`. If omitted,\nall rows match (equivalent to `match_all`).\n"
        },
        "key_template": {
          "type": "string",
          "description": "Override the source-level `key_template` for this route. If omitted,\nthe source-level template is used.\n"
        },
        "on_update": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations for INSERT/UPDATE events on this route. If omitted,\nauto-generates `$set` for every column (passthrough mode).\n"
        },
        "on_delete": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations for DELETE events on this route. If omitted,\nauto-derives from this route's `on_update` paths.\n"
        }
      }
    },
    "ReplicationSource": {
      "type": "object",
      "required": [
        "type",
        "dsn",
        "postgres_table"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the replication source. Currently only \"postgres\" is supported.\n",
          "enum": [
            "postgres"
          ]
        },
        "dsn": {
          "type": "string",
          "description": "Data source name (connection string) for the PostgreSQL database.\nSupports `${secret:key_name}` references that resolve from the Antfly secret store\nor environment variables. Requires `wal_level=logical` on the source.\n"
        },
        "postgres_table": {
          "type": "string",
          "description": "Name of the table in the PostgreSQL database to replicate from.\n"
        },
        "key_template": {
          "type": "string",
          "default": "_id",
          "description": "Template for constructing the Antfly document key from PG columns.\nWhen omitted, Antfly first uses `_id`, then falls back to `id` if\nthe row has no `_id` column.\nA plain string (e.g., \"id\") uses that column's value directly.\nUse `{{column}}` syntax for composite keys: `{{tenant_id}}:{{user_id}}`.\n"
        },
        "slot_name": {
          "type": "string",
          "description": "PostgreSQL replication slot name. If omitted, auto-derived from\nthe Antfly table and PG table names. Specify this when using\npre-created slots (e.g., on Supabase or Neon).\n"
        },
        "publication_name": {
          "type": "string",
          "description": "PostgreSQL publication name. If omitted, auto-derived and created\nautomatically. Specify this when using pre-created publications.\n"
        },
        "on_update": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations applied on INSERT/UPDATE events. Values can\nreference PG columns via `{{column}}` syntax. If omitted, auto-generates\n`$set` for every column (passthrough mode).\n"
        },
        "on_delete": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations applied on DELETE events. If omitted, auto-derives\n`$unset` ops from `on_update`'s `$set` paths (safe for multi-source).\nUse `$delete_document` op to delete the entire Antfly document.\n"
        },
        "publication_filter": {
          "$ref": "#/$defs/RawQuery",
          "description": "Antfly's native filter query (see `RawQuery`) that gets translated to SQL and\napplied as a WHERE clause on the PostgreSQL publication. This filters rows at the\nsource before they are sent over the replication stream, reducing\nnetwork and processing overhead.\n\nRequires PostgreSQL 15 or newer and is applied only when Antfly\ncreates the publication. Changing this value does not alter an\nexisting publication; update or recreate that publication directly.\n\nOnly a subset of filter types are supported (term, match, range,\nconjuncts, disjuncts, must_not). The filter is translated to SQL\nwith inlined literal values.\n\nExample: `{\"term\": \"active\", \"field\": \"status\"}` becomes\n`WHERE (\"status\" = 'active')` on the publication.\n"
        },
        "routes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationRoute"
          },
          "description": "Conditional routes for fan-out replication. Each route evaluates its\n`where` filter against every CDC row and, on match, writes to the\nspecified `target_table`. Multiple routes can match the same row.\n\nWhen routes are present, the top-level `on_update`/`on_delete` are\nignored — each route defines its own transforms.\n"
        },
        "require_exact_cutover": {
          "type": "boolean",
          "description": "When true, indicates this source was reseeded with exact cutover mode\nand must replay from a consistent snapshot before streaming.\n"
        },
        "status": {
          "$ref": "#/$defs/ReplicationSourceStatus"
        },
        "action_hint": {
          "$ref": "#/$defs/ReplicationSourceActionHint"
        }
      }
    },
    "ReplicationSourceActionHint": {
      "type": "object",
      "readOnly": true,
      "description": "Action hint for this replication source when remediation is recommended.\nPresent only in GET table detail responses.\n",
      "properties": {
        "action": {
          "type": "string",
          "description": "Recommended action (e.g., \"reseed_exact_cutover\")."
        },
        "reason": {
          "type": "string",
          "description": "Human-readable reason for the recommendation."
        },
        "reseed_exact_cutover_path": {
          "type": "string",
          "description": "API path to trigger a reseed exact cutover, if applicable."
        }
      }
    },
    "ReplicationSourceStatus": {
      "type": "object",
      "readOnly": true,
      "description": "Runtime status of this replication source. Present only in GET table\ndetail responses, not in create/update requests.\n",
      "properties": {
        "source_kind": {
          "type": "string"
        },
        "external_table": {
          "type": "string"
        },
        "cutover_mode": {
          "type": "string"
        },
        "slot_name": {
          "type": "string"
        },
        "publication_name": {
          "type": "string"
        },
        "phase": {
          "type": "string"
        },
        "checkpoint": {
          "type": "string"
        },
        "snapshot_offset": {
          "type": "integer"
        },
        "prepared_checkpoint": {
          "type": "string"
        },
        "stream_checkpoint": {
          "type": "string"
        },
        "last_error": {
          "type": "string"
        },
        "failure_class": {
          "type": "string"
        },
        "lag_records": {
          "type": "integer"
        },
        "lag_millis": {
          "type": "integer"
        },
        "consecutive_failures": {
          "type": "integer"
        },
        "last_source_commit_at_ms": {
          "type": "integer"
        },
        "last_success_at_ms": {
          "type": "integer"
        },
        "last_change_applied_at_ms": {
          "type": "integer"
        },
        "updated_at_ms": {
          "type": "integer"
        }
      }
    },
    "ReplicationTransformOp": {
      "type": "object",
      "required": [
        "op"
      ],
      "properties": {
        "op": {
          "type": "string",
          "description": "Transform operation. Supported ops: `$set`, `$setOnInsert`, `$unset`, `$inc`, `$push`, `$pull`, `$addToSet`, `$min`, `$max`.\nReplication-specific: `$merge` (flatten JSONB into top-level fields),\n`$delete_document` (delete entire Antfly doc, `on_delete` only).\n"
        },
        "path": {
          "type": "string",
          "description": "Antfly document field path. Required for `$set`, `$unset`, etc."
        },
        "value": {
          "description": "Value for the operation. Can be a literal (string, number, boolean)\nor a `{{column}}` reference to a PG column value. Use `{{col.key}}` to\nnavigate into decoded JSONB columns.\n"
        }
      }
    },
    "RequestPacing": {
      "type": "string",
      "enum": [
        "token_bucket",
        "completion"
      ],
      "description": "token_bucket limits admission rate while allowing overlapping attempts.\ncompletion serializes attempts and waits one RPM interval after each\nattempt finishes, including streamed writes and transport failures.\nThis prevents delayed connection setup from compressing successful\nrequest spacing, at the cost of response latency plus one interval per\nrequest. Requires requests_per_minute and burst=1. Neither mode can\nguarantee zero upstream 429s or coordinate other processes.\n"
    },
    "SQLArrayColumnSchema": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "type",
        "x-antfly-sql-type"
      ],
      "description": "JSON Schema property declaration for one typed SQL-array column in a\nrelational table. Use it as a root property of DocumentSchema.schema.\nThe element identity is mandatory; a JSON Schema `array` remains a JSON\ncolumn and is never inferred to be a SQL array. Column values use the\nlossless SQLArrayValue envelope: dimensions with lower bounds, flat\nrow-major values and explicit SQL NULL flags. Integer elements are\ndecimal strings, even when small. JSONB null and SQL NULL are distinct.\nFloat elements acquire their declared width before validation and\nstorage. Outer null represents a SQL NULL array when nullable is true.\nAdditional JSON Schema constraints apply to this envelope, not to\nPostgreSQL array subscripts. SQL array index keys and SQL DDL activation\nare not implied by accepting this storage schema.\n",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "sql_array"
          ]
        },
        "x-antfly-sql-type": {
          "$ref": "#/$defs/SQLArrayElementType"
        },
        "x-antfly-sql-numeric-modifier": {
          "$ref": "#/$defs/SQLNumericModifier",
          "x-go-type-skip-optional-pointer": false,
          "description": "Accepted only with numeric element identity. Applies assignment coercion to each non-NULL element while preserving dimensions and lower bounds. Requires reader capability version 23."
        },
        "nullable": {
          "type": "boolean",
          "default": false
        },
        "description": {
          "type": "string"
        }
      }
    },
    "SQLArrayElementType": {
      "type": "string",
      "description": "Bound SQL scalar or array-element identity, including numeric widths and exact NUMERIC. Never inferred from JSON value shape.",
      "enum": [
        "text",
        "int16",
        "int32",
        "int64",
        "float32",
        "float64",
        "boolean",
        "uuid",
        "jsonb",
        "numeric"
      ]
    },
    "SQLBuiltinType": {
      "type": "string",
      "description": "Exact PostgreSQL builtin identity for a relational root scalar column.\nSQL array columns use SQLArrayElementType for their element identity.\nSet the JSON Schema property's `x-antfly-sql-type` annotation to one of\nthese values. The underlying property type must match. SQL array storage\nis not implied by this annotation. Existing unannotated schemas retain\ntheir original domains.\nThe numeric identity uses an underlying number property and exact\nPostgreSQL NUMERIC semantics, never binary float. Submit finite values\nas JSON numeric lexemes or decimal strings; special values use strings\nNaN, Infinity and -Infinity. Const/enum finite numeric members must be\nJSON numbers, not strings. Bounds and multipleOf are exact decimals.\nPublic scalar NUMERIC schemas require reader capability version 22.\nTo constrain a NUMERIC scalar or SQL-array column, set the root\nproperty's `x-antfly-sql-numeric-modifier` annotation to an object with\nprecision (1..1000) and signed scale (-1000..1000). The annotation\nrequires numeric identity and reader capability version 23. Assignment\nrounds before constraints, indexes and generated dependents; overflow\nrejects the write. Restore verifies stored values without rounding.\n",
      "enum": [
        "text",
        "int16",
        "int32",
        "int64",
        "float32",
        "float64",
        "boolean",
        "uuid",
        "jsonb",
        "numeric"
      ]
    },
    "SQLNumericModifier": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "precision",
        "scale"
      ],
      "description": "PostgreSQL NUMERIC precision and signed scale. For arrays this describes every element, not dimensions. Absent means unconstrained NUMERIC.",
      "properties": {
        "precision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "scale": {
          "type": "integer",
          "minimum": -1000,
          "maximum": 1000
        }
      }
    },
    "STTConfig": {
      "description": "Unified configuration for an STT provider.\n\nSelect the provider type and configure provider-specific settings.\n\n**Supported Providers:**\n- `openai` - OpenAI Whisper (whisper-1)\n- `vertex` - Google Cloud Speech-to-Text (Vertex AI)\n- `antfly` - Antfly inference service (Whisper, Wav2Vec2, HuBERT)\n\n**Example:**\n```yaml\nprovider: antfly\napi_url: \"http://localhost:8080\"\nmodel: openai/whisper-base\n```",
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudflareSTTConfig"
            },
            {
              "$ref": "#/$defs/OpenAISTTConfig"
            },
            {
              "$ref": "#/$defs/VertexSTTConfig"
            },
            {
              "$ref": "#/$defs/AntflySTTConfig"
            },
            {
              "$ref": "#/$defs/AppleSTTConfig"
            }
          ]
        },
        {
          "properties": {
            "provider": {
              "$ref": "#/$defs/STTProvider"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "STTProvider": {
      "type": "string",
      "enum": [
        "cloudflare",
        "openai",
        "vertex",
        "antfly",
        "apple"
      ],
      "description": "The STT provider to use."
    },
    "TableSchema": {
      "type": "object",
      "description": "Schema definition for a table with multiple document types",
      "properties": {
        "version": {
          "type": "integer",
          "format": "uint32",
          "readOnly": true,
          "description": "Backend-managed schema generation used for migrations. Omit it from create and update requests."
        },
        "storage_mode": {
          "$ref": "#/$defs/TableStorageMode"
        },
        "base_source": {
          "$ref": "#/$defs/ExternalLakeTableSource",
          "description": "External tables require relational storage mode. Ordinary row writes are read-only; an explicit iceberg_writer catalog binding permits Iceberg file commits. Omit for native tables."
        },
        "column_defaults": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalColumnExpression"
          },
          "description": "Immutable typed expressions applied only to absent columns on new\nwrites, never explicit null. Defaults cannot reference columns.\nA column cannot have both a default and a generated expression.\nOmission or [] declares none. Relational tables only.\n"
        },
        "generated_columns": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalColumnExpression"
          },
          "description": "Stored immutable generated columns, evaluated in dependency order\non writes before validation and indexing. Cycles are rejected.\nGenerated columns are output-only; submitted values are replaced\nby the computed value. Omission or [] declares none. Defaults\nand generated declarations together are limited to 256 columns,\n4096 expression nodes, and 4 MiB of literal data. Evaluation has\na shared 4 MiB allocation budget across all column expressions.\nRestore verifies stored results instead of silently recomputing\nthem. Changing, adding, or removing generated semantics through\nan existing table's schema update requires explicit rewrite=true\non the PUT or PATCH schema route. This returns a durable restore\njob and replaces the complete authorized dependency cohort only\nafter distributed transformation and validation. Ordinary schema\nupdates reject these changes, even when a table appears empty.\nDeclaration reordering and default-only changes remain allowed.\nRelational tables only.\n"
        },
        "checks": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalCheckConstraint"
          },
          "description": "Named scalar CHECK constraints for a relational schema. This is\npart of the complete schema: omission or [] declares no checks.\nNew writes enforce every check. Existing-row validation status is\nmaintained separately and is never accepted from the client.\n"
        },
        "unique_constraints": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalUniqueConstraint"
          },
          "description": "Complete set of composite unique declarations. Omission or [] declares none."
        },
        "foreign_keys": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalForeignKeyConstraint"
          },
          "description": "Complete set of outgoing composite foreign keys. Omission or [] declares none."
        },
        "relational_indexes": {
          "type": "array",
          "x-go-type-skip-optional-pointer": false,
          "maxItems": 4096,
          "items": {
            "$ref": "#/$defs/RelationalIndexDefinition"
          },
          "description": "Desired ordered indexes for a relational table. Names must be unique.\nAn explicit array replaces the declarations; an empty array drops\nthem. Omission preserves existing declarations during schema updates.\nIndex definitions commit atomically with the schema; build progress\nand readiness are local to each owning shard, not client-writable.\n"
        },
        "default_type": {
          "type": "string",
          "description": "Default type to use from the document_schemas."
        },
        "enforce_types": {
          "type": "boolean",
          "description": "Whether to enforce that documents must match one of the provided document types.\nIf false, documents not matching any type will be accepted but not indexed.\n"
        },
        "document_schemas": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentSchema"
          },
          "description": "A map of type names to their document json schemas."
        },
        "ttl": {
          "allOf": [
            {
              "$ref": "#/$defs/TtlConfig"
            }
          ],
          "description": "Automatic document expiration. Set this object to enable TTL and\nset it to null to disable an existing TTL policy.\n"
        },
        "ttl_field": {
          "type": "string",
          "deprecated": true,
          "description": "Deprecated compatibility alias for `ttl.field`. Cannot be combined with `ttl`.\n"
        },
        "ttl_duration": {
          "type": "string",
          "deprecated": true,
          "description": "Deprecated compatibility alias for `ttl.duration`. Cannot be combined with `ttl`.\n"
        },
        "dynamic_templates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DynamicTemplate"
          },
          "description": "Rules for mapping dynamically detected fields. When a document contains fields\nthat don't have explicit mappings and dynamic mapping is enabled, templates are\nevaluated in order to determine how those fields should be indexed.\n"
        }
      }
    },
    "TableStorageMode": {
      "type": "string",
      "enum": [
        "document",
        "relational"
      ],
      "description": "Storage representation for the table. Omission selects \"document\".\n\"relational\" stores schema-bound typed rows and requires exactly one\nclosed document schema with declared properties. It implies\nenforce_types; explicitly setting enforce_types to false is invalid.\nExisting JSON document write and read APIs remain available. This\nsetting alone does not declare primary keys or unique constraints.\n"
    },
    "TableStorageSettings": {
      "type": "object",
      "additionalProperties": false,
      "description": "Immutable source embedding ownership. Omit storage when creating a table to select vector_store for a local single-shard standalone table without HA or replication, and primary_lsm for other deployments. Existing tables retain their recorded ownership; changing the creation default does not migrate data. Snapshot/backup and split operations currently reject vector_store tables; explicitly select primary_lsm when these operations are required.",
      "properties": {
        "engine": {
          "type": "string",
          "enum": [
            "local",
            "object"
          ],
          "default": "local",
          "description": "Durable table engine, independent of deployment. local uses the hosting process's local or Lite backend and normal shard placement. object uses external lake data with durable sidecars, or an Antfly-owned object WAL and published generations. Object tables do not allocate data Raft groups; omit num_shards and replication_sources. Metadata remains authoritative for table lifetime. Configure the shared destination through storage.artifacts. Writable object document tables initially require immutable schema and index definitions; changes require a new table and explicit migration."
        },
        "dense_embeddings": {
          "type": "string",
          "enum": [
            "primary_lsm",
            "vector_store"
          ],
          "default": "primary_lsm",
          "description": "Explicit ownership choice. vector_store requires a fresh local single-shard standalone table without HA or replication. An explicit empty storage object keeps primary_lsm; omit the storage object to use the deployment default."
        }
      }
    },
    "TemplateFieldMapping": {
      "type": "object",
      "additionalProperties": false,
      "description": "Field mapping used by a dynamic template. Dynamic templates match one physical field at a time and therefore do not accept multifields; use a DocumentFieldMapping in a document property's `x-antfly-field` annotation when named subfields are required.",
      "properties": {
        "type": {
          "$ref": "#/$defs/FieldMappingType"
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name (e.g., \"standard\", \"keyword\", \"en\", \"html_analyzer\").\nUsed for text fields to control tokenization and normalization.\n"
        },
        "index": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "description": "Whether to index the field. Omit to use the server default of true."
        },
        "store": {
          "type": "boolean",
          "default": false,
          "description": "Whether to store the field value (default false)"
        },
        "include_in_all": {
          "type": "boolean",
          "default": false,
          "description": "Whether to include in the _all field for cross-field search"
        },
        "sortable": {
          "type": "boolean",
          "default": false,
          "description": "Whether this exact scalar field can be used in order_by. Supported\nsortable mapping types are keyword, numeric/number/integer,\nboolean/bool, datetime/date/timestamp, and link. Analyzed text,\nsearch_as_you_type, geo, embedding, blob, html, object, and array\nfields are not directly sortable; use an exact scalar subfield such\nas title.keyword for sorted string pagination. When true, Antfly\nderives the internal typed doc-value structures required for exact\nsorting; users should not configure doc_values directly.\n"
        },
        "missing_null_policy": {
          "type": "string",
          "enum": [
            "missing_rejected",
            "nulls_ordered"
          ],
          "default": "missing_rejected",
          "description": "Missing/null sort policy for this mapped field. The default missing_rejected\nrejects missing or null native sort values. Opt in to nulls_ordered\nto sort missing/null values first ascending and last descending,\nwith JSON null in replayable sort cursor tuples. Native sorting\nrequires a complete producer proof for nullable physical layouts.\n"
        }
      }
    },
    "TermQuery": {
      "type": "object",
      "description": "Match an indexed post-analysis term exactly. Use match for analyzed natural-language input.",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "term": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "term"
      ]
    },
    "TermRangeQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "min": {
          "type": [
            "string",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "max": {
          "type": [
            "string",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_min": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_max": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "TextAnalysisComponent": {
      "type": "object",
      "required": [
        "type"
      ],
      "description": "One named analysis component: its type and type-specific configuration.",
      "properties": {
        "type": {
          "type": "string"
        },
        "config": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "TextAnalysisConfig": {
      "type": "object",
      "description": "Custom text analysis for a full-text index. Component maps are keyed\nby the name that analyzers and `field_analyzers` reference. Built-in\nanalyzers (`standard`, `simple`, `keyword`, `html`, `search_as_you_type`,\n`substring`, and the language analyzers such as `german`) are always\navailable without declaring them.\n\nExample: split camelCase identifiers and match them as substrings.\n\n```json\n{\n  \"analysis_config\": {\n    \"field_analyzers\": {\"symbol\": \"code\"},\n    \"token_filters\": {\n      \"tails\": {\"type\": \"suffix\", \"config\": {\"min\": 3, \"max\": 24}}\n    },\n    \"analyzers\": {\n      \"code\": {\n        \"type\": \"custom\",\n        \"config\": {\n          \"tokenizer\": \"whitespace\",\n          \"token_filters\": [\"camel_case\", \"unique\", \"tails\"]\n        }\n      }\n    }\n  }\n}\n```\n",
      "properties": {
        "field_analyzers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of indexed field name to analyzer name. Overrides the analyzer derived from the table schema for that field."
        },
        "char_filters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named character filters. Types: `html_strip` (alias `html`), `ascii_fold`, `zero_width_non_joiner`."
        },
        "tokenizers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named tokenizers. Types: `unicode` (alias `unicode_words`), `whitespace`, `keyword`, `character`, `ngram` (`config.min`, `config.max`), `edge_ngram` (`config.min`, `config.max`, `config.side` of `front` or `back`)."
        },
        "token_filters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named token filters. Types: `lowercase` (alias `to_lower`), `stop_words` (alias `stop`; optional `config.language`), `stemmer` (optional `config.language`), `ngram` and `edge_ngram` (`config.min`, `config.max`), `shingle` (`config.min`, `config.max`, `config.separator` of `space` or `none`), `suffix` (`config.min`, `config.max`; emits every suffix of each token so prefix queries answer containment), `length` (`config.min`, `config.max`), `truncate` (`config.length`), `camel_case`, `unique`, `reverse`, `elision`, `apostrophe`. Languages: english, german, french, spanish, italian, portuguese, dutch, swedish, norwegian, danish, finnish."
        },
        "analyzers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named analyzers of type `custom`. `config.tokenizer` names a built-in or declared tokenizer; `config.char_filters` and `config.token_filters` list built-in or declared component names in application order. Configuration-free filters (`lowercase`, `stop_words`, `stemmer`, `camel_case`, `unique`, `reverse`, `elision`, `apostrophe`, `suffix`) can be listed by name without declaring them."
        },
        "default_datetime_parser": {
          "type": "string",
          "description": "Name of the date-time parser applied to datetime fields without a field-specific parser."
        },
        "field_date_time_parsers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of field name to date-time parser name."
        },
        "date_time_parsers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named date-time parsers. Type `sanitizedgo` accepts `config.layouts`, a list of Go reference-time layouts tried in order."
        }
      }
    },
    "TextChunkOptions": {
      "type": "object",
      "description": "Options specific to text chunking.",
      "properties": {
        "target_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Target number of tokens per chunk."
        },
        "overlap_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Number of tokens to overlap between consecutive chunks. Helps maintain context across chunk boundaries. Only used by fixed-size chunkers."
        },
        "separator": {
          "type": "string",
          "description": "Separator string for splitting (e.g., '\\n\\n' for paragraphs). Only used by fixed-size chunkers."
        }
      }
    },
    "TranscriberEnrichmentConfig": {
      "description": "Speech-to-text provider for the `transcriber` enrichment shorthand.\n\nCarries the provider's STT configuration (`provider`, `model`, `api_url`, `api_key`, ...) plus the transcription options below. The fields are declared inline rather than composed from `STTConfig` so that a generated client can leave an option out: a composed schema makes a typed client serialize every field, and a `max_download_bytes` of zero would reject every recording.\n\n**Example:**\n```yaml\nname: call_transcripts\nkind: asset\nfield: recording_url\ntranscriber:\n  provider: antfly\n  model: openai/whisper-base\n  language_code: en\n  timestamps: true\n```",
      "type": "object",
      "required": [
        "provider"
      ],
      "properties": {
        "provider": {
          "$ref": "#/$defs/STTProvider"
        },
        "model": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Model name, as the provider names it (e.g. 'openai/whisper-base' for antfly, 'whisper-1' for openai)."
        },
        "api_url": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "format": "uri",
          "description": "Antfly inference API URL. Falls back to ANTFLY_INFERENCE_URL."
        },
        "base_url": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "format": "uri",
          "description": "OpenAI API base URL. Falls back to OPENAI_BASE_URL."
        },
        "api_key": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Provider API key. Falls back to the provider's environment variable."
        },
        "project_id": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Google Cloud project ID for the vertex provider. Falls back to GOOGLE_CLOUD_PROJECT."
        },
        "location": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Google Cloud location for the vertex provider."
        },
        "credentials_path": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Path to an ADC credential JSON file for the vertex provider. Falls back to the default ADC chain."
        },
        "language_code": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Spoken language hint (ISO 639-1, e.g. 'en'). Omit for automatic detection where the provider supports it."
        },
        "timestamps": {
          "x-go-type-skip-optional-pointer": false,
          "type": "boolean",
          "default": true,
          "description": "Request timestamped transcript segments so chunks carry recording offsets. Providers without segment timing return plain text."
        },
        "diarization": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "default": false,
          "description": "Request speaker labels on transcript segments where the provider supports them."
        },
        "max_download_bytes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Largest recording fetched from a URL, in bytes. Defaults to 128 MiB, which covers a one hour voice memo or podcast."
        },
        "download_assets": {
          "type": "boolean",
          "default": false,
          "x-go-type-skip-optional-pointer": true,
          "description": "For Apple transcription, explicitly permit preparing and installing the selected on-device Speech assets."
        }
      }
    },
    "TtlConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "duration"
      ],
      "description": "Automatic document-expiration policy for a table.",
      "properties": {
        "duration": {
          "type": "string",
          "description": "Expiration duration using Antfly's integer-component duration format.\nSupported units are `ns`, `us`, `ms`, `s`, `m`, `h`, and `d`;\nexamples include `90m`, `1h30m`, and `7d`.\n"
        },
        "field": {
          "type": "string",
          "default": "_timestamp",
          "minLength": 1,
          "description": "Timestamp field used as the expiration reference."
        }
      }
    },
    "VectorLabelsConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "labels"
      ],
      "description": "Zero-shot label stage over accepted dense embedding artifacts. Label prompts use the source embedding producer; changing this vocabulary rebuilds labels without reading or decoding media. Scores are raw dot products, not probabilities. The asset enrichment must name a dense embedding enrichment in source_artifact_name.",
      "properties": {
        "labels": {
          "type": "array",
          "minItems": 1,
          "maxItems": 4096,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "label"
            ],
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536
              }
            }
          }
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 3
        },
        "min_score": {
          "type": "number",
          "format": "float"
        }
      }
    },
    "VertexEmbedderConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Vertex AI embedding models (enterprise-grade).\n\nUses Application Default Credentials (ADC) for authentication. Requires IAM role `roles/aiplatform.user`.\n\n**Example Model:** gemini-embedding-2 (default, 3072 dims)\n\nAntfly's Vertex embedder currently supports text inputs. Binary media is rejected\ninstead of being flattened or silently discarded.\n\n**Docs:** https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings\n",
      "properties": {
        "request_format": {
          "type": "string",
          "enum": [
            "embed_content",
            "predict"
          ],
          "description": "Wire protocol. New configurations default to embed_content; existing catalogs retain their pinned protocol. No automatic fallback.",
          "default": "embed_content"
        },
        "task_encoding": {
          "type": "string",
          "enum": [
            "prompt",
            "task_type",
            "none"
          ],
          "description": "Retrieval task representation, independent of model name. Defaults to prompt with embed_content and task_type with legacy protocols. Changing it requires re-embedding."
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum inputs per upstream request. embed_content requires 1 so independent records never become one aggregated embedding."
        },
        "provider": {
          "type": "string",
          "enum": [
            "vertex"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Vertex AI embedding model to use.",
          "default": "gemini-embedding-2"
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID. Can also be set via GOOGLE_CLOUD_PROJECT environment variable."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud region for Vertex AI API (e.g., 'us-central1', 'europe-west1'). Can also be set via GOOGLE_CLOUD_LOCATION. Defaults to 'global' for new configurations.",
          "default": "global"
        },
        "credentials_path": {
          "type": "string",
          "writeOnly": true,
          "description": "Path to an ADC credential JSON file (service-account, authorized-user, or external-account). Alternative to the default ADC chain."
        },
        "dimension": {
          "type": "integer",
          "description": "The dimension of the embedding vector (768, 1536, or 3072 for gemini-embedding-2).",
          "default": 3072
        },
        "retrieval": {
          "$ref": "#/$defs/EmbeddingRetrievalConfig"
        }
      },
      "required": [
        "provider"
      ]
    },
    "VertexGeneratorConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Vertex AI generative models.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "vertex"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Vertex AI model to use.",
          "default": "gemini-2.5-flash"
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud region for Vertex AI API.",
          "default": "us-central1"
        },
        "credentials_path": {
          "type": "string",
          "writeOnly": true,
          "description": "Path to service account JSON key file."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "VertexSTTConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Speech-to-Text provider (Vertex AI).\n\nUses Application Default Credentials (ADC) for authentication.\n\n**Features:** Streaming, speaker diarization, automatic punctuation\n\n**Docs:** https://cloud.google.com/speech-to-text/docs",
      "properties": {
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID. Falls back to GOOGLE_CLOUD_PROJECT environment variable."
        },
        "location": {
          "type": "string",
          "default": "us-central1",
          "description": "Google Cloud location."
        },
        "credentials_path": {
          "type": "string",
          "description": "Path to an ADC credential JSON file (service-account, authorized-user, or external-account). Falls back to the default ADC chain."
        },
        "language_code": {
          "type": "string",
          "default": "en-US",
          "description": "Default language code (e.g., 'en-US', 'es-ES')."
        },
        "enable_automatic_punctuation": {
          "type": "boolean",
          "default": true,
          "description": "Enable automatic punctuation."
        },
        "use_enhanced": {
          "type": "boolean",
          "default": false,
          "description": "Use enhanced models for better accuracy (costs more)."
        },
        "model": {
          "type": "string",
          "description": "Recognition model (e.g., 'latest_long', 'telephony', 'medical_dictation')."
        }
      }
    },
    "WildcardQuery": {
      "type": "object",
      "description": "Match post-analysis indexed terms. Patterns are not stemmed; use match for analyzed natural-language input.",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "wildcard": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "wildcard"
      ]
    }
  }
}