@codragraph/cli 2.0.0 → 2.1.1

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 (101) hide show
  1. package/README.md +60 -22
  2. package/dist/_shared/cgdb/schema-constants.d.ts +16 -0
  3. package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -0
  4. package/dist/_shared/cgdb/schema-constants.js +70 -0
  5. package/dist/_shared/cgdb/schema-constants.js.map +1 -0
  6. package/dist/_shared/feature-clusters.d.ts +99 -0
  7. package/dist/_shared/feature-clusters.d.ts.map +1 -0
  8. package/dist/_shared/feature-clusters.js +2 -0
  9. package/dist/_shared/feature-clusters.js.map +1 -0
  10. package/dist/_shared/graph/types.d.ts +16 -2
  11. package/dist/_shared/graph/types.d.ts.map +1 -1
  12. package/dist/_shared/index.d.ts +3 -2
  13. package/dist/_shared/index.d.ts.map +1 -1
  14. package/dist/_shared/index.js +1 -1
  15. package/dist/_shared/index.js.map +1 -1
  16. package/dist/_shared/pipeline.d.ts +1 -1
  17. package/dist/_shared/pipeline.d.ts.map +1 -1
  18. package/dist/cli/ai-context.js +4 -0
  19. package/dist/cli/analyze.js +30 -27
  20. package/dist/cli/graphstore.js +21 -21
  21. package/dist/cli/index-repo.js +3 -3
  22. package/dist/cli/index.js +37 -0
  23. package/dist/cli/setup.js +9 -5
  24. package/dist/cli/tool.d.ts +25 -0
  25. package/dist/cli/tool.js +74 -0
  26. package/dist/cli/wiki.js +3 -3
  27. package/dist/config/supported-languages.d.ts +3 -3
  28. package/dist/config/supported-languages.js +3 -3
  29. package/dist/core/augmentation/engine.js +7 -7
  30. package/dist/core/cgdb/cgdb-adapter.d.ts +176 -0
  31. package/dist/core/cgdb/cgdb-adapter.js +1336 -0
  32. package/dist/core/cgdb/content-read.d.ts +46 -0
  33. package/dist/core/cgdb/content-read.js +64 -0
  34. package/dist/core/cgdb/csv-generator.d.ts +29 -0
  35. package/dist/core/cgdb/csv-generator.js +523 -0
  36. package/dist/core/cgdb/pool-adapter.d.ts +93 -0
  37. package/dist/core/cgdb/pool-adapter.js +550 -0
  38. package/dist/core/cgdb/schema.d.ts +63 -0
  39. package/dist/core/cgdb/schema.js +557 -0
  40. package/dist/core/embeddings/embedder.js +4 -2
  41. package/dist/core/embeddings/embedding-pipeline.js +4 -4
  42. package/dist/core/graphstore/cgdb-row-source.d.ts +19 -0
  43. package/dist/core/graphstore/cgdb-row-source.js +141 -0
  44. package/dist/core/graphstore/index.d.ts +2 -2
  45. package/dist/core/graphstore/index.js +4 -4
  46. package/dist/core/group/bridge-db.d.ts +2 -2
  47. package/dist/core/group/bridge-db.js +18 -18
  48. package/dist/core/group/bridge-schema.d.ts +4 -4
  49. package/dist/core/group/bridge-schema.js +4 -4
  50. package/dist/core/group/cross-impact.js +3 -3
  51. package/dist/core/group/service.d.ts +16 -0
  52. package/dist/core/group/service.js +360 -0
  53. package/dist/core/group/sync.js +4 -4
  54. package/dist/core/ingestion/emit-references.d.ts +1 -1
  55. package/dist/core/ingestion/emit-references.js +1 -1
  56. package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
  57. package/dist/core/ingestion/feature-cluster-processor.js +626 -0
  58. package/dist/core/ingestion/finalize-orchestrator.js +1 -1
  59. package/dist/core/ingestion/model/registration-table.js +1 -0
  60. package/dist/core/ingestion/model/resolve.d.ts +2 -2
  61. package/dist/core/ingestion/model/resolve.js +3 -3
  62. package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
  63. package/dist/core/ingestion/model/semantic-model.js +1 -1
  64. package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
  65. package/dist/core/ingestion/model/symbol-table.js +1 -1
  66. package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
  67. package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
  68. package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
  69. package/dist/core/ingestion/pipeline-phases/index.js +1 -0
  70. package/dist/core/ingestion/pipeline.d.ts +4 -0
  71. package/dist/core/ingestion/pipeline.js +9 -5
  72. package/dist/core/run-analyze.d.ts +1 -0
  73. package/dist/core/run-analyze.js +36 -30
  74. package/dist/core/search/bm25-index.d.ts +3 -3
  75. package/dist/core/search/bm25-index.js +9 -9
  76. package/dist/core/search/hybrid-search.js +2 -2
  77. package/dist/core/wiki/generator.d.ts +2 -2
  78. package/dist/core/wiki/generator.js +4 -4
  79. package/dist/core/wiki/graph-queries.d.ts +2 -2
  80. package/dist/core/wiki/graph-queries.js +5 -5
  81. package/dist/mcp/core/cgdb-adapter.d.ts +5 -0
  82. package/dist/mcp/core/cgdb-adapter.js +5 -0
  83. package/dist/mcp/core/embedder.js +6 -3
  84. package/dist/mcp/local/local-backend.d.ts +14 -2
  85. package/dist/mcp/local/local-backend.js +396 -18
  86. package/dist/mcp/resources.js +139 -0
  87. package/dist/mcp/server.js +3 -3
  88. package/dist/mcp/tools.js +175 -3
  89. package/dist/server/analyze-worker.js +2 -2
  90. package/dist/server/api.js +147 -31
  91. package/dist/storage/repo-manager.d.ts +10 -5
  92. package/dist/storage/repo-manager.js +10 -6
  93. package/dist/types/pipeline.d.ts +2 -0
  94. package/hooks/claude/codragraph-hook.cjs +4 -4
  95. package/package.json +15 -6
  96. package/scripts/build.js +21 -21
  97. package/skills/codragraph-cli.md +17 -1
  98. package/skills/codragraph-guide.md +6 -2
  99. package/skills/codragraph-onboarding.md +2 -2
  100. package/vendor/tree-sitter-proto/bindings/node/index.js +3 -3
  101. package/vendor/tree-sitter-proto/src/node-types.json +1 -1
@@ -5,7 +5,7 @@ description: "Use when the user needs to run CodraGraph CLI commands like analyz
5
5
 
6
6
  # CodraGraph CLI Commands
7
7
 
8
- All commands work via `npx` — no global install required.
8
+ All commands work via `npx` — no global install required. The examples are safe in Windows PowerShell, macOS bash/zsh, and Linux shells; prefer `npm --prefix <package> <script>` from the repo root when running package-local checks.
9
9
 
10
10
  ## Commands
11
11
 
@@ -32,6 +32,22 @@ npx @codragraph/cli status
32
32
 
33
33
  Shows whether the current repo has a CodraGraph index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
34
34
 
35
+ ### feature-clusters — List product/domain areas
36
+
37
+ ```bash
38
+ npx @codragraph/cli feature-clusters
39
+ ```
40
+
41
+ Shows the human-facing feature clusters CodraGraph detected: areas like Settings, Auth, AI, Billing, or Admin, with member counts and confidence. Use this before asking an agent to work on a product area.
42
+
43
+ ### feature-context — Load one focused context pack
44
+
45
+ ```bash
46
+ npx @codragraph/cli feature-context Settings
47
+ ```
48
+
49
+ Returns the members, file paths, line ranges, dependencies, and flows for one feature cluster so an agent can edit the right files without re-exploring the whole repo.
50
+
35
51
  ### clean — Delete the index
36
52
 
37
53
  ```bash
@@ -37,6 +37,8 @@ For any task involving code understanding, debugging, impact analysis, or refact
37
37
  | `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence |
38
38
  | `detect_changes` | Git-diff impact — what do your current changes affect |
39
39
  | `rename` | Multi-file coordinated rename with confidence-tagged edits |
40
+ | `feature_clusters` | Product/domain feature map for targeted context |
41
+ | `feature_context` | Members, line ranges, dependencies, and flows for one feature |
40
42
  | `cypher` | Raw graph queries (read `codragraph://repo/{name}/schema` first) |
41
43
  | `list_repos` | Discover indexed repos |
42
44
 
@@ -48,6 +50,8 @@ Lightweight reads (~100-500 tokens) for navigation:
48
50
  | ---------------------------------------------- | ----------------------------------------- |
49
51
  | `codragraph://repo/{name}/context` | Stats, staleness check |
50
52
  | `codragraph://repo/{name}/clusters` | All functional areas with cohesion scores |
53
+ | `codragraph://repo/{name}/feature-clusters` | Product/domain feature areas |
54
+ | `codragraph://repo/{name}/feature/{featureName}` | Focused files, line ranges, flows, deps |
51
55
  | `codragraph://repo/{name}/cluster/{clusterName}` | Area members |
52
56
  | `codragraph://repo/{name}/processes` | All execution flows |
53
57
  | `codragraph://repo/{name}/process/{processName}` | Step-by-step trace |
@@ -55,8 +59,8 @@ Lightweight reads (~100-500 tokens) for navigation:
55
59
 
56
60
  ## Graph Schema
57
61
 
58
- **Nodes:** File, Function, Class, Interface, Method, Community, Process
59
- **Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS
62
+ **Nodes:** File, Function, Class, Interface, Method, Community, Process, FeatureCluster
63
+ **Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS, FEATURE_MEMBER_OF, FEATURE_DEPENDS_ON
60
64
 
61
65
  ```cypher
62
66
  MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
@@ -89,7 +89,7 @@ running through it."
89
89
 
90
90
  3. READ .claude/skills/generated/ingestion/SKILL.md
91
91
  → Entry points: runFullAnalysis, IngestionPipeline.run
92
- → Key files: codragraph/src/core/ingestion/
92
+ → Key files: packages/core/src/core/ingestion/
93
93
 
94
94
  4. READ codragraph://repo/CodraGraph/processes
95
95
  → Top flows: AnalyzeFlow, McpQueryFlow, GraphstoreCommitFlow
@@ -101,7 +101,7 @@ running through it."
101
101
  → orchestrator that takes (repoPath, options, hooks) and runs the pipeline.
102
102
  → Called by: analyzeCommand (CLI), eval-server, augment hook
103
103
 
104
- Tour result: "Start at runFullAnalysis (codragraph/src/core/run-analyze.ts).
104
+ Tour result: "Start at runFullAnalysis (packages/core/src/core/run-analyze.ts).
105
105
  That's the orchestrator. The 12-stage pipeline lives under
106
106
  src/core/ingestion/. Phase 4 graphstore is in src/core/graphstore/."
107
107
  ```
@@ -1,7 +1,7 @@
1
- const root = require("path").join(__dirname, "..", "..");
1
+ const root = require('path').join(__dirname, '..', '..');
2
2
 
3
- module.exports = require("node-gyp-build")(root);
3
+ module.exports = require('node-gyp-build')(root);
4
4
 
5
5
  try {
6
- module.exports.nodeTypeInfo = require("../../src/node-types.json");
6
+ module.exports.nodeTypeInfo = require('../../src/node-types.json');
7
7
  } catch (_) {}
@@ -1142,4 +1142,4 @@
1142
1142
  "type": "}",
1143
1143
  "named": false
1144
1144
  }
1145
- ]
1145
+ ]