gitnexus 1.6.8-rc.2 → 1.6.8-rc.21
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.
- package/README.md +20 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts +21 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +4 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/cli/ai-context.js +1 -0
- package/dist/cli/analyze-config.js +40 -0
- package/dist/cli/analyze.d.ts +22 -0
- package/dist/cli/analyze.js +36 -6
- package/dist/cli/clean.d.ts +1 -0
- package/dist/cli/clean.js +43 -1
- package/dist/cli/eval-server.js +43 -0
- package/dist/cli/help-i18n.js +11 -0
- package/dist/cli/i18n/en.d.ts +13 -0
- package/dist/cli/i18n/en.js +13 -0
- package/dist/cli/i18n/resources.d.ts +26 -0
- package/dist/cli/i18n/zh-CN.d.ts +13 -0
- package/dist/cli/i18n/zh-CN.js +13 -0
- package/dist/cli/index.js +19 -0
- package/dist/cli/list.js +12 -0
- package/dist/cli/optional-grammars.d.ts +6 -8
- package/dist/cli/optional-grammars.js +8 -11
- package/dist/cli/skill-gen.js +1 -0
- package/dist/cli/status.js +26 -5
- package/dist/cli/tool.d.ts +12 -1
- package/dist/cli/tool.js +41 -1
- package/dist/core/embeddings/embedder.js +4 -0
- package/dist/core/embeddings/embedding-pipeline.js +27 -16
- package/dist/core/embeddings/onnxruntime-common-resolver.d.ts +6 -0
- package/dist/core/embeddings/onnxruntime-common-resolver.js +130 -0
- package/dist/core/graph/import-cycles.d.ts +10 -0
- package/dist/core/graph/import-cycles.js +103 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +10 -6
- package/dist/core/group/extractors/http-patterns/java.js +3 -50
- package/dist/core/group/extractors/http-patterns/kotlin.js +7 -7
- package/dist/core/group/extractors/include-extractor.js +7 -7
- package/dist/core/ingestion/cfg/cfg-builder.d.ts +64 -0
- package/dist/core/ingestion/cfg/cfg-builder.js +129 -0
- package/dist/core/ingestion/cfg/collect.d.ts +30 -0
- package/dist/core/ingestion/cfg/collect.js +34 -0
- package/dist/core/ingestion/cfg/control-flow-context.d.ts +97 -0
- package/dist/core/ingestion/cfg/control-flow-context.js +113 -0
- package/dist/core/ingestion/cfg/emit.d.ts +144 -0
- package/dist/core/ingestion/cfg/emit.js +315 -0
- package/dist/core/ingestion/cfg/reaching-defs.d.ts +90 -0
- package/dist/core/ingestion/cfg/reaching-defs.js +364 -0
- package/dist/core/ingestion/cfg/traversal-result.d.ts +20 -0
- package/dist/core/ingestion/cfg/traversal-result.js +2 -0
- package/dist/core/ingestion/cfg/types.d.ts +231 -0
- package/dist/core/ingestion/cfg/types.js +13 -0
- package/dist/core/ingestion/cfg/visitors/typescript-harvest.d.ts +144 -0
- package/dist/core/ingestion/cfg/visitors/typescript-harvest.js +1032 -0
- package/dist/core/ingestion/cfg/visitors/typescript.d.ts +66 -0
- package/dist/core/ingestion/cfg/visitors/typescript.js +584 -0
- package/dist/core/ingestion/language-provider.d.ts +36 -2
- package/dist/core/ingestion/languages/c-cpp.js +11 -4
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +6 -2
- package/dist/core/ingestion/languages/cpp/captures.js +24 -1
- package/dist/core/ingestion/languages/cpp/query.js +23 -0
- package/dist/core/ingestion/languages/java.js +3 -0
- package/dist/core/ingestion/languages/kotlin/query.js +3 -2
- package/dist/core/ingestion/languages/kotlin.js +5 -1
- package/dist/core/ingestion/languages/typescript.js +5 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.js +6 -13
- package/dist/core/ingestion/method-extractors/generic.js +1 -0
- package/dist/core/ingestion/method-types.d.ts +2 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -0
- package/dist/core/ingestion/model/symbol-table.js +1 -0
- package/dist/core/ingestion/parsing-processor.js +22 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +18 -1
- package/dist/core/ingestion/pipeline-phases/routes.js +64 -14
- package/dist/core/ingestion/pipeline.d.ts +57 -0
- package/dist/core/ingestion/route-extractors/spring-shared.d.ts +50 -0
- package/dist/core/ingestion/route-extractors/spring-shared.js +80 -0
- package/dist/core/ingestion/route-extractors/spring.d.ts +35 -0
- package/dist/core/ingestion/route-extractors/spring.js +136 -0
- package/dist/core/ingestion/scope-extractor.js +3 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +12 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +145 -24
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +6 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +43 -3
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +21 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +207 -0
- package/dist/core/ingestion/scope-resolution/resolution-outcome.d.ts +1 -1
- package/dist/core/ingestion/taint/emit.d.ts +124 -0
- package/dist/core/ingestion/taint/emit.js +204 -0
- package/dist/core/ingestion/taint/match.d.ts +153 -0
- package/dist/core/ingestion/taint/match.js +278 -0
- package/dist/core/ingestion/taint/path-codec.d.ts +134 -0
- package/dist/core/ingestion/taint/path-codec.js +190 -0
- package/dist/core/ingestion/taint/propagate.d.ts +216 -0
- package/dist/core/ingestion/taint/propagate.js +664 -0
- package/dist/core/ingestion/taint/site-safety.d.ts +29 -0
- package/dist/core/ingestion/taint/site-safety.js +98 -0
- package/dist/core/ingestion/taint/source-sink-config.d.ts +94 -23
- package/dist/core/ingestion/taint/source-sink-config.js +11 -11
- package/dist/core/ingestion/taint/source-sink-registry.d.ts +6 -4
- package/dist/core/ingestion/taint/source-sink-registry.js +6 -4
- package/dist/core/ingestion/taint/typescript-model.d.ts +38 -0
- package/dist/core/ingestion/taint/typescript-model.js +102 -0
- package/dist/core/ingestion/utils/method-props.js +1 -0
- package/dist/core/ingestion/workers/clone-safety.d.ts +109 -0
- package/dist/core/ingestion/workers/clone-safety.js +465 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +11 -0
- package/dist/core/ingestion/workers/parse-worker.js +70 -53
- package/dist/core/ingestion/workers/post-result.d.ts +22 -0
- package/dist/core/ingestion/workers/post-result.js +87 -0
- package/dist/core/ingestion/workers/result-merge.d.ts +20 -0
- package/dist/core/ingestion/workers/result-merge.js +43 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +15 -0
- package/dist/core/ingestion/workers/worker-pool.js +33 -16
- package/dist/core/lbug/lbug-adapter.d.ts +19 -0
- package/dist/core/lbug/lbug-adapter.js +56 -1
- package/dist/core/run-analyze.d.ts +87 -0
- package/dist/core/run-analyze.js +280 -25
- package/dist/core/tree-sitter/parser-loader.js +5 -4
- package/dist/core/tree-sitter/vendored-grammars.d.ts +39 -0
- package/dist/core/tree-sitter/vendored-grammars.js +57 -0
- package/dist/mcp/core/embedder.js +4 -0
- package/dist/mcp/local/local-backend.d.ts +86 -2
- package/dist/mcp/local/local-backend.js +657 -27
- package/dist/mcp/resources.js +1 -0
- package/dist/mcp/tools.d.ts +9 -0
- package/dist/mcp/tools.js +109 -0
- package/dist/server/analyze-launch.d.ts +29 -0
- package/dist/server/analyze-launch.js +137 -0
- package/dist/server/analyze-upload.d.ts +33 -0
- package/dist/server/analyze-upload.js +123 -0
- package/dist/server/analyze-worker-ipc.d.ts +58 -0
- package/dist/server/analyze-worker-ipc.js +16 -0
- package/dist/server/analyze-worker.d.ts +17 -1
- package/dist/server/analyze-worker.js +7 -1
- package/dist/server/api.js +46 -140
- package/dist/server/git-clone.d.ts +1 -0
- package/dist/server/git-clone.js +1 -1
- package/dist/server/middleware.d.ts +11 -0
- package/dist/server/middleware.js +27 -0
- package/dist/server/upload-ingest.d.ts +56 -0
- package/dist/server/upload-ingest.js +276 -0
- package/dist/server/upload-paths.d.ts +31 -0
- package/dist/server/upload-paths.js +51 -0
- package/dist/server/upload-sweep.d.ts +20 -0
- package/dist/server/upload-sweep.js +57 -0
- package/dist/storage/branch-index.d.ts +52 -0
- package/dist/storage/branch-index.js +65 -0
- package/dist/storage/git.d.ts +11 -0
- package/dist/storage/git.js +28 -0
- package/dist/storage/parse-cache.d.ts +22 -1
- package/dist/storage/parse-cache.js +32 -10
- package/dist/storage/repo-manager.d.ts +122 -10
- package/dist/storage/repo-manager.js +162 -21
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +42 -8
- package/hooks/claude/gitnexus-hook.cjs +36 -8
- package/hooks/claude/hook-db-lock-probe.cjs +123 -2
- package/package.json +4 -2
- package/scripts/assert-publish-grammar-coverage.cjs +31 -0
- package/scripts/build-tree-sitter-grammars.cjs +16 -10
- package/skills/gitnexus-guide.md +11 -0
- package/vendor/tree-sitter-c/package.json +1 -1
- package/vendor/tree-sitter-dart/package.json +1 -1
- package/vendor/tree-sitter-kotlin/package.json +1 -1
- package/vendor/tree-sitter-proto/package.json +1 -1
- package/vendor/tree-sitter-swift/package.json +1 -1
- package/web/assets/{agent-CKPMqImC.js → agent-ay4LD70X.js} +1 -1
- package/web/assets/{architectureDiagram-UL44E2DR-D1EXI0zA.js → architectureDiagram-UL44E2DR-Dc-viYhd.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-Dfmux4m1.js → chunk-LCXTWHL2-4rpojOyj.js} +1 -1
- package/web/assets/{chunk-RG4AUYOV-CAkzcoRj.js → chunk-RG4AUYOV-BnOy944n.js} +1 -1
- package/web/assets/{classDiagram-KGZ6W3CR-Bv93af_b.js → classDiagram-KGZ6W3CR-Bsgpy98Q.js} +1 -1
- package/web/assets/{classDiagram-v2-72OJOZXJ-CLfEqHUa.js → classDiagram-v2-72OJOZXJ-D5atDGjc.js} +1 -1
- package/web/assets/{diagram-3NCE3AQN-BqAtKUpW.js → diagram-3NCE3AQN-Cz1OEMVi.js} +1 -1
- package/web/assets/{diagram-GF46GFSD-CaBG6n6o.js → diagram-GF46GFSD-CWYwzfP8.js} +1 -1
- package/web/assets/{diagram-QXG6HAR7-CZ-O3rcV.js → diagram-QXG6HAR7-DtBObr8L.js} +1 -1
- package/web/assets/{diagram-WEQXMOUZ-P4lSL4GH.js → diagram-WEQXMOUZ-BUV44Ov_.js} +1 -1
- package/web/assets/{erDiagram-L5TCEMPS-QN2eEP1e.js → erDiagram-L5TCEMPS-Ds9s-sRF.js} +1 -1
- package/web/assets/{flowDiagram-H6V6AXG4-CXbXImlN.js → flowDiagram-H6V6AXG4-CupStHQb.js} +1 -1
- package/web/assets/index-COMMmbxW.css +2 -0
- package/web/assets/{index-CG6q8eTs.js → index-Do8AE5yF.js} +85 -85
- package/web/assets/{infoDiagram-3YFTVSEB-DmLICZx1.js → infoDiagram-3YFTVSEB-DPTXSbgu.js} +1 -1
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-6LKOvBfp.js → ishikawaDiagram-BNXS4ZKH-CeK-Qhet.js} +1 -1
- package/web/assets/{kanban-definition-75IXJCU3-DgDi9oJT.js → kanban-definition-75IXJCU3-D4tx6QQ-.js} +1 -1
- package/web/assets/{mindmap-definition-2TDM6QVE-CwR5sBB-.js → mindmap-definition-2TDM6QVE-Bcto_kGa.js} +1 -1
- package/web/assets/{pieDiagram-CU6KROY3-By8g6f6B.js → pieDiagram-CU6KROY3-DPIeBTG6.js} +1 -1
- package/web/assets/{requirementDiagram-JXO7QTGE-7oDcJ1_J.js → requirementDiagram-JXO7QTGE-DDGXjVKO.js} +1 -1
- package/web/assets/{sequenceDiagram-VS2MUI6T-FySeKCUy.js → sequenceDiagram-VS2MUI6T-BzDqpcVW.js} +1 -1
- package/web/assets/{stateDiagram-7D4R322I-CB2nABwH.js → stateDiagram-7D4R322I-Bx__als3.js} +1 -1
- package/web/assets/{stateDiagram-v2-36443NZ5-COBGd2RL.js → stateDiagram-v2-36443NZ5-QqOh2yO-.js} +1 -1
- package/web/assets/{timeline-definition-O6YCAMPW-Ds2CnVZK.js → timeline-definition-O6YCAMPW-C1eogTOG.js} +1 -1
- package/web/assets/{vennDiagram-MWXL3ELB-DUIEwXWp.js → vennDiagram-MWXL3ELB-D20F4rSW.js} +1 -1
- package/web/assets/{wardleyDiagram-CUQ6CDDI-DEiFPQih.js → wardleyDiagram-CUQ6CDDI-BeBHg7ST.js} +1 -1
- package/web/assets/{xychartDiagram-N2JHSOCM-BUbayhST.js → xychartDiagram-N2JHSOCM-CdOWeoNI.js} +1 -1
- package/web/index.html +2 -2
- package/scripts/materialize-vendor-grammars.cjs +0 -97
- package/web/assets/index-BKWA-m7o.css +0 -2
|
@@ -11,6 +11,9 @@ export declare const cliResources: {
|
|
|
11
11
|
readonly 'list.title': "Indexed Repositories ({{count}})";
|
|
12
12
|
readonly 'list.indexed': "Indexed";
|
|
13
13
|
readonly 'list.commit': "Commit";
|
|
14
|
+
readonly 'list.branch': "Branch";
|
|
15
|
+
readonly 'list.branchIndexes': "Branch indexes";
|
|
16
|
+
readonly 'list.branchLine': "{{branch}} ({{commit}}, {{indexed}})";
|
|
14
17
|
readonly 'list.stats': "Stats";
|
|
15
18
|
readonly 'list.statsValue': "{{files}} files, {{symbols}} symbols, {{edges}} edges";
|
|
16
19
|
readonly 'list.clusters': "Clusters";
|
|
@@ -24,6 +27,9 @@ export declare const cliResources: {
|
|
|
24
27
|
readonly 'status.indexed': "Indexed";
|
|
25
28
|
readonly 'status.indexedCommit': "Indexed commit";
|
|
26
29
|
readonly 'status.currentCommit': "Current commit";
|
|
30
|
+
readonly 'status.branch': "Branch";
|
|
31
|
+
readonly 'status.detached': "(detached HEAD)";
|
|
32
|
+
readonly 'status.branchNotIndexed': "⚠️ current branch not indexed (primary index is for '{{primary}}'; run gitnexus analyze)";
|
|
27
33
|
readonly 'status.status': "Status";
|
|
28
34
|
readonly 'status.upToDate': "✅ up-to-date";
|
|
29
35
|
readonly 'status.stale': "⚠️ stale (re-run gitnexus analyze)";
|
|
@@ -31,6 +37,9 @@ export declare const cliResources: {
|
|
|
31
37
|
readonly 'clean.deletedRepo': "Deleted: {{name}} ({{storagePath}})";
|
|
32
38
|
readonly 'clean.notFoundHere': "No indexed repository found in this directory.";
|
|
33
39
|
readonly 'clean.deleteCurrent': "This will delete the GitNexus index for: {{repoName}}";
|
|
40
|
+
readonly 'clean.branchNotIndexed': "No indexed branch named \"{{branch}}\" for this repository.";
|
|
41
|
+
readonly 'clean.deleteBranch': "This will delete the branch index \"{{branch}}\" at: {{path}}";
|
|
42
|
+
readonly 'clean.deletedBranch': "Deleted branch index: {{branch}}";
|
|
34
43
|
readonly 'clean.lbugSidecars.state': "LadybugDB sidecar state: {{state}}";
|
|
35
44
|
readonly 'clean.lbugSidecars.none': "No quarantined LadybugDB missing-shadow WAL sidecars found.";
|
|
36
45
|
readonly 'clean.lbugSidecars.preview': "This will delete {{count}} quarantined LadybugDB missing-shadow WAL sidecar(s):";
|
|
@@ -118,6 +127,7 @@ export declare const cliResources: {
|
|
|
118
127
|
readonly 'help.command.impact.description': "Blast radius analysis: what breaks if you change a symbol";
|
|
119
128
|
readonly 'help.command.cypher.description': "Execute raw Cypher query against the knowledge graph";
|
|
120
129
|
readonly 'help.command.detectChanges.description': "Map git diff hunks to indexed symbols and affected execution flows";
|
|
130
|
+
readonly 'help.command.check.description': "Run structural checks against the indexed graph";
|
|
121
131
|
readonly 'help.command.evalServer.description': "Start lightweight HTTP server for fast tool calls during evaluation";
|
|
122
132
|
readonly 'help.command.group.description': "Manage repository groups for cross-index impact analysis";
|
|
123
133
|
readonly 'help.command.group.create.description': "Create a new group with template group.yaml";
|
|
@@ -157,6 +167,7 @@ export declare const cliResources: {
|
|
|
157
167
|
readonly 'help.option.force.confirmation': "Skip confirmation prompt";
|
|
158
168
|
readonly 'help.option.uninstall.force': "Apply the changes (default is a dry-run preview)";
|
|
159
169
|
readonly 'help.option.clean.all': "Clean all indexed repos";
|
|
170
|
+
readonly 'help.option.clean.branch': "Delete only the named branch index (not the primary)";
|
|
160
171
|
readonly 'help.option.clean.lbugSidecars': "Clean quarantined LadybugDB missing-shadow WAL sidecars";
|
|
161
172
|
readonly 'help.option.wiki.force': "Force full regeneration even if up to date";
|
|
162
173
|
readonly 'help.option.wiki.provider': "LLM provider: openai, openrouter, azure, custom, cursor, claude, codex, or opencode (default: openai)";
|
|
@@ -179,6 +190,7 @@ export declare const cliResources: {
|
|
|
179
190
|
readonly 'help.option.query.limit': "Max processes to return (default: 5)";
|
|
180
191
|
readonly 'help.option.content': "Include full symbol source code";
|
|
181
192
|
readonly 'help.option.repo.target': "Target repository";
|
|
193
|
+
readonly 'help.option.branch': "Scope to a specific branch index (multi-branch repos)";
|
|
182
194
|
readonly 'help.option.context.uid': "Direct symbol UID (zero-ambiguity lookup)";
|
|
183
195
|
readonly 'help.option.context.file': "File path to disambiguate common names";
|
|
184
196
|
readonly 'help.option.impact.kind': "Kind filter to disambiguate common names (e.g. Function, Class, Method)";
|
|
@@ -190,6 +202,7 @@ export declare const cliResources: {
|
|
|
190
202
|
readonly 'help.option.impact.summaryOnly': "Return counts and risk only, omit symbol list";
|
|
191
203
|
readonly 'help.option.detectChanges.scope': "What to analyze: unstaged, staged, all, or compare";
|
|
192
204
|
readonly 'help.option.detectChanges.baseRef': "Branch/commit for compare scope (e.g. main)";
|
|
205
|
+
readonly 'help.option.check.cycles': "Detect circular imports and fail when any are found";
|
|
193
206
|
readonly 'help.option.evalServer.host': "Bind address (default: 127.0.0.1, use 0.0.0.0 to expose to all interfaces)";
|
|
194
207
|
readonly 'help.option.evalServer.idleTimeout': "Auto-shutdown after N seconds idle (0 = disabled)";
|
|
195
208
|
readonly 'help.option.group.create.force': "Overwrite existing group";
|
|
@@ -224,6 +237,9 @@ export declare const cliResources: {
|
|
|
224
237
|
'list.title': string;
|
|
225
238
|
'list.indexed': string;
|
|
226
239
|
'list.commit': string;
|
|
240
|
+
'list.branch': string;
|
|
241
|
+
'list.branchIndexes': string;
|
|
242
|
+
'list.branchLine': string;
|
|
227
243
|
'list.stats': string;
|
|
228
244
|
'list.statsValue': string;
|
|
229
245
|
'list.clusters': string;
|
|
@@ -237,6 +253,9 @@ export declare const cliResources: {
|
|
|
237
253
|
'status.indexed': string;
|
|
238
254
|
'status.indexedCommit': string;
|
|
239
255
|
'status.currentCommit': string;
|
|
256
|
+
'status.branch': string;
|
|
257
|
+
'status.detached': string;
|
|
258
|
+
'status.branchNotIndexed': string;
|
|
240
259
|
'status.status': string;
|
|
241
260
|
'status.upToDate': string;
|
|
242
261
|
'status.stale': string;
|
|
@@ -244,6 +263,9 @@ export declare const cliResources: {
|
|
|
244
263
|
'clean.deletedRepo': string;
|
|
245
264
|
'clean.notFoundHere': string;
|
|
246
265
|
'clean.deleteCurrent': string;
|
|
266
|
+
'clean.branchNotIndexed': string;
|
|
267
|
+
'clean.deleteBranch': string;
|
|
268
|
+
'clean.deletedBranch': string;
|
|
247
269
|
'clean.lbugSidecars.state': string;
|
|
248
270
|
'clean.lbugSidecars.none': string;
|
|
249
271
|
'clean.lbugSidecars.preview': string;
|
|
@@ -331,6 +353,7 @@ export declare const cliResources: {
|
|
|
331
353
|
'help.command.impact.description': string;
|
|
332
354
|
'help.command.cypher.description': string;
|
|
333
355
|
'help.command.detectChanges.description': string;
|
|
356
|
+
'help.command.check.description': string;
|
|
334
357
|
'help.command.evalServer.description': string;
|
|
335
358
|
'help.command.group.description': string;
|
|
336
359
|
'help.command.group.create.description': string;
|
|
@@ -370,6 +393,7 @@ export declare const cliResources: {
|
|
|
370
393
|
'help.option.force.confirmation': string;
|
|
371
394
|
'help.option.uninstall.force': string;
|
|
372
395
|
'help.option.clean.all': string;
|
|
396
|
+
'help.option.clean.branch': string;
|
|
373
397
|
'help.option.clean.lbugSidecars': string;
|
|
374
398
|
'help.option.wiki.force': string;
|
|
375
399
|
'help.option.wiki.provider': string;
|
|
@@ -392,6 +416,7 @@ export declare const cliResources: {
|
|
|
392
416
|
'help.option.query.limit': string;
|
|
393
417
|
'help.option.content': string;
|
|
394
418
|
'help.option.repo.target': string;
|
|
419
|
+
'help.option.branch': string;
|
|
395
420
|
'help.option.context.uid': string;
|
|
396
421
|
'help.option.context.file': string;
|
|
397
422
|
'help.option.impact.kind': string;
|
|
@@ -403,6 +428,7 @@ export declare const cliResources: {
|
|
|
403
428
|
'help.option.impact.summaryOnly': string;
|
|
404
429
|
'help.option.detectChanges.scope': string;
|
|
405
430
|
'help.option.detectChanges.baseRef': string;
|
|
431
|
+
'help.option.check.cycles': string;
|
|
406
432
|
'help.option.evalServer.host': string;
|
|
407
433
|
'help.option.evalServer.idleTimeout': string;
|
|
408
434
|
'help.option.group.create.force': string;
|
package/dist/cli/i18n/zh-CN.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export declare const zhCN: {
|
|
|
10
10
|
'list.title': string;
|
|
11
11
|
'list.indexed': string;
|
|
12
12
|
'list.commit': string;
|
|
13
|
+
'list.branch': string;
|
|
14
|
+
'list.branchIndexes': string;
|
|
15
|
+
'list.branchLine': string;
|
|
13
16
|
'list.stats': string;
|
|
14
17
|
'list.statsValue': string;
|
|
15
18
|
'list.clusters': string;
|
|
@@ -23,6 +26,9 @@ export declare const zhCN: {
|
|
|
23
26
|
'status.indexed': string;
|
|
24
27
|
'status.indexedCommit': string;
|
|
25
28
|
'status.currentCommit': string;
|
|
29
|
+
'status.branch': string;
|
|
30
|
+
'status.detached': string;
|
|
31
|
+
'status.branchNotIndexed': string;
|
|
26
32
|
'status.status': string;
|
|
27
33
|
'status.upToDate': string;
|
|
28
34
|
'status.stale': string;
|
|
@@ -30,6 +36,9 @@ export declare const zhCN: {
|
|
|
30
36
|
'clean.deletedRepo': string;
|
|
31
37
|
'clean.notFoundHere': string;
|
|
32
38
|
'clean.deleteCurrent': string;
|
|
39
|
+
'clean.branchNotIndexed': string;
|
|
40
|
+
'clean.deleteBranch': string;
|
|
41
|
+
'clean.deletedBranch': string;
|
|
33
42
|
'clean.lbugSidecars.state': string;
|
|
34
43
|
'clean.lbugSidecars.none': string;
|
|
35
44
|
'clean.lbugSidecars.preview': string;
|
|
@@ -117,6 +126,7 @@ export declare const zhCN: {
|
|
|
117
126
|
'help.command.impact.description': string;
|
|
118
127
|
'help.command.cypher.description': string;
|
|
119
128
|
'help.command.detectChanges.description': string;
|
|
129
|
+
'help.command.check.description': string;
|
|
120
130
|
'help.command.evalServer.description': string;
|
|
121
131
|
'help.command.group.description': string;
|
|
122
132
|
'help.command.group.create.description': string;
|
|
@@ -156,6 +166,7 @@ export declare const zhCN: {
|
|
|
156
166
|
'help.option.force.confirmation': string;
|
|
157
167
|
'help.option.uninstall.force': string;
|
|
158
168
|
'help.option.clean.all': string;
|
|
169
|
+
'help.option.clean.branch': string;
|
|
159
170
|
'help.option.clean.lbugSidecars': string;
|
|
160
171
|
'help.option.wiki.force': string;
|
|
161
172
|
'help.option.wiki.provider': string;
|
|
@@ -178,6 +189,7 @@ export declare const zhCN: {
|
|
|
178
189
|
'help.option.query.limit': string;
|
|
179
190
|
'help.option.content': string;
|
|
180
191
|
'help.option.repo.target': string;
|
|
192
|
+
'help.option.branch': string;
|
|
181
193
|
'help.option.context.uid': string;
|
|
182
194
|
'help.option.context.file': string;
|
|
183
195
|
'help.option.impact.kind': string;
|
|
@@ -189,6 +201,7 @@ export declare const zhCN: {
|
|
|
189
201
|
'help.option.impact.summaryOnly': string;
|
|
190
202
|
'help.option.detectChanges.scope': string;
|
|
191
203
|
'help.option.detectChanges.baseRef': string;
|
|
204
|
+
'help.option.check.cycles': string;
|
|
192
205
|
'help.option.evalServer.host': string;
|
|
193
206
|
'help.option.evalServer.idleTimeout': string;
|
|
194
207
|
'help.option.group.create.force': string;
|
package/dist/cli/i18n/zh-CN.js
CHANGED
|
@@ -10,6 +10,9 @@ export const zhCN = {
|
|
|
10
10
|
'list.title': '已索引仓库({{count}})',
|
|
11
11
|
'list.indexed': '索引时间',
|
|
12
12
|
'list.commit': '提交',
|
|
13
|
+
'list.branch': '分支',
|
|
14
|
+
'list.branchIndexes': '分支索引',
|
|
15
|
+
'list.branchLine': '{{branch}}({{commit}},{{indexed}})',
|
|
13
16
|
'list.stats': '统计',
|
|
14
17
|
'list.statsValue': '{{files}} 个文件,{{symbols}} 个符号,{{edges}} 条边',
|
|
15
18
|
'list.clusters': '聚类',
|
|
@@ -23,6 +26,9 @@ export const zhCN = {
|
|
|
23
26
|
'status.indexed': '索引时间',
|
|
24
27
|
'status.indexedCommit': '索引提交',
|
|
25
28
|
'status.currentCommit': '当前提交',
|
|
29
|
+
'status.branch': '分支',
|
|
30
|
+
'status.detached': '(分离 HEAD)',
|
|
31
|
+
'status.branchNotIndexed': "⚠️ 当前分支未索引(主索引对应 '{{primary}}';请运行 gitnexus analyze)",
|
|
26
32
|
'status.status': '状态',
|
|
27
33
|
'status.upToDate': '✅ 已是最新',
|
|
28
34
|
'status.stale': '⚠️ 已过期(重新运行 gitnexus analyze)',
|
|
@@ -30,6 +36,9 @@ export const zhCN = {
|
|
|
30
36
|
'clean.deletedRepo': '已删除:{{name}}({{storagePath}})',
|
|
31
37
|
'clean.notFoundHere': '当前目录未找到已索引仓库。',
|
|
32
38
|
'clean.deleteCurrent': '将删除该仓库的 GitNexus 索引:{{repoName}}',
|
|
39
|
+
'clean.branchNotIndexed': '该仓库没有名为 “{{branch}}” 的已索引分支。',
|
|
40
|
+
'clean.deleteBranch': '将删除分支索引 “{{branch}}”,路径:{{path}}',
|
|
41
|
+
'clean.deletedBranch': '已删除分支索引:{{branch}}',
|
|
33
42
|
'clean.lbugSidecars.state': 'LadybugDB sidecar 状态:{{state}}',
|
|
34
43
|
'clean.lbugSidecars.none': '未找到已隔离的 LadybugDB missing-shadow WAL sidecar。',
|
|
35
44
|
'clean.lbugSidecars.preview': '将删除 {{count}} 个已隔离的 LadybugDB missing-shadow WAL sidecar:',
|
|
@@ -117,6 +126,7 @@ export const zhCN = {
|
|
|
117
126
|
'help.command.impact.description': '影响面分析:修改符号会影响什么',
|
|
118
127
|
'help.command.cypher.description': '对知识图谱执行原始 Cypher 查询',
|
|
119
128
|
'help.command.detectChanges.description': '将 git diff hunk 映射到已索引符号和受影响执行流程',
|
|
129
|
+
'help.command.check.description': '对已索引图谱运行结构检查',
|
|
120
130
|
'help.command.evalServer.description': '启动轻量 HTTP 服务器,用于评测期间的快速工具调用',
|
|
121
131
|
'help.command.group.description': '管理仓库组,用于跨索引影响分析',
|
|
122
132
|
'help.command.group.create.description': '使用模板 group.yaml 创建新仓库组',
|
|
@@ -156,6 +166,7 @@ export const zhCN = {
|
|
|
156
166
|
'help.option.force.confirmation': '跳过确认提示',
|
|
157
167
|
'help.option.uninstall.force': '应用更改(默认仅为预演预览)',
|
|
158
168
|
'help.option.clean.all': '清理所有已索引仓库',
|
|
169
|
+
'help.option.clean.branch': '仅删除指定分支的索引(不影响主索引)',
|
|
159
170
|
'help.option.clean.lbugSidecars': '清理已隔离的 LadybugDB missing-shadow WAL sidecar',
|
|
160
171
|
'help.option.wiki.force': '即使已是最新也强制完整重新生成',
|
|
161
172
|
'help.option.wiki.provider': 'LLM 提供商:openai、openrouter、azure、custom、cursor、claude、codex 或 opencode(默认:openai)',
|
|
@@ -178,6 +189,7 @@ export const zhCN = {
|
|
|
178
189
|
'help.option.query.limit': '最多返回的流程数(默认:5)',
|
|
179
190
|
'help.option.content': '包含完整符号源码',
|
|
180
191
|
'help.option.repo.target': '目标仓库',
|
|
192
|
+
'help.option.branch': '将查询限定到指定分支的索引(多分支仓库)',
|
|
181
193
|
'help.option.context.uid': '直接符号 UID(零歧义查找)',
|
|
182
194
|
'help.option.context.file': '用于消除常见名称歧义的文件路径',
|
|
183
195
|
'help.option.impact.kind': '用于消除常见名称歧义的类型过滤(如 Function、Class、Method)',
|
|
@@ -189,6 +201,7 @@ export const zhCN = {
|
|
|
189
201
|
'help.option.impact.summaryOnly': '仅返回计数和风险等级,省略符号列表',
|
|
190
202
|
'help.option.detectChanges.scope': '分析范围:unstaged、staged、all 或 compare',
|
|
191
203
|
'help.option.detectChanges.baseRef': 'compare 范围的分支/提交(例如 main)',
|
|
204
|
+
'help.option.check.cycles': '检测循环导入,并在发现循环时失败',
|
|
192
205
|
'help.option.evalServer.host': '绑定地址(默认:127.0.0.1;用 0.0.0.0 暴露到所有网卡)',
|
|
193
206
|
'help.option.evalServer.idleTimeout': '空闲 N 秒后自动关闭(0 = 禁用)',
|
|
194
207
|
'help.option.group.create.force': '覆盖现有仓库组',
|
package/dist/cli/index.js
CHANGED
|
@@ -32,8 +32,13 @@ program
|
|
|
32
32
|
.option('--skills', 'Generate repo-specific skill files from detected communities ' +
|
|
33
33
|
'(no-op when --index-only is also set).')
|
|
34
34
|
.option('--skip-agents-md', 'Skip updating the gitnexus section in AGENTS.md and CLAUDE.md')
|
|
35
|
+
.option('--pdg', 'Build the control-flow-graph / PDG substrate (BasicBlock nodes + CFG edges) ' +
|
|
36
|
+
'for supported languages. Opt-in; off by default. (#2081 M1)')
|
|
35
37
|
.option('--default-branch <branch>', 'Default branch used in the generated regression-compare example (base_ref). ' +
|
|
36
38
|
'Falls back to .gitnexusrc, then auto-detected origin/HEAD, then "main".')
|
|
39
|
+
.option('--branch <name>', 'Index the working tree under a specific branch slot (multi-branch indexing). ' +
|
|
40
|
+
'Defaults to the checked-out branch; the primary/first-indexed branch keeps the ' +
|
|
41
|
+
'flat index and others get their own. Distinct from --default-branch (cosmetic base_ref).')
|
|
37
42
|
.option('--no-stats', 'Omit volatile file/symbol counts from AGENTS.md and CLAUDE.md')
|
|
38
43
|
.option('--skip-skills', 'Skip installing standard GitNexus skill files under .claude/skills/gitnexus/. ' +
|
|
39
44
|
'Does not suppress community skills from --skills (those use .claude/skills/generated/). ' +
|
|
@@ -89,6 +94,7 @@ program
|
|
|
89
94
|
.description('Delete GitNexus index for current repo')
|
|
90
95
|
.option('-f, --force', 'Skip confirmation prompt')
|
|
91
96
|
.option('--all', 'Clean all indexed repos')
|
|
97
|
+
.option('--branch <name>', 'Delete only the named branch index (not the primary)')
|
|
92
98
|
.option('--lbug-sidecars', 'Clean quarantined LadybugDB missing-shadow WAL sidecars')
|
|
93
99
|
.action(createLazyAction(() => import('./clean.js'), 'cleanCommand'));
|
|
94
100
|
program
|
|
@@ -135,6 +141,7 @@ program
|
|
|
135
141
|
.command('query <search_query>')
|
|
136
142
|
.description('Search the knowledge graph for execution flows related to a concept')
|
|
137
143
|
.option('-r, --repo <name>', 'Target repository (omit if only one indexed)')
|
|
144
|
+
.option('--branch <name>', 'Scope to a specific branch index (multi-branch repos)')
|
|
138
145
|
.option('-c, --context <text>', 'Task context to improve ranking')
|
|
139
146
|
.option('-g, --goal <text>', 'What you want to find')
|
|
140
147
|
.option('-l, --limit <n>', 'Max processes to return (default: 5)')
|
|
@@ -144,6 +151,7 @@ program
|
|
|
144
151
|
.command('context [name]')
|
|
145
152
|
.description('360-degree view of a code symbol: callers, callees, processes')
|
|
146
153
|
.option('-r, --repo <name>', 'Target repository')
|
|
154
|
+
.option('--branch <name>', 'Scope to a specific branch index (multi-branch repos)')
|
|
147
155
|
.option('-u, --uid <uid>', 'Direct symbol UID (zero-ambiguity lookup)')
|
|
148
156
|
.option('-f, --file <path>', 'File path to disambiguate common names')
|
|
149
157
|
.option('--content', 'Include full symbol source code')
|
|
@@ -153,6 +161,7 @@ program
|
|
|
153
161
|
.description('Blast radius analysis: what breaks if you change a symbol')
|
|
154
162
|
.option('-d, --direction <dir>', 'upstream (dependants) or downstream (dependencies)', 'upstream')
|
|
155
163
|
.option('-r, --repo <name>', 'Target repository')
|
|
164
|
+
.option('--branch <name>', 'Scope to a specific branch index (multi-branch repos)')
|
|
156
165
|
.option('-u, --uid <uid>', 'Direct symbol UID (zero-ambiguity lookup)')
|
|
157
166
|
.option('-f, --file <path>', 'File path to disambiguate common names')
|
|
158
167
|
.option('--kind <kind>', 'Kind filter to disambiguate common names (e.g. Function, Class, Method)')
|
|
@@ -166,6 +175,7 @@ program
|
|
|
166
175
|
.command('cypher <query>')
|
|
167
176
|
.description('Execute raw Cypher query against the knowledge graph')
|
|
168
177
|
.option('-r, --repo <name>', 'Target repository')
|
|
178
|
+
.option('--branch <name>', 'Scope to a specific branch index (multi-branch repos)')
|
|
169
179
|
.action(createLbugLazyAction(() => import('./tool.js'), 'cypherCommand'));
|
|
170
180
|
program
|
|
171
181
|
.command('detect-changes')
|
|
@@ -174,7 +184,16 @@ program
|
|
|
174
184
|
.option('-s, --scope <scope>', 'What to analyze: unstaged, staged, all, or compare', 'unstaged')
|
|
175
185
|
.option('-b, --base-ref <ref>', 'Branch/commit for compare scope (e.g. main)')
|
|
176
186
|
.option('-r, --repo <name>', 'Target repository')
|
|
187
|
+
.option('--branch <name>', 'Scope to a specific branch index (multi-branch repos)')
|
|
177
188
|
.action(createLbugLazyAction(() => import('./tool.js'), 'detectChangesCommand'));
|
|
189
|
+
program
|
|
190
|
+
.command('check')
|
|
191
|
+
.description('Run structural checks against the indexed graph')
|
|
192
|
+
.option('--cycles', 'Detect circular imports and fail when any are found')
|
|
193
|
+
.option('--json', 'Emit machine-readable JSON')
|
|
194
|
+
.option('-r, --repo <name>', 'Target repository')
|
|
195
|
+
.option('--branch <name>', 'Scope to a specific branch index (multi-branch repos)')
|
|
196
|
+
.action(createLbugLazyAction(() => import('./tool.js'), 'checkCommand'));
|
|
178
197
|
// ─── Eval Server (persistent daemon for SWE-bench) ─────────────────
|
|
179
198
|
program
|
|
180
199
|
.command('eval-server')
|
package/dist/cli/list.js
CHANGED
|
@@ -31,6 +31,8 @@ export const listCommand = async () => {
|
|
|
31
31
|
console.log(` ${t('common.path')}: ${entry.path}`);
|
|
32
32
|
console.log(` ${t('list.indexed')}: ${indexedDate}`);
|
|
33
33
|
console.log(` ${t('list.commit')}: ${commitShort}`);
|
|
34
|
+
if (entry.branch)
|
|
35
|
+
console.log(` ${t('list.branch')}: ${entry.branch}`);
|
|
34
36
|
console.log(` ${t('list.stats')}: ${t('list.statsValue', {
|
|
35
37
|
files: stats.files ?? 0,
|
|
36
38
|
symbols: stats.nodes ?? 0,
|
|
@@ -40,6 +42,16 @@ export const listCommand = async () => {
|
|
|
40
42
|
console.log(` ${t('list.clusters')}: ${stats.communities}`);
|
|
41
43
|
if (stats.processes)
|
|
42
44
|
console.log(` ${t('list.processes')}: ${stats.processes}`);
|
|
45
|
+
// Per-branch indexes (#2106). Only rendered when extra branches were
|
|
46
|
+
// indexed for this path, so single-branch output is unchanged.
|
|
47
|
+
if (entry.branches && entry.branches.length > 0) {
|
|
48
|
+
console.log(` ${t('list.branchIndexes')}:`);
|
|
49
|
+
for (const b of entry.branches) {
|
|
50
|
+
const bCommit = b.lastCommit?.slice(0, 7) || t('list.unknown');
|
|
51
|
+
const bIndexed = new Date(b.indexedAt).toLocaleString();
|
|
52
|
+
console.log(` ${t('list.branchLine', { branch: b.branch, commit: bCommit, indexed: bIndexed })}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
43
55
|
console.log('');
|
|
44
56
|
}
|
|
45
57
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Optional grammar availability check.
|
|
3
3
|
*
|
|
4
|
-
* tree-sitter-dart,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* prebuilds activated via node-gyp-build.
|
|
8
|
-
* optionalDependency (not vendored). All can be skipped via
|
|
4
|
+
* tree-sitter-dart, -proto, -swift, and -kotlin are vendored under vendor/ and
|
|
5
|
+
* loaded from there by absolute path (NEVER copied into node_modules — see
|
|
6
|
+
* core/tree-sitter/vendored-grammars.ts / #2111). Each ships committed platform
|
|
7
|
+
* prebuilds activated via node-gyp-build. All can be skipped via
|
|
9
8
|
* GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 (postinstall scripts), or can silently
|
|
10
|
-
* soft-fail when the
|
|
11
|
-
*
|
|
12
|
-
* skipped or its native build failed (Kotlin).
|
|
9
|
+
* soft-fail when no prebuild matches the host platform (and a source build was
|
|
10
|
+
* unavailable / not attempted).
|
|
13
11
|
*
|
|
14
12
|
* Either path produces the same observable: the .node binding is absent
|
|
15
13
|
* at runtime. This helper detects that condition and surfaces a single
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Optional grammar availability check.
|
|
3
3
|
*
|
|
4
|
-
* tree-sitter-dart,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* prebuilds activated via node-gyp-build.
|
|
8
|
-
* optionalDependency (not vendored). All can be skipped via
|
|
4
|
+
* tree-sitter-dart, -proto, -swift, and -kotlin are vendored under vendor/ and
|
|
5
|
+
* loaded from there by absolute path (NEVER copied into node_modules — see
|
|
6
|
+
* core/tree-sitter/vendored-grammars.ts / #2111). Each ships committed platform
|
|
7
|
+
* prebuilds activated via node-gyp-build. All can be skipped via
|
|
9
8
|
* GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 (postinstall scripts), or can silently
|
|
10
|
-
* soft-fail when the
|
|
11
|
-
*
|
|
12
|
-
* skipped or its native build failed (Kotlin).
|
|
9
|
+
* soft-fail when no prebuild matches the host platform (and a source build was
|
|
10
|
+
* unavailable / not attempted).
|
|
13
11
|
*
|
|
14
12
|
* Either path produces the same observable: the .node binding is absent
|
|
15
13
|
* at runtime. This helper detects that condition and surfaces a single
|
|
16
14
|
* stderr line per missing grammar so users learn why .dart/.proto/.swift/.kt
|
|
17
15
|
* support is unavailable instead of silently getting a degraded index.
|
|
18
16
|
*/
|
|
19
|
-
import { createRequire } from 'module';
|
|
20
17
|
import { SupportedLanguages } from '../_shared/index.js';
|
|
21
18
|
import { isGrammarRuntimeSkipped } from '../core/tree-sitter/parser-loader.js';
|
|
19
|
+
import { requireVendoredGrammar } from '../core/tree-sitter/vendored-grammars.js';
|
|
22
20
|
import { cliWarn } from './cli-message.js';
|
|
23
|
-
const _require = createRequire(import.meta.url);
|
|
24
21
|
const OPTIONAL_GRAMMARS = [
|
|
25
22
|
{
|
|
26
23
|
name: 'tree-sitter-dart',
|
|
@@ -76,7 +73,7 @@ export function detectMissingOptionalGrammars() {
|
|
|
76
73
|
continue;
|
|
77
74
|
}
|
|
78
75
|
try {
|
|
79
|
-
|
|
76
|
+
requireVendoredGrammar(g.pkg);
|
|
80
77
|
}
|
|
81
78
|
catch (err) {
|
|
82
79
|
const code = err?.code;
|
package/dist/cli/skill-gen.js
CHANGED
|
@@ -485,6 +485,7 @@ const renderSkillMarkdown = (community, projectName, members, files, entryPoints
|
|
|
485
485
|
lines.push(`1. \`context({name: "${firstEntry}"})\` \u2014 see callers and callees`);
|
|
486
486
|
lines.push(`2. \`query({query: "${community.label.toLowerCase()}"})\` \u2014 find related execution flows`);
|
|
487
487
|
lines.push('3. Read key files listed above for implementation details');
|
|
488
|
+
lines.push('4. `explain({target: "<file or symbol>"})` — persisted taint findings (source→sink data flows), when indexed with `--pdg`');
|
|
488
489
|
lines.push('');
|
|
489
490
|
return lines.join('\n');
|
|
490
491
|
};
|
package/dist/cli/status.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shows the indexing status of the current repository.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import { findRepo, getStoragePaths, loadMeta, hasKuzuIndex } from '../storage/repo-manager.js';
|
|
8
|
+
import { getCurrentCommit, getCurrentBranch, isGitRepo, getGitRoot } from '../storage/git.js';
|
|
8
9
|
import { t } from './i18n/index.js';
|
|
9
10
|
export const statusCommand = async () => {
|
|
10
11
|
const cwd = process.cwd();
|
|
@@ -28,10 +29,30 @@ export const statusCommand = async () => {
|
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
const currentCommit = getCurrentCommit(repo.repoPath);
|
|
31
|
-
const
|
|
32
|
+
const currentBranch = getCurrentBranch(repo.repoPath);
|
|
33
|
+
// Pick the index matching the checked-out branch (#2106). The flat index
|
|
34
|
+
// belongs to the primary branch (repo.meta.branch); when the current branch
|
|
35
|
+
// differs and has its own index, report that one. Legacy/no-branch metas and
|
|
36
|
+
// detached HEAD fall through to the flat index (unchanged behavior).
|
|
37
|
+
let activeMeta = repo.meta;
|
|
38
|
+
let currentBranchIndexed = true;
|
|
39
|
+
if (currentBranch && repo.meta.branch && currentBranch !== repo.meta.branch) {
|
|
40
|
+
const { metaPath } = getStoragePaths(repo.repoPath, currentBranch);
|
|
41
|
+
const branchMeta = await loadMeta(path.dirname(metaPath));
|
|
42
|
+
if (branchMeta)
|
|
43
|
+
activeMeta = branchMeta;
|
|
44
|
+
else
|
|
45
|
+
currentBranchIndexed = false;
|
|
46
|
+
}
|
|
32
47
|
console.log(`${t('status.repository')}: ${repo.repoPath}`);
|
|
33
|
-
console.log(`${t('status.
|
|
34
|
-
|
|
48
|
+
console.log(`${t('status.branch')}: ${currentBranch ?? t('status.detached')}`);
|
|
49
|
+
if (!currentBranchIndexed) {
|
|
50
|
+
console.log(`${t('status.status')}: ${t('status.branchNotIndexed', { primary: repo.meta.branch ?? '' })}`);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const isUpToDate = currentCommit === activeMeta.lastCommit;
|
|
54
|
+
console.log(`${t('status.indexed')}: ${new Date(activeMeta.indexedAt).toLocaleString()}`);
|
|
55
|
+
console.log(`${t('status.indexedCommit')}: ${activeMeta.lastCommit?.slice(0, 7)}`);
|
|
35
56
|
console.log(`${t('status.currentCommit')}: ${currentCommit?.slice(0, 7)}`);
|
|
36
57
|
console.log(`${t('status.status')}: ${isUpToDate ? t('status.upToDate') : t('status.stale')}`);
|
|
37
58
|
};
|
package/dist/cli/tool.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Direct CLI Tool Commands
|
|
3
3
|
*
|
|
4
|
-
* Exposes GitNexus tools (query, context, impact, cypher) as direct CLI commands.
|
|
4
|
+
* Exposes GitNexus tools (query, context, impact, cypher, check) as direct CLI commands.
|
|
5
5
|
* Bypasses MCP entirely — invokes LocalBackend directly for minimal overhead.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function queryCommand(queryText: string, options?: {
|
|
18
18
|
repo?: string;
|
|
19
|
+
branch?: string;
|
|
19
20
|
context?: string;
|
|
20
21
|
goal?: string;
|
|
21
22
|
limit?: string;
|
|
@@ -23,6 +24,7 @@ export declare function queryCommand(queryText: string, options?: {
|
|
|
23
24
|
}): Promise<void>;
|
|
24
25
|
export declare function contextCommand(name: string, options?: {
|
|
25
26
|
repo?: string;
|
|
27
|
+
branch?: string;
|
|
26
28
|
file?: string;
|
|
27
29
|
uid?: string;
|
|
28
30
|
content?: boolean;
|
|
@@ -30,6 +32,7 @@ export declare function contextCommand(name: string, options?: {
|
|
|
30
32
|
export declare function impactCommand(target?: string, options?: {
|
|
31
33
|
direction?: string;
|
|
32
34
|
repo?: string;
|
|
35
|
+
branch?: string;
|
|
33
36
|
uid?: string;
|
|
34
37
|
file?: string;
|
|
35
38
|
kind?: string;
|
|
@@ -41,9 +44,17 @@ export declare function impactCommand(target?: string, options?: {
|
|
|
41
44
|
}): Promise<void>;
|
|
42
45
|
export declare function cypherCommand(query: string, options?: {
|
|
43
46
|
repo?: string;
|
|
47
|
+
branch?: string;
|
|
44
48
|
}): Promise<void>;
|
|
45
49
|
export declare function detectChangesCommand(options?: {
|
|
46
50
|
scope?: string;
|
|
47
51
|
baseRef?: string;
|
|
48
52
|
repo?: string;
|
|
53
|
+
branch?: string;
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
export declare function checkCommand(options?: {
|
|
56
|
+
cycles?: boolean;
|
|
57
|
+
json?: boolean;
|
|
58
|
+
repo?: string;
|
|
59
|
+
branch?: string;
|
|
49
60
|
}): Promise<void>;
|
package/dist/cli/tool.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Direct CLI Tool Commands
|
|
3
3
|
*
|
|
4
|
-
* Exposes GitNexus tools (query, context, impact, cypher) as direct CLI commands.
|
|
4
|
+
* Exposes GitNexus tools (query, context, impact, cypher, check) as direct CLI commands.
|
|
5
5
|
* Bypasses MCP entirely — invokes LocalBackend directly for minimal overhead.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
@@ -68,6 +68,7 @@ export async function queryCommand(queryText, options) {
|
|
|
68
68
|
limit: options?.limit ? parseInt(options.limit) : undefined,
|
|
69
69
|
include_content: options?.content ?? false,
|
|
70
70
|
repo: options?.repo,
|
|
71
|
+
branch: options?.branch,
|
|
71
72
|
});
|
|
72
73
|
output(result);
|
|
73
74
|
}
|
|
@@ -88,6 +89,7 @@ export async function contextCommand(name, options) {
|
|
|
88
89
|
file_path: options?.file,
|
|
89
90
|
include_content: options?.content ?? false,
|
|
90
91
|
repo: options?.repo,
|
|
92
|
+
branch: options?.branch,
|
|
91
93
|
});
|
|
92
94
|
output(result);
|
|
93
95
|
}
|
|
@@ -126,6 +128,7 @@ export async function impactCommand(target, options) {
|
|
|
126
128
|
maxDepth: options?.depth ? parseInt(options.depth, 10) : undefined,
|
|
127
129
|
includeTests: options?.includeTests ?? false,
|
|
128
130
|
repo: options?.repo,
|
|
131
|
+
branch: options?.branch,
|
|
129
132
|
limit: parsedLimit,
|
|
130
133
|
offset: parsedOffset,
|
|
131
134
|
summaryOnly: options?.summaryOnly ?? undefined,
|
|
@@ -153,6 +156,7 @@ export async function cypherCommand(query, options) {
|
|
|
153
156
|
const result = await backend.callTool('cypher', {
|
|
154
157
|
query,
|
|
155
158
|
repo: options?.repo,
|
|
159
|
+
branch: options?.branch,
|
|
156
160
|
});
|
|
157
161
|
output(result);
|
|
158
162
|
}
|
|
@@ -162,6 +166,42 @@ export async function detectChangesCommand(options) {
|
|
|
162
166
|
scope: options?.scope || 'unstaged',
|
|
163
167
|
base_ref: options?.baseRef,
|
|
164
168
|
repo: options?.repo,
|
|
169
|
+
branch: options?.branch,
|
|
165
170
|
});
|
|
166
171
|
output(formatDetectChangesResult(result));
|
|
167
172
|
}
|
|
173
|
+
export async function checkCommand(options) {
|
|
174
|
+
if (!options?.cycles) {
|
|
175
|
+
process.stderr.write('Usage: gitnexus check --cycles [--json]\n');
|
|
176
|
+
process.exitCode = 1;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
const backend = await getBackend();
|
|
181
|
+
const result = await backend.callTool('check', {
|
|
182
|
+
cycles: true,
|
|
183
|
+
repo: options.repo,
|
|
184
|
+
branch: options.branch,
|
|
185
|
+
});
|
|
186
|
+
if (result?.error) {
|
|
187
|
+
output(result);
|
|
188
|
+
process.exitCode = 1;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (options.json) {
|
|
192
|
+
output(result);
|
|
193
|
+
}
|
|
194
|
+
else if (result.cycleCount === 0) {
|
|
195
|
+
output('No circular imports found.');
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
output(result.cycles.map((cycle) => cycle.files.join(' -> ')).join('\n'));
|
|
199
|
+
}
|
|
200
|
+
if (result.cycleCount > 0)
|
|
201
|
+
process.exitCode = 1;
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
output({ error: error instanceof Error ? error.message : String(error) });
|
|
205
|
+
process.exitCode = 1;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
@@ -21,6 +21,7 @@ import { isHttpMode, getHttpDimensions, httpEmbed } from './http-client.js';
|
|
|
21
21
|
import { resolveEmbeddingConfig } from './config.js';
|
|
22
22
|
import { applyHfEnvOverrides, isHfDownloadFailure, withHfDownloadRetry } from './hf-env.js';
|
|
23
23
|
import { getLocalEmbeddingRuntimeBlocker } from './runtime-support.js';
|
|
24
|
+
import { ensureOnnxRuntimeCommonResolvable } from './onnxruntime-common-resolver.js';
|
|
24
25
|
import { logger } from '../logger.js';
|
|
25
26
|
/**
|
|
26
27
|
* Check whether the onnxruntime-node package that @huggingface/transformers
|
|
@@ -147,6 +148,9 @@ export const initEmbedder = async (onProgress, config = {}, forceDevice) => {
|
|
|
147
148
|
try {
|
|
148
149
|
// Lazy-load transformers.js only after the runtime guard has passed, so
|
|
149
150
|
// unsupported platforms never reach the native ONNX import (#1515).
|
|
151
|
+
// Under pnpm-strict / `pnpm dlx`, transformers' phantom `onnxruntime-common`
|
|
152
|
+
// import is unresolvable; register the fallback resolver first (#307).
|
|
153
|
+
ensureOnnxRuntimeCommonResolvable();
|
|
150
154
|
const { pipeline, env } = await import('@huggingface/transformers');
|
|
151
155
|
// Configure transformers.js environment
|
|
152
156
|
env.allowLocalModels = false;
|