Skip to content

rocketlang/recon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RECON — Repository Entity Crawler & Ontology Navigator

License: MIT Bun

RECON crawls your entire monorepo in seconds and builds a searchable entity graph — every exported function, class, interface, HTTP route, Prisma model, and GraphQL type across all your packages.

Built by ANKR Labs (Powerp Box IT Solutions Pvt Ltd) — Gurgaon, India.

What it does

28,100 TypeScript + GraphQL + Prisma files crawled in 10 seconds
→ 89,195 entities extracted
→ 1,619 packages indexed
→ Searchable via REST or natural language (Claude / GPT-4)

Entity types extracted:

  • function — exported functions with signatures
  • class — exported classes
  • interface / type — TypeScript interfaces and types
  • const — exported constants
  • route — HTTP routes (app.get, app.post, Fastify, Express)
  • model — Prisma database models
  • enum — TypeScript enums

Quick Start

bun recon.ts
# or
PORT=4575 bun recon.ts

API

# Search entities
GET /search?q=invoice&type=function&limit=20

# Natural language search (requires AI proxy)
POST /search/ai
{ "question": "which functions handle GST calculation?" }

# All entities with filters
GET /entities?type=model&package=@ankr/erp&limit=100

# Statistics
GET /stats

# Trigger a fresh crawl
POST /crawl

# PACKAGE.meta proposals (for new packages without meta)
GET /proposals
POST /proposals/:id/accept
POST /proposals/:id/reject

# Health
GET /health

Example Responses

$ curl http://localhost:4575/stats
{
  "entityCount": 89195,
  "packageCount": 1619,
  "fileCount": 28100,
  "crawledAt": "2026-02-24T10:55:58Z",
  "durationMs": 10258,
  "entityTypes": {
    "interface": 30558,
    "function": 20472,
    "const": 11343,
    "type": 9385,
    "class": 6591,
    "model": 6431,
    "route": 3944,
    "enum": 471
  }
}
$ curl "http://localhost:4575/search?q=invoice&type=function&limit=3"
{
  "q": "invoice",
  "results": [
    { "type": "function", "name": "createInvoice", "package": "@ankr/erp", "filePath": "src/invoice.ts", "lineNumber": 42 },
    { "type": "function", "name": "sendInvoiceEmail", "package": "@ankr/mailer", "filePath": "src/email.ts" },
    { "type": "function", "name": "generateInvoicePDF", "package": "@ankr/pdf", "filePath": "src/pdf.ts" }
  ]
}

Configuration

RECON crawls these directories by default (edit CRAWL_ROOTS in recon.ts):

const CRAWL_ROOTS = [
  '/root/ankr-labs-nx/packages',
  '/root/ankr-labs-nx/apps',
  '/root/swayam/packages',
  '/root/ankr-packages',
];

Update these paths for your monorepo layout.

Incremental Crawling

RECON is SHA256-aware — it only re-processes files that changed since the last crawl. On a warm run (few changed files), a 28K-file repo crawls in under 1 second.

State is persisted to:

.ankr/agents/recon-index.json      ← entity graph
.ankr/agents/recon-hashes.json     ← file hash cache
.ankr/agents/recon-proposals.json  ← pending meta proposals

PACKAGE.meta Proposals

When RECON finds packages that don't have a PACKAGE.meta.json, it generates proposals:

GET /proposals
{
  "total": 50,
  "proposals": [
    {
      "id": "prop-abc123",
      "type": "package-meta",
      "target": "@ankr/new-package",
      "proposal": {
        "exports": ["createClient", "fetchData"],
        "routes": ["GET /api/data"],
        "models": ["DataRecord"],
        "suggestedCapabilities": ["data-query", "http-api", "database-model"]
      },
      "confidence": 82,
      "status": "pending"
    }
  ]
}

# Accept a proposal (writes PACKAGE.meta.json to disk)
POST /proposals/prop-abc123/accept

Natural Language Search

With an AI proxy running (Claude or OpenAI compatible):

POST /search/ai
{ "question": "which service handles container tracking?" }

→ {
    "answer": "Container tracking is handled in @ankr/logistics — specifically the `trackContainer` function in src/tracking.ts. The HTTP route is GET /api/track/:containerId exposed by the freight-service package.",
    "entities": [...]
  }

Set AI_PROXY_URL environment variable to point to your AI proxy.

TROVE Integration

If you're running the ANKR platform, RECON integrates with carta-showcase:

GET  http://localhost:4059/api/recon/stats
GET  http://localhost:4059/api/recon/search?q=invoice
POST http://localhost:4059/api/recon/crawl
POST http://localhost:4059/api/recon/search/ai

Environment Variables

Variable Default Description
PORT 4575 HTTP server port
AI_PROXY_URL http://localhost:4444 OpenAI-compatible AI proxy for NL search

Why RECON?

Most code search tools (Sourcegraph, GitHub code search) answer "where is this string?" RECON answers:

  • "What can this codebase DO?" — all exported functions + routes
  • "What data does it manage?" — all Prisma models + GraphQL types
  • "Which package should I import for X?" — semantic entity search
  • "Which packages don't have documentation yet?" — proposal generation

This makes it the natural complement to a service registry like TROVE — TROVE knows about running services, RECON knows about the code inside them.

License

MIT — free for commercial and non-commercial use.


Part of the ANKR Platform — India's AI-native enterprise operating system.
ANKR Labs · Powerp Box IT Solutions Pvt Ltd · Gurgaon, India

About

RECON — Repository Entity Crawler. Indexes 89K+ entities from TypeScript, GraphQL, Prisma across monorepos in 10s

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors