pi-shazam 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,233 +1,128 @@
1
1
  # pi-shazam
2
2
 
3
- > Native codebase awareness extension for the Pi coding agentunified structural analysis and LSP diagnostics as first-class LLM tools.
3
+ > Give your AI agent structural awareness of your codebasebefore it reads a single file.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/pi-shazam)](https://www.npmjs.com/package/pi-shazam)
6
6
  [![CI](https://github.com/gjczone/pi-shazam/actions/workflows/ci.yml/badge.svg)](https://github.com/gjczone/pi-shazam/actions/workflows/ci.yml)
7
7
 
8
- pi-shazam builds a full dependency graph of your codebase — parsing every source file with tree-sitter, extracting symbols and their call/import relationships, ranking them with PageRank, and exposing the results through LLM-callable Pi tools. The agent sees `shazam_overview` and `shazam_codequery` the same way it sees `read` and `bash`.
8
+ ## What It Solves
9
9
 
10
- ## Installation
10
+ AI coding agents start blind. They see a file tree, maybe a README. They don't know which files are the "spine" of the project, what depends on what, or which callers will break when a function signature changes. They guess. Sometimes they guess wrong.
11
11
 
12
- ```bash
13
- pi install npm:pi-shazam
14
- ```
15
-
16
- Or add to `~/.pi/agent/settings.json`:
17
-
18
- ```json
19
- {
20
- "packages": ["npm:pi-shazam@0.1.1"]
21
- }
22
- ```
23
-
24
- > Requires Node.js ≥ 18.
25
-
26
- ## What It Gives the Agent
27
-
28
- ### Before touching any code — `shazam_overview`
29
-
30
- The first thing the agent should call in an unfamiliar repo. One call returns:
31
-
32
- - **Module dependency map** — which directories depend on which
33
- - **Top-10 files by PageRank** — the structural "spine" of the codebase
34
- - **Entry points** — exported symbols with the most incoming references
35
- - **Suggested reading order** — where to start understanding the code
36
- - **Hotspots** — files with the highest complexity and risk
37
-
38
- ### Before editing a symbol — `shazam_codequery` / `shazam_refs` / `shazam_call_chain`
12
+ pi-shazam answers the questions every agent should ask before touching code:
39
13
 
40
- Before renaming, deleting, or changing any function, the agent checks:
14
+ - "What's the structure of this project?" `shazam_overview`
15
+ - "What will break if I change this file?" → `shazam_impact`
16
+ - "Who calls this function?" → `shazam_call_chain`
17
+ - "Did my edit introduce errors?" → `shazam_verify`
41
18
 
42
- | What | Which tool |
43
- |------|-----------|
44
- | Where is it defined? | `shazam_codequery --symbol <name>` |
45
- | What's its signature and visibility? | `shazam_symbol --symbol <name>` |
46
- | Who calls it? | `shazam_refs --symbol <name>` (incoming edges) |
47
- | What does it call? | `shazam_refs --symbol <name>` (outgoing edges) |
48
- | Full call chain? | `shazam_call_chain --symbol <name> --depth 2` |
19
+ Under the hood it parses **every source file** with tree-sitter (18 languages), builds a **full dependency graph** (symbols, imports, calls, references), ranks them with **PageRank**, and optionally enriches results with **LSP diagnostics** (6 languages). The agent gets precise, ranked answers in one call — no grep, no guesswork.
49
20
 
50
- ### Before editing a file — `shazam_file_detail` / `shazam_codequery --file`
21
+ ## Primary: Pi Package
51
22
 
52
- Reading raw source shows syntax; these tools show **structure**. The agent sees every symbol in the file with signatures, visibility, line ranges, incoming/outgoing reference counts, and PageRank scores so it spots dependencies and side effects that raw reading misses.
23
+ pi-shazam is a **Pi coding agent package** the native, first-class experience. Install once, tools appear alongside `read` and `bash`:
53
24
 
54
- ### Before multi-file edits — `shazam_impact`
55
-
56
- Pass the files you plan to change and get back:
57
-
58
- - **Blast radius** — every file that references the symbols in your target files
59
- - **Key symbols at risk** — high-PageRank symbols that would be affected
60
- - **Suggested tests** — test files most likely to catch regressions
61
- - **Risk level** — low / medium / high with specific reasons
62
-
63
- ### After every edit — `shazam_verify`
64
-
65
- The evidence gate. After each write/edit, the agent runs:
66
-
67
- 1. **Git diff** → what actually changed
68
- 2. **Baseline comparison** → added/removed/modified symbols vs last snapshot
69
- 3. **Orphan detection** → symbols with zero incoming references (dead code candidates)
70
- 4. **Risk assessment** → low / medium / high based on change magnitude
71
- 5. **Call-graph consistency** → broken calls, broken imports
72
-
73
- Use `--quick` for a 2-second risk-only check after each individual edit. Run the full verify before committing.
74
-
75
- ### Before committing — `shazam_ready`
76
-
77
- The final gate. Composes verify + check into a single pass/fail readout:
78
-
79
- ```
80
- Status: ✅ READY or ❌ NOT READY
81
- - Risk level: low / medium / high
82
- - Orphan symbols: N
83
- - Files parsed: N / N
25
+ ```bash
26
+ pi install npm:pi-shazam
84
27
  ```
85
28
 
86
- If not ready, it tells the agent exactly what to fix and which tools to run.
87
-
88
- ### When CI is red — `shazam_check`
89
-
90
- Independent of git state. Runs tree-sitter parse validation across all project files and reports which files failed to parse, symbol counts, and edge statistics. For deeper diagnostics, points the agent to `npx tsc --noEmit` or language-specific linters.
29
+ All 13 analysis tools register as native Pi tools. Automatic hooks inject structural overviews into the system prompt, verify code after every edit, and log tool usage for optimization. This is the recommended setup for Pi users.
91
30
 
92
- ### Format issues — `shazam_fix`
31
+ ## Also: MCP Server
93
32
 
94
- Detects available formatters from project config (prettier, eslint, biome) and scans files for:
33
+ pi-shazam ships with an MCP server (`npx pi-shazam-mcp`) so **any MCP-compatible client** can use the same analysis tools. No Pi required.
95
34
 
96
- - Trailing whitespace
97
- - Tab indentation in space-convention files
98
- - Mixed tabs and spaces
99
- - Missing newline at end of file
100
- - Consecutive blank lines (>2)
35
+ Supported clients: Cursor, Claude Desktop, Windsurf, Qoder, Kimi Code, and any tool that speaks MCP.
101
36
 
102
- Always defaults to **dry-run mode** — shows what would change without touching files. The agent must explicitly pass `{ "dryRun": false }` to apply fixes.
103
-
104
- ### Finding dead code — `shazam_orphan`
105
-
106
- Lists symbols with zero incoming references (filtering out exported entry points, anonymous functions, and test files). Confidence ≥ 70. Before deleting anything, the agent should also check for dynamic references.
107
-
108
- ### Finding complexity problems — `shazam_hotspots`
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "pi-shazam": {
41
+ "command": "npx",
42
+ "args": ["pi-shazam-mcp"]
43
+ }
44
+ }
45
+ }
46
+ ```
109
47
 
110
- Ranks files by a composite of symbol count, edge density, and PageRank sum. The files at the top are where bugs are most likely to hide.
48
+ The same 13 tools, the same analysis engine, the same output format. MCP tools sync with Pi tools in every release.
111
49
 
112
- ### HTTP APIs — `shazam_routes`
50
+ ## Tools
113
51
 
114
- Discovers HTTP route registrations across the project — framework-agnostic pattern matching for Express, Flask, FastAPI, Gin, Actix, and more.
52
+ ### Query (read-only)
115
53
 
116
- ### State machines `shazam_state_map`
54
+ | Tool | What it tells the agent |
55
+ |------|------------------------|
56
+ | `shazam_overview` | Project structure, top-10 files by PageRank, key dependencies, recent commits, HTTP routes |
57
+ | `shazam_impact` | Every file, symbol, and test affected by your planned changes |
58
+ | `shazam_codesearch` | BM25-ranked symbol search — use instead of grep |
59
+ | `shazam_symbol` | Definition, kind, signature, callers, callees for any symbol. `mode: "state"` for enums |
60
+ | `shazam_hover` | Type signatures and JSDoc via LSP — content raw reads miss |
61
+ | `shazam_file_detail` | All symbols in a file with signatures, PageRank, call counts, LSP hierarchy |
62
+ | `shazam_call_chain` | Full upstream/downstream call graph. `flat: true` for reference list |
63
+ | `shazam_find_tests` | Which test files cover a given module |
64
+ | `shazam_hotspots` | Files ranked by complexity — where bugs hurt most |
65
+ | `shazam_type_hierarchy` | Class/interface inheritance chain |
117
66
 
118
- Traces enum and constant definitions, their values, and transition relationships. Useful for understanding configuration states, feature flags, or finite state machines.
67
+ ### Write & Verify
119
68
 
120
- ### Keyword search `shazam_codesearch`
69
+ | Tool | What it tells the agent |
70
+ |------|------------------------|
71
+ | `shazam_verify` | Post-edit gate: LSP diagnostics + risk + orphans + graph diff. PASS/WARN/FAIL |
72
+ | `shazam_fix` | Auto-fix format issues (prettier, biome, eslint, ruff, gofmt) |
73
+ | `shazam_rename_symbol` | Safe project-wide rename via LSP — verifies references first |
74
+ | `shazam_safe_delete` | Confirms zero incoming references before removing a symbol |
121
75
 
122
- BM25-ranked symbol search across the entire codebase. Better than grep for finding "that function that handles authentication" when you don't know its exact name.
76
+ ## Pi-Only Features
123
77
 
124
- ## All Tools at a Glance
78
+ These run automatically when installed as a Pi package:
125
79
 
126
- | Tool | Type | Description |
80
+ | Hook | When | What it does |
127
81
  |------|------|-------------|
128
- | `shazam_overview` | Query | Project structure, modules, Top-10 PageRank files, reading order |
129
- | `shazam_codequery` | Query | Unified lookup: `--symbol`, `--file`, or `--query` (keyword) |
130
- | `shazam_codesearch` | Query | BM25 symbol search across entire codebase |
131
- | `shazam_file_detail` | Query | Deep file analysis: all symbols, signatures, ref counts, imports |
132
- | `shazam_symbol` | Query | Single symbol: definition, kind, visibility, call counts |
133
- | `shazam_refs` | Query | All incoming + outgoing references for a symbol |
134
- | `shazam_impact` | Query | Blast radius of planned file changes with risk level |
135
- | `shazam_call_chain` | Query | Upstream callers → downstream callees with depth control |
136
- | `shazam_routes` | Query | HTTP route inventory (framework-agnostic) |
137
- | `shazam_state_map` | Query | Enum/state definitions and transitions |
138
- | `shazam_orphan` | Query | Dead code candidates (zero incoming references) |
139
- | `shazam_hotspots` | Query | Complexity-ranked file list |
140
- | `shazam_verify` | Verify | Post-edit gate: diff, orphans, risk, call-graph consistency |
141
- | `shazam_check` | Verify | Parse validation and symbol statistics (git-independent) |
142
- | `shazam_fix` | Write | Auto-detect and preview format issues (dry-run by default) |
143
- | `shazam_ready` | Verify | Pre-commit composition of verify + check |
144
-
145
- All tools support `{ "json": true }` for structured output. Write tools use `{ "dryRun": true }` by default and require explicit opt-out to apply changes.
146
-
147
- ## Automatic Hooks
148
-
149
- Two hooks run without the agent asking:
150
-
151
- ### Overview Injection (`before_agent_start`)
152
-
153
- When the agent starts in a project, pi-shazam silently scans the codebase and injects a structural overview into the system prompt. The agent **sees the shape of the code before reading a single file**, eliminating the "where do I even start" problem.
154
-
155
- ### Post-Edit Verification (`tool_result` → `write`/`edit`)
156
-
157
- After every file write or edit, pi-shazam re-scans the project and reports:
158
-
159
- - Total symbols and files
160
- - Graph changes since baseline (added/removed/modified)
161
- - Orphan symbol count (with smarter filtering — skips exported entry points and test files)
162
- - Edge count and file relationship coverage
82
+ | `before_agent_start` | Agent starts | Injects project structure overview into system prompt |
83
+ | `after_write/edit` | Agent writes/edits | Auto-verifies changes, reports structural impact |
84
+ | `shazam-guide` | Key lifecycle events | Nudges agent to use shazam tools at the right moments |
85
+ | `tool-logger` | Every shazam call | Logs usage to `~/.pi/hooks/audit/shazam-calls.log` for optimization |
163
86
 
164
- Findings are sent as a message into the conversation so the agent is immediately aware of structural impacts.
87
+ Plus two commands: `/shazam-setup` (LSP server detection) and `/shazam-doctor` (health check).
165
88
 
166
- ## Commands
89
+ ## Supported Languages
167
90
 
168
- | Command | Purpose |
169
- |---------|---------|
170
- | `/shazam-setup` | Detect installed language servers, print install instructions for missing ones |
171
- | `/shazam-doctor` | Full health check: tree-sitter grammars, LSP servers, cache integrity |
91
+ **Tree-sitter parsing (14)**: TypeScript/TSX, JavaScript/JSX, Python, Rust, Go, Java, C, C++, C#, Ruby, CSS, HTML, JSON
172
92
 
173
- ## Languages
93
+ **LSP diagnostics (6)**: TypeScript/JavaScript, Python (pyright), Rust (rust-analyzer), Go (gopls), JSON, YAML
174
94
 
175
- ### Tree-sitter Parsing (18 languages)
176
-
177
- TypeScript, JavaScript, Python, Rust, Go, Java, C, C++, C#, Ruby, CSS, HTML, JSON, YAML, Bash, Lua, Kotlin, Swift, Scala
178
-
179
- ### LSP Diagnostics (6 languages, auto-spawned)
180
-
181
- | Language | Server |
182
- |----------|--------|
183
- | TypeScript / JavaScript | typescript-language-server |
184
- | Python | pyright |
185
- | Rust | rust-analyzer |
186
- | Go | gopls |
187
- | JSON | vscode-json-languageserver |
188
- | YAML | yaml-language-server |
189
-
190
- When a language server is unavailable, tools fall back to tree-sitter and annotate output with `(tree-sitter only, LSP unavailable)`. They never throw on missing LSP.
191
-
192
- ## Encoding
193
-
194
- Adaptive file reading: UTF-8 → GBK → GB2312. Chinese-character source files are handled automatically. The scanner never assumes UTF-8.
195
-
196
- ## JSON Output Envelope
197
-
198
- ```json
199
- {
200
- "schema_version": "1.0",
201
- "command": "<tool_name>",
202
- "project": "<absolute_path>",
203
- "status": "ok",
204
- "result": { }
205
- }
206
- ```
95
+ When LSP servers are unavailable, tools fall back to tree-sitter only.
207
96
 
208
97
  ## Architecture
209
98
 
210
99
  ```
211
- index.ts ← Pi extension entry point (default export)
212
- ├── core/ ← Pure analysis — zero Pi or LSP imports
213
- ├── treesitter.ts AST parsing + symbol extraction (18 languages)
214
- ├── graph.ts ← Symbol dependency graph (imports, calls, refs)
215
- ├── pagerank.ts ← PageRank scoring
216
- ├── scanner.ts ← Project walking + graph construction
217
- ├── encoding.ts ← Adaptive encoding (UTF-8 → GBK → GB2312)
218
- │ └── cache.ts ← Baseline save/load + graph diff
219
- ├── lsp/ ← Language server process management
220
- │ ├── manager.ts Server lifecycle (spawn, stdio, health, shutdown)
221
- │ ├── client.ts JSON-RPC over stdio via vscode-jsonrpc
222
- ├── servers.ts Language → server config (6 languages)
223
- └── setup.ts ← /shazam-setup command logic
224
- ├── tools/ One file per registerTool call (16 tools)
225
- └── hooks/ ← Automatic event handlers (not LLM-callable)
226
- ├── before-start.ts ← Inject overview into system prompt
227
- └── after-write.ts ← Auto-verify after write/edit operations
100
+ pi-shazam (npm package)
101
+ ├── Pi extension MCP server
102
+ index.ts ──tools/*.ts mcp/entry.ts ──mcp/tools.ts
103
+ │ │ │ │
104
+ └──── core/ + lsp/ ───────────┘──────────────┘
105
+ (shared, no duplication)
106
+
107
+ ├── hooks/
108
+ ├── before-start.ts inject overview into prompt
109
+ │ ├── after-write.ts auto-verify after edits
110
+ │ ├── shazam-guide.ts nudge agent to use tools
111
+ └── tool-logger.ts usage analytics
112
+
113
+ └── core/ + lsp/ pure analysis (zero Pi/MCP imports)
228
114
  ```
229
115
 
230
- Layer direction: `hooks/` → `tools/` → `core/` + `lsp/`. Core never imports from tools, hooks, or lsp.
116
+ ## MCP Sync Discipline
117
+
118
+ Pi and MCP tools ship in the same package, from the same codebase. When Pi tools change, MCP tools must update in the same PR:
119
+
120
+ | Pi change | MCP action |
121
+ |-----------|------------|
122
+ | New tool | Add `registerTool` in `mcp/tools.ts` |
123
+ | Tool deleted | Remove from `mcp/tools.ts` |
124
+ | Schema changed | Update Zod schema |
125
+ | Description updated | Sync to MCP tool description |
231
126
 
232
127
  ## Development
233
128
 
@@ -238,7 +133,7 @@ npm install --legacy-peer-deps
238
133
 
239
134
  npm run dev # tsc --watch
240
135
  npm run typecheck # tsc --noEmit
241
- npm test # vitest (98 tests)
136
+ npm test # vitest (208 tests)
242
137
  npm run build # tsc → dist/
243
138
  ```
244
139
 
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Guide the agent to use shazam tools at the right moments.
3
+ *
4
+ * Injects context reminders at key lifecycle points:
5
+ * - before_agent_start: inject shazam tool list into system prompt
6
+ * - tool_result (write/edit): suggest running shazam_verify
7
+ * - tool_call (search/grep/find): suggest shazam_codesearch
8
+ */
9
+ import type { ExtensionAPI } from "../types/pi-extension.js";
10
+ export declare function registerShazamGuide(pi: ExtensionAPI): void;
11
+ //# sourceMappingURL=shasam-guide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shasam-guide.d.ts","sourceRoot":"","sources":["../../hooks/shasam-guide.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAsC1D"}
@@ -0,0 +1,41 @@
1
+ export function registerShazamGuide(pi) {
2
+ pi.on("before_agent_start", (_event, _ctx) => {
3
+ const guide = [
4
+ "",
5
+ "14 pi-shazam tools available this session:",
6
+ " shazam_overview — project structure, deps, git history in one call",
7
+ " shazam_impact — check blast radius before editing multiple files",
8
+ " shazam_codesearch — ranked code search, more precise than grep",
9
+ " shazam_symbol — locate a function/class definition and its callers",
10
+ " shazam_hover — type signatures and JSDoc via LSP",
11
+ " shazam_file_detail — see all symbols and dependencies in a file",
12
+ " shazam_call_chain — trace every caller before changing a function",
13
+ " shazam_find_tests — discover test files for any module",
14
+ " shazam_hotspots — find the most complex, highest-risk files",
15
+ " shazam_type_hierarchy — full class inheritance chain",
16
+ " shazam_verify — check for errors after every edit (PASS/WARN/FAIL)",
17
+ " shazam_fix — auto-fix format and lint issues",
18
+ " shazam_rename_symbol — safe rename, verify references first",
19
+ " shazam_safe_delete — confirm zero references before removing",
20
+ "",
21
+ ];
22
+ const current = _event.systemPrompt;
23
+ if (current.some((s) => s.includes("pi-shazam tools available")))
24
+ return;
25
+ current.push(...guide);
26
+ });
27
+ pi.on("tool_result", (event, ctx) => {
28
+ if (event.toolName !== "write" && event.toolName !== "edit")
29
+ return;
30
+ if (event.isError)
31
+ return;
32
+ ctx.ui?.notify?.("reminder: shazam_verify checks for errors after editing", "info");
33
+ });
34
+ pi.on("tool_call", (event, ctx) => {
35
+ const name = event.toolName;
36
+ if (name !== "search" && name !== "grep" && name !== "find")
37
+ return;
38
+ ctx.ui?.notify?.("reminder: shazam_codesearch gives ranked results, try it instead of grep", "info");
39
+ });
40
+ }
41
+ //# sourceMappingURL=shasam-guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shasam-guide.js","sourceRoot":"","sources":["../../hooks/shasam-guide.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,mBAAmB,CAAC,EAAgB;IACnD,EAAE,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QAC5C,MAAM,KAAK,GAAG;YACb,EAAE;YACF,4CAA4C;YAC5C,sEAAsE;YACtE,sEAAsE;YACtE,kEAAkE;YAClE,wEAAwE;YACxE,wDAAwD;YACxD,mEAAmE;YACnE,qEAAqE;YACrE,0DAA0D;YAC1D,gEAAgE;YAChE,wDAAwD;YACxD,yEAAyE;YACzE,sDAAsD;YACtD,gEAAgE;YAChE,mEAAmE;YACnE,EAAE;SACF,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;QACpC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;YAAE,OAAO;QACzE,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACnC,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM;YAAE,OAAO;QACpE,IAAI,KAAK,CAAC,OAAO;YAAE,OAAO;QAC1B,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,yDAAyD,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACjC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC5B,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO;QACpE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,0EAA0E,EAAE,MAAM,CAAC,CAAC;IACtG,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Log shazam tool calls to ~/.pi/hooks/audit/shazam-calls.log (JSONL).
3
+ *
4
+ * Each log entry captures enough detail for debugging and optimization:
5
+ * - Basic: ts, project, tool, event, durationMs, success
6
+ * - Tool-specific: verdict (verify), hitCount (codesearch), symbolCount (overview), etc.
7
+ * - Error: error message (truncated)
8
+ * - Context: result size, params summary
9
+ *
10
+ * Follows audit-guard.ts pattern: writes to ~/.pi/hooks/audit/.
11
+ */
12
+ import type { ExtensionAPI } from "../types/pi-extension.js";
13
+ export declare function registerToolLogger(pi: ExtensionAPI): void;
14
+ //# sourceMappingURL=tool-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-logger.d.ts","sourceRoot":"","sources":["../../hooks/tool-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA0E7D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA+CzD"}
@@ -0,0 +1,116 @@
1
+ import { appendFileSync, mkdirSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { homedir } from "node:os";
4
+ const AUDIT_DIR = join(homedir(), ".pi", "hooks", "audit");
5
+ const LOG_FILE = join(AUDIT_DIR, "shazam-calls.log");
6
+ const _starts = new Map();
7
+ function ensureDir() {
8
+ mkdirSync(AUDIT_DIR, { recursive: true });
9
+ }
10
+ function ts() {
11
+ const d = new Date();
12
+ const pad = (n) => String(n).padStart(2, "0");
13
+ const off = -d.getTimezoneOffset();
14
+ const sign = off >= 0 ? "+" : "-";
15
+ const tz = `${sign}${pad(Math.floor(Math.abs(off) / 60))}${pad(Math.abs(off) % 60)}`;
16
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}${tz}`;
17
+ }
18
+ function write(entry) {
19
+ try {
20
+ ensureDir();
21
+ appendFileSync(LOG_FILE, JSON.stringify(entry) + "\n", "utf-8");
22
+ }
23
+ catch { /* silent */ }
24
+ }
25
+ function isShazam(name) {
26
+ return name.startsWith("shazam_");
27
+ }
28
+ /** Extract tool-specific metadata from result text */
29
+ function extractMeta(tool, text) {
30
+ const meta = {};
31
+ const t = text.slice(0, 500);
32
+ // verify: check for PASS / WARN / FAIL verdict
33
+ if (tool === "shazam_verify") {
34
+ if (t.includes("PASS"))
35
+ meta.verdict = "PASS";
36
+ else if (t.includes("FAIL"))
37
+ meta.verdict = "FAIL";
38
+ else if (t.includes("WARN"))
39
+ meta.verdict = "WARN";
40
+ }
41
+ // codesearch / overview: count results
42
+ const symbolMatches = t.match(/(\d+) symbols?/i);
43
+ if (symbolMatches)
44
+ meta.symbolCount = parseInt(symbolMatches[1], 10);
45
+ const fileMatches = t.match(/(\d+) files?/i);
46
+ if (fileMatches)
47
+ meta.fileCount = parseInt(fileMatches[1], 10);
48
+ // call_chain: reference count
49
+ const refMatches = t.match(/(\d+) references?/i);
50
+ if (refMatches)
51
+ meta.refCount = parseInt(refMatches[1], 10);
52
+ return meta;
53
+ }
54
+ function summarize(v) {
55
+ if (v === null || v === undefined)
56
+ return v;
57
+ if (typeof v === "string")
58
+ return v.length > 200 ? `[${v.length} chars]` : v;
59
+ if (Array.isArray(v))
60
+ return `[${v.length} items]`;
61
+ if (typeof v === "object") {
62
+ const s = {};
63
+ for (const [k, val] of Object.entries(v)) {
64
+ s[k] = summarize(val);
65
+ }
66
+ return s;
67
+ }
68
+ return v;
69
+ }
70
+ export function registerToolLogger(pi) {
71
+ pi.on("tool_call", (event, ctx) => {
72
+ if (!isShazam(event.toolName))
73
+ return;
74
+ const t0 = Date.now();
75
+ _starts.set(event.toolCallId, t0);
76
+ const input = "input" in event
77
+ ? event.input
78
+ : {};
79
+ write({
80
+ ts: ts(),
81
+ project: ctx.cwd,
82
+ event: "call",
83
+ tool: event.toolName,
84
+ params: summarize(input),
85
+ });
86
+ });
87
+ pi.on("tool_result", (event, ctx) => {
88
+ if (!isShazam(event.toolName))
89
+ return;
90
+ const start = _starts.get(event.toolCallId);
91
+ const durationMs = start != null ? Date.now() - start : -1;
92
+ _starts.delete(event.toolCallId);
93
+ // Extract result text for metadata parsing
94
+ const texts = [];
95
+ if (event.content) {
96
+ for (const c of event.content) {
97
+ if (typeof c === "object" && "text" in c)
98
+ texts.push(c.text);
99
+ }
100
+ }
101
+ const combined = texts.join("\n");
102
+ const meta = extractMeta(event.toolName, combined);
103
+ write({
104
+ ts: ts(),
105
+ project: ctx.cwd,
106
+ event: "result",
107
+ tool: event.toolName,
108
+ durationMs,
109
+ success: !event.isError,
110
+ resultSize: combined.length,
111
+ error: event.isError ? texts[0]?.slice(0, 300) : null,
112
+ ...meta,
113
+ });
114
+ });
115
+ }
116
+ //# sourceMappingURL=tool-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-logger.js","sourceRoot":"","sources":["../../hooks/tool-logger.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE1C,SAAS,SAAS;IACjB,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,EAAE;IACV,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAClC,MAAM,EAAE,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,GAAG,C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IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAC/B,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,IAAI,CAAC;oBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC9D,CAAC;QACF,CAAC;QACD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAEnD,KAAK,CAAC;YACL,EAAE,EAAE,EAAE,EAAE;YACR,OAAO,EAAE,GAAG,CAAC,GAAG;YAChB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,UAAU;YACV,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO;YACvB,UAAU,EAAE,QAAQ,CAAC,MAAM;YAC3B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;YACrD,GAAG,IAAI;SACP,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACX,YAAY,EAEZ,MAAM,yBAAyB,CAAC;AAyBjC,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,GAAG,IAAI,CAuF/C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACX,YAAY,EAEZ,MAAM,yBAAyB,CAAC;AA2BjC,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,GAAG,IAAI,CAyF/C"}
package/dist/index.js CHANGED
@@ -14,6 +14,8 @@ import { setLspManager } from "./tools/_context.js";
14
14
  // ── Hook registrations ───────────────────────────────────────────────────
15
15
  import { registerBeforeStartHook } from "./hooks/before-start.js";
16
16
  import { registerAfterWriteHook } from "./hooks/after-write.js";
17
+ import { registerToolLogger } from "./hooks/tool-logger.js";
18
+ import { registerShazamGuide } from "./hooks/shasam-guide.js";
17
19
  // ── Tool registrations ────────────────────────────────────────────────────
18
20
  import { registerOverview } from "./tools/overview.js";
19
21
  import { registerImpact } from "./tools/impact.js";
@@ -60,6 +62,8 @@ export default function (pi) {
60
62
  // ── Hooks ────────────────────────────────────────────────────────────────
61
63
  registerBeforeStartHook(pi);
62
64
  registerAfterWriteHook(pi);
65
+ registerToolLogger(pi);
66
+ registerShazamGuide(pi);
63
67
  // ── /shazam-setup command ───────────────────────────────────────────────
64
68
  pi.registerCommand("shazam-setup", {
65
69
  description: "Detect and report LSP server availability with install instructions",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,4EAA4E;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,6EAA6E;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,cAAc,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{};
3
+ //# sourceMappingURL=entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../mcp/entry.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * pi-shazam MCP server — exposes codebase analysis tools via Model Context Protocol.
4
+ *
5
+ * Usage: npx pi-shazam-mcp
6
+ *
7
+ * Clients (Cursor, Claude Desktop, Windsurf, Qoder) launch this process
8
+ * and communicate via stdio JSON-RPC.
9
+ */
10
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
12
+ import { scanProject } from "../core/scanner.js";
13
+ import { registerAllTools } from "./tools.js";
14
+ const PROJECT_ROOT = process.argv[2] || ".";
15
+ async function main() {
16
+ const server = new McpServer({
17
+ name: "pi-shazam",
18
+ version: "0.2.0",
19
+ });
20
+ // Scan project (builds symbol graph, may take 1-5s for large projects)
21
+ const graph = scanProject(PROJECT_ROOT);
22
+ // Register all 13 analysis tools
23
+ registerAllTools(server, graph, PROJECT_ROOT);
24
+ // Start stdio transport
25
+ const transport = new StdioServerTransport();
26
+ await server.connect(transport);
27
+ }
28
+ main().catch((err) => {
29
+ console.error("pi-shazam MCP server failed to start:", err);
30
+ process.exit(1);
31
+ });
32
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../mcp/entry.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;AAE5C,KAAK,UAAU,IAAI;IAClB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC5B,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,OAAO;KAChB,CAAC,CAAC;IAEH,uEAAuE;IACvE,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAExC,iCAAiC;IACjC,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IAE9C,wBAAwB;IACxB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACpB,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAC;IAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * pi-shazam MCP tools — register all analysis tools as MCP tools.
3
+ * Each handler is wrapped with withLogging() for usage analytics.
4
+ */
5
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ import type { RepoGraph } from "../core/graph.js";
7
+ export declare function registerAllTools(server: McpServer, graph: RepoGraph, projectRoot: string): void;
8
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../mcp/tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAuDlD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAqK/F"}
@@ -0,0 +1,175 @@
1
+ import { z } from "zod";
2
+ import { executeOverview } from "../tools/overview.js";
3
+ import { executeImpact } from "../tools/impact.js";
4
+ import { executeCodesearch } from "../tools/codesearch.js";
5
+ import { executeSymbolWithMode } from "../tools/symbol.js";
6
+ import { executeFileDetail } from "../tools/file_detail.js";
7
+ import { executeCallChain, getFlatReferences, formatFlatReferences } from "../tools/call_chain.js";
8
+ import { executeHover } from "../tools/hover.js";
9
+ import { executeFindTests } from "../tools/find_tests.js";
10
+ import { executeHotspots } from "../tools/hotspots.js";
11
+ import { executeVerify } from "../tools/verify.js";
12
+ import { executeTypeHierarchy } from "../tools/type_hierarchy.js";
13
+ import { executeRenameSymbol } from "../tools/rename_symbol.js";
14
+ import { executeSafeDelete } from "../tools/safe_delete.js";
15
+ import { appendFileSync, mkdirSync } from "node:fs";
16
+ import { join } from "node:path";
17
+ import { homedir } from "node:os";
18
+ // ── Logging ──────────────────────────────────────────────────────
19
+ const LOG_DIR = join(homedir(), ".kimi-code", "audit");
20
+ function logMCP(entry) {
21
+ try {
22
+ mkdirSync(LOG_DIR, { recursive: true });
23
+ appendFileSync(join(LOG_DIR, "shazam-calls.log"), JSON.stringify({
24
+ ts: new Date().toISOString(),
25
+ source: "mcp",
26
+ ...entry,
27
+ }) + "\n", "utf-8");
28
+ }
29
+ catch { /* silent */ }
30
+ }
31
+ function withLogging(tool, fn) {
32
+ return async (args) => {
33
+ const t0 = Date.now();
34
+ logMCP({ tool, event: "start", params: JSON.stringify(args).slice(0, 200) });
35
+ try {
36
+ const result = await fn(args);
37
+ logMCP({ tool, event: "end", durationMs: Date.now() - t0, success: true, resultSize: result.content[0]?.text?.length ?? 0 });
38
+ return result;
39
+ }
40
+ catch (err) {
41
+ logMCP({ tool, event: "end", durationMs: Date.now() - t0, success: false, error: String(err).slice(0, 300) });
42
+ throw err;
43
+ }
44
+ };
45
+ }
46
+ // ── Registration ─────────────────────────────────────────────────
47
+ export function registerAllTools(server, graph, projectRoot) {
48
+ server.registerTool("shazam_overview", {
49
+ description: "When you first enter a project or return after changes — use this to understand the codebase before reading a single file. Returns module dependency map, top-10 PageRank files, key dependencies, recent git changes, entry points, reading order, and HTTP routes.",
50
+ inputSchema: z.object({ filter: z.string().optional().describe("Optional keyword to filter files") }),
51
+ }, withLogging("shazam_overview", async ({ filter }) => {
52
+ const text = executeOverview(graph, projectRoot, filter);
53
+ return { content: [{ type: "text", text }] };
54
+ }));
55
+ server.registerTool("shazam_impact", {
56
+ description: "Required before editing 2+ files or any shared/exported module. Returns every file, symbol, and test affected by your planned changes.",
57
+ inputSchema: z.object({ files: z.array(z.string()).describe("List of file paths to analyze") }),
58
+ }, withLogging("shazam_impact", async ({ files }) => {
59
+ const text = executeImpact(graph, files);
60
+ return { content: [{ type: "text", text }] };
61
+ }));
62
+ server.registerTool("shazam_codesearch", {
63
+ description: "Don't reach for grep or raw text search. Use this — it ranks results by relevance (BM25), understands camelCase/snake_case boundaries, and enriches hits with LSP workspace symbols.",
64
+ inputSchema: z.object({
65
+ query: z.string().describe("Search query text"),
66
+ target: z.enum(["symbol", "code"]).optional().default("symbol").describe("symbol or code"),
67
+ }),
68
+ }, withLogging("shazam_codesearch", async ({ query }) => {
69
+ const results = executeCodesearch(graph, query);
70
+ return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
71
+ }));
72
+ server.registerTool("shazam_symbol", {
73
+ description: "When you need to look up a symbol before importing or calling it — returns definition, kind, signature, callers, and callees in one call. Use mode=state for enum/state analysis.",
74
+ inputSchema: z.object({
75
+ name: z.string().describe("Symbol name to look up"),
76
+ mode: z.enum(["state"]).optional().describe("Use 'state' for enum/state map analysis"),
77
+ file: z.string().optional().describe("Optional file path to scope the search"),
78
+ }),
79
+ }, withLogging("shazam_symbol", async ({ name, mode, file }) => {
80
+ const text = executeSymbolWithMode(graph, name, mode, file);
81
+ return { content: [{ type: "text", text }] };
82
+ }));
83
+ server.registerTool("shazam_file_detail", {
84
+ description: "When you are about to edit a file you have not read before — this shows structure (symbols, signatures, visibility, PageRank), not just syntax.",
85
+ inputSchema: z.object({ file: z.string().describe("Path to the file to analyze") }),
86
+ }, withLogging("shazam_file_detail", async ({ file }) => {
87
+ const text = executeFileDetail(graph, file);
88
+ return { content: [{ type: "text", text }] };
89
+ }));
90
+ server.registerTool("shazam_call_chain", {
91
+ description: "Without this, you ship bugs. Traces ALL upstream callers, downstream callees, and references for any symbol.",
92
+ inputSchema: z.object({
93
+ symbol: z.string().describe("Symbol name to trace"),
94
+ depth: z.number().int().min(1).max(10).optional().default(2).describe("Traversal depth (default 2)"),
95
+ flat: z.boolean().optional().default(false).describe("Return a flat list of all references"),
96
+ }),
97
+ }, withLogging("shazam_call_chain", async ({ symbol, depth, flat }) => {
98
+ if (flat) {
99
+ const refs = getFlatReferences(graph, symbol);
100
+ const text = formatFlatReferences(refs, symbol);
101
+ return { content: [{ type: "text", text }] };
102
+ }
103
+ const text = executeCallChain(graph, symbol, depth ?? 2);
104
+ return { content: [{ type: "text", text }] };
105
+ }));
106
+ server.registerTool("shazam_hover", {
107
+ description: "After finding a symbol, use this to get its full type signature, documentation comments, and JSDoc.",
108
+ inputSchema: z.object({
109
+ name: z.string().describe("Symbol name"),
110
+ file: z.string().optional().describe("Optional file path to scope lookup"),
111
+ }),
112
+ }, withLogging("shazam_hover", async ({ name, file }) => {
113
+ const result = await executeHover(graph, name, file);
114
+ const text = JSON.stringify(result, null, 2);
115
+ return { content: [{ type: "text", text }] };
116
+ }));
117
+ server.registerTool("shazam_find_tests", {
118
+ description: "When adding tests or modifying source code — discover which test files cover a module.",
119
+ inputSchema: z.object({
120
+ sourceFile: z.string().optional().describe("Path to source file to find tests for"),
121
+ module: z.string().optional().describe("Module name to scope search"),
122
+ }),
123
+ }, withLogging("shazam_find_tests", async ({ sourceFile, module: mod }) => {
124
+ const result = executeFindTests(graph, projectRoot, { sourceFile: sourceFile, module: mod });
125
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
126
+ }));
127
+ server.registerTool("shazam_hotspots", {
128
+ description: "Without this, you optimize the wrong files. Returns files ranked by (symbol density x PageRank) — where bugs have the highest blast radius.",
129
+ inputSchema: z.object({}),
130
+ }, withLogging("shazam_hotspots", async () => {
131
+ const text = executeHotspots(graph);
132
+ return { content: [{ type: "text", text }] };
133
+ }));
134
+ server.registerTool("shazam_verify", {
135
+ description: "After every write or edit, run this to confirm no errors. Runs LSP diagnostics + graph analysis. Verdict: PASS / WARN / FAIL.",
136
+ inputSchema: z.object({
137
+ quick: z.boolean().optional().default(false).describe("Fast git-change-only check (~2s)"),
138
+ lspOnly: z.boolean().optional().default(false).describe("LSP diagnostics only, skip graph analysis"),
139
+ }),
140
+ }, withLogging("shazam_verify", async ({ quick, lspOnly }) => {
141
+ const text = executeVerify(graph, projectRoot, { quick: quick, lspOnly: lspOnly });
142
+ return { content: [{ type: "text", text }] };
143
+ }));
144
+ server.registerTool("shazam_type_hierarchy", {
145
+ description: "When working with classes or interfaces — see the full inheritance chain (supertypes and subtypes) in one call.",
146
+ inputSchema: z.object({
147
+ name: z.string().describe("Symbol name"),
148
+ direction: z.enum(["both", "supertypes", "subtypes"]).optional().default("both").describe("Traversal direction"),
149
+ }),
150
+ }, withLogging("shazam_type_hierarchy", async ({ name, direction }) => {
151
+ const result = executeTypeHierarchy(graph, name, direction ?? "both");
152
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
153
+ }));
154
+ server.registerTool("shazam_rename_symbol", {
155
+ description: "Safety gate before renaming. Step 1: call shazam_call_chain to review references. Step 2: use this to rename. Step 3: call shazam_verify to confirm.",
156
+ inputSchema: z.object({
157
+ symbol: z.string().describe("Current symbol name to rename"),
158
+ newName: z.string().describe("New symbol name"),
159
+ }),
160
+ }, withLogging("shazam_rename_symbol", async ({ symbol, newName }) => {
161
+ const result = executeRenameSymbol(graph, symbol, newName);
162
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
163
+ }));
164
+ server.registerTool("shazam_safe_delete", {
165
+ description: "Safety gate before removing any symbol. Verifies zero incoming references before providing deletion instructions.",
166
+ inputSchema: z.object({
167
+ symbol: z.string().describe("Symbol name to delete"),
168
+ dryRun: z.boolean().optional().default(true).describe("Preview only, do not modify files"),
169
+ }),
170
+ }, withLogging("shazam_safe_delete", async ({ symbol, dryRun }) => {
171
+ const result = executeSafeDelete(graph, symbol, dryRun);
172
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
173
+ }));
174
+ }
175
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../mcp/tools.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO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C,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;SAC1F,CAAC;KACF,EACA,WAAW,CAAC,oBAAoB,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAgB,EAAE,MAAiB,CAAC,CAAC;QAC7E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAC/E,CAAC,CAAC,CACF,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "pi-shazam",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Pi coding agent native codebase awareness extension - Shazam: power from multiple sources (repomap, pi-lens, serena MCP, tree-sitter, LSP) unified into one",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "pi-shazam-mcp": "dist/mcp/entry.js"
10
+ },
8
11
  "files": [
9
12
  "dist/**/*"
10
13
  ],
@@ -38,8 +41,8 @@
38
41
  "url": "https://github.com/gjczone/pi-shazam.git"
39
42
  },
40
43
  "dependencies": {
44
+ "@modelcontextprotocol/sdk": "^1.29.0",
41
45
  "iconv-lite": "^0.7.2",
42
- "typebox": "^1.2.1",
43
46
  "tree-sitter": "^0.22.4",
44
47
  "tree-sitter-c": "0.23.4",
45
48
  "tree-sitter-c-sharp": "0.23.1",
@@ -54,8 +57,10 @@
54
57
  "tree-sitter-ruby": "0.23.1",
55
58
  "tree-sitter-rust": "0.23.2",
56
59
  "tree-sitter-typescript": "0.23.2",
60
+ "typebox": "*",
57
61
  "vscode-jsonrpc": "^9.0.0",
58
- "vscode-languageserver-protocol": "^3.18.0"
62
+ "vscode-languageserver-protocol": "^3.18.0",
63
+ "zod": "^4.4.3"
59
64
  },
60
65
  "peerDependencies": {
61
66
  "typebox": "*"