gitnexus 1.6.5-rc.29 → 1.6.5-rc.30

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 (29) hide show
  1. package/dist/cli/ai-context.js +40 -4
  2. package/package.json +1 -1
  3. package/web/assets/{agent-BDDjazGf.js → agent-D2kLt6Dl.js} +83 -83
  4. package/web/assets/{architectureDiagram-UL44E2DR-0TKVszPW.js → architectureDiagram-UL44E2DR-DvIkEGkp.js} +1 -1
  5. package/web/assets/{chunk-LCXTWHL2-DavkqCND.js → chunk-LCXTWHL2-CqJ0oo1x.js} +1 -1
  6. package/web/assets/{chunk-RG4AUYOV-D_ubpjIs.js → chunk-RG4AUYOV-D0M6vdq9.js} +1 -1
  7. package/web/assets/{classDiagram-KGZ6W3CR-CojpAtMx.js → classDiagram-KGZ6W3CR-BB-saqC1.js} +1 -1
  8. package/web/assets/{classDiagram-v2-72OJOZXJ-DGdoqp9r.js → classDiagram-v2-72OJOZXJ-Bp2bAlS5.js} +1 -1
  9. package/web/assets/{diagram-3NCE3AQN-5odGXWhY.js → diagram-3NCE3AQN-BUxnDPOY.js} +1 -1
  10. package/web/assets/{diagram-GF46GFSD-Du26loU5.js → diagram-GF46GFSD-BJTyqqvI.js} +1 -1
  11. package/web/assets/{diagram-QXG6HAR7-Vi3k1Pck.js → diagram-QXG6HAR7-DilMHamP.js} +1 -1
  12. package/web/assets/{diagram-WEQXMOUZ-C646kJx-.js → diagram-WEQXMOUZ-8KUrarg1.js} +1 -1
  13. package/web/assets/{erDiagram-L5TCEMPS-B02mTKtG.js → erDiagram-L5TCEMPS-Doj9mSiW.js} +1 -1
  14. package/web/assets/{flowDiagram-H6V6AXG4-DYQh7Y0C.js → flowDiagram-H6V6AXG4-BOSR-i3p.js} +1 -1
  15. package/web/assets/{index-D6RE1OtS.js → index-j4-NuleT.js} +5 -5
  16. package/web/assets/{infoDiagram-3YFTVSEB-Dz72SU_l.js → infoDiagram-3YFTVSEB-Ce_TvtaV.js} +1 -1
  17. package/web/assets/{ishikawaDiagram-BNXS4ZKH-O10m70dP.js → ishikawaDiagram-BNXS4ZKH-4MXIDCSF.js} +1 -1
  18. package/web/assets/{kanban-definition-75IXJCU3-uUbWa1c6.js → kanban-definition-75IXJCU3-yYdfm8Kk.js} +1 -1
  19. package/web/assets/{mindmap-definition-2TDM6QVE-DpMxZSfi.js → mindmap-definition-2TDM6QVE-DFNEKM77.js} +1 -1
  20. package/web/assets/{pieDiagram-CU6KROY3-CMkeerkq.js → pieDiagram-CU6KROY3-iZAqpvhd.js} +1 -1
  21. package/web/assets/{requirementDiagram-JXO7QTGE-BTeZrcKz.js → requirementDiagram-JXO7QTGE-CtDijhnf.js} +1 -1
  22. package/web/assets/{sequenceDiagram-VS2MUI6T-Cb_0gO9y.js → sequenceDiagram-VS2MUI6T-BdjvyCHM.js} +1 -1
  23. package/web/assets/{stateDiagram-7D4R322I-gzKZ2GGa.js → stateDiagram-7D4R322I-e5odN9fG.js} +1 -1
  24. package/web/assets/{stateDiagram-v2-36443NZ5-I1MiGU6x.js → stateDiagram-v2-36443NZ5-vPsvjR2D.js} +1 -1
  25. package/web/assets/{timeline-definition-O6YCAMPW-BVMAewfu.js → timeline-definition-O6YCAMPW-DPAksNQp.js} +1 -1
  26. package/web/assets/{vennDiagram-MWXL3ELB-B1LIvNBr.js → vennDiagram-MWXL3ELB-Dtlfdt7J.js} +1 -1
  27. package/web/assets/{wardleyDiagram-CUQ6CDDI-DzzfaG4H.js → wardleyDiagram-CUQ6CDDI-B23uRMUC.js} +1 -1
  28. package/web/assets/{xychartDiagram-N2JHSOCM-BMw7CGC6.js → xychartDiagram-N2JHSOCM-DxwHeksW.js} +1 -1
  29. package/web/index.html +1 -1
@@ -156,7 +156,7 @@ async function fileExists(filePath) {
156
156
  * - If file exists without GitNexus section: append
157
157
  * - If file exists with GitNexus section: replace that section
158
158
  */
159
- async function upsertGitNexusSection(filePath, content) {
159
+ async function upsertGitNexusSection(filePath, content, projectName, stats) {
160
160
  const exists = await fileExists(filePath);
161
161
  if (!exists) {
162
162
  await fs.writeFile(filePath, content, 'utf-8');
@@ -172,7 +172,43 @@ async function upsertGitNexusSection(filePath, content) {
172
172
  const startIdx = findSectionMarkerIndex(existingContent, GITNEXUS_START_MARKER);
173
173
  const endIdx = findSectionMarkerIndex(existingContent, GITNEXUS_END_MARKER, startIdx === -1 ? 0 : startIdx);
174
174
  if (startIdx !== -1 && endIdx !== -1 && endIdx > startIdx) {
175
- // Replace existing section
175
+ const existingSection = existingContent.substring(startIdx, endIdx + GITNEXUS_END_MARKER.length);
176
+ // If the existing section contains <!-- gitnexus:keep -->, preserve the user's
177
+ // custom layout and only update the stats line (node/edge/flow counts).
178
+ // This lets teams trim the verbose default template to a lean format without
179
+ // having it overwritten on every `gitnexus analyze`.
180
+ //
181
+ // Note: the keep-marker check operates on `existingSection` (the substring
182
+ // between valid section markers identified by findSectionMarkerIndex), so
183
+ // a keep marker in user prose OUTSIDE the GitNexus block has no effect.
184
+ if (existingSection.includes('<!-- gitnexus:keep -->')) {
185
+ // Build the new stats line from the caller-provided values directly.
186
+ // We do NOT re-extract from `content` because:
187
+ // (a) first-bold extraction is fragile if the template evolves
188
+ // (b) the parenthesized-text fallback can match unrelated tuples
189
+ // like `({target: "symbolName", direction: "upstream"})`
190
+ // when noStats is set
191
+ // Passing projectName + stats explicitly makes the contract obvious.
192
+ // noStats controls template generation, not keep-section stat updates — the user opted into a stats line by keeping it.
193
+ const newStatsInner = `${stats.nodes || 0} symbols, ${stats.edges || 0} relationships, ${stats.processes || 0} execution flows`;
194
+ const statsLine = `Indexed as **${projectName}** (${newStatsInner})`;
195
+ // Match either canonical phrasing at line start (`^` with `m` flag) so we
196
+ // cannot replace prose embedded mid-paragraph. Deliberately no `$`: text
197
+ // after the closing `)` on the same line (e.g. ". MCP tools.") stays intact.
198
+ const statsPattern = /^(?:Indexed as|indexed by GitNexus as) \*\*[^*]+\*\* \([^)]+\)/m;
199
+ if (statsPattern.test(existingSection)) {
200
+ const updatedSection = existingSection.replace(statsPattern, statsLine);
201
+ const before = existingContent.substring(0, startIdx);
202
+ const after = existingContent.substring(endIdx + GITNEXUS_END_MARKER.length);
203
+ await fs.writeFile(filePath, (before + updatedSection + after).trim() + '\n', 'utf-8');
204
+ return 'updated';
205
+ }
206
+ // Keep marker present but no stats line matched. Section is preserved
207
+ // unchanged on disk; return a distinct status so callers/CLI output
208
+ // don't mis-report this as 'updated' (which would imply a write).
209
+ return 'preserved';
210
+ }
211
+ // No keep marker — replace existing section with full verbose content
176
212
  const before = existingContent.substring(0, startIdx);
177
213
  const after = existingContent.substring(endIdx + GITNEXUS_END_MARKER.length);
178
214
  const newContent = before + content + after;
@@ -264,11 +300,11 @@ export async function generateAIContextFiles(repoPath, _storagePath, projectName
264
300
  if (!options?.skipAgentsMd) {
265
301
  // Create AGENTS.md (standard for Cursor, Windsurf, OpenCode, Cline, etc.)
266
302
  const agentsPath = path.join(repoPath, 'AGENTS.md');
267
- const agentsResult = await upsertGitNexusSection(agentsPath, content);
303
+ const agentsResult = await upsertGitNexusSection(agentsPath, content, projectName, stats);
268
304
  createdFiles.push(`AGENTS.md (${agentsResult})`);
269
305
  // Create CLAUDE.md (for Claude Code)
270
306
  const claudePath = path.join(repoPath, 'CLAUDE.md');
271
- const claudeResult = await upsertGitNexusSection(claudePath, content);
307
+ const claudeResult = await upsertGitNexusSection(claudePath, content, projectName, stats);
272
308
  createdFiles.push(`CLAUDE.md (${claudeResult})`);
273
309
  }
274
310
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.5-rc.29",
3
+ "version": "1.6.5-rc.30",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",