@lzehrung/codegraph 2.3.27 → 2.3.28

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.
Files changed (137) hide show
  1. package/codegraph-skill/codegraph/SKILL.md +1 -0
  2. package/dist/agent/explain.d.ts +9 -1
  3. package/dist/agent/explain.d.ts.map +1 -1
  4. package/dist/agent/explain.js +18 -1
  5. package/dist/agent/explain.js.map +1 -1
  6. package/dist/agent/refactor-plan.d.ts +2 -0
  7. package/dist/agent/refactor-plan.d.ts.map +1 -1
  8. package/dist/agent/refactor-plan.js +11 -0
  9. package/dist/agent/refactor-plan.js.map +1 -1
  10. package/dist/agent/rename-preview.d.ts.map +1 -1
  11. package/dist/agent/rename-preview.js +49 -11
  12. package/dist/agent/rename-preview.js.map +1 -1
  13. package/dist/agent-tools.d.ts +2 -1
  14. package/dist/agent-tools.d.ts.map +1 -1
  15. package/dist/agent-tools.js +8 -0
  16. package/dist/agent-tools.js.map +1 -1
  17. package/dist/agent.d.ts +1 -1
  18. package/dist/agent.d.ts.map +1 -1
  19. package/dist/agent.js.map +1 -1
  20. package/dist/bin/cli.js +1389 -259
  21. package/dist/bin/query-index-worker.js +56 -18
  22. package/dist/cli/navigation.d.ts.map +1 -1
  23. package/dist/cli/navigation.js +4 -0
  24. package/dist/cli/navigation.js.map +1 -1
  25. package/dist/impact/call-compatibility.js +3 -3
  26. package/dist/impact/call-compatibility.js.map +1 -1
  27. package/dist/impact/direct.js +1 -1
  28. package/dist/impact/direct.js.map +1 -1
  29. package/dist/impact/reference-cache.d.ts +1 -0
  30. package/dist/impact/reference-cache.d.ts.map +1 -1
  31. package/dist/impact/reference-cache.js +44 -18
  32. package/dist/impact/reference-cache.js.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
  37. package/dist/indexer/build-cache/module-cache.js +30 -0
  38. package/dist/indexer/build-cache/module-cache.js.map +1 -1
  39. package/dist/indexer/build-cache/options.d.ts +13 -2
  40. package/dist/indexer/build-cache/options.d.ts.map +1 -1
  41. package/dist/indexer/build-cache/options.js +13 -2
  42. package/dist/indexer/build-cache/options.js.map +1 -1
  43. package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
  44. package/dist/indexer/build-cache/project-snapshot.js +60 -5
  45. package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
  46. package/dist/indexer/import-types.d.ts +14 -1
  47. package/dist/indexer/import-types.d.ts.map +1 -1
  48. package/dist/indexer/imports/binding-ranges.d.ts +50 -0
  49. package/dist/indexer/imports/binding-ranges.d.ts.map +1 -0
  50. package/dist/indexer/imports/binding-ranges.js +297 -0
  51. package/dist/indexer/imports/binding-ranges.js.map +1 -0
  52. package/dist/indexer/imports/js-text-imports.d.ts +4 -0
  53. package/dist/indexer/imports/js-text-imports.d.ts.map +1 -1
  54. package/dist/indexer/imports/js-text-imports.js +210 -48
  55. package/dist/indexer/imports/js-text-imports.js.map +1 -1
  56. package/dist/indexer/imports/language-specific.d.ts +3 -0
  57. package/dist/indexer/imports/language-specific.d.ts.map +1 -1
  58. package/dist/indexer/imports/language-specific.js +97 -23
  59. package/dist/indexer/imports/language-specific.js.map +1 -1
  60. package/dist/indexer/imports/native-captures.d.ts.map +1 -1
  61. package/dist/indexer/imports/native-captures.js +52 -30
  62. package/dist/indexer/imports/native-captures.js.map +1 -1
  63. package/dist/indexer/imports/python.d.ts +2 -0
  64. package/dist/indexer/imports/python.d.ts.map +1 -1
  65. package/dist/indexer/imports/python.js +55 -18
  66. package/dist/indexer/imports/python.js.map +1 -1
  67. package/dist/indexer/imports.d.ts.map +1 -1
  68. package/dist/indexer/imports.js +15 -1
  69. package/dist/indexer/imports.js.map +1 -1
  70. package/dist/indexer/navigation-goto.d.ts +1 -1
  71. package/dist/indexer/navigation-goto.d.ts.map +1 -1
  72. package/dist/indexer/navigation-goto.js +66 -17
  73. package/dist/indexer/navigation-goto.js.map +1 -1
  74. package/dist/indexer/navigation-references.d.ts +23 -2
  75. package/dist/indexer/navigation-references.d.ts.map +1 -1
  76. package/dist/indexer/navigation-references.js +196 -4
  77. package/dist/indexer/navigation-references.js.map +1 -1
  78. package/dist/indexer/navigation.d.ts +9 -3
  79. package/dist/indexer/navigation.d.ts.map +1 -1
  80. package/dist/indexer/navigation.js +154 -41
  81. package/dist/indexer/navigation.js.map +1 -1
  82. package/dist/indexer/scope.d.ts.map +1 -1
  83. package/dist/indexer/scope.js +18 -0
  84. package/dist/indexer/scope.js.map +1 -1
  85. package/dist/indexer/symbols.d.ts +1 -0
  86. package/dist/indexer/symbols.d.ts.map +1 -1
  87. package/dist/indexer/types.d.ts +10 -0
  88. package/dist/indexer/types.d.ts.map +1 -1
  89. package/dist/indexer.d.ts +1 -1
  90. package/dist/indexer.d.ts.map +1 -1
  91. package/dist/indexer.js.map +1 -1
  92. package/dist/languages/definitions/javascript.d.ts.map +1 -1
  93. package/dist/languages/definitions/javascript.js +10 -2
  94. package/dist/languages/definitions/javascript.js.map +1 -1
  95. package/dist/languages/definitions/php.d.ts.map +1 -1
  96. package/dist/languages/definitions/php.js +15 -8
  97. package/dist/languages/definitions/php.js.map +1 -1
  98. package/dist/languages/definitions/python.d.ts.map +1 -1
  99. package/dist/languages/definitions/python.js +11 -1
  100. package/dist/languages/definitions/python.js.map +1 -1
  101. package/dist/languages/definitions/typescript.d.ts.map +1 -1
  102. package/dist/languages/definitions/typescript.js +20 -3
  103. package/dist/languages/definitions/typescript.js.map +1 -1
  104. package/dist/languages/definitions/zig.d.ts.map +1 -1
  105. package/dist/languages/definitions/zig.js +10 -3
  106. package/dist/languages/definitions/zig.js.map +1 -1
  107. package/dist/languages/import-statement-parsers.d.ts +3 -0
  108. package/dist/languages/import-statement-parsers.d.ts.map +1 -1
  109. package/dist/languages/import-statement-parsers.js +4 -0
  110. package/dist/languages/import-statement-parsers.js.map +1 -1
  111. package/dist/mcp/handlers.d.ts +2 -1
  112. package/dist/mcp/handlers.d.ts.map +1 -1
  113. package/dist/mcp/handlers.js +15 -1
  114. package/dist/mcp/handlers.js.map +1 -1
  115. package/dist/review/summaries.d.ts.map +1 -1
  116. package/dist/review/summaries.js +11 -19
  117. package/dist/review/summaries.js.map +1 -1
  118. package/dist/review/types.d.ts +2 -1
  119. package/dist/review/types.d.ts.map +1 -1
  120. package/dist/review/types.js.map +1 -1
  121. package/dist/session.d.ts +2 -9
  122. package/dist/session.d.ts.map +1 -1
  123. package/dist/session.js.map +1 -1
  124. package/dist/sql/navigation.d.ts +6 -1
  125. package/dist/sql/navigation.d.ts.map +1 -1
  126. package/dist/sql/navigation.js +35 -3
  127. package/dist/sql/navigation.js.map +1 -1
  128. package/dist/util/comments.d.ts +10 -0
  129. package/dist/util/comments.d.ts.map +1 -1
  130. package/dist/util/comments.js +43 -2
  131. package/dist/util/comments.js.map +1 -1
  132. package/dist/util/lines.d.ts +2 -0
  133. package/dist/util/lines.d.ts.map +1 -1
  134. package/dist/util/lines.js +14 -0
  135. package/dist/util/lines.js.map +1 -1
  136. package/docs/mcp.md +1 -1
  137. package/package.json +3 -3
@@ -6,4 +6,18 @@ export function collectLineStartOffsets(source) {
6
6
  }
7
7
  return lineStarts;
8
8
  }
9
+ export function positionAtOffset(lineStarts, index) {
10
+ let low = 0;
11
+ let high = lineStarts.length - 1;
12
+ while (low < high) {
13
+ const middle = Math.ceil((low + high) / 2);
14
+ if (lineStarts[middle] <= index) {
15
+ low = middle;
16
+ }
17
+ else {
18
+ high = middle - 1;
19
+ }
20
+ }
21
+ return { line: low + 1, column: index - lineStarts[low] + 1, index };
22
+ }
9
23
  //# sourceMappingURL=lines.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/util/lines.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACvB,KAAK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GAAG,CAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AACxE,CAAC"}
package/docs/mcp.md CHANGED
@@ -86,7 +86,7 @@ The server exposes the same bounded primitives as the CLI and library session la
86
86
  - `get_file`: bounded project file read with `offset`/`limit` line pagination, exact `number<TAB>line` content, and optional direct graph context.
87
87
  - `get_symbol`: resolve a stable search or explain handle.
88
88
  - `goto`: definition lookup by portable handle, qualified `file::symbol` path, or file position.
89
- - `refs`: references by portable handle, qualified `file::symbol` path, or file position. Collection `limit` defaults to 25 and caps at 500 (`DEFAULT_MCP_COLLECTION_LIMIT` / `MAX_MCP_COLLECTION_LIMIT` in `src/mcp/tools.ts`). The response pairs `references` with `limit`, `totalSeen`, `truncated`, and `omitted`; `truncated` is exact because the lookup probes one reference past the limit. When truncated, `totalSeen` and `omitted` are lower bounds from the bounded probe, not full corpus-wide counts.
89
+ - `refs`: references by portable handle, qualified `file::symbol` path, or file position. Collection `limit` defaults to 25 and caps at 500 (`DEFAULT_MCP_COLLECTION_LIMIT` / `MAX_MCP_COLLECTION_LIMIT` in `src/mcp/tools.ts`). The response pairs `references` with `limit`, `totalSeen`, `truncated`, and `omitted`; `truncated` is exact because the lookup probes one reference past the limit. When truncated, `totalSeen` and `omitted` are lower bounds from the bounded probe, not full corpus-wide counts. Successful results also include `referenceCoverage`: `complete` means every statically linked candidate known to the current index was checked, while `partial` identifies `parser_degraded`, `unresolved_import`, or `truncated` reasons and any known affected files. This scope does not certify unknown dynamic or bare imports. Resolved named and default import declaration references use top-level `importBinding` to identify `imported` source-name tokens and distinct `local` alias/default tokens.
90
90
  - `file_deps`, `path`: dependency navigation; pass `direction: "deps"` or `"rdeps"` to `file_deps`. `file_deps` uses the same collection `limit` default 25 / max 500 as `refs`. `file_deps.file` accepts a portable symbol handle or qualified symbol path and traverses its declaring file. `dependencies`/`reverseDependencies` carry the same `limit`/`totalSeen`/`truncated`/`omitted` metadata as `refs`, so a capped prefix is always distinguishable from a complete result; when truncated, `totalSeen` and `omitted` are lower bounds from the bounded probe, not full graph-wide counts.
91
91
  - `impact`: compact git-range impact analysis (`format: "compact"`, `impacted`, diagnostics). Bounded by default.
92
92
  - `review`: git-range review report (`riskSummary`, `reviewTasks`, candidate tests). MCP is a bounded transport: `projectFiles`, `changedFiles` (including per-file `symbols`), `graphDelta`, and `candidateTests` are capped at the response's `limits` with exact per-collection `omittedCounts`, and `summary` totals stay accurate for the full report. Library callers that need the complete unbounded report call `buildReviewReport` directly instead of going through MCP.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzehrung/codegraph",
3
- "version": "2.3.27",
3
+ "version": "2.3.28",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -82,7 +82,7 @@
82
82
  "license": "MIT",
83
83
  "description": "Multi-language repository map for agents and humans: MCP tools, dependency graphs, symbol indexes, impact review, and bounded source evidence.",
84
84
  "dependencies": {
85
- "@lzehrung/codegraph-core": "2.3.27",
85
+ "@lzehrung/codegraph-core": "2.3.28",
86
86
  "@modelcontextprotocol/node": "^2.0.0",
87
87
  "@modelcontextprotocol/server": "^2.0.0",
88
88
  "fast-glob": "^3.3.3",
@@ -99,6 +99,6 @@
99
99
  "@emnapi/runtime": "1.11.3"
100
100
  },
101
101
  "optionalDependencies": {
102
- "@lzehrung/codegraph-native": "^1.12.27"
102
+ "@lzehrung/codegraph-native": "^1.12.28"
103
103
  }
104
104
  }