{"_id":"@akaza21/pi-codeindex","_rev":"2-8280d498cec8ff2a651cc0601b1e65ec","name":"@akaza21/pi-codeindex","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@akaza21/pi-codeindex","version":"0.1.0","keywords":["pi-package","pi-extension","agent-tools","code-intelligence","code-index","code-graph","call-graph","static-analysis","tree-sitter","code-navigation","scip"],"license":"MIT","_id":"@akaza21/pi-codeindex@0.1.0","maintainers":[{"name":"akaza21","email":"ipragyash258@gmail.com"}],"homepage":"https://github.com/akaza21/pi-codeindex#readme","bugs":{"url":"https://github.com/akaza21/pi-codeindex/issues"},"pi":{"extensions":["./src/pi/index.ts"]},"bin":{"codeindex":"bin/codeindex.mjs"},"dist":{"shasum":"38c1ee2d5efe23181a0c6b6968312be9d7f74eeb","tarball":"https://registry.npmjs.org/@akaza21/pi-codeindex/-/pi-codeindex-0.1.0.tgz","fileCount":77,"integrity":"sha512-/rleLILVirw5PFvc5IGn2xohD6sw0sw1eVy6qe1i+GeEv9lP+OXZ1JWL0T8vf5kb4939Mp8Jz4V2UJAhx8tOhw==","signatures":[{"sig":"MEQCIDrhEtMpjLt/yihudkPCPSLZkTiwOeC7j2yse7Rl0rJAAiBtloHPzK4zExGvpLVKpTFCr+ymXoqMwJjjDET6H0h8MA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@akaza21%2fpi-codeindex@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":403063},"type":"module","engines":{"node":">=22.19.0"},"gitHead":"e3b2cda2b76057426b08f31c0e5852c2678b4ec6","scripts":{"cli":"node bin/codeindex.mjs","lint":"biome check src bin scripts test","test":"vitest run","check":"npm run lint:boundary && npm run typecheck && npm run lint && npm run test && npm run check:package && npm run test:package","typecheck":"tsc --noEmit","test:package":"node scripts/smoke-package.mjs","check:package":"node scripts/check-package.mjs","lint:boundary":"node scripts/check-boundary.mjs"},"_npmUser":{"name":"akaza21","email":"ipragyash258@gmail.com"},"repository":{"url":"git+https://github.com/akaza21/pi-codeindex.git","type":"git"},"_npmVersion":"11.16.0","description":"Local code navigation for pi agents and the command line, with call graphs, structural search, and SCIP support.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"jiti":"^2.7.0","ignore":"^7.0.6","typebox":"^1.3.8","chokidar":"^5.0.0","tree-sitter-c":"^0.24.1","tree-sitter-go":"^0.25.0","tree-sitter-cpp":"^0.23.4","tree-sitter-php":"^0.24.2","web-tree-sitter":"^0.26.9","tree-sitter-java":"^0.23.5","tree-sitter-ruby":"^0.23.1","tree-sitter-rust":"^0.24.0","tree-sitter-scala":"^0.24.0","tree-sitter-python":"^0.25.0","tree-sitter-c-sharp":"^0.23.5","tree-sitter-javascript":"^0.25.0","tree-sitter-typescript":"^0.23.2","@tree-sitter-grammars/tree-sitter-kotlin":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","@types/node":"^22.0.0","@biomejs/biome":"^2.5.5","@earendil-works/pi-coding-agent":"^0.82.0"},"peerDependencies":{"@earendil-works/pi-coding-agent":">=0.81.1"},"optionalDependencies":{"protobufjs":"^7.6.5","typescript":"^5.9.3"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-codeindex_0.1.0_1784964140080_0.7082732501600484","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@akaza21/pi-codeindex","version":"0.1.1","description":"Local code navigation for pi agents and the command line, with call graphs, structural search, and SCIP support.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/akaza21/pi-codeindex.git"},"homepage":"https://github.com/akaza21/pi-codeindex#readme","bugs":{"url":"https://github.com/akaza21/pi-codeindex/issues"},"keywords":["pi-package","pi-extension","agent-tools","code-intelligence","code-index","code-graph","call-graph","static-analysis","tree-sitter","code-navigation","scip"],"bin":{"codeindex":"bin/codeindex.mjs"},"scripts":{"cli":"node bin/codeindex.mjs","typecheck":"tsc --noEmit","lint":"biome check src bin scripts test","lint:boundary":"node scripts/check-boundary.mjs","check:package":"node scripts/check-package.mjs","test":"vitest run","test:watcher-stress":"node --experimental-strip-types scripts/watch-stress.mjs","test:package":"node scripts/smoke-package.mjs","check":"npm run lint:boundary && npm run typecheck && npm run lint && npm run test && npm run check:package && npm run test:package"},"dependencies":{"@tree-sitter-grammars/tree-sitter-kotlin":"^1.1.0","chokidar":"^5.0.0","ignore":"^7.0.6","jiti":"^2.7.0","tree-sitter-c":"^0.24.1","tree-sitter-c-sharp":"^0.23.5","tree-sitter-cpp":"^0.23.4","tree-sitter-go":"^0.25.0","tree-sitter-java":"^0.23.5","tree-sitter-javascript":"^0.25.0","tree-sitter-php":"^0.24.2","tree-sitter-python":"^0.25.0","tree-sitter-ruby":"^0.23.1","tree-sitter-rust":"^0.24.0","tree-sitter-scala":"^0.24.0","tree-sitter-typescript":"^0.23.2","typebox":"^1.3.8","web-tree-sitter":"^0.26.9"},"optionalDependencies":{"protobufjs":"^7.6.5","typescript":"^5.9.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":">=0.81.1"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"devDependencies":{"@biomejs/biome":"^2.5.5","@earendil-works/pi-coding-agent":"^0.82.0","@types/node":"^22.0.0","vitest":"^4.1.10"},"pi":{"extensions":["./src/pi/index.ts"]},"publishConfig":{"access":"public"},"engines":{"node":">=22.19.0"},"gitHead":"feab5d3721b8b86bd25beab773ab3c947d396f5e","_id":"@akaza21/pi-codeindex@0.1.1","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-7ynfcxYJSxCpZiZKJIj2b628T5yhDfBBueNcR4L6kuP6Vbh6+fa1dwViV4hzys5kxLPVLxSQLm3D3UYNEkLfVg==","shasum":"893b0fa8e725760a704e150fd4d07eab801ecbad","tarball":"https://registry.npmjs.org/@akaza21/pi-codeindex/-/pi-codeindex-0.1.1.tgz","fileCount":78,"unpackedSize":418854,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@akaza21%2fpi-codeindex@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICEmljnQw1WraHgUOvQ8swj1EzVgQ9i4Ef4w/kaZmV0fAiEA1JzHu/W8wJHvx8+pRC+Qj7L2M5ZCeC+KHhsYxLyK73A="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8e4374e4-1b4b-44b6-979d-b923772d4d7a"}},"directories":{},"maintainers":[{"name":"akaza21","email":"ipragyash258@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-codeindex_0.1.1_1785353138514_0.8166689769926292"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-25T07:22:19.927Z","modified":"2026-07-29T19:25:38.980Z","0.1.0":"2026-07-25T07:22:20.234Z","0.1.1":"2026-07-29T19:25:38.661Z"},"bugs":{"url":"https://github.com/akaza21/pi-codeindex/issues"},"license":"MIT","homepage":"https://github.com/akaza21/pi-codeindex#readme","keywords":["pi-package","pi-extension","agent-tools","code-intelligence","code-index","code-graph","call-graph","static-analysis","tree-sitter","code-navigation","scip"],"repository":{"type":"git","url":"git+https://github.com/akaza21/pi-codeindex.git"},"description":"Local code navigation for pi agents and the command line, with call graphs, structural search, and SCIP support.","maintainers":[{"name":"akaza21","email":"ipragyash258@gmail.com"}],"readme":"# pi-codeindex\n\nCode navigation for [pi](https://github.com/earendil-works/pi) agents and the command line.\n\npi-codeindex gives an agent a persistent map of definitions, references, callers, callees, inheritance, reverse-call reach, files, and AST shapes. It runs entirely on the user's machine: there is no server, network request, account, or telemetry in this package.\n\n## Why use it?\n\nText search is useful for strings, but it makes an agent repeatedly scan files and infer which same-named symbol a result belongs to. Compiler services are precise, but usually language-specific and not always available. pi-codeindex sits between those approaches:\n\n- one local SQLite index across 14 language IDs;\n- repo-local monikers that distinguish same-named declarations;\n- heuristic resolution scores and provenance on resolved references;\n- background incremental updates in pi and deterministic snapshot reads in the CLI;\n- optional TypeScript compiler resolution and external SCIP facts when more precision is available; and\n- bounded outputs designed for an agent's context window.\n\nIt is a navigation aid, not a semantic rename engine or a prediction of which edits will break.\n\n## Supported languages\n\nBuilt-in indexing supports TypeScript, TSX, JavaScript, Python, Go, Java, Ruby, Kotlin, C#, C++, PHP, Scala, Rust, and C. All work without a compiler toolchain; optional TypeScript resolution and imported SCIP facts can add precision where available. See the [language support matrix](docs/languages.md) for resolution capabilities and known limits.\n\n## Quick start\n\nRequires Node.js 22.19 or newer and pi 0.81.1 or newer.\n\n### Use it in pi\n\nInstall the npm package:\n\n```bash\npi install npm:@akaza21/pi-codeindex\n```\n\nOr install a local checkout while developing:\n\n```bash\npi install /path/to/pi-codeindex\n```\n\nStart pi inside a repository. The extension warms and watches that repository in the background. Child repositories discovered from a container directory are indexed on demand rather than all being watched at startup. For example:\n\n```text\nUse codeindex_status, then use codeindex_explore to explain openIndex and show who calls it.\n```\n\nUse `codeindex_explore` when you know the symbol name. It returns the definition, source head, callers, callees, hierarchy, and reverse-call reach. Use `codeindex_search` when the name is uncertain.\n\n### Use the standalone CLI\n\n```bash\nnpm install -g @akaza21/pi-codeindex\n\ncd /path/to/repository\ncodeindex sync .\ncodeindex search Calculator .\ncodeindex explore Calculator .\ncodeindex callers Calculator .\n```\n\nStandalone reads are snapshots. Run `codeindex sync` after edits; the CLI does not start a watcher.\n\n## What it can answer\n\n| Intent | Start with |\n| --- | --- |\n| “Where is this symbol and what surrounds it?” | `codeindex_explore` |\n| “I know part of the name.” | `codeindex_search` |\n| “Who uses this function?” | `codeindex_callers` or `codeindex_refs` |\n| “What does this function depend on?” | `codeindex_callees` |\n| “Which callers can reach this symbol?” | `codeindex_impact` |\n| “Which types explicitly implement or extend this?” | `codeindex_implementers` / `codeindex_supertypes` |\n| “Find code with this AST shape.” | `codeindex_match` |\n| “Is the index current and is watching active?” | `codeindex_status` |\n\nSee the complete [tool and CLI reference](docs/tools.md).\n\n## Precision model\n\npi-codeindex prefers the most specific available resolver and does not merge lower tiers into a higher-tier answer:\n\n1. optional TypeScript compiler resolution;\n2. lexical scope resolution;\n3. compiler-free import/package and same-file binding;\n4. bounded, lower-score same-name candidates.\n\nImported compiler-produced SCIP facts replace heuristic facts at the exact source locations they cover.\n\nResolution scores are heuristic ranking evidence, not calibrated probabilities or a guarantee of completeness. Precisely resolved bindings normally score `0.9–1.0`. Ambiguous candidates share lower scores, and name-only fan-out above eight candidates is suppressed rather than expanded into every possible edge. When suppression is reported, use source search, typed resolution, or imported SCIP facts; selecting a moniker cannot recover an edge that was never stored.\n\nResolution coverage differs by language. In particular, Go's structural interface satisfaction is not computed by the built-in index. The [language support matrix](docs/languages.md) lists import binding, receiver handling, inheritance, and typed-index support.\n\n## Typed and SCIP precision\n\nEnable the optional in-process TypeScript resolver for TS/JS:\n\n```bash\ncodeindex sync . --typed\n```\n\nIn pi, set `PI_CODEINDEX_TYPED=1` before starting the agent. Typed mode reads the repository's root `tsconfig.json` through the TypeScript API when present. Because it rebuilds a compiler program for each index snapshot, its default scope is 500 files; choose a larger `--max-files` or `PI_CODEINDEX_MAX_FILES` value explicitly after measuring the target repository.\n\nSCIP is optional interoperability, not a requirement for installation or normal indexing. pi-codeindex does not download or invoke compiler indexers. If the language ecosystem provides a [SCIP indexer](https://github.com/scip-code/scip), generate `index.scip` separately and import it:\n\n```bash\ncodeindex scip-import index.scip .\n```\n\nSCIP import/export needs the optional `protobufjs` dependency. Imported facts cover locally indexed symbols only and must be re-imported after relevant source changes. The repository's `.codeindex/index.db` is pi-codeindex's own SQLite cache, not a SCIP database.\n\n## Local data and privacy\n\nEach repository stores its cache in `.codeindex/index.db`. Source files and the index stay local, and pi-codeindex itself makes no network calls. Tool output returned to pi can still enter the context sent to the model provider the user configured, so that provider's data policy still applies to sensitive code.\n\nDirectory and file symlinks are not indexed, preventing traversal outside the selected repository. The index is a cache, not a sandbox; the process otherwise has the same filesystem permissions as the user running it.\n\n## Documentation\n\n- [Tools and CLI](docs/tools.md)\n- [Language support](docs/languages.md)\n- [Configuration and troubleshooting](docs/configuration.md)\n- [How the index works](docs/how-it-works.md)\n- [Evaluation](docs/evaluation.md)\n- [Performance](docs/performance.md)\n- [Security policy](SECURITY.md)\n\n## Development\n\n```bash\nnpm ci\nnpm run check\n```\n\nThe check verifies the engine/pi boundary, types, formatting and lint rules, the full test suite, the npm payload, and a fresh install of the packed CLI. See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidance.\n\n## License\n\n[MIT](LICENSE). Vendored and dependency attribution is documented in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n","readmeFilename":"README.md"}