{
  "version": 1,
  "docs": [
    {
      "name": "lwir_map/README.md",
      "path": "scripts/lwir_map/README.md",
      "purpose": "Pipeline doc for LWIR scene atlas: purpose, 4-step workflow, script options, known limitations (tilt during turns), and future improvements."
    },
    {
      "name": "mcp-http-howto.md",
      "path": "scripts/mcp-http-howto.md",
      "purpose": "HTTP MCP endpoints and usage notes for controlling imagej-elphel via MCP."
    },
    {
      "name": "eyesis-host-daemon-howto.md",
      "path": "scripts/eyesis-host-daemon-howto.md",
      "purpose": "Host daemon workflow that removes repeated approval prompts by using a local file queue."
    }
  ],
  "scripts": [
    {
      "name": "mcp_filter_list_by_model_version.py",
      "path": "scripts/mcp_filter_list_by_model_version.py",
      "purpose": "Filter a .list file to keep only sequences with an existing model version subdir.",
      "inputs": [
        "MCP server (http://127.0.0.1:48888)",
        "list file path (required)",
        "model version (from MCP dialog or CLI argument)"
      ],
      "outputs": [
        "Filtered .list file in the same directory as input (name suffixed with -<version>.list)"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/mcp_filter_list_by_model_version.py /media/elphel/btrfs-data/lwir16-proc/NC/lists/nc_site.list v89",
      "tags": ["mcp", "list", "models", "filter"],
      "dependencies": ["MCP server", "-Delphel.mcp.allowed.configdir"],
      "owner": "codex",
      "created": "2026-02-03"
    },
    {
      "name": "field_calib_aggregate.py",
      "path": "scripts/field_calib_aggregate.py",
      "purpose": "Aggregate FIELD_CALIBRATION.corr-xml into CSV with per-sensor angles and noise metrics.",
      "inputs": [
        "Models root directory containing *-FIELD_CALIBRATION.corr-xml"
      ],
      "outputs": [
        "CSV file with per-sensor azimuth/tilt/roll columns and stats"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/field_calib_aggregate.py /media/elphel/btrfs-data/lwir16-proc/NC/models/1763232117-1763234145 -o /home/elphel/CODEX/tmp/field_calib_1763232117-1763234145.csv",
      "tags": ["csv", "models", "aggregation", "plot"],
      "dependencies": [],
      "owner": "codex",
      "created": "2026-02-03"
    },
    {
      "name": "lwir_scene_summary.py",
      "path": "scripts/lwir_map/lwir_scene_summary.py",
      "purpose": "Read imagej-elphel linked LWIR scene output and write a per-scene TSV with GPS corners, AGL, heading, forestation, and ground-plane columns.",
      "inputs": [
        "Linked view root containing timestamp and *-index directories",
        "*-elevations_histogram.csv and *-egomotion.csv under each scene version directory",
        "*-ground_planes.csv under each following *-index version directory"
      ],
      "outputs": [
        "TSV file with ~65 columns: status, group metadata, scene IDs, timestamps, GPS corners, heading, AGL, forestation, ground-plane data"
      ],
      "example": "/home/elphel/wksp2/imagej-elphel/scripts/lwir_map/lwir_scene_summary.py /home/elphel/lwir16-proc/NC/linked/linked_1763232117-1763234145-v88 -o /home/elphel/lwir16-proc/NC/summaries/linked_1763232117-1763234145-v88-summary.tsv",
      "tags": ["lwir", "map", "atlas", "summary", "tsv"],
      "dependencies": [],
      "owner": "codex",
      "created": "2026-05-14"
    },
    {
      "name": "lwir_map_overlay.py",
      "path": "scripts/lwir_map/lwir_map_overlay.py",
      "purpose": "Generate KML, GeoJSON, SVG, and bounds TSV map overlays from a LWIR scene summary TSV.",
      "inputs": [
        "Summary TSV generated by lwir_scene_summary.py"
      ],
      "outputs": [
        "Bounds TSV with min/max latitude and longitude",
        "GeoJSON polygon overlay",
        "KML polygon and label overlay",
        "SVG vector page with projected rectangles, configurable labels, fill, color source, and image-right direction cue"
      ],
      "example": "/home/elphel/wksp2/imagej-elphel/scripts/lwir_map/lwir_map_overlay.py /home/elphel/lwir16-proc/NC/summaries/linked_1763232117-1763234145-v88-summary.tsv --out-prefix /home/elphel/lwir16-proc/NC/summaries/linked_1763232117-1763234145-v88-overlay --svg-fill none --svg-color-by agl_m --svg-label-mode first-per-group --svg-direction-cue broken-right",
      "tags": ["lwir", "map", "atlas", "overlay", "kml", "geojson", "svg"],
      "dependencies": [],
      "owner": "codex",
      "created": "2026-05-14"
    },
    {
      "name": "rag_index.py",
      "path": "scripts/rag_index.py",
      "purpose": "Build a local RAG index from attic/CODEX/rag_sources using fastembed + hnswlib.",
      "inputs": [
        "rag_sources root directory",
        "embedding model name (default: BAAI/bge-base-en-v1.5)"
      ],
      "outputs": [
        "index.bin",
        "meta.jsonl",
        "config.json"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/rag_index.py --source /home/elphel/git/imagej-elphel/attic/CODEX/rag_sources --out /home/elphel/git/imagej-elphel/attic/CODEX/rag_index",
      "tags": ["rag", "index", "embedding"],
      "dependencies": [
        "fastembed",
        "hnswlib",
        "numpy"
      ],
      "owner": "codex",
      "created": "2026-02-04"
    },
    {
      "name": "rag_index.sh",
      "path": "scripts/rag_index.sh",
      "purpose": "Wrapper to run rag_index.py using the RAG venv.",
      "inputs": [
        "same args as rag_index.py"
      ],
      "outputs": [
        "index.bin",
        "meta.jsonl",
        "config.json"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/rag_index.sh --source /home/elphel/git/imagej-elphel/attic/CODEX/rag_sources --out /home/elphel/git/imagej-elphel/attic/CODEX/rag_index",
      "tags": ["rag", "index", "wrapper"],
      "dependencies": [
        "rag_index.py",
        "rag venv"
      ],
      "owner": "codex",
      "created": "2026-02-04"
    },
    {
      "name": "rag_query.py",
      "path": "scripts/rag_query.py",
      "purpose": "Query a local RAG index built by rag_index.py.",
      "inputs": [
        "query string",
        "index directory (default: attic/CODEX/rag_index)"
      ],
      "outputs": [
        "Top-k matching chunks with file paths and snippets"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/rag_query.py \"Explain differential rectification\"",
      "tags": ["rag", "query"],
      "dependencies": [
        "fastembed",
        "hnswlib",
        "numpy"
      ],
      "owner": "codex",
      "created": "2026-02-04"
    },
    {
      "name": "rag_query.sh",
      "path": "scripts/rag_query.sh",
      "purpose": "Wrapper to run rag_query.py using the RAG venv.",
      "inputs": [
        "query string",
        "index directory (default: attic/CODEX/rag_index)"
      ],
      "outputs": [
        "Top-k matching chunks with file paths and snippets"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/rag_query.sh \"Explain differential rectification\"",
      "tags": ["rag", "query", "wrapper"],
      "dependencies": [
        "rag_query.py",
        "rag venv"
      ],
      "owner": "codex",
      "created": "2026-02-04"
    },
    {
      "name": "eyesis_mcp_ctl.sh",
      "path": "scripts/eyesis_mcp_ctl.sh",
      "purpose": "Lifecycle controller for Eyesis_Correction in MCP mode (start/stop/restart/status/logs/wait).",
      "inputs": [
        "command: start|stop|restart|status|logs|wait",
        "optional flags: --configdir/--config/--port/--rebuild/--log",
        "environment overrides: EYESIS_MCP_*"
      ],
      "outputs": [
        "Background JVM process managed by pid file",
        "MCP readiness checks and status output",
        "Log file at attic/session-logs/eyesis_mcp.log by default"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/eyesis_mcp_ctl.sh start --configdir /media/elphel/btrfs-data/lwir16-proc/NC/config --rebuild",
      "tags": ["mcp", "lifecycle", "launcher", "automation"],
      "dependencies": [
        "mvn",
        "curl"
      ],
      "owner": "codex",
      "created": "2026-02-23"
    },
    {
      "name": "mcp_http.sh",
      "path": "scripts/mcp_http.sh",
      "purpose": "Thin MCP HTTP wrapper for status/dialog/button/value/submit/interrupt operations.",
      "inputs": [
        "subcommand: status|dialog|button|set|submit|interrupt|confirm-stop",
        "subcommand flags like --label/--value/--id/--ok",
        "optional --base and --timeout (or EYESIS_MCP_BASE_URL/EYESIS_MCP_TIMEOUT_SEC)"
      ],
      "outputs": [
        "Raw JSON response from MCP HTTP endpoint"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/mcp_http.sh button --label \"Restore\"",
      "tags": ["mcp", "http", "automation", "wrapper"],
      "dependencies": [
        "curl"
      ],
      "owner": "codex",
      "created": "2026-02-23"
    },
    {
      "name": "eyesis_host_daemon.py",
      "path": "scripts/eyesis_host_daemon.py",
      "purpose": "Host-side queue daemon that executes whitelisted lifecycle/MCP wrapper commands in desktop session context.",
      "inputs": [
        "serve mode with queue dir and poll interval",
        "submit mode: action ctl|mcp and args after --",
        "read mode: request id"
      ],
      "outputs": [
        "JSON response files in queue responses/",
        "stdout/stderr passthrough for submit --wait-sec"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/eyesis_host_daemon.py submit --action ctl -- status",
      "tags": ["daemon", "queue", "automation", "mcp", "lifecycle"],
      "dependencies": [
        "python3"
      ],
      "owner": "codex",
      "created": "2026-02-23"
    },
    {
      "name": "eyesis_host_daemon_ctl.sh",
      "path": "scripts/eyesis_host_daemon_ctl.sh",
      "purpose": "Start/stop/status/logs helper for eyesis_host_daemon.py.",
      "inputs": [
        "command: start|stop|restart|status|logs",
        "optional flags: --queue-dir/--log/--poll-ms/--force"
      ],
      "outputs": [
        "Background daemon process and PID file",
        "Daemon status and log streaming"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/eyesis_host_daemon_ctl.sh start",
      "tags": ["daemon", "control", "automation"],
      "dependencies": [
        "python3"
      ],
      "owner": "codex",
      "created": "2026-02-23"
    },
    {
      "name": "eyesis_host_submit.sh",
      "path": "scripts/eyesis_host_submit.sh",
      "purpose": "Convenience wrapper to submit daemon requests for ctl/mcp actions.",
      "inputs": [
        "action: ctl or mcp",
        "subcommand arguments for selected action"
      ],
      "outputs": [
        "Command output from daemon response"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/eyesis_host_submit.sh mcp status",
      "tags": ["daemon", "client", "automation", "mcp", "lifecycle"],
      "dependencies": [
        "python3",
        "eyesis_host_daemon.py"
      ],
      "owner": "codex",
      "created": "2026-02-23"
    },
    {
      "name": "eyesis_run_report.py",
      "path": "scripts/eyesis_run_report.py",
      "purpose": "Extract latest completed Eyesis run summary from eyesis_mcp.log and compare report JSONs.",
      "inputs": [
        "extract: --log path (default attic/session-logs/eyesis_mcp.log)",
        "extract: optional --json output, --snapshot-dir DIR, --auto-compare, --show-outputs N",
        "compare: --base report.json --new report.json"
      ],
      "outputs": [
        "Console summary for latest completed run",
        "Optional JSON report and/or timestamped snapshots for baseline tracking",
        "CSV-like metric delta table for report comparisons"
      ],
      "example": "/home/elphel/git/imagej-elphel/scripts/eyesis_run_report.py extract --snapshot-dir /tmp/eyesis-reports --auto-compare",
      "tags": ["log", "report", "lma", "comparison", "automation"],
      "dependencies": [
        "python3"
      ],
      "owner": "codex",
      "created": "2026-02-23"
    }
  ]
}
