gitnexus 1.4.10 → 1.5.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.
- package/README.md +6 -5
- package/dist/_shared/graph/types.d.ts +65 -0
- package/dist/_shared/graph/types.d.ts.map +1 -0
- package/dist/_shared/graph/types.js +8 -0
- package/dist/_shared/graph/types.js.map +1 -0
- package/dist/_shared/index.d.ts +7 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +6 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/language-detection.d.ts +23 -0
- package/dist/_shared/language-detection.d.ts.map +1 -0
- package/dist/_shared/language-detection.js +137 -0
- package/dist/_shared/language-detection.js.map +1 -0
- package/dist/_shared/languages.d.ts +25 -0
- package/dist/_shared/languages.d.ts.map +1 -0
- package/dist/_shared/languages.js +26 -0
- package/dist/_shared/languages.js.map +1 -0
- package/dist/_shared/lbug/schema-constants.d.ts +16 -0
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -0
- package/dist/_shared/lbug/schema-constants.js +64 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -0
- package/dist/_shared/pipeline.d.ts +16 -0
- package/dist/_shared/pipeline.d.ts.map +1 -0
- package/dist/_shared/pipeline.js +5 -0
- package/dist/_shared/pipeline.js.map +1 -0
- package/dist/cli/ai-context.d.ts +4 -1
- package/dist/cli/ai-context.js +19 -11
- package/dist/cli/analyze.d.ts +6 -0
- package/dist/cli/analyze.js +105 -251
- package/dist/cli/eval-server.js +20 -11
- package/dist/cli/index-repo.js +20 -22
- package/dist/cli/index.js +8 -7
- package/dist/cli/mcp.js +1 -1
- package/dist/cli/serve.js +29 -1
- package/dist/cli/setup.js +9 -9
- package/dist/cli/skill-gen.js +15 -9
- package/dist/cli/wiki.d.ts +2 -0
- package/dist/cli/wiki.js +141 -26
- package/dist/config/ignore-service.js +102 -22
- package/dist/config/supported-languages.d.ts +8 -42
- package/dist/config/supported-languages.js +8 -43
- package/dist/core/augmentation/engine.js +19 -7
- package/dist/core/embeddings/embedder.js +19 -15
- package/dist/core/embeddings/embedding-pipeline.js +6 -6
- package/dist/core/embeddings/http-client.js +3 -3
- package/dist/core/embeddings/text-generator.js +9 -24
- package/dist/core/embeddings/types.d.ts +1 -1
- package/dist/core/embeddings/types.js +1 -7
- package/dist/core/graph/graph.js +6 -2
- package/dist/core/graph/types.d.ts +9 -59
- package/dist/core/ingestion/ast-cache.js +3 -3
- package/dist/core/ingestion/call-processor.d.ts +20 -2
- package/dist/core/ingestion/call-processor.js +347 -144
- package/dist/core/ingestion/call-routing.js +10 -4
- package/dist/core/ingestion/call-sites/extract-language-call-site.d.ts +10 -0
- package/dist/core/ingestion/call-sites/extract-language-call-site.js +22 -0
- package/dist/core/ingestion/call-sites/java.d.ts +9 -0
- package/dist/core/ingestion/call-sites/java.js +30 -0
- package/dist/core/ingestion/cluster-enricher.js +6 -8
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +10 -3
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +287 -81
- package/dist/core/ingestion/cobol/jcl-parser.js +1 -1
- package/dist/core/ingestion/cobol/jcl-processor.js +1 -1
- package/dist/core/ingestion/cobol-processor.js +102 -56
- package/dist/core/ingestion/community-processor.js +21 -15
- package/dist/core/ingestion/entry-point-scoring.d.ts +1 -1
- package/dist/core/ingestion/entry-point-scoring.js +5 -6
- package/dist/core/ingestion/export-detection.js +32 -9
- package/dist/core/ingestion/field-extractor.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/configs/c-cpp.js +8 -12
- package/dist/core/ingestion/field-extractors/configs/csharp.js +45 -2
- package/dist/core/ingestion/field-extractors/configs/dart.js +5 -3
- package/dist/core/ingestion/field-extractors/configs/go.js +3 -7
- package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +5 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.js +14 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.js +7 -7
- package/dist/core/ingestion/field-extractors/configs/php.js +9 -11
- package/dist/core/ingestion/field-extractors/configs/python.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/ruby.js +4 -3
- package/dist/core/ingestion/field-extractors/configs/rust.js +2 -5
- package/dist/core/ingestion/field-extractors/configs/swift.js +9 -7
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +2 -6
- package/dist/core/ingestion/field-extractors/generic.d.ts +5 -2
- package/dist/core/ingestion/field-extractors/generic.js +6 -0
- package/dist/core/ingestion/field-extractors/typescript.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/typescript.js +1 -1
- package/dist/core/ingestion/field-types.d.ts +4 -2
- package/dist/core/ingestion/filesystem-walker.js +3 -3
- package/dist/core/ingestion/framework-detection.d.ts +1 -1
- package/dist/core/ingestion/framework-detection.js +355 -85
- package/dist/core/ingestion/heritage-processor.d.ts +24 -0
- package/dist/core/ingestion/heritage-processor.js +99 -8
- package/dist/core/ingestion/import-processor.js +44 -15
- package/dist/core/ingestion/import-resolvers/csharp.js +7 -3
- package/dist/core/ingestion/import-resolvers/dart.js +1 -1
- package/dist/core/ingestion/import-resolvers/go.js +4 -2
- package/dist/core/ingestion/import-resolvers/jvm.js +4 -4
- package/dist/core/ingestion/import-resolvers/php.js +4 -4
- package/dist/core/ingestion/import-resolvers/python.js +1 -1
- package/dist/core/ingestion/import-resolvers/rust.js +9 -3
- package/dist/core/ingestion/import-resolvers/standard.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.js +6 -5
- package/dist/core/ingestion/import-resolvers/swift.js +2 -1
- package/dist/core/ingestion/import-resolvers/utils.js +26 -7
- package/dist/core/ingestion/language-config.js +5 -4
- package/dist/core/ingestion/language-provider.d.ts +7 -2
- package/dist/core/ingestion/languages/c-cpp.js +106 -21
- package/dist/core/ingestion/languages/cobol.js +1 -1
- package/dist/core/ingestion/languages/csharp.js +96 -19
- package/dist/core/ingestion/languages/dart.js +23 -7
- package/dist/core/ingestion/languages/go.js +1 -1
- package/dist/core/ingestion/languages/index.d.ts +1 -1
- package/dist/core/ingestion/languages/index.js +2 -3
- package/dist/core/ingestion/languages/java.js +4 -1
- package/dist/core/ingestion/languages/kotlin.js +60 -13
- package/dist/core/ingestion/languages/php.js +102 -25
- package/dist/core/ingestion/languages/python.js +28 -5
- package/dist/core/ingestion/languages/ruby.js +56 -14
- package/dist/core/ingestion/languages/rust.js +55 -11
- package/dist/core/ingestion/languages/swift.js +112 -27
- package/dist/core/ingestion/languages/typescript.js +95 -19
- package/dist/core/ingestion/markdown-processor.js +5 -5
- package/dist/core/ingestion/method-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.js +283 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.js +326 -0
- package/dist/core/ingestion/method-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/method-extractors/generic.js +137 -0
- package/dist/core/ingestion/method-types.d.ts +61 -0
- package/dist/core/ingestion/method-types.js +2 -0
- package/dist/core/ingestion/mro-processor.d.ts +1 -1
- package/dist/core/ingestion/mro-processor.js +12 -8
- package/dist/core/ingestion/named-binding-processor.js +2 -2
- package/dist/core/ingestion/named-bindings/rust.js +3 -1
- package/dist/core/ingestion/parsing-processor.js +74 -24
- package/dist/core/ingestion/pipeline.d.ts +2 -1
- package/dist/core/ingestion/pipeline.js +208 -102
- package/dist/core/ingestion/process-processor.js +12 -10
- package/dist/core/ingestion/resolution-context.js +3 -3
- package/dist/core/ingestion/route-extractors/middleware.js +31 -7
- package/dist/core/ingestion/route-extractors/php.js +2 -1
- package/dist/core/ingestion/route-extractors/response-shapes.js +8 -4
- package/dist/core/ingestion/structure-processor.d.ts +1 -1
- package/dist/core/ingestion/structure-processor.js +4 -4
- package/dist/core/ingestion/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/symbol-table.js +22 -6
- package/dist/core/ingestion/tree-sitter-queries.d.ts +1 -1
- package/dist/core/ingestion/tree-sitter-queries.js +1 -1
- package/dist/core/ingestion/type-env.d.ts +2 -2
- package/dist/core/ingestion/type-env.js +75 -50
- package/dist/core/ingestion/type-extractors/c-cpp.js +33 -30
- package/dist/core/ingestion/type-extractors/csharp.js +24 -14
- package/dist/core/ingestion/type-extractors/dart.js +6 -8
- package/dist/core/ingestion/type-extractors/go.js +7 -6
- package/dist/core/ingestion/type-extractors/jvm.js +10 -21
- package/dist/core/ingestion/type-extractors/php.js +26 -13
- package/dist/core/ingestion/type-extractors/python.js +11 -15
- package/dist/core/ingestion/type-extractors/ruby.js +8 -3
- package/dist/core/ingestion/type-extractors/rust.js +6 -8
- package/dist/core/ingestion/type-extractors/shared.js +134 -50
- package/dist/core/ingestion/type-extractors/swift.js +16 -13
- package/dist/core/ingestion/type-extractors/typescript.js +23 -15
- package/dist/core/ingestion/utils/ast-helpers.d.ts +8 -8
- package/dist/core/ingestion/utils/ast-helpers.js +72 -35
- package/dist/core/ingestion/utils/call-analysis.d.ts +2 -0
- package/dist/core/ingestion/utils/call-analysis.js +96 -49
- package/dist/core/ingestion/utils/event-loop.js +1 -1
- package/dist/core/ingestion/workers/parse-worker.d.ts +7 -2
- package/dist/core/ingestion/workers/parse-worker.js +364 -84
- package/dist/core/ingestion/workers/worker-pool.js +5 -10
- package/dist/core/lbug/csv-generator.js +54 -15
- package/dist/core/lbug/lbug-adapter.d.ts +5 -0
- package/dist/core/lbug/lbug-adapter.js +86 -23
- package/dist/core/lbug/schema.d.ts +3 -6
- package/dist/core/lbug/schema.js +6 -30
- package/dist/core/run-analyze.d.ts +49 -0
- package/dist/core/run-analyze.js +257 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +1 -1
- package/dist/core/tree-sitter/parser-loader.js +1 -1
- package/dist/core/wiki/cursor-client.js +2 -7
- package/dist/core/wiki/generator.js +38 -23
- package/dist/core/wiki/graph-queries.js +10 -10
- package/dist/core/wiki/html-viewer.js +7 -3
- package/dist/core/wiki/llm-client.d.ts +23 -2
- package/dist/core/wiki/llm-client.js +96 -26
- package/dist/core/wiki/prompts.js +7 -6
- package/dist/mcp/core/embedder.js +1 -1
- package/dist/mcp/core/lbug-adapter.d.ts +4 -1
- package/dist/mcp/core/lbug-adapter.js +17 -7
- package/dist/mcp/local/local-backend.js +247 -95
- package/dist/mcp/resources.js +14 -6
- package/dist/mcp/server.js +13 -5
- package/dist/mcp/staleness.js +5 -1
- package/dist/mcp/tools.js +100 -23
- package/dist/server/analyze-job.d.ts +53 -0
- package/dist/server/analyze-job.js +146 -0
- package/dist/server/analyze-worker.d.ts +13 -0
- package/dist/server/analyze-worker.js +59 -0
- package/dist/server/api.js +795 -44
- package/dist/server/git-clone.d.ts +25 -0
- package/dist/server/git-clone.js +91 -0
- package/dist/storage/git.js +1 -3
- package/dist/storage/repo-manager.d.ts +5 -2
- package/dist/storage/repo-manager.js +4 -4
- package/dist/types/pipeline.d.ts +1 -21
- package/dist/types/pipeline.js +1 -18
- package/hooks/claude/gitnexus-hook.cjs +52 -22
- package/package.json +5 -4
- package/scripts/build.js +69 -0
- package/dist/core/ingestion/utils/language-detection.d.ts +0 -9
- package/dist/core/ingestion/utils/language-detection.js +0 -70
package/README.md
CHANGED
|
@@ -149,11 +149,12 @@ Your AI agent gets these tools automatically:
|
|
|
149
149
|
## CLI Commands
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
|
-
gitnexus setup
|
|
153
|
-
gitnexus analyze [path]
|
|
154
|
-
gitnexus analyze --force
|
|
155
|
-
gitnexus analyze --embeddings
|
|
156
|
-
gitnexus analyze --
|
|
152
|
+
gitnexus setup # Configure MCP for your editors (one-time)
|
|
153
|
+
gitnexus analyze [path] # Index a repository (or update stale index)
|
|
154
|
+
gitnexus analyze --force # Force full re-index
|
|
155
|
+
gitnexus analyze --embeddings # Enable embedding generation (slower, better search)
|
|
156
|
+
gitnexus analyze --skip-agents-md # Preserve custom AGENTS.md/CLAUDE.md gitnexus section edits
|
|
157
|
+
gitnexus analyze --verbose # Log skipped files when parsers are unavailable
|
|
157
158
|
gitnexus mcp # Start MCP server (stdio) — serves all indexed repos
|
|
158
159
|
gitnexus serve # Start local HTTP server (multi-repo) for web UI
|
|
159
160
|
gitnexus index # Register an existing .gitnexus/ folder into the global registry
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph type definitions — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* Both gitnexus (CLI) and gitnexus-web import from this package.
|
|
5
|
+
* Do NOT add Node.js-specific or browser-specific imports here.
|
|
6
|
+
*/
|
|
7
|
+
import { SupportedLanguages } from '../languages.js';
|
|
8
|
+
export type NodeLabel = 'Project' | 'Package' | 'Module' | 'Folder' | 'File' | 'Class' | 'Function' | 'Method' | 'Variable' | 'Interface' | 'Enum' | 'Decorator' | 'Import' | 'Type' | 'CodeElement' | 'Community' | 'Process' | 'Struct' | 'Macro' | 'Typedef' | 'Union' | 'Namespace' | 'Trait' | 'Impl' | 'TypeAlias' | 'Const' | 'Static' | 'Property' | 'Record' | 'Delegate' | 'Annotation' | 'Constructor' | 'Template' | 'Section' | 'Route' | 'Tool';
|
|
9
|
+
export type NodeProperties = {
|
|
10
|
+
name: string;
|
|
11
|
+
filePath: string;
|
|
12
|
+
startLine?: number;
|
|
13
|
+
endLine?: number;
|
|
14
|
+
language?: SupportedLanguages | string;
|
|
15
|
+
isExported?: boolean;
|
|
16
|
+
astFrameworkMultiplier?: number;
|
|
17
|
+
astFrameworkReason?: string;
|
|
18
|
+
heuristicLabel?: string;
|
|
19
|
+
cohesion?: number;
|
|
20
|
+
symbolCount?: number;
|
|
21
|
+
keywords?: string[];
|
|
22
|
+
description?: string;
|
|
23
|
+
enrichedBy?: 'heuristic' | 'llm';
|
|
24
|
+
processType?: 'intra_community' | 'cross_community';
|
|
25
|
+
stepCount?: number;
|
|
26
|
+
communities?: string[];
|
|
27
|
+
entryPointId?: string;
|
|
28
|
+
terminalId?: string;
|
|
29
|
+
entryPointScore?: number;
|
|
30
|
+
entryPointReason?: string;
|
|
31
|
+
parameterCount?: number;
|
|
32
|
+
level?: number;
|
|
33
|
+
returnType?: string;
|
|
34
|
+
declaredType?: string;
|
|
35
|
+
visibility?: string;
|
|
36
|
+
isStatic?: boolean;
|
|
37
|
+
isReadonly?: boolean;
|
|
38
|
+
isAbstract?: boolean;
|
|
39
|
+
isFinal?: boolean;
|
|
40
|
+
isVirtual?: boolean;
|
|
41
|
+
isOverride?: boolean;
|
|
42
|
+
isAsync?: boolean;
|
|
43
|
+
isPartial?: boolean;
|
|
44
|
+
annotations?: string[];
|
|
45
|
+
responseKeys?: string[];
|
|
46
|
+
errorKeys?: string[];
|
|
47
|
+
middleware?: string[];
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
};
|
|
50
|
+
export type RelationshipType = 'CONTAINS' | 'CALLS' | 'INHERITS' | 'OVERRIDES' | 'IMPORTS' | 'USES' | 'DEFINES' | 'DECORATES' | 'IMPLEMENTS' | 'EXTENDS' | 'HAS_METHOD' | 'HAS_PROPERTY' | 'ACCESSES' | 'MEMBER_OF' | 'STEP_IN_PROCESS' | 'HANDLES_ROUTE' | 'FETCHES' | 'HANDLES_TOOL' | 'ENTRY_POINT_OF' | 'WRAPS' | 'QUERIES';
|
|
51
|
+
export interface GraphNode {
|
|
52
|
+
id: string;
|
|
53
|
+
label: NodeLabel;
|
|
54
|
+
properties: NodeProperties;
|
|
55
|
+
}
|
|
56
|
+
export interface GraphRelationship {
|
|
57
|
+
id: string;
|
|
58
|
+
sourceId: string;
|
|
59
|
+
targetId: string;
|
|
60
|
+
type: RelationshipType;
|
|
61
|
+
confidence: number;
|
|
62
|
+
reason: string;
|
|
63
|
+
step?: number;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MA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M,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { NodeLabel, NodeProperties, RelationshipType, GraphNode, GraphRelationship, } from './graph/types.js';
|
|
2
|
+
export { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME, } from './lbug/schema-constants.js';
|
|
3
|
+
export type { NodeTableName, RelType } from './lbug/schema-constants.js';
|
|
4
|
+
export { SupportedLanguages } from './languages.js';
|
|
5
|
+
export { getLanguageFromFilename, getSyntaxLanguageFromFilename } from './language-detection.js';
|
|
6
|
+
export type { PipelinePhase, PipelineProgress } from './pipeline.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGjG,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Schema constants
|
|
2
|
+
export { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME, } from './lbug/schema-constants.js';
|
|
3
|
+
// Language support
|
|
4
|
+
export { SupportedLanguages } from './languages.js';
|
|
5
|
+
export { getLanguageFromFilename, getSyntaxLanguageFromFilename } from './language-detection.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,mBAAmB;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Detection — maps file paths to SupportedLanguages enum values.
|
|
3
|
+
*
|
|
4
|
+
* Shared between CLI (ingestion pipeline) and web (syntax highlighting).
|
|
5
|
+
*
|
|
6
|
+
* ADDING A NEW LANGUAGE:
|
|
7
|
+
* 1. Add enum member to SupportedLanguages in languages.ts
|
|
8
|
+
* 2. Add file extensions to EXTENSION_MAP below
|
|
9
|
+
* 3. TypeScript will error if you miss either step (exhaustive Record)
|
|
10
|
+
*/
|
|
11
|
+
import { SupportedLanguages } from './languages.js';
|
|
12
|
+
/**
|
|
13
|
+
* Map file extension to SupportedLanguage enum.
|
|
14
|
+
* Returns null if the file extension is not recognized.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getLanguageFromFilename: (filename: string) => SupportedLanguages | null;
|
|
17
|
+
/**
|
|
18
|
+
* Map file path to a Prism-compatible syntax highlight language string.
|
|
19
|
+
* Covers all SupportedLanguages (code files) plus common non-code formats.
|
|
20
|
+
* Returns 'text' for unrecognised files.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getSyntaxLanguageFromFilename: (filePath: string) => string;
|
|
23
|
+
//# sourceMappingURL=language-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-detection.d.ts","sourceRoot":"","sources":["../src/language-detection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AA8CpD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,KAAG,kBAAkB,GAAG,IAgB/E,CAAC;AAuDF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAU,MAAM,KAAG,MAQhE,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Detection — maps file paths to SupportedLanguages enum values.
|
|
3
|
+
*
|
|
4
|
+
* Shared between CLI (ingestion pipeline) and web (syntax highlighting).
|
|
5
|
+
*
|
|
6
|
+
* ADDING A NEW LANGUAGE:
|
|
7
|
+
* 1. Add enum member to SupportedLanguages in languages.ts
|
|
8
|
+
* 2. Add file extensions to EXTENSION_MAP below
|
|
9
|
+
* 3. TypeScript will error if you miss either step (exhaustive Record)
|
|
10
|
+
*/
|
|
11
|
+
import { SupportedLanguages } from './languages.js';
|
|
12
|
+
/** Ruby extensionless filenames recognised as Ruby source */
|
|
13
|
+
const RUBY_EXTENSIONLESS_FILES = new Set([
|
|
14
|
+
'Rakefile',
|
|
15
|
+
'Gemfile',
|
|
16
|
+
'Guardfile',
|
|
17
|
+
'Vagrantfile',
|
|
18
|
+
'Brewfile',
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Exhaustive map: every SupportedLanguages member → its file extensions.
|
|
22
|
+
*
|
|
23
|
+
* If a new language is added to the enum without adding an entry here,
|
|
24
|
+
* TypeScript emits a compile error: "Property 'NewLang' is missing in type..."
|
|
25
|
+
*/
|
|
26
|
+
const EXTENSION_MAP = {
|
|
27
|
+
[SupportedLanguages.JavaScript]: ['.js', '.jsx', '.mjs', '.cjs'],
|
|
28
|
+
[SupportedLanguages.TypeScript]: ['.ts', '.tsx', '.mts', '.cts'],
|
|
29
|
+
[SupportedLanguages.Python]: ['.py'],
|
|
30
|
+
[SupportedLanguages.Java]: ['.java'],
|
|
31
|
+
[SupportedLanguages.C]: ['.c'],
|
|
32
|
+
[SupportedLanguages.CPlusPlus]: ['.cpp', '.cc', '.cxx', '.h', '.hpp', '.hxx', '.hh'],
|
|
33
|
+
[SupportedLanguages.CSharp]: ['.cs'],
|
|
34
|
+
[SupportedLanguages.Go]: ['.go'],
|
|
35
|
+
[SupportedLanguages.Ruby]: ['.rb', '.rake', '.gemspec'],
|
|
36
|
+
[SupportedLanguages.Rust]: ['.rs'],
|
|
37
|
+
[SupportedLanguages.PHP]: ['.php', '.phtml', '.php3', '.php4', '.php5', '.php8'],
|
|
38
|
+
[SupportedLanguages.Kotlin]: ['.kt', '.kts'],
|
|
39
|
+
[SupportedLanguages.Swift]: ['.swift'],
|
|
40
|
+
[SupportedLanguages.Dart]: ['.dart'],
|
|
41
|
+
[SupportedLanguages.Cobol]: ['.cbl', '.cob', '.cpy', '.cobol'],
|
|
42
|
+
}; // Ensure exhaustiveness
|
|
43
|
+
/** Pre-built reverse lookup: extension → language (built once at module load). */
|
|
44
|
+
const extToLang = new Map();
|
|
45
|
+
for (const [lang, exts] of Object.entries(EXTENSION_MAP)) {
|
|
46
|
+
for (const ext of exts) {
|
|
47
|
+
extToLang.set(ext, lang);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Map file extension to SupportedLanguage enum.
|
|
52
|
+
* Returns null if the file extension is not recognized.
|
|
53
|
+
*/
|
|
54
|
+
export const getLanguageFromFilename = (filename) => {
|
|
55
|
+
// Fast path: check the extension map
|
|
56
|
+
const lastDot = filename.lastIndexOf('.');
|
|
57
|
+
if (lastDot >= 0) {
|
|
58
|
+
const ext = filename.slice(lastDot).toLowerCase();
|
|
59
|
+
const lang = extToLang.get(ext);
|
|
60
|
+
if (lang !== undefined)
|
|
61
|
+
return lang;
|
|
62
|
+
}
|
|
63
|
+
// Ruby extensionless files (Rakefile, Gemfile, etc.)
|
|
64
|
+
const basename = filename.split('/').pop() || filename;
|
|
65
|
+
if (RUBY_EXTENSIONLESS_FILES.has(basename)) {
|
|
66
|
+
return SupportedLanguages.Ruby;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Exhaustive map: every SupportedLanguages member → Prism syntax identifier.
|
|
72
|
+
*
|
|
73
|
+
* If a new language is added to the enum without adding an entry here,
|
|
74
|
+
* TypeScript emits a compile error.
|
|
75
|
+
*/
|
|
76
|
+
const SYNTAX_MAP = {
|
|
77
|
+
[SupportedLanguages.JavaScript]: 'javascript',
|
|
78
|
+
[SupportedLanguages.TypeScript]: 'typescript',
|
|
79
|
+
[SupportedLanguages.Python]: 'python',
|
|
80
|
+
[SupportedLanguages.Java]: 'java',
|
|
81
|
+
[SupportedLanguages.C]: 'c',
|
|
82
|
+
[SupportedLanguages.CPlusPlus]: 'cpp',
|
|
83
|
+
[SupportedLanguages.CSharp]: 'csharp',
|
|
84
|
+
[SupportedLanguages.Go]: 'go',
|
|
85
|
+
[SupportedLanguages.Ruby]: 'ruby',
|
|
86
|
+
[SupportedLanguages.Rust]: 'rust',
|
|
87
|
+
[SupportedLanguages.PHP]: 'php',
|
|
88
|
+
[SupportedLanguages.Kotlin]: 'kotlin',
|
|
89
|
+
[SupportedLanguages.Swift]: 'swift',
|
|
90
|
+
[SupportedLanguages.Dart]: 'dart',
|
|
91
|
+
[SupportedLanguages.Cobol]: 'cobol',
|
|
92
|
+
}; // Ensure exhaustiveness
|
|
93
|
+
/** Non-code file extensions → Prism-compatible syntax identifiers */
|
|
94
|
+
const AUXILIARY_SYNTAX_MAP = {
|
|
95
|
+
json: 'json',
|
|
96
|
+
yaml: 'yaml',
|
|
97
|
+
yml: 'yaml',
|
|
98
|
+
md: 'markdown',
|
|
99
|
+
mdx: 'markdown',
|
|
100
|
+
html: 'markup',
|
|
101
|
+
htm: 'markup',
|
|
102
|
+
erb: 'markup',
|
|
103
|
+
xml: 'markup',
|
|
104
|
+
css: 'css',
|
|
105
|
+
scss: 'css',
|
|
106
|
+
sass: 'css',
|
|
107
|
+
sh: 'bash',
|
|
108
|
+
bash: 'bash',
|
|
109
|
+
zsh: 'bash',
|
|
110
|
+
sql: 'sql',
|
|
111
|
+
toml: 'toml',
|
|
112
|
+
ini: 'ini',
|
|
113
|
+
dockerfile: 'docker',
|
|
114
|
+
};
|
|
115
|
+
/** Extensionless filenames → Prism-compatible syntax identifiers */
|
|
116
|
+
const AUXILIARY_BASENAME_MAP = {
|
|
117
|
+
Makefile: 'makefile',
|
|
118
|
+
Dockerfile: 'docker',
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Map file path to a Prism-compatible syntax highlight language string.
|
|
122
|
+
* Covers all SupportedLanguages (code files) plus common non-code formats.
|
|
123
|
+
* Returns 'text' for unrecognised files.
|
|
124
|
+
*/
|
|
125
|
+
export const getSyntaxLanguageFromFilename = (filePath) => {
|
|
126
|
+
const lang = getLanguageFromFilename(filePath);
|
|
127
|
+
if (lang)
|
|
128
|
+
return SYNTAX_MAP[lang];
|
|
129
|
+
const ext = filePath.split('.').pop()?.toLowerCase();
|
|
130
|
+
if (ext && ext in AUXILIARY_SYNTAX_MAP)
|
|
131
|
+
return AUXILIARY_SYNTAX_MAP[ext];
|
|
132
|
+
const basename = filePath.split('/').pop() || '';
|
|
133
|
+
if (basename in AUXILIARY_BASENAME_MAP)
|
|
134
|
+
return AUXILIARY_BASENAME_MAP[basename];
|
|
135
|
+
return 'text';
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=language-detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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AE,KAAK;IACX,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF,oEAAoE;AACpE,MAAM,sBAAsB,GAA2B;IACrD,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,QAAgB,EAAU,EAAE;IACxE,MAAM,IAAI,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,IAAI;QAAE,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;IACrD,IAAI,GAAG,IAAI,GAAG,IAAI,oBAAoB;QAAE,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IACjD,IAAI,QAAQ,IAAI,sBAAsB;QAAE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAChF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported language enum — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* Both CLI and web use this to identify which language a file/node belongs to.
|
|
5
|
+
* The CLI uses it throughout the ingestion pipeline; the web uses it for display.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SupportedLanguages {
|
|
8
|
+
JavaScript = "javascript",
|
|
9
|
+
TypeScript = "typescript",
|
|
10
|
+
Python = "python",
|
|
11
|
+
Java = "java",
|
|
12
|
+
C = "c",
|
|
13
|
+
CPlusPlus = "cpp",
|
|
14
|
+
CSharp = "csharp",
|
|
15
|
+
Go = "go",
|
|
16
|
+
Ruby = "ruby",
|
|
17
|
+
Rust = "rust",
|
|
18
|
+
PHP = "php",
|
|
19
|
+
Kotlin = "kotlin",
|
|
20
|
+
Swift = "swift",
|
|
21
|
+
Dart = "dart",
|
|
22
|
+
/** Standalone regex processor — no tree-sitter, no LanguageProvider. */
|
|
23
|
+
Cobol = "cobol"
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,kBAAkB;IAC5B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,CAAC,MAAM;IACP,SAAS,QAAQ;IACjB,MAAM,WAAW;IACjB,EAAE,OAAO;IACT,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,wEAAwE;IACxE,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported language enum — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* Both CLI and web use this to identify which language a file/node belongs to.
|
|
5
|
+
* The CLI uses it throughout the ingestion pipeline; the web uses it for display.
|
|
6
|
+
*/
|
|
7
|
+
export var SupportedLanguages;
|
|
8
|
+
(function (SupportedLanguages) {
|
|
9
|
+
SupportedLanguages["JavaScript"] = "javascript";
|
|
10
|
+
SupportedLanguages["TypeScript"] = "typescript";
|
|
11
|
+
SupportedLanguages["Python"] = "python";
|
|
12
|
+
SupportedLanguages["Java"] = "java";
|
|
13
|
+
SupportedLanguages["C"] = "c";
|
|
14
|
+
SupportedLanguages["CPlusPlus"] = "cpp";
|
|
15
|
+
SupportedLanguages["CSharp"] = "csharp";
|
|
16
|
+
SupportedLanguages["Go"] = "go";
|
|
17
|
+
SupportedLanguages["Ruby"] = "ruby";
|
|
18
|
+
SupportedLanguages["Rust"] = "rust";
|
|
19
|
+
SupportedLanguages["PHP"] = "php";
|
|
20
|
+
SupportedLanguages["Kotlin"] = "kotlin";
|
|
21
|
+
SupportedLanguages["Swift"] = "swift";
|
|
22
|
+
SupportedLanguages["Dart"] = "dart";
|
|
23
|
+
/** Standalone regex processor — no tree-sitter, no LanguageProvider. */
|
|
24
|
+
SupportedLanguages["Cobol"] = "cobol";
|
|
25
|
+
})(SupportedLanguages || (SupportedLanguages = {}));
|
|
26
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,+CAAyB,CAAA;IACzB,uCAAiB,CAAA;IACjB,mCAAa,CAAA;IACb,6BAAO,CAAA;IACP,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,+BAAS,CAAA;IACT,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,iCAAW,CAAA;IACX,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,wEAAwE;IACxE,qCAAe,CAAA;AACjB,CAAC,EAjBW,kBAAkB,KAAlB,kBAAkB,QAiB7B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LadybugDB schema constants — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* NODE_TABLES and REL_TYPES define what the knowledge graph can contain.
|
|
5
|
+
* Both CLI and web must agree on these for data compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Full DDL schemas remain in each package's own schema.ts because
|
|
8
|
+
* the CLI uses native LadybugDB and the web uses WASM.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NODE_TABLES: readonly ["File", "Folder", "Function", "Class", "Interface", "Method", "CodeElement", "Community", "Process", "Section", "Struct", "Enum", "Macro", "Typedef", "Union", "Namespace", "Trait", "Impl", "TypeAlias", "Const", "Static", "Property", "Record", "Delegate", "Annotation", "Constructor", "Template", "Module", "Route", "Tool"];
|
|
11
|
+
export type NodeTableName = (typeof NODE_TABLES)[number];
|
|
12
|
+
export declare const REL_TABLE_NAME = "CodeRelation";
|
|
13
|
+
export declare const REL_TYPES: readonly ["CONTAINS", "DEFINES", "IMPORTS", "CALLS", "EXTENDS", "IMPLEMENTS", "HAS_METHOD", "HAS_PROPERTY", "ACCESSES", "OVERRIDES", "MEMBER_OF", "STEP_IN_PROCESS", "HANDLES_ROUTE", "FETCHES", "HANDLES_TOOL", "ENTRY_POINT_OF", "WRAPS", "QUERIES"];
|
|
14
|
+
export type RelType = (typeof REL_TYPES)[number];
|
|
15
|
+
export declare const EMBEDDING_TABLE_NAME = "CodeEmbedding";
|
|
16
|
+
//# sourceMappingURL=schema-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-constants.d.ts","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,8UA+Bd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,SAAS,wPAmBZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LadybugDB schema constants — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* NODE_TABLES and REL_TYPES define what the knowledge graph can contain.
|
|
5
|
+
* Both CLI and web must agree on these for data compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Full DDL schemas remain in each package's own schema.ts because
|
|
8
|
+
* the CLI uses native LadybugDB and the web uses WASM.
|
|
9
|
+
*/
|
|
10
|
+
export const NODE_TABLES = [
|
|
11
|
+
'File',
|
|
12
|
+
'Folder',
|
|
13
|
+
'Function',
|
|
14
|
+
'Class',
|
|
15
|
+
'Interface',
|
|
16
|
+
'Method',
|
|
17
|
+
'CodeElement',
|
|
18
|
+
'Community',
|
|
19
|
+
'Process',
|
|
20
|
+
'Section',
|
|
21
|
+
'Struct',
|
|
22
|
+
'Enum',
|
|
23
|
+
'Macro',
|
|
24
|
+
'Typedef',
|
|
25
|
+
'Union',
|
|
26
|
+
'Namespace',
|
|
27
|
+
'Trait',
|
|
28
|
+
'Impl',
|
|
29
|
+
'TypeAlias',
|
|
30
|
+
'Const',
|
|
31
|
+
'Static',
|
|
32
|
+
'Property',
|
|
33
|
+
'Record',
|
|
34
|
+
'Delegate',
|
|
35
|
+
'Annotation',
|
|
36
|
+
'Constructor',
|
|
37
|
+
'Template',
|
|
38
|
+
'Module',
|
|
39
|
+
'Route',
|
|
40
|
+
'Tool',
|
|
41
|
+
];
|
|
42
|
+
export const REL_TABLE_NAME = 'CodeRelation';
|
|
43
|
+
export const REL_TYPES = [
|
|
44
|
+
'CONTAINS',
|
|
45
|
+
'DEFINES',
|
|
46
|
+
'IMPORTS',
|
|
47
|
+
'CALLS',
|
|
48
|
+
'EXTENDS',
|
|
49
|
+
'IMPLEMENTS',
|
|
50
|
+
'HAS_METHOD',
|
|
51
|
+
'HAS_PROPERTY',
|
|
52
|
+
'ACCESSES',
|
|
53
|
+
'OVERRIDES',
|
|
54
|
+
'MEMBER_OF',
|
|
55
|
+
'STEP_IN_PROCESS',
|
|
56
|
+
'HANDLES_ROUTE',
|
|
57
|
+
'FETCHES',
|
|
58
|
+
'HANDLES_TOOL',
|
|
59
|
+
'ENTRY_POINT_OF',
|
|
60
|
+
'WRAPS',
|
|
61
|
+
'QUERIES',
|
|
62
|
+
];
|
|
63
|
+
export const EMBEDDING_TABLE_NAME = 'CodeEmbedding';
|
|
64
|
+
//# sourceMappingURL=schema-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-constants.js","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,WAAW;IACX,QAAQ;IACR,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;CACE,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,SAAS;CACD,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline progress types — shared between CLI and web.
|
|
3
|
+
*/
|
|
4
|
+
export type PipelinePhase = 'idle' | 'extracting' | 'structure' | 'parsing' | 'imports' | 'calls' | 'heritage' | 'communities' | 'processes' | 'enriching' | 'complete' | 'error';
|
|
5
|
+
export interface PipelineProgress {
|
|
6
|
+
phase: PipelinePhase;
|
|
7
|
+
percent: number;
|
|
8
|
+
message: string;
|
|
9
|
+
detail?: string;
|
|
10
|
+
stats?: {
|
|
11
|
+
filesProcessed: number;
|
|
12
|
+
totalFiles: number;
|
|
13
|
+
nodesCreated: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,GACT,OAAO,GACP,UAAU,GACV,aAAa,GACb,WAAW,GACX,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/cli/ai-context.d.ts
CHANGED
|
@@ -14,10 +14,13 @@ interface RepoStats {
|
|
|
14
14
|
clusters?: number;
|
|
15
15
|
processes?: number;
|
|
16
16
|
}
|
|
17
|
+
export interface AIContextOptions {
|
|
18
|
+
skipAgentsMd?: boolean;
|
|
19
|
+
}
|
|
17
20
|
/**
|
|
18
21
|
* Generate AI context files after indexing
|
|
19
22
|
*/
|
|
20
|
-
export declare function generateAIContextFiles(repoPath: string, _storagePath: string, projectName: string, stats: RepoStats, generatedSkills?: GeneratedSkillInfo[]): Promise<{
|
|
23
|
+
export declare function generateAIContextFiles(repoPath: string, _storagePath: string, projectName: string, stats: RepoStats, generatedSkills?: GeneratedSkillInfo[], options?: AIContextOptions): Promise<{
|
|
21
24
|
files: string[];
|
|
22
25
|
}>;
|
|
23
26
|
export {};
|
package/dist/cli/ai-context.js
CHANGED
|
@@ -25,8 +25,10 @@ const GITNEXUS_END_MARKER = '<!-- gitnexus:end -->';
|
|
|
25
25
|
* - Self-review checklist — forces model to verify its own work
|
|
26
26
|
*/
|
|
27
27
|
function generateGitNexusContent(projectName, stats, generatedSkills) {
|
|
28
|
-
const generatedRows =
|
|
29
|
-
? generatedSkills
|
|
28
|
+
const generatedRows = generatedSkills && generatedSkills.length > 0
|
|
29
|
+
? generatedSkills
|
|
30
|
+
.map((s) => `| Work in the ${s.label} area (${s.symbolCount} symbols) | \`.claude/skills/generated/${s.name}/SKILL.md\` |`)
|
|
31
|
+
.join('\n')
|
|
30
32
|
: '';
|
|
31
33
|
const skillsTable = `| Task | Read this skill file |
|
|
32
34
|
|------|---------------------|
|
|
@@ -245,17 +247,23 @@ Use GitNexus tools to accomplish this task.
|
|
|
245
247
|
/**
|
|
246
248
|
* Generate AI context files after indexing
|
|
247
249
|
*/
|
|
248
|
-
export async function generateAIContextFiles(repoPath, _storagePath, projectName, stats, generatedSkills) {
|
|
250
|
+
export async function generateAIContextFiles(repoPath, _storagePath, projectName, stats, generatedSkills, options) {
|
|
249
251
|
const content = generateGitNexusContent(projectName, stats, generatedSkills);
|
|
250
252
|
const createdFiles = [];
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
if (!options?.skipAgentsMd) {
|
|
254
|
+
// Create AGENTS.md (standard for Cursor, Windsurf, OpenCode, Cline, etc.)
|
|
255
|
+
const agentsPath = path.join(repoPath, 'AGENTS.md');
|
|
256
|
+
const agentsResult = await upsertGitNexusSection(agentsPath, content);
|
|
257
|
+
createdFiles.push(`AGENTS.md (${agentsResult})`);
|
|
258
|
+
// Create CLAUDE.md (for Claude Code)
|
|
259
|
+
const claudePath = path.join(repoPath, 'CLAUDE.md');
|
|
260
|
+
const claudeResult = await upsertGitNexusSection(claudePath, content);
|
|
261
|
+
createdFiles.push(`CLAUDE.md (${claudeResult})`);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
createdFiles.push('AGENTS.md (skipped via --skip-agents-md)');
|
|
265
|
+
createdFiles.push('CLAUDE.md (skipped via --skip-agents-md)');
|
|
266
|
+
}
|
|
259
267
|
// Install skills to .claude/skills/gitnexus/
|
|
260
268
|
const installedSkills = await installSkills(repoPath);
|
|
261
269
|
if (installedSkills.length > 0) {
|
package/dist/cli/analyze.d.ts
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
* Analyze Command
|
|
3
3
|
*
|
|
4
4
|
* Indexes a repository and stores the knowledge graph in .gitnexus/
|
|
5
|
+
*
|
|
6
|
+
* Delegates core analysis to the shared runFullAnalysis orchestrator.
|
|
7
|
+
* This CLI wrapper handles: heap management, progress bar, SIGINT,
|
|
8
|
+
* skill generation (--skills), summary output, and process.exit().
|
|
5
9
|
*/
|
|
6
10
|
export interface AnalyzeOptions {
|
|
7
11
|
force?: boolean;
|
|
8
12
|
embeddings?: boolean;
|
|
9
13
|
skills?: boolean;
|
|
10
14
|
verbose?: boolean;
|
|
15
|
+
/** Skip AGENTS.md and CLAUDE.md gitnexus block updates. */
|
|
16
|
+
skipAgentsMd?: boolean;
|
|
11
17
|
/** Index the folder even when no .git directory is present. */
|
|
12
18
|
skipGit?: boolean;
|
|
13
19
|
}
|