Skip to content

v1.26.0

Choose a tag to compare

@github-actions github-actions released this 23 Nov 14:26

Highlight — indexing no longer hangs on a large generated module (#816). Since v1.21.2, a file embedding a long string or template, such as a ~790 KB base64 WebAssembly payload in packages/excalidraw/subset/harfbuzz/harfbuzz-wasm.ts of excalidraw, kept indexing at 100 % CPU for hours: every graph-it tool, graph-it diagram and the MCP server waited on it. The import/export reader backtracked quadratically over the blanked string; it now runs in linear time with the same matches. On excalidraw, a cold graph-it tool get_index_status --no-cache now answers in 1.3 seconds; v1.25.6 was still at 100 % CPU after 4 minutes.

Added

  • Sequence diagram of one entry symbol (#808, #809): graph-it diagram --view sequence <file#symbol> draws the calls of a function as a UML sequence: one lifeline per file (--participants class: one per class), one message per call in call order, activation bars, and the alt, opt, loop and catch fragments the calls sit in, with their guards (TypeScript, JavaScript, Python). --depth (default 3), --maxMessages (default 30, up to 60) and --startLine bound it, and a note counts what was left out. Formats: SVG, HTML, diagram-spec (kind: "sequence") and --format mermaid, a sequenceDiagram that GitHub renders in a pull request or a README (Mermaid is refused for the other views, exit 4). The MCP tool export_architecture_diagram takes view: "sequence" with depth, maxMessages, participants and diagramFormat: "mermaid", and --spec redraws a sequence spec whose lifeline titles, message labels and guards an agent rewrote.

    graph-it diagram --view sequence src/cli/commands/diagram.ts#run --depth 2 --format mermaid --output run.mmd

    Sequence diagram of the diagram command's run function

  • Show Diagram in VS Code (#795, #810): right-click a function in the editor and run Show Flow Diagram (Symbol at Cursor), or right-click a file in the Explorer and run Show Diagram… (Show Folder Diagram on a folder). The Dependency Graph view shows the tabs Units | Folder | Matrix | Flow | Seq, the views of graph-it diagram --view, drawn by the same renderer. Click a step to open its declaration, a lifeline its file (a class at its line), a call label its call site; Follow cursor redraws the diagram for the symbol or folder under the cursor. Refresh and theme work on every tab; Flow and Seq export SVG, HTML or the diagram spec (.json), and a sequence also Mermaid (.mmd). The symbol pick shows each symbol's call count; a symbol that calls nothing (a class, a constructor) shows No calls found with the file's symbols that do, one click away.
    Show Flow Diagram in the Dependency Graph view

  • Auto-imported names in the call graph (#793): Nuxt (.nuxt/imports.d.ts, .nuxt/components.d.ts), unplugin-auto-import (auto-imports.d.ts) and unplugin-vue-components (components.d.ts) declarations are read per project, so an auto-imported composable call or a <Foo /> component in <script setup>, a module or a template links to its declaration, as an import does; a name they do not declare is never guessed. A changed declaration re-extracts its project, an unchanged one nothing. A Nuxt project without .nuxt/imports.d.ts prints one stderr warning (run nuxi prepare) and get_index_status lists it under callGraph.autoImports.missing.

  • Most coupled pairs and bridging files (#342): graph-it architecture --coupling and explore_architecture with view: "coupling" list, for the groups, a folder level (--folder) or the units (--level units), the pairs of rows coupled by file pairs (aToB, bToA, mutual, heaviest first) and the files whose imports cross into 2 or more other rows, each with up to 3 evidence file pairs and the formulas. Counts are the matrix cells folded two by two; no extraction score. Group cycles and Ca/Ce/instability stay in --matrix / view: "matrix".

  • Flow diagram of one entry symbol (#793): graph-it diagram --view flow <file#symbol> draws the calls of a function from the call graph index, one column per step in call order and one row per lane (main, alternative, error) read from the call sites (TypeScript, JavaScript, Python), as SVG, HTML or a kind: "flow" diagram spec. --maxSteps (1 to 12, default 8) caps the steps and a note counts the callees left out; --startLine (1-based) picks one of several same-name symbols. The export_architecture_diagram MCP tool and its VS Code language model tool take view: "flow" with filePath, symbolName, startLine and maxSteps, and draw the same markup. A warm run restores the call graph from .graph-it/cache and re-extracts nothing. graph-it tool export_architecture_diagram now runs the tool from the CLI.
    Flow diagram of invokeTool

  • Annotated diagram specs drawn again (#794): graph-it diagram --spec <file.json> (MCP and VS Code language model export_architecture_diagram spec, REPL /diagram --spec) draws a flow or architecture spec written by --format diagram-spec after an agent rewrote its texts: node titles and subtitles, edge labels and caption lines of a flow, node labels and caption lines of a level. The spec is rebuilt from the current index and compared field by field: an unknown, added or removed node or edge, any other changed field, a stale spec, invalid JSON, an unknown version or kind fail with one line naming the JSON path; a spec outside the workspace exits 5. An untouched spec draws the same bytes as the direct command. Texts are sanitized and cut to their box, and the output names the cut ones. The flow spec gains caption and an edge label.

Changed — breaking

  • Call graph lines are 1-based, the editor line, everywhere (#793). They used to be 0-based (editor line 3 was 2). Changed fields and parameters:
    • MCP and VS Code language model query_call_graph: the startLine parameter (now at least 1), symbol.startLine/endLine, candidates[].startLine/endLine, and callers[]/callees[] sourceLine. startLine: 0 fails with "startLine" must be >= 1; got 0. startLine is 1-based (the editor line): the first line is 1.
    • VS Code language model get_symbol_callers: callers[].line when it comes from the call graph.
    • query_natural_language and graph-it query: the node line (l in TOON, startLine in JSON, file:line in text).
    • graph_context and graph-it context: symbol and test nodes[].startLine/endLine, and sourceLine/sourceEndLine on CONTAINS and call graph edges. Before, a call on line 1 lost its line.
    • generate_wiki and graph-it wiki: the symbol Line column and the caller/callee call-site line.
    • Symbol ids that embed a line (file:name:line in query_call_graph, symbol:file:name:line in graph_context) show the same 1-based line: an id copied from a result still selects its symbol, an id from an older result is reported as stale_selector.

Changed

  • CLI and MCP server on Node.js 24 use a fifth to two fifths of the memory when they parse with tree-sitter (#800): tree-sitter's WebAssembly now stays on V8's baseline compiler (Liftoff), as with node --liftoff-only. A cold graph-it tool query_call_graph on this repository drops from 3.9 GB to 1.2 GB of resident memory, and an MCP server session from 4.1 GB to 1.4 GB; a run that builds the call graph from scratch takes 15 to 35 % longer. On Node.js 22 nothing changes (no memory gain there). GRAPH_IT_WASM_TIERING=default or liftoff forces either choice (see docs/CLI.md). The VS Code extension host is unchanged. graph-it serve leaves the choice, and the warning on an unknown GRAPH_IT_WASM_TIERING value, to the MCP server it starts, so the warning prints once.

Fixed

  • (root) warning cleared once the moved units are named (#790): since v1.25.5, a graphit.architecture.json naming (root) warns that the files outside every project moved to per-folder units. The warning stayed after those units were named in the same element unit selector (or matched by a wildcard or the element's role), or by other roles keys. It now lists only the moved units the selector does not cover, and disappears when it covers them all.
  • REPL /diagram reads its positional wherever it sits among the options, as the command line does, so /diagram --view flow <file#symbol> works; unknown options are refused before drawing.
  • Did you mean suggests only close files (#801, #803): a missing file in a mistyped folder suggests the file of that name elsewhere in the workspace (File not found: src/cli/ink/ReplinkApp.ts. Did you mean: src/cli/repl/ink/ReplInkApp.ts?), skipping node_modules and dot folders. A suggestion now keeps the same extension and a close base name: the distance is measured without the extension (it used to count .json as shared letters, so flow.json suggested COM.json), at most one edit per three characters, and swapping two adjacent letters counts as one edit (flwo.ts finds flow.ts). With no close file the error names none. context seeds and MCP graph_context seeds follow the same rule.
  • review-pr compares a type member by its literals (#810): an interface member whose type resolves to string literals (Exclude<Tab, "flow">, a union alias) is compared by its sorted set of literals, not by its text. Two spellings of the same set no longer raise a breaking change, and an unchanged spelling whose set changed is now caught.
  • REPL /diagram names sequence and mermaid in its errors and hints, and in a narrowed /scope, /diagram --view sequence no longer passes the scope folder as its symbol. graph-it --help lists the sequence view and Mermaid for diagram.
  • No guessed call graph edge for an unimported name (#793): in a TypeScript or JavaScript ES module, throw new Error(), new Map(), extends Error, : Promise<T> or a call to a parameter no longer link to a same-named Vue component (error.vue, named after its file) or to a declaration of another file the module does not import; such a name reaches a declaration of its own file only. No bare name reaches a Vue SFC component node. The call graph cache is rebuilt once.

What's Changed

Features

  • feat(architecture): most coupled pairs and bridging files per level (#342) by @magic5644 in #789
  • feat(diagram): flow model of an entry symbol — steps, lanes and diagram-spec (#792) by @magic5644 in #796
  • feat(diagram): flow diagram with lanes, graph-it diagram --view flow and MCP view flow (#793) by @magic5644 in #799
  • feat(diagram): redraw an annotated diagram spec with --spec (#794) by @magic5644 in #802
  • feat(vscode): Show Diagram commands and Units | Folder | Matrix | Flow tabs in the Architecture view (#795) by @magic5644 in #804
  • feat(diagram): sequence model of an entry symbol — participants, messages, fragments and diagram-spec (#808) by @magic5644 in #811
  • feat(diagram): sequence renderer (SVG/HTML/Mermaid), graph-it diagram --view sequence, MCP view sequence, --spec kind sequence (#809) by @magic5644 in #812
  • feat(vscode): Sequence tab in the Show Diagram switcher (#810) by @magic5644 in #813

Fixes

  • fix(architecture): (root) warning skips the moved units the selector already names (#790) by @magic5644 in #791
  • fix(repl): /diagram --view flow <file#symbol> after the options; File not found suggests the file in another folder by @magic5644 in #801
  • fix(cli,mcp): 'Did you mean' suggests only close files with the same extension (#803) by @magic5644 in #815
  • fix(parser): import/export regex no longer backtracks quadratically on long blank runs (#816) by @magic5644 in #817

Performance

  • perf(cli,mcp): tree-sitter WebAssembly on Liftoff only on Node.js 24 (#800) by @magic5644 in #814

Documentation

Chores / dependencies

  • chore(plugin): sync version with published CLI by @github-actions in #788
  • chore(deps): fast-check 4.11.0 for 1.26.0 by @magic5644 in #818

Contributors

Thanks to @magic5644.

Full Changelog: v1.25.6...v1.26.0