@codragraph/cli 2.1.0 → 2.1.4
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 +62 -21
- package/dist/_shared/cgdb/schema-constants.d.ts +2 -2
- package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -1
- package/dist/_shared/cgdb/schema-constants.js +3 -0
- package/dist/_shared/cgdb/schema-constants.js.map +1 -1
- package/dist/_shared/feature-clusters.d.ts +99 -0
- package/dist/_shared/feature-clusters.d.ts.map +1 -0
- package/dist/_shared/feature-clusters.js +2 -0
- package/dist/_shared/feature-clusters.js.map +1 -0
- package/dist/_shared/graph/types.d.ts +16 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +1 -0
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/pipeline.d.ts +1 -1
- package/dist/_shared/pipeline.d.ts.map +1 -1
- package/dist/cli/ai-context.js +4 -0
- package/dist/cli/analyze.js +46 -26
- package/dist/cli/index.js +39 -1
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +3 -1
- package/dist/cli/setup.js +42 -21
- package/dist/cli/status.d.ts +13 -0
- package/dist/cli/status.js +99 -0
- package/dist/cli/tool.d.ts +25 -0
- package/dist/cli/tool.js +74 -0
- package/dist/config/ignore-service.js +2 -0
- package/dist/config/supported-languages.d.ts +3 -3
- package/dist/config/supported-languages.js +3 -3
- package/dist/core/cgdb/cgdb-adapter.js +19 -3
- package/dist/core/cgdb/csv-generator.js +33 -2
- package/dist/core/cgdb/schema.d.ts +2 -1
- package/dist/core/cgdb/schema.js +55 -0
- package/dist/core/embeddings/embedder.js +4 -2
- package/dist/core/graphstore/cgdb-row-source.js +3 -2
- package/dist/core/graphstore/index.d.ts +1 -1
- package/dist/core/graphstore/index.js +1 -1
- package/dist/core/group/bridge-db.js +42 -10
- package/dist/core/group/service.d.ts +16 -0
- package/dist/core/group/service.js +360 -0
- package/dist/core/ingestion/emit-references.d.ts +1 -1
- package/dist/core/ingestion/emit-references.js +1 -1
- package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
- package/dist/core/ingestion/feature-cluster-processor.js +626 -0
- package/dist/core/ingestion/finalize-orchestrator.js +1 -1
- package/dist/core/ingestion/model/registration-table.js +1 -0
- package/dist/core/ingestion/model/resolve.d.ts +2 -2
- package/dist/core/ingestion/model/resolve.js +3 -3
- package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/model/symbol-table.js +1 -1
- package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline.d.ts +4 -0
- package/dist/core/ingestion/pipeline.js +9 -5
- package/dist/core/run-analyze.d.ts +21 -0
- package/dist/core/run-analyze.js +213 -6
- package/dist/core/search/hybrid-search.js +11 -3
- package/dist/mcp/core/embedder.js +5 -2
- package/dist/mcp/local/local-backend.d.ts +12 -0
- package/dist/mcp/local/local-backend.js +381 -3
- package/dist/mcp/resources.js +139 -0
- package/dist/mcp/tools.js +174 -2
- package/dist/server/api.d.ts +14 -2
- package/dist/server/api.js +206 -7
- package/dist/server/mcp-http.d.ts +22 -0
- package/dist/server/mcp-http.js +21 -2
- package/dist/server/web-dashboard.d.ts +28 -0
- package/dist/server/web-dashboard.js +61 -0
- package/dist/storage/repo-manager.d.ts +6 -1
- package/dist/storage/repo-manager.js +5 -1
- package/dist/types/pipeline.d.ts +2 -0
- package/dist/web/assets/agent-D5lb0zXz.js +1089 -0
- package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +36 -0
- package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +132 -0
- package/dist/web/assets/c4Diagram-DFAF54RM-C4Hl3J2U.js +10 -0
- package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +231 -0
- package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +1 -0
- package/dist/web/assets/chunk-7RZVMHOQ-BitYcNVR.js +338 -0
- package/dist/web/assets/chunk-AEOMTBSW-BgTIXPsY.js +1 -0
- package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +13 -0
- package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +1 -0
- package/dist/web/assets/chunk-KSICW3F5-BYzvDLNI.js +15 -0
- package/dist/web/assets/chunk-O5ABG6QK-dHwHzA6n.js +1 -0
- package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +206 -0
- package/dist/web/assets/chunk-RWUO3TPN-BgRTY0_k.js +1 -0
- package/dist/web/assets/chunk-TBF5ZNIQ-DL5stGM1.js +1 -0
- package/dist/web/assets/chunk-TU3PZOEN-RLyvLcv-.js +1 -0
- package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +1 -0
- package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +1 -0
- package/dist/web/assets/context-builder-22jU3V56.js +16 -0
- package/dist/web/assets/cose-bilkent-PNC4W37J-DVhePRYg.js +1 -0
- package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +4 -0
- package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +43 -0
- package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +24 -0
- package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +10 -0
- package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +24 -0
- package/dist/web/assets/erDiagram-GCSMX5X6-C3dhDFA8.js +85 -0
- package/dist/web/assets/flowDiagram-OTCZ4VVT-CWSFWmhr.js +162 -0
- package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +292 -0
- package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +106 -0
- package/dist/web/assets/index-BgeqpYgd.js +1415 -0
- package/dist/web/assets/index-CT0GtFLZ.css +1 -0
- package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +2 -0
- package/dist/web/assets/ishikawaDiagram-YMYX4NHK-DUoJvNP2.js +70 -0
- package/dist/web/assets/journeyDiagram-SO5T7YLQ-RMFPNNqz.js +139 -0
- package/dist/web/assets/kanban-definition-LJHFXRCJ-BzpDs1K9.js +89 -0
- package/dist/web/assets/katex-GD7MH7QM-DBQvrix-.js +261 -0
- package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +96 -0
- package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +30 -0
- package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +7 -0
- package/dist/web/assets/requirementDiagram-M5DCFWZL-DLHOVTSv.js +84 -0
- package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +10 -0
- package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +157 -0
- package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +1 -0
- package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +1 -0
- package/dist/web/assets/timeline-definition-5SPVSISX-TRSDRgPw.js +120 -0
- package/dist/web/assets/vennDiagram-IE5QUKF5-DNy7HRBM.js +34 -0
- package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +161 -0
- package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +20 -0
- package/dist/web/assets/xychartDiagram-ZHJ5623Y-Dr9r7a35.js +7 -0
- package/dist/web/codragraph-logo-512.png +0 -0
- package/dist/web/codragraph-logo.png +0 -0
- package/dist/web/favicon.png +0 -0
- package/dist/web/index.html +36 -0
- package/hooks/claude/codragraph-hook.cjs +24 -9
- package/hooks/claude/pre-tool-use.sh +6 -1
- package/package.json +15 -4
- package/scripts/build.js +75 -16
- package/scripts/patch-tree-sitter-swift.cjs +0 -1
- package/skills/codragraph-cli.md +17 -1
- package/skills/codragraph-guide.md +6 -2
- package/skills/codragraph-onboarding.md +2 -2
- package/vendor/leiden/index.cjs +272 -285
- package/vendor/leiden/utils.cjs +264 -274
- package/dist/_shared/lbug/schema-constants.d.ts +0 -16
- package/dist/_shared/lbug/schema-constants.d.ts.map +0 -1
- package/dist/_shared/lbug/schema-constants.js +0 -67
- package/dist/_shared/lbug/schema-constants.js.map +0 -1
- package/dist/core/graphstore/lbug-row-source.d.ts +0 -19
- package/dist/core/graphstore/lbug-row-source.js +0 -141
- package/dist/core/lbug/content-read.d.ts +0 -46
- package/dist/core/lbug/content-read.js +0 -64
- package/dist/core/lbug/csv-generator.d.ts +0 -29
- package/dist/core/lbug/csv-generator.js +0 -492
- package/dist/core/lbug/lbug-adapter.d.ts +0 -176
- package/dist/core/lbug/lbug-adapter.js +0 -1320
- package/dist/core/lbug/pool-adapter.d.ts +0 -93
- package/dist/core/lbug/pool-adapter.js +0 -550
- package/dist/core/lbug/schema.d.ts +0 -62
- package/dist/core/lbug/schema.js +0 -502
- package/dist/mcp/core/lbug-adapter.d.ts +0 -5
- package/dist/mcp/core/lbug-adapter.js +0 -5
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
export const HOSTED_WEB_APP_URL = process.env.CODRAGRAPH_WEB_URL || 'https://codragraph.vercel.app';
|
|
6
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
export const normalizeWebDashboardMode = (raw) => {
|
|
8
|
+
const value = (raw ?? 'local').trim().toLowerCase();
|
|
9
|
+
if (value === 'local' || value === 'hosted' || value === 'off')
|
|
10
|
+
return value;
|
|
11
|
+
throw new Error(`Invalid web dashboard mode "${raw}". Use one of: local, hosted, off.`);
|
|
12
|
+
};
|
|
13
|
+
export const getBundledWebAppCandidates = () => [
|
|
14
|
+
// Published package: packages/core/dist/server/*.js -> packages/core/dist/web
|
|
15
|
+
path.resolve(moduleDir, '..', 'web'),
|
|
16
|
+
// Monorepo/dev fallback after running `npm --prefix apps/web run build`.
|
|
17
|
+
path.resolve(moduleDir, '..', '..', '..', '..', 'apps', 'web', 'dist'),
|
|
18
|
+
];
|
|
19
|
+
export const hasWebDashboardIndex = (candidate) => {
|
|
20
|
+
try {
|
|
21
|
+
return fs.statSync(path.join(candidate, 'index.html')).isFile();
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const resolveBundledWebAppPath = (candidates = getBundledWebAppCandidates()) => {
|
|
28
|
+
for (const candidate of candidates) {
|
|
29
|
+
if (hasWebDashboardIndex(candidate))
|
|
30
|
+
return candidate;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
};
|
|
34
|
+
export const mountWebDashboard = (app, options = {}) => {
|
|
35
|
+
const mode = options.mode ?? 'local';
|
|
36
|
+
if (mode !== 'local') {
|
|
37
|
+
return { mode, served: false, hostedUrl: HOSTED_WEB_APP_URL };
|
|
38
|
+
}
|
|
39
|
+
const webAppPath = options.webAppPath ?? resolveBundledWebAppPath();
|
|
40
|
+
if (!webAppPath || !hasWebDashboardIndex(webAppPath)) {
|
|
41
|
+
return {
|
|
42
|
+
mode,
|
|
43
|
+
served: false,
|
|
44
|
+
hostedUrl: HOSTED_WEB_APP_URL,
|
|
45
|
+
reason: 'Bundled web dashboard not found. Rebuild the package or use --web hosted.',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
app.use(express.static(webAppPath, { index: false }));
|
|
49
|
+
app.get(/^\/(?!api(?:\/|$)).*/, (_req, res) => {
|
|
50
|
+
res.sendFile(path.join(webAppPath, 'index.html'));
|
|
51
|
+
});
|
|
52
|
+
return { mode, served: true, hostedUrl: HOSTED_WEB_APP_URL, localPath: webAppPath };
|
|
53
|
+
};
|
|
54
|
+
export const getWebDashboardInfo = (mount, apiBaseUrl) => ({
|
|
55
|
+
mode: mount.mode,
|
|
56
|
+
served: mount.served,
|
|
57
|
+
localUrl: mount.served ? apiBaseUrl : null,
|
|
58
|
+
hostedUrl: mount.hostedUrl,
|
|
59
|
+
apiBaseUrl,
|
|
60
|
+
reason: mount.reason,
|
|
61
|
+
});
|
|
@@ -47,6 +47,10 @@ export declare const canonicalizePath: (p: string) => string;
|
|
|
47
47
|
* opt into compression via `--compress brotli|zstd` (compression
|
|
48
48
|
* is OFF by default, so existing readers keep working). Readers
|
|
49
49
|
* decode based on the per-row encoding tag.
|
|
50
|
+
* 3 - FeatureCluster layer: adds FeatureCluster nodes plus
|
|
51
|
+
* FEATURE_MEMBER_OF / FEATURE_DEPENDS_ON relation rows.
|
|
52
|
+
* 4 - FeatureCluster context-pack metadata: summary, repo/service,
|
|
53
|
+
* routes, tools, test coverage hints, and indexed commit fields.
|
|
50
54
|
*
|
|
51
55
|
* Bumping this is the migration trigger: `runFullAnalysis` forces a
|
|
52
56
|
* full re-analyze when an existing index has a missing or older
|
|
@@ -54,7 +58,7 @@ export declare const canonicalizePath: (p: string) => string;
|
|
|
54
58
|
* LadybugDB table via ALTER is not validated end-to-end yet — fresh
|
|
55
59
|
* `CREATE NODE TABLE` is the supported path.
|
|
56
60
|
*/
|
|
57
|
-
export declare const INDEX_SCHEMA_VERSION:
|
|
61
|
+
export declare const INDEX_SCHEMA_VERSION: 4;
|
|
58
62
|
export interface RepoMeta {
|
|
59
63
|
repoPath: string;
|
|
60
64
|
lastCommit: string;
|
|
@@ -103,6 +107,7 @@ export interface RepoMeta {
|
|
|
103
107
|
nodes?: number;
|
|
104
108
|
edges?: number;
|
|
105
109
|
communities?: number;
|
|
110
|
+
featureClusters?: number;
|
|
106
111
|
processes?: number;
|
|
107
112
|
embeddings?: number;
|
|
108
113
|
};
|
|
@@ -60,6 +60,10 @@ export const canonicalizePath = (p) => {
|
|
|
60
60
|
* opt into compression via `--compress brotli|zstd` (compression
|
|
61
61
|
* is OFF by default, so existing readers keep working). Readers
|
|
62
62
|
* decode based on the per-row encoding tag.
|
|
63
|
+
* 3 - FeatureCluster layer: adds FeatureCluster nodes plus
|
|
64
|
+
* FEATURE_MEMBER_OF / FEATURE_DEPENDS_ON relation rows.
|
|
65
|
+
* 4 - FeatureCluster context-pack metadata: summary, repo/service,
|
|
66
|
+
* routes, tools, test coverage hints, and indexed commit fields.
|
|
63
67
|
*
|
|
64
68
|
* Bumping this is the migration trigger: `runFullAnalysis` forces a
|
|
65
69
|
* full re-analyze when an existing index has a missing or older
|
|
@@ -67,7 +71,7 @@ export const canonicalizePath = (p) => {
|
|
|
67
71
|
* LadybugDB table via ALTER is not validated end-to-end yet — fresh
|
|
68
72
|
* `CREATE NODE TABLE` is the supported path.
|
|
69
73
|
*/
|
|
70
|
-
export const INDEX_SCHEMA_VERSION =
|
|
74
|
+
export const INDEX_SCHEMA_VERSION = 4;
|
|
71
75
|
const CODRAGRAPH_DIR = '.codragraph';
|
|
72
76
|
// ─── Local Storage Helpers ─────────────────────────────────────────────
|
|
73
77
|
/**
|
package/dist/types/pipeline.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KnowledgeGraph } from '../core/graph/types.js';
|
|
2
2
|
import { CommunityDetectionResult } from '../core/ingestion/community-processor.js';
|
|
3
|
+
import { FeatureClusterDetectionResult } from '../core/ingestion/feature-cluster-processor.js';
|
|
3
4
|
import { ProcessDetectionResult } from '../core/ingestion/process-processor.js';
|
|
4
5
|
export interface PipelineResult {
|
|
5
6
|
graph: KnowledgeGraph;
|
|
@@ -9,6 +10,7 @@ export interface PipelineResult {
|
|
|
9
10
|
totalFileCount: number;
|
|
10
11
|
communityResult?: CommunityDetectionResult;
|
|
11
12
|
processResult?: ProcessDetectionResult;
|
|
13
|
+
featureClusterResult?: FeatureClusterDetectionResult;
|
|
12
14
|
/**
|
|
13
15
|
* True if the parse phase spawned a worker pool for this run. False means
|
|
14
16
|
* the sequential fallback handled every chunk. Primarily a test affordance
|