Skip to content

knock v0.2.0: JavaScript and TypeScript code map

Latest

Choose a tag to compare

@HasanGilani HasanGilani released this 03 Nov 09:53
· 1 commit to main since this release

JavaScript and TypeScript now get the full code map, the same one Python has had: exact line ranges, what each function calls and uses, and who calls it.

claude mcp add knock -- uvx knock-mcp serve --repo . --toolset map

Already set up with uvx? The next session picks up 0.2.0 automatically when uv refreshes its cache (or run uvx knock-mcp@latest once). Existing indexes re-read JS/TS files once.

What's new

  • JS/TS call graph. Functions, arrow functions, classes and their methods, interfaces, types, enums, React components (including memo/forwardRef), object-literal methods, CommonJS exports, Express-style routes and test blocks, each with a line range and what its body calls: function calls, new X, .method(), constants, JSX components like <OrderItems>, and process.env keys. Errors checked with instanceof in catch blocks are recorded too.
  • Vue and Svelte <script> blocks are handled the same way, including Vue's options API.
  • Safe fallback. Minified or unreadable files fall back to the previous line patterns, so nothing gets worse.
  • Clearer maps. Types and constants now show "used by" instead of "called by".

How it was checked

On Hono and Excalidraw, which knock wasn't developed on: 968 of 971 JS/TS files handled (the rest are an SVG logo and embedded WebAssembly), and maps for 8 questions found 11 of 14 expected answers, against 6 of 14 before. The existing retrieval benchmark is unchanged. This is a deterministic check, not recorded Claude Code sessions; details and limits are in docs/benchmark.md.