{"_id":"@0xanand/coremap","_rev":"3-f5240922388942b649fd3b83a2b42464","name":"@0xanand/coremap","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@0xanand/coremap","version":"0.1.0","keywords":["coremap","cli","llm","context","coding-agents","code-search","evals","developer-tools","typescript","openai","codex"],"author":{"name":"Anand Vashishtha"},"license":"MIT","_id":"@0xanand/coremap@0.1.0","maintainers":[{"name":"0xanand","email":"anandcollege07@gmail.com"}],"homepage":"https://github.com/Anand-0037/coremap#readme","bugs":{"url":"https://github.com/Anand-0037/coremap/issues"},"bin":{"coremap":"bin/coremap"},"dist":{"shasum":"45e0fc48746e76acd4a8fb4c752da8c041cda1d7","tarball":"https://registry.npmjs.org/@0xanand/coremap/-/coremap-0.1.0.tgz","fileCount":40,"integrity":"sha512-DbOU+69oulk2g0Nq+fhP83iGpCvCyQVQS64JG7XPfDtw8aoo0cdW6hheQMlHXgO95xBOj/RYZxAutSfqds2vVQ==","signatures":[{"sig":"MEQCIBk7Vy/lcbaCNgupdBNrTLilsOQ8eyJy1UGXgPOnSpIGAiAohKfoN+dcYTKsHSBzcptJ8k0TV84fvgb7Wih+ksjRxg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85599},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":"./dist/index.js"},"gitHead":"ef0ec8404b69b37f8687646af202a63f9cca5e8a","scripts":{"dev":"tsx src/cli.ts","demo":"tsx src/cli.ts ./fixtures/eval-tax-bug --task \"$(cat evals/tax-bug/issue.txt)\" --budget-lines 25 --ground-truth ./evals/tax-bug/ground-truth.patch --verify --no-llm --out-dir /tmp/coremap-demo","lint":"tsc -p tsconfig.json --noEmit","pack":"tsx src/cli.ts . --out-file repomap.txt --max-tokens 200000 --out-dir .","test":"vitest run","build":"tsc -p tsconfig.json && node -e \"require('fs').chmodSync('dist/cli.js',0o755)\"","coremap":"tsx src/cli.ts","pack:md":"tsx src/cli.ts . --out-file coremap.md --max-tokens 200000 --out-dir .","prepare":"npm run build","pack:npm":"npm pack","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"0xanand","email":"anandcollege07@gmail.com"},"repository":{"url":"git+https://github.com/Anand-0037/coremap.git","type":"git"},"_npmVersion":"11.12.1","description":"Pack a repo into one AI-friendly file — or pass --task to keep only the lines that matter, with a verification receipt.","directories":{"bin":"./bin"},"_nodeVersion":"24.15.0","dependencies":{"ignore":"^7.0.4","commander":"^13.1.0","js-tiktoken":"^1.0.19","web-tree-sitter":"^0.25.10","tree-sitter-wasms":"^0.1.13"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.14.1"},"optionalDependencies":{"openai":"^4.96.0"},"_npmOperationalInternal":{"tmp":"tmp/coremap_0.1.0_1784016857472_0.9488369802369061","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@0xanand/coremap","version":"0.1.1","keywords":["coremap","cli","llm","context","coding-agents","code-search","evals","developer-tools","typescript","openai","codex"],"author":{"name":"Anand Vashishtha"},"license":"MIT","_id":"@0xanand/coremap@0.1.1","maintainers":[{"name":"0xanand","email":"anandcollege07@gmail.com"}],"homepage":"https://github.com/Anand-0037/coremap#readme","bugs":{"url":"https://github.com/Anand-0037/coremap/issues"},"bin":{"coremap":"bin/coremap"},"dist":{"shasum":"2010c69b870966d44bd11f9cfbfe16cb28ee0d9e","tarball":"https://registry.npmjs.org/@0xanand/coremap/-/coremap-0.1.1.tgz","fileCount":40,"integrity":"sha512-cKtMmUNwrmmCZmuAIEyFshzgmG5hO854mXigwuHp9KBVNvQvPUz6WIxj6C7uyh8W8Tvj3nwXb6Qz8lvvGvgIig==","signatures":[{"sig":"MEYCIQCqEefNBN9nnhnlnD6z7E/AVTl9iQ6mPIDp/TW85/P3KgIhAKJpZHqKODKfPQHbSbbqF62PkJ7YkV0RrvBVTdeFhkT7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86070},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":"./dist/index.js"},"gitHead":"ef0ec8404b69b37f8687646af202a63f9cca5e8a","scripts":{"dev":"tsx src/cli.ts","demo":"tsx src/cli.ts ./fixtures/eval-tax-bug --task \"$(cat evals/tax-bug/issue.txt)\" --budget-lines 25 --ground-truth ./evals/tax-bug/ground-truth.patch --verify --no-llm --out-dir /tmp/coremap-demo","lint":"tsc -p tsconfig.json --noEmit","pack":"tsx src/cli.ts . --out-file repomap.txt --max-tokens 200000 --out-dir .","test":"vitest run","build":"tsc -p tsconfig.json && node -e \"require('fs').chmodSync('dist/cli.js',0o755)\"","coremap":"tsx src/cli.ts","pack:md":"tsx src/cli.ts . --out-file coremap.md --max-tokens 200000 --out-dir .","prepare":"npm run build","pack:npm":"npm pack","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"0xanand","email":"anandcollege07@gmail.com"},"repository":{"url":"git+https://github.com/Anand-0037/coremap.git","type":"git"},"_npmVersion":"11.12.1","description":"Pack a repo into one AI-friendly file — or pass --task to keep only the lines that matter, with a verification receipt.","directories":{"bin":"./bin"},"_nodeVersion":"24.15.0","dependencies":{"ignore":"^7.0.4","commander":"^13.1.0","js-tiktoken":"^1.0.19","web-tree-sitter":"^0.25.10","tree-sitter-wasms":"^0.1.13"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.14.1"},"optionalDependencies":{"openai":"^4.96.0"},"_npmOperationalInternal":{"tmp":"tmp/coremap_0.1.1_1784020427362_0.9569768066784945","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@0xanand/coremap","version":"0.1.2","description":"Pack a repo into one AI-friendly file — or pass --task to keep only the lines that matter, with a verification receipt.","type":"module","main":"./dist/index.js","exports":{".":"./dist/index.js"},"bin":{"coremap":"dist/cli.js"},"scripts":{"build":"tsc -p tsconfig.json && node -e \"require('fs').chmodSync('dist/cli.js',0o755)\"","dev":"tsx src/cli.ts","test":"vitest run","test:watch":"vitest","lint":"tsc -p tsconfig.json --noEmit","prepare":"npm run build","prepublishOnly":"npm run build && npm test","pack:npm":"npm pack","coremap":"tsx src/cli.ts","pack":"tsx src/cli.ts . --out-file repomap.txt --max-tokens 200000 --out-dir .","pack:md":"tsx src/cli.ts . --out-file coremap.md --max-tokens 200000 --out-dir .","demo":"tsx src/cli.ts ./fixtures/eval-tax-bug --task \"$(cat evals/tax-bug/issue.txt)\" --budget-lines 25 --ground-truth ./evals/tax-bug/ground-truth.patch --verify --no-llm --out-dir /tmp/coremap-demo"},"engines":{"node":">=20"},"keywords":["coremap","cli","llm","context","coding-agents","code-search","evals","developer-tools","typescript","openai","codex"],"license":"MIT","author":{"name":"Anand Vashishtha"},"repository":{"type":"git","url":"git+https://github.com/Anand-0037/coremap.git"},"homepage":"https://github.com/Anand-0037/coremap#readme","bugs":{"url":"https://github.com/Anand-0037/coremap/issues"},"publishConfig":{"access":"public"},"dependencies":{"commander":"^13.1.0","ignore":"^7.0.4","js-tiktoken":"^1.0.19","tree-sitter-wasms":"^0.1.13","web-tree-sitter":"^0.25.10"},"optionalDependencies":{"openai":"^4.96.0"},"devDependencies":{"@types/node":"^22.14.1","tsx":"^4.19.3","typescript":"^5.8.3","vitest":"^3.1.1"},"gitHead":"2f54c562ab4d54bfc70f61eb3afb751d7d408593","types":"./dist/index.d.ts","_id":"@0xanand/coremap@0.1.2","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-akF5oPHdPc9726RkRsgVsaW6yOvj5Obf/LvfEOPxXuy0/0UjE2DXgw4ync/JMAZF+sicMIh4T/YbNqHLFnz8xQ==","shasum":"43878e84c2a752116d756e3e51e967f06153a199","tarball":"https://registry.npmjs.org/@0xanand/coremap/-/coremap-0.1.2.tgz","fileCount":39,"unpackedSize":86080,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDIMLVv7IAuOteWJ6EeAjEBWV5EfR3e5hT0NQgQFZs9zAIgKSMQ3HvaBcwi9VfUohYSVvq3KYMt6GtsugsDZ0j4GUQ="}]},"_npmUser":{"name":"0xanand","email":"anandcollege07@gmail.com"},"directories":{},"maintainers":[{"name":"0xanand","email":"anandcollege07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/coremap_0.1.2_1784022086220_0.3468738054132099"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-14T08:14:17.326Z","modified":"2026-07-14T09:41:26.447Z","0.1.0":"2026-07-14T08:14:17.650Z","0.1.1":"2026-07-14T09:13:47.494Z","0.1.2":"2026-07-14T09:41:26.346Z"},"bugs":{"url":"https://github.com/Anand-0037/coremap/issues"},"author":{"name":"Anand Vashishtha"},"license":"MIT","homepage":"https://github.com/Anand-0037/coremap#readme","keywords":["coremap","cli","llm","context","coding-agents","code-search","evals","developer-tools","typescript","openai","codex"],"repository":{"type":"git","url":"git+https://github.com/Anand-0037/coremap.git"},"description":"Pack a repo into one AI-friendly file — or pass --task to keep only the lines that matter, with a verification receipt.","maintainers":[{"name":"0xanand","email":"anandcollege07@gmail.com"}],"readme":"# CoreMap\n\nPack your repository into one AI-friendly file — or pass a task and keep only the lines that matter.\n\n```bash\nnpx @0xanand/coremap .\n```\n\nWrites `coremap.md`: directory tree, source files, and a short summary. Secrets are excluded.\n\n[![npm](https://img.shields.io/npm/v/@0xanand/coremap.svg)](https://www.npmjs.com/package/@0xanand/coremap)\n[![Node.js](https://img.shields.io/node/v/coremap.svg)](https://nodejs.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\n---\n\n## Two modes\n\n| Mode | Command | Output |\n|------|---------|--------|\n| **Pack** | `coremap .` | Full repo → one file (`coremap.md`) |\n| **Task** | `coremap . --task \"fix …\"` | Exact spans → `coremap-context.md` + `coremap-receipt.json` |\n\nPack is the everyday path. Task mode selects a small evidence set and can verify it by applying a patch and running your tests.\n\n---\n\n## Install\n\n**No install** (recommended):\n\n```bash\nnpx @0xanand/coremap .\n```\n\n**Global:**\n\n```bash\nnpm install -g @0xanand/coremap\ncoremap .\n```\n\nRequires **Node.js 20+**.\n\n---\n\n## Usage\n\n### Pack mode\n\n```bash\ncoremap .                          # → coremap.md\ncoremap . --out-file context.md    # custom name\ncoremap . --max-tokens 200000      # raise whole-file budget\ncoremap . --out-dir ./out          # write elsewhere\n```\n\n### Task mode\n\n```bash\ncoremap . --task \"fix the tax bug\" --budget-lines 25\n\n# Optional: prove the context was enough\ncoremap . --task \"fix the tax bug\" --verify\ncoremap . --task \"…\" --verify --no-llm   # offline (no API key)\n```\n\nPinned demo (included in this repo):\n\n```bash\nnpm run demo\n```\n\nExample output:\n\n```\n                          Full  Compress   CoreMap\n--------------------  --------  --------  --------\nContext tokens             432        81       192\nHitFile                      —         —      1.00\nHitRegion≈                   —         —      0.71\nPatch produced              no        no       yes\nTests (original repo)        no        no       yes\n\ncoremap: GREEN DELTA  tokens 432→192  |  HitFile=1.00  |  HitRegion≈0.71  |  tests=PASS\n```\n\n`Tests (original repo)` is the same baseline for the Full and Compress columns; CoreMap applies the demo oracle patch only in an isolated temporary copy.\n\n---\n\n## Features\n\n- **One command** — pack a repo in seconds\n- **Git-aware** — respects `.gitignore` and optional `.coremapignore`\n- **Secret-safe** — path + content filters (keys, tokens, PEMs, etc.)\n- **Real token counts** — js-tiktoken `o200k_base`\n- **Exact spans** — path + line ranges with real source (task mode)\n- **Verification receipt** — optional patch + tests (`--verify`)\n- **Works offline** — pack and selection need no API key\n\n---\n\n## CLI reference\n\n```\nUsage: coremap [options] [path]\n\nArguments:\n  path                        repository path (default: \".\")\n\nOptions:\n  --task <text>               issue / change request (enables task mode)\n  --budget-lines <n>          max source lines in the context pack (default: 200)\n  --verify                    run one patch attempt + tests\n  --no-llm                    offline selection; skip LLM patch\n  --ground-truth <patch>      unified diff for HitFile / HitRegion scoring only\n  --max-tokens <n>            pack mode whole-file token budget (default: 50000)\n  --out-file <name>           pack mode output filename (default: coremap.md)\n  --out-dir <dir>             output directory (default: .)\n  -V, --version               output version number\n  -h, --help                  display help\n```\n\n| Flag | Mode | Notes |\n|------|------|--------|\n| `--task` | task | Turns on span selection + receipt |\n| `--budget-lines` | task | Hard line budget for selected source |\n| `--verify` | task | Patch attempt + test run |\n| `--no-llm` | task | Never call OpenAI; use oracle if `--ground-truth` is set |\n| `--ground-truth` | task | Eval only — never used as selection input |\n| `--max-tokens` | pack | Skip huge files once the budget is hit |\n| `--out-file` / `--out-dir` | both | Control where artifacts land |\n\n---\n\n## How it works\n\n**Pack:** walk the tree (gitignore-aware) → filter secrets → emit tree + files + summary with token counts.\n\n**Task:** parse the task → gather candidates (terms, symbols, imports, tests) → rank → select exact spans under the line budget → write pack + receipt → optionally verify.\n\n![CoreMap architecture](./assets/architecture.jpg)\n\n---\n\n## Project layout\n\n```\nsrc/\n  cli.ts              # CLI entry\n  index.ts            # library exports\n  coremap/            # pack, select, receipt, verify, …\nbin/coremap           # npm bin wrapper (optional; published bin is dist/cli.js)\nfixtures/             # mini-repo + tax-bug eval fixture\nevals/tax-bug/        # issue text + ground-truth patch\nspecs/coremap/        # product spec / plan / tasks\ntests/                # vitest\n```\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/Anand-0037/coremap.git\ncd coremap\nnpm install\nnpm test          # 22 tests\nnpm run build\nnpm run lint\nnpm run pack      # dogfood: pack this repo → repomap.txt\nnpm run demo      # GREEN DELTA on the pinned eval\n```\n\n### Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `npm test` | Run vitest |\n| `npm run build` | Compile TypeScript → `dist/` |\n| `npm run coremap` | Run CLI via tsx |\n| `npm run pack` | Full pack of this repo |\n| `npm run demo` | Pinned task + verify demo |\n\n### Ignore rules\n\nCoreMap respects `.gitignore`. Add a `.coremapignore` (gitignore syntax) for extra exclusions.\n\n---\n\n## Security\n\n- Path patterns: `.env*`, keys, PEMs, credential filenames, and similar\n- Content scan: private-key headers, `sk-…`, `AKIA…`, high-entropy secret-like assignments\n- Matched files are skipped; secret contents are never written into the pack\n\nReport security issues via GitHub Issues (or privately if you prefer).\n\n---\n\n## Contributing\n\n1. Fork and create a branch\n2. Keep changes small and typed (`strict` TypeScript)\n3. Add or update a vitest for behavior you change\n4. Run `npm test && npm run build` before opening a PR\n\nBug reports and PRs are welcome.\n\n---\n\n## License\n\n[MIT](./LICENSE)\n\n---\n\nBuilt for the OpenAI Codex Build Week hackathon (Delhi NCR). See [`CODEX.md`](./CODEX.md). Agent rules: [`AGENTS.md`](./AGENTS.md).\n","readmeFilename":"README.md"}