module

Xerp::CLI

Constants

INDEX_SCHEMA = "{\n \"type\": \"object\",\n \"description\": \"Index workspace files\",\n \"properties\": {\n \"root\": {\n \"type\": \"string\",\n \"description\": \"Workspace root directory\"\n },\n \"rebuild\": {\n \"type\": \"boolean\",\n \"description\": \"Force full reindex\"\n },\n \"train\": {\n \"type\": \"boolean\",\n \"description\": \"Train semantic vectors after indexing\"\n },\n \"json\": {\n \"type\": \"boolean\",\n \"description\": \"Output stats as JSON\"\n }\n }\n }"
MARK_SCHEMA = "{\n \"type\": \"object\",\n \"description\": \"Record feedback on results\",\n \"positional\": [\"result_id\"],\n \"properties\": {\n \"result_id\": {\n \"type\": \"string\",\n \"description\": \"Result ID to mark\"\n },\n \"root\": {\n \"type\": \"string\",\n \"description\": \"Workspace root directory\"\n },\n \"useful\": {\n \"type\": \"boolean\",\n \"description\": \"Mark as useful\"\n },\n \"promising\": {\n \"type\": \"boolean\",\n \"description\": \"Mark as promising lead\"\n },\n \"not-useful\": {\n \"type\": \"boolean\",\n \"description\": \"Mark as not useful\"\n },\n \"note\": {\n \"type\": \"string\",\n \"description\": \"Add a note\"\n },\n \"json\": {\n \"type\": \"boolean\",\n \"description\": \"Output as JSON\"\n }\n },\n \"required\": [\"result_id\"]\n }"
OUTLINE_SCHEMA = "{\n \"type\": \"object\",\n \"description\": \"Show structural outline of indexed files\",\n \"properties\": {\n \"root\": {\n \"type\": \"string\",\n \"description\": \"Workspace root directory\"\n },\n \"file\": {\n \"type\": \"string\",\n \"description\": \"Filter by file path glob (e.g., src/**/*.cr)\"\n },\n \"level\": {\n \"type\": \"integer\",\n \"default\": 2,\n \"description\": \"Number of levels to show (default: 2)\"\n },\n \"json\": {\n \"type\": \"boolean\",\n \"description\": \"Output as JSON\"\n }\n }\n }"
QUERY_SCHEMA = "{\n \"type\": \"object\",\n \"description\": \"Search indexed content\",\n \"positional\": [\"query\"],\n \"properties\": {\n \"query\": {\n \"type\": \"string\",\n \"description\": \"Search query\"\n },\n \"top\": {\n \"type\": \"integer\",\n \"default\": 10,\n \"description\": \"Number of results\"\n },\n \"no-ancestry\": {\n \"type\": \"boolean\",\n \"description\": \"Hide block ancestry chain\"\n },\n \"ellipsis\": {\n \"type\": \"boolean\",\n \"description\": \"Show ... between ancestry and snippet\"\n },\n \"explain\": {\n \"type\": \"boolean\",\n \"description\": \"Show token contributions\"\n },\n \"context\": {\n \"type\": \"integer\",\n \"short\": \"C\",\n \"default\": 2,\n \"description\": \"Lines of context around hits\"\n },\n \"max-block-lines\": {\n \"type\": \"integer\",\n \"default\": 24,\n \"description\": \"Max lines per result block\"\n },\n \"root\": {\n \"type\": \"string\",\n \"description\": \"Workspace root directory\"\n },\n \"file\": {\n \"type\": \"string\",\n \"description\": \"Filter by file path regex\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"Filter by file type (code/markdown/config/text)\"\n },\n \"json\": {\n \"type\": \"boolean\",\n \"description\": \"Full JSON output\"\n },\n \"jsonl\": {\n \"type\": \"boolean\",\n \"description\": \"One JSON object per result\"\n },\n \"grep\": {\n \"type\": \"boolean\",\n \"description\": \"Compact grep-like output\"\n }\n },\n \"required\": [\"query\"]\n }"
TERMS_SCHEMA = "{\n \"type\": \"object\",\n \"description\": \"Extract related terms for a query\",\n \"positional\": [\"query\"],\n \"properties\": {\n \"query\": {\n \"type\": \"string\",\n \"description\": \"Search query\"\n },\n \"source\": {\n \"type\": \"string\",\n \"description\": \"Term source: scope (salience), line, block, vector (line+block), combined (default)\"\n },\n \"root\": {\n \"type\": \"string\",\n \"description\": \"Workspace root directory\"\n },\n \"top\": {\n \"type\": \"integer\",\n \"default\": 30,\n \"description\": \"Number of terms to return\"\n },\n \"top-blocks\": {\n \"type\": \"integer\",\n \"default\": 20,\n \"description\": \"Number of blocks to analyze (scope mode)\"\n },\n \"max-df\": {\n \"type\": \"number\",\n \"default\": 22,\n \"description\": \"Max df% to include (e.g., 22 = filter terms in >22% of files)\"\n },\n \"json\": {\n \"type\": \"boolean\",\n \"description\": \"Output as JSON\"\n }\n },\n \"required\": [\"query\"]\n }"
TRAIN_SCHEMA = "{\n \"type\": \"object\",\n \"description\": \"Train semantic token vectors\",\n \"properties\": {\n \"root\": {\n \"type\": \"string\",\n \"description\": \"Workspace root directory\"\n },\n \"model\": {\n \"type\": \"string\",\n \"description\": \"Model to train: line, block, or all\"\n },\n \"window\": {\n \"type\": \"integer\",\n \"default\": 5,\n \"description\": \"Context window size (±N tokens)\"\n },\n \"min-count\": {\n \"type\": \"integer\",\n \"default\": 3,\n \"description\": \"Minimum co-occurrence count\"\n },\n \"top-neighbors\": {\n \"type\": \"integer\",\n \"default\": 32,\n \"description\": \"Max neighbors per token\"\n },\n \"clear\": {\n \"type\": \"boolean\",\n \"description\": \"Clear existing vectors without retraining\"\n },\n \"json\": {\n \"type\": \"boolean\",\n \"description\": \"Output stats as JSON\"\n }\n }\n }"
VERSION = Xerp::VERSION

Class methods

run(args : Array(String)) : Int32
Source

Nested types