@monoes/monograph 1.0.0
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/.monomind/data/ranked-context.json +5 -0
- package/.monomind/sessions/current.json +13 -0
- package/__tests__/export/formats.test.ts +82 -0
- package/__tests__/fixtures/sample.py +11 -0
- package/__tests__/fixtures/sample.ts +17 -0
- package/__tests__/integration/full-pipeline.test.ts +64 -0
- package/__tests__/parsers/loader.test.ts +14 -0
- package/__tests__/parsers/python.test.ts +32 -0
- package/__tests__/parsers/typescript.test.ts +45 -0
- package/__tests__/pipeline/analysis.test.ts +58 -0
- package/__tests__/pipeline/phases.test.ts +41 -0
- package/__tests__/pipeline/runner.test.ts +28 -0
- package/__tests__/setup.ts +1 -0
- package/__tests__/storage/db.test.ts +37 -0
- package/__tests__/storage/stores.test.ts +100 -0
- package/__tests__/types.test.ts +13 -0
- package/__tests__/watch/watcher.test.ts +31 -0
- package/dist/src/export/canvas.d.ts +3 -0
- package/dist/src/export/canvas.d.ts.map +1 -0
- package/dist/src/export/canvas.js +39 -0
- package/dist/src/export/canvas.js.map +1 -0
- package/dist/src/export/cypher.d.ts +3 -0
- package/dist/src/export/cypher.d.ts.map +1 -0
- package/dist/src/export/cypher.js +24 -0
- package/dist/src/export/cypher.js.map +1 -0
- package/dist/src/export/graphml.d.ts +3 -0
- package/dist/src/export/graphml.d.ts.map +1 -0
- package/dist/src/export/graphml.js +38 -0
- package/dist/src/export/graphml.js.map +1 -0
- package/dist/src/export/html.d.ts +3 -0
- package/dist/src/export/html.d.ts.map +1 -0
- package/dist/src/export/html.js +54 -0
- package/dist/src/export/html.js.map +1 -0
- package/dist/src/export/index.d.ts +8 -0
- package/dist/src/export/index.d.ts.map +1 -0
- package/dist/src/export/index.js +8 -0
- package/dist/src/export/index.js.map +1 -0
- package/dist/src/export/json.d.ts +3 -0
- package/dist/src/export/json.d.ts.map +1 -0
- package/dist/src/export/json.js +31 -0
- package/dist/src/export/json.js.map +1 -0
- package/dist/src/export/obsidian.d.ts +3 -0
- package/dist/src/export/obsidian.d.ts.map +1 -0
- package/dist/src/export/obsidian.js +38 -0
- package/dist/src/export/obsidian.js.map +1 -0
- package/dist/src/export/svg.d.ts +3 -0
- package/dist/src/export/svg.d.ts.map +1 -0
- package/dist/src/export/svg.js +46 -0
- package/dist/src/export/svg.js.map +1 -0
- package/dist/src/graph/analyzer.d.ts +8 -0
- package/dist/src/graph/analyzer.d.ts.map +1 -0
- package/dist/src/graph/analyzer.js +25 -0
- package/dist/src/graph/analyzer.js.map +1 -0
- package/dist/src/graph/diff.d.ts +19 -0
- package/dist/src/graph/diff.d.ts.map +1 -0
- package/dist/src/graph/diff.js +44 -0
- package/dist/src/graph/diff.js.map +1 -0
- package/dist/src/graph/loader.d.ts +5 -0
- package/dist/src/graph/loader.d.ts.map +1 -0
- package/dist/src/graph/loader.js +42 -0
- package/dist/src/graph/loader.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +18 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/resources.d.ts +11 -0
- package/dist/src/mcp/resources.d.ts.map +1 -0
- package/dist/src/mcp/resources.js +69 -0
- package/dist/src/mcp/resources.js.map +1 -0
- package/dist/src/parsers/extractor.d.ts +5 -0
- package/dist/src/parsers/extractor.d.ts.map +1 -0
- package/dist/src/parsers/extractor.js +142 -0
- package/dist/src/parsers/extractor.js.map +1 -0
- package/dist/src/parsers/go.d.ts +3 -0
- package/dist/src/parsers/go.d.ts.map +1 -0
- package/dist/src/parsers/go.js +25 -0
- package/dist/src/parsers/go.js.map +1 -0
- package/dist/src/parsers/java.d.ts +3 -0
- package/dist/src/parsers/java.d.ts.map +1 -0
- package/dist/src/parsers/java.js +25 -0
- package/dist/src/parsers/java.js.map +1 -0
- package/dist/src/parsers/language-config.d.ts +27 -0
- package/dist/src/parsers/language-config.d.ts.map +1 -0
- package/dist/src/parsers/language-config.js +2 -0
- package/dist/src/parsers/language-config.js.map +1 -0
- package/dist/src/parsers/loader.d.ts +15 -0
- package/dist/src/parsers/loader.d.ts.map +1 -0
- package/dist/src/parsers/loader.js +73 -0
- package/dist/src/parsers/loader.js.map +1 -0
- package/dist/src/parsers/python.d.ts +3 -0
- package/dist/src/parsers/python.d.ts.map +1 -0
- package/dist/src/parsers/python.js +24 -0
- package/dist/src/parsers/python.js.map +1 -0
- package/dist/src/parsers/rust.d.ts +3 -0
- package/dist/src/parsers/rust.d.ts.map +1 -0
- package/dist/src/parsers/rust.js +23 -0
- package/dist/src/parsers/rust.js.map +1 -0
- package/dist/src/parsers/typescript.d.ts +3 -0
- package/dist/src/parsers/typescript.d.ts.map +1 -0
- package/dist/src/parsers/typescript.js +39 -0
- package/dist/src/parsers/typescript.js.map +1 -0
- package/dist/src/pipeline/orchestrator.d.ts +8 -0
- package/dist/src/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/src/pipeline/orchestrator.js +37 -0
- package/dist/src/pipeline/orchestrator.js.map +1 -0
- package/dist/src/pipeline/phases/communities.d.ts +7 -0
- package/dist/src/pipeline/phases/communities.d.ts.map +1 -0
- package/dist/src/pipeline/phases/communities.js +34 -0
- package/dist/src/pipeline/phases/communities.js.map +1 -0
- package/dist/src/pipeline/phases/cross-file.d.ts +7 -0
- package/dist/src/pipeline/phases/cross-file.d.ts.map +1 -0
- package/dist/src/pipeline/phases/cross-file.js +36 -0
- package/dist/src/pipeline/phases/cross-file.js.map +1 -0
- package/dist/src/pipeline/phases/god-nodes.d.ts +7 -0
- package/dist/src/pipeline/phases/god-nodes.d.ts.map +1 -0
- package/dist/src/pipeline/phases/god-nodes.js +28 -0
- package/dist/src/pipeline/phases/god-nodes.js.map +1 -0
- package/dist/src/pipeline/phases/mro.d.ts +7 -0
- package/dist/src/pipeline/phases/mro.d.ts.map +1 -0
- package/dist/src/pipeline/phases/mro.js +41 -0
- package/dist/src/pipeline/phases/mro.js.map +1 -0
- package/dist/src/pipeline/phases/parse.d.ts +9 -0
- package/dist/src/pipeline/phases/parse.d.ts.map +1 -0
- package/dist/src/pipeline/phases/parse.js +51 -0
- package/dist/src/pipeline/phases/parse.js.map +1 -0
- package/dist/src/pipeline/phases/scan.d.ts +7 -0
- package/dist/src/pipeline/phases/scan.d.ts.map +1 -0
- package/dist/src/pipeline/phases/scan.js +60 -0
- package/dist/src/pipeline/phases/scan.js.map +1 -0
- package/dist/src/pipeline/phases/structure.d.ts +9 -0
- package/dist/src/pipeline/phases/structure.d.ts.map +1 -0
- package/dist/src/pipeline/phases/structure.js +56 -0
- package/dist/src/pipeline/phases/structure.js.map +1 -0
- package/dist/src/pipeline/phases/suggest.d.ts +7 -0
- package/dist/src/pipeline/phases/suggest.d.ts.map +1 -0
- package/dist/src/pipeline/phases/suggest.js +59 -0
- package/dist/src/pipeline/phases/suggest.js.map +1 -0
- package/dist/src/pipeline/phases/surprises.d.ts +7 -0
- package/dist/src/pipeline/phases/surprises.d.ts.map +1 -0
- package/dist/src/pipeline/phases/surprises.js +54 -0
- package/dist/src/pipeline/phases/surprises.js.map +1 -0
- package/dist/src/pipeline/runner.d.ts +8 -0
- package/dist/src/pipeline/runner.d.ts.map +1 -0
- package/dist/src/pipeline/runner.js +53 -0
- package/dist/src/pipeline/runner.js.map +1 -0
- package/dist/src/pipeline/types.d.ts +24 -0
- package/dist/src/pipeline/types.d.ts.map +1 -0
- package/dist/src/pipeline/types.js +8 -0
- package/dist/src/pipeline/types.js.map +1 -0
- package/dist/src/storage/db.d.ts +7 -0
- package/dist/src/storage/db.d.ts.map +1 -0
- package/dist/src/storage/db.js +52 -0
- package/dist/src/storage/db.js.map +1 -0
- package/dist/src/storage/edge-store.d.ts +9 -0
- package/dist/src/storage/edge-store.d.ts.map +1 -0
- package/dist/src/storage/edge-store.js +46 -0
- package/dist/src/storage/edge-store.js.map +1 -0
- package/dist/src/storage/fts-store.d.ts +11 -0
- package/dist/src/storage/fts-store.d.ts.map +1 -0
- package/dist/src/storage/fts-store.js +32 -0
- package/dist/src/storage/fts-store.js.map +1 -0
- package/dist/src/storage/node-store.d.ts +9 -0
- package/dist/src/storage/node-store.d.ts.map +1 -0
- package/dist/src/storage/node-store.js +52 -0
- package/dist/src/storage/node-store.js.map +1 -0
- package/dist/src/storage/schema.d.ts +8 -0
- package/dist/src/storage/schema.d.ts.map +1 -0
- package/dist/src/storage/schema.js +72 -0
- package/dist/src/storage/schema.js.map +1 -0
- package/dist/src/types.d.ts +76 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +37 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/watch/watcher.d.ts +16 -0
- package/dist/src/watch/watcher.d.ts.map +1 -0
- package/dist/src/watch/watcher.js +59 -0
- package/dist/src/watch/watcher.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +44 -0
- package/src/export/canvas.ts +42 -0
- package/src/export/cypher.ts +33 -0
- package/src/export/graphml.ts +48 -0
- package/src/export/html.ts +61 -0
- package/src/export/index.ts +7 -0
- package/src/export/json.ts +36 -0
- package/src/export/obsidian.ts +44 -0
- package/src/export/svg.ts +55 -0
- package/src/graph/analyzer.ts +29 -0
- package/src/graph/diff.ts +65 -0
- package/src/graph/loader.ts +41 -0
- package/src/index.ts +17 -0
- package/src/mcp/resources.ts +69 -0
- package/src/parsers/extractor.ts +180 -0
- package/src/parsers/go.ts +27 -0
- package/src/parsers/java.ts +27 -0
- package/src/parsers/language-config.ts +28 -0
- package/src/parsers/loader.ts +85 -0
- package/src/parsers/python.ts +26 -0
- package/src/parsers/rust.ts +25 -0
- package/src/parsers/typescript.ts +41 -0
- package/src/pipeline/orchestrator.ts +46 -0
- package/src/pipeline/phases/communities.ts +45 -0
- package/src/pipeline/phases/cross-file.ts +48 -0
- package/src/pipeline/phases/god-nodes.ts +40 -0
- package/src/pipeline/phases/mro.ts +52 -0
- package/src/pipeline/phases/parse.ts +62 -0
- package/src/pipeline/phases/scan.ts +58 -0
- package/src/pipeline/phases/structure.ts +68 -0
- package/src/pipeline/phases/suggest.ts +71 -0
- package/src/pipeline/phases/surprises.ts +70 -0
- package/src/pipeline/runner.ts +61 -0
- package/src/pipeline/types.ts +33 -0
- package/src/storage/db.ts +54 -0
- package/src/storage/edge-store.ts +61 -0
- package/src/storage/fts-store.ts +52 -0
- package/src/storage/node-store.ts +72 -0
- package/src/storage/schema.ts +77 -0
- package/src/types.ts +131 -0
- package/src/watch/watcher.ts +66 -0
- package/tsconfig.json +10 -0
- package/vitest.config.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypher.d.ts","sourceRoot":"","sources":["../../../src/export/cypher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CAsB/E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function toCypher(nodes, edges) {
|
|
2
|
+
const lines = [
|
|
3
|
+
'// Generated by Monograph — read-only import script',
|
|
4
|
+
'// Only CREATE statements; no DROP/DELETE operations',
|
|
5
|
+
'',
|
|
6
|
+
];
|
|
7
|
+
for (const n of nodes) {
|
|
8
|
+
const props = `{id: ${q(n.id)}, name: ${q(n.name)}, file: ${q(n.filePath ?? '')}, exported: ${n.isExported}}`;
|
|
9
|
+
lines.push(`CREATE (n_${safe(n.id)}:${n.label} ${props})`);
|
|
10
|
+
}
|
|
11
|
+
lines.push('');
|
|
12
|
+
for (const e of edges) {
|
|
13
|
+
lines.push(`MATCH (a {id: ${q(e.sourceId)}}), (b {id: ${q(e.targetId)}}) ` +
|
|
14
|
+
`CREATE (a)-[:${e.relation} {confidence: ${q(e.confidence)}}]->(b)`);
|
|
15
|
+
}
|
|
16
|
+
return lines.join('\n');
|
|
17
|
+
}
|
|
18
|
+
function q(s) {
|
|
19
|
+
return `"${s.replace(/"/g, '\\"')}"`;
|
|
20
|
+
}
|
|
21
|
+
function safe(s) {
|
|
22
|
+
return s.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=cypher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypher.js","sourceRoot":"","sources":["../../../src/export/cypher.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,KAAsB,EAAE,KAAsB;IACrE,MAAM,KAAK,GAAa;QACtB,qDAAqD;QACrD,sDAAsD;QACtD,EAAE;KACH,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,eAAe,CAAC,CAAC,UAAU,GAAG,CAAC;QAC9G,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CACR,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK;YAC7D,gBAAgB,CAAC,CAAC,QAAQ,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CACtE,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,CAAC,CAAC,CAAS;IAClB,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;AACvC,CAAC;AAED,SAAS,IAAI,CAAC,CAAS;IACrB,OAAO,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphml.d.ts","sourceRoot":"","sources":["../../../src/export/graphml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CAoChF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function toGraphml(nodes, edges) {
|
|
2
|
+
const nodeXml = nodes
|
|
3
|
+
.map(n => ` <node id="${esc(n.id)}">` +
|
|
4
|
+
`<data key="label">${esc(n.label)}</data>` +
|
|
5
|
+
`<data key="name">${esc(n.name)}</data>` +
|
|
6
|
+
`<data key="file">${esc(n.filePath ?? '')}</data>` +
|
|
7
|
+
`<data key="exported">${n.isExported ? 'true' : 'false'}</data>` +
|
|
8
|
+
`</node>`)
|
|
9
|
+
.join('\n');
|
|
10
|
+
const edgeXml = edges
|
|
11
|
+
.map(e => ` <edge id="${esc(e.id)}" source="${esc(e.sourceId)}" target="${esc(e.targetId)}">` +
|
|
12
|
+
`<data key="relation">${esc(e.relation)}</data>` +
|
|
13
|
+
`<data key="confidence">${esc(e.confidence)}</data>` +
|
|
14
|
+
`</edge>`)
|
|
15
|
+
.join('\n');
|
|
16
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
17
|
+
<graphml xmlns="http://graphml.graphdrawing.org/graphml">
|
|
18
|
+
<key id="label" for="node" attr.name="label" attr.type="string"/>
|
|
19
|
+
<key id="name" for="node" attr.name="name" attr.type="string"/>
|
|
20
|
+
<key id="file" for="node" attr.name="file" attr.type="string"/>
|
|
21
|
+
<key id="exported" for="node" attr.name="exported" attr.type="boolean"/>
|
|
22
|
+
<key id="relation" for="edge" attr.name="relation" attr.type="string"/>
|
|
23
|
+
<key id="confidence" for="edge" attr.name="confidence" attr.type="string"/>
|
|
24
|
+
<graph id="G" edgedefault="directed">
|
|
25
|
+
${nodeXml}
|
|
26
|
+
${edgeXml}
|
|
27
|
+
</graph>
|
|
28
|
+
</graphml>`;
|
|
29
|
+
}
|
|
30
|
+
function esc(s) {
|
|
31
|
+
return s
|
|
32
|
+
.replace(/&/g, '&')
|
|
33
|
+
.replace(/</g, '<')
|
|
34
|
+
.replace(/>/g, '>')
|
|
35
|
+
.replace(/"/g, '"')
|
|
36
|
+
.replace(/'/g, ''');
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=graphml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphml.js","sourceRoot":"","sources":["../../../src/export/graphml.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,KAAsB,EAAE,KAAsB;IACtE,MAAM,OAAO,GAAG,KAAK;SAClB,GAAG,CACF,CAAC,CAAC,EAAE,CACF,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI;QAC5B,qBAAqB,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS;QAC1C,oBAAoB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;QACxC,oBAAoB,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,SAAS;QAClD,wBAAwB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,SAAS;QAChE,SAAS,CACZ;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,OAAO,GAAG,KAAK;SAClB,GAAG,CACF,CAAC,CAAC,EAAE,CACF,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI;QACpF,wBAAwB,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS;QAChD,0BAA0B,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS;QACpD,SAAS,CACZ;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;;;;;;;;;EASP,OAAO;EACP,OAAO;;WAEE,CAAC;AACZ,CAAC;AAED,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,CAAC;SACL,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/export/html.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIhE,wBAAgB,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CAwD7E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const MAX_NODES = 5000;
|
|
2
|
+
export function toHtml(nodes, edges) {
|
|
3
|
+
const visNodes = nodes.slice(0, MAX_NODES).map(n => ({
|
|
4
|
+
id: n.id,
|
|
5
|
+
label: n.name,
|
|
6
|
+
title: `${n.label} in ${n.filePath ?? '?'}`,
|
|
7
|
+
group: n.communityId ?? 0,
|
|
8
|
+
}));
|
|
9
|
+
const visEdges = edges
|
|
10
|
+
.filter(e => visNodes.some(n => n.id === e.sourceId) && visNodes.some(n => n.id === e.targetId))
|
|
11
|
+
.map(e => ({
|
|
12
|
+
from: e.sourceId,
|
|
13
|
+
to: e.targetId,
|
|
14
|
+
title: e.relation,
|
|
15
|
+
}));
|
|
16
|
+
return `<!DOCTYPE html>
|
|
17
|
+
<html>
|
|
18
|
+
<head>
|
|
19
|
+
<meta charset="UTF-8">
|
|
20
|
+
<title>Monograph</title>
|
|
21
|
+
<script src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"><\/script>
|
|
22
|
+
<style>
|
|
23
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
24
|
+
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
|
|
25
|
+
#graph { width: 100vw; height: 100vh; }
|
|
26
|
+
#search { position: fixed; top: 10px; left: 10px; z-index: 10; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
|
|
27
|
+
#info { position: fixed; top: 10px; right: 10px; z-index: 10; background: rgba(255,255,255,0.9); padding: 10px; border-radius: 4px; font-size: 12px; }
|
|
28
|
+
</style>
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<input id="search" placeholder="Search nodes..." oninput="filterNodes(this.value)">
|
|
32
|
+
<div id="info">Nodes: <span id="nodeCount">${visNodes.length}</span> | Edges: <span id="edgeCount">${visEdges.length}</span></div>
|
|
33
|
+
<div id="graph"><\/div>
|
|
34
|
+
<script>
|
|
35
|
+
const nodes = new vis.DataSet(${JSON.stringify(visNodes)});
|
|
36
|
+
const edges = new vis.DataSet(${JSON.stringify(visEdges)});
|
|
37
|
+
const network = new vis.Network(document.getElementById('graph'), { nodes, edges }, {
|
|
38
|
+
physics: { enabled: true, stabilization: { iterations: 100 } },
|
|
39
|
+
interaction: { hover: true },
|
|
40
|
+
});
|
|
41
|
+
function filterNodes(q) {
|
|
42
|
+
const originalNodes = ${JSON.stringify(visNodes)};
|
|
43
|
+
if (!q) {
|
|
44
|
+
nodes.update(originalNodes);
|
|
45
|
+
} else {
|
|
46
|
+
const lowerQ = q.toLowerCase();
|
|
47
|
+
nodes.update(originalNodes.map(n => ({...n, hidden: !n.label.toLowerCase().includes(lowerQ)})));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
<\/script>
|
|
51
|
+
</body>
|
|
52
|
+
</html>`;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/export/html.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB,MAAM,UAAU,MAAM,CAAC,KAAsB,EAAE,KAAsB;IACnE,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACnD,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,IAAI;QACb,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,QAAQ,IAAI,GAAG,EAAE;QAC3C,KAAK,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC;KAC1B,CAAC,CAAC,CAAC;IAEJ,MAAM,QAAQ,GAAG,KAAK;SACnB,MAAM,CACL,CAAC,CAAC,EAAE,CACF,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,CACrF;SACA,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACT,IAAI,EAAE,CAAC,CAAC,QAAQ;QAChB,EAAE,EAAE,CAAC,CAAC,QAAQ;QACd,KAAK,EAAE,CAAC,CAAC,QAAQ;KAClB,CAAC,CAAC,CAAC;IAEN,OAAO;;;;;;;;;;;;;;;;+CAgBsC,QAAQ,CAAC,MAAM,yCAAyC,QAAQ,CAAC,MAAM;;;oCAGlF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;oCACxB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;8BAM9B,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;;QAU9C,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { toJson } from './json.js';
|
|
2
|
+
export { toCypher } from './cypher.js';
|
|
3
|
+
export { toHtml } from './html.js';
|
|
4
|
+
export { toObsidian } from './obsidian.js';
|
|
5
|
+
export { toCanvas } from './canvas.js';
|
|
6
|
+
export { toGraphml } from './graphml.js';
|
|
7
|
+
export { toSvg } from './svg.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/export/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { toJson } from './json.js';
|
|
2
|
+
export { toCypher } from './cypher.js';
|
|
3
|
+
export { toHtml } from './html.js';
|
|
4
|
+
export { toObsidian } from './obsidian.js';
|
|
5
|
+
export { toCanvas } from './canvas.js';
|
|
6
|
+
export { toGraphml } from './graphml.js';
|
|
7
|
+
export { toSvg } from './svg.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/export/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/export/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,wBAAgB,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CAiC7E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function toJson(nodes, edges) {
|
|
2
|
+
return JSON.stringify({
|
|
3
|
+
nodes: nodes.map(n => ({
|
|
4
|
+
id: n.id,
|
|
5
|
+
label: n.label,
|
|
6
|
+
name: n.name,
|
|
7
|
+
norm_label: n.normLabel,
|
|
8
|
+
source_file: n.filePath ?? null,
|
|
9
|
+
start_line: n.startLine ?? null,
|
|
10
|
+
end_line: n.endLine ?? null,
|
|
11
|
+
community: n.communityId ?? null,
|
|
12
|
+
is_exported: n.isExported,
|
|
13
|
+
language: n.language ?? null,
|
|
14
|
+
properties: n.properties ?? null,
|
|
15
|
+
})),
|
|
16
|
+
edges: edges.map(e => ({
|
|
17
|
+
id: e.id,
|
|
18
|
+
source: e.sourceId,
|
|
19
|
+
target: e.targetId,
|
|
20
|
+
relation: e.relation,
|
|
21
|
+
confidence: e.confidence,
|
|
22
|
+
confidence_score: e.confidenceScore,
|
|
23
|
+
})),
|
|
24
|
+
links: edges.map(e => ({
|
|
25
|
+
source: e.sourceId,
|
|
26
|
+
target: e.targetId,
|
|
27
|
+
relation: e.relation,
|
|
28
|
+
})),
|
|
29
|
+
}, null, 2);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/export/json.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,MAAM,CAAC,KAAsB,EAAE,KAAsB;IACnE,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,UAAU,EAAE,CAAC,CAAC,SAAS;YACvB,WAAW,EAAE,CAAC,CAAC,QAAQ,IAAI,IAAI;YAC/B,UAAU,EAAE,CAAC,CAAC,SAAS,IAAI,IAAI;YAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,IAAI,IAAI;YAC3B,SAAS,EAAE,CAAC,CAAC,WAAW,IAAI,IAAI;YAChC,WAAW,EAAE,CAAC,CAAC,UAAU;YACzB,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,IAAI;YAC5B,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,IAAI;SACjC,CAAC,CAAC;QACH,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,MAAM,EAAE,CAAC,CAAC,QAAQ;YAClB,MAAM,EAAE,CAAC,CAAC,QAAQ;YAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,gBAAgB,EAAE,CAAC,CAAC,eAAe;SACpC,CAAC,CAAC;QACH,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,QAAQ;YAClB,MAAM,EAAE,CAAC,CAAC,QAAQ;YAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC;KACJ,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obsidian.d.ts","sourceRoot":"","sources":["../../../src/export/obsidian.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIhE,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAuClG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { writeFileSync, mkdirSync } from 'fs';
|
|
3
|
+
export function toObsidian(nodes, edges, outputDir) {
|
|
4
|
+
mkdirSync(outputDir, { recursive: true });
|
|
5
|
+
const adjOut = new Map();
|
|
6
|
+
for (const e of edges) {
|
|
7
|
+
const targets = adjOut.get(e.sourceId) ?? [];
|
|
8
|
+
targets.push(e.targetId);
|
|
9
|
+
adjOut.set(e.sourceId, targets);
|
|
10
|
+
}
|
|
11
|
+
const nodeMap = new Map(nodes.map(n => [n.id, n]));
|
|
12
|
+
for (const node of nodes) {
|
|
13
|
+
const links = (adjOut.get(node.id) ?? [])
|
|
14
|
+
.map(tid => nodeMap.get(tid)?.name)
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.map(name => `- [[${name}]]`)
|
|
17
|
+
.join('\n');
|
|
18
|
+
const content = `---
|
|
19
|
+
label: ${node.label}
|
|
20
|
+
file: ${node.filePath ?? ''}
|
|
21
|
+
exported: ${node.isExported}
|
|
22
|
+
community: ${node.communityId ?? 'none'}
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# ${node.name}
|
|
26
|
+
|
|
27
|
+
**Type:** ${node.label}
|
|
28
|
+
**Language:** ${node.language ?? 'unknown'}
|
|
29
|
+
|
|
30
|
+
## Outgoing links
|
|
31
|
+
|
|
32
|
+
${links || '_none_'}
|
|
33
|
+
`;
|
|
34
|
+
const filename = node.name.replace(/[<>:"/\\|?*]/g, '_');
|
|
35
|
+
writeFileSync(join(outputDir, `${filename}.md`), content);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=obsidian.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obsidian.js","sourceRoot":"","sources":["../../../src/export/obsidian.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE9C,MAAM,UAAU,UAAU,CAAC,KAAsB,EAAE,KAAsB,EAAE,SAAiB;IAC1F,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GA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-0,0 +1,46 @@
|
|
|
1
|
+
const W = 1200;
|
|
2
|
+
const H = 800;
|
|
3
|
+
export function toSvg(nodes, edges) {
|
|
4
|
+
const positions = forceLayout(nodes.slice(0, 200));
|
|
5
|
+
const edgeSvg = edges
|
|
6
|
+
.filter(e => positions.has(e.sourceId) && positions.has(e.targetId))
|
|
7
|
+
.map(e => {
|
|
8
|
+
const s = positions.get(e.sourceId);
|
|
9
|
+
const t = positions.get(e.targetId);
|
|
10
|
+
return `<line x1="${s.x}" y1="${s.y}" x2="${t.x}" y2="${t.y}" stroke="#94a3b8" stroke-width="1" opacity="0.5"/>`;
|
|
11
|
+
})
|
|
12
|
+
.join('\n');
|
|
13
|
+
const nodeSvg = [...positions.entries()]
|
|
14
|
+
.map(([id, pos]) => {
|
|
15
|
+
const node = nodes.find(n => n.id === id);
|
|
16
|
+
const label = node?.name ?? id;
|
|
17
|
+
return (`<circle cx="${pos.x}" cy="${pos.y}" r="6" fill="#3b82f6" stroke="#1e293b" stroke-width="0.5"/>` +
|
|
18
|
+
`<text x="${pos.x + 8}" y="${pos.y + 4}" font-size="10" fill="#1e293b">${sanitizeLabel(label)}</text>`);
|
|
19
|
+
})
|
|
20
|
+
.join('\n');
|
|
21
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${H}" viewBox="0 0 ${W} ${H}">
|
|
22
|
+
<defs>
|
|
23
|
+
<style>
|
|
24
|
+
text { font-family: system-ui, -apple-system, sans-serif; user-select: none; }
|
|
25
|
+
</style>
|
|
26
|
+
</defs>
|
|
27
|
+
<rect width="${W}" height="${H}" fill="#f8fafc"/>
|
|
28
|
+
${edgeSvg}
|
|
29
|
+
${nodeSvg}
|
|
30
|
+
</svg>`;
|
|
31
|
+
}
|
|
32
|
+
function forceLayout(nodes) {
|
|
33
|
+
const positions = new Map();
|
|
34
|
+
nodes.forEach((n, i) => {
|
|
35
|
+
const angle = (i / Math.max(nodes.length, 1)) * 2 * Math.PI;
|
|
36
|
+
positions.set(n.id, {
|
|
37
|
+
x: W / 2 + Math.cos(angle) * (W * 0.35),
|
|
38
|
+
y: H / 2 + Math.sin(angle) * (H * 0.35),
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return positions;
|
|
42
|
+
}
|
|
43
|
+
function sanitizeLabel(s) {
|
|
44
|
+
return s.substring(0, 20).replace(/[&<>"']/g, '_');
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/export/svg.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,GAAG,IAAI,CAAC;AACf,MAAM,CAAC,GAAG,GAAG,CAAC;AAEd,MAAM,UAAU,KAAK,CAAC,KAAsB,EAAE,KAAsB;IAClE,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnD,MAAM,OAAO,GAAG,KAAK;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;SACnE,GAAG,CAAC,CAAC,CAAC,EAAE;QACP,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAE,CAAC;QACrC,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAE,CAAC;QACrC,OAAO,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qDAAqD,CAAC;IACnH,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;SACrC,GAAG,CAA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AC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,aAAa,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type Graph from 'graphology';
|
|
2
|
+
import type { MonographDb } from '../storage/db.js';
|
|
3
|
+
export declare function getShortestPath(db: MonographDb, sourceId: string, targetId: string, maxDepth?: number): string[] | null;
|
|
4
|
+
export declare function getNodeDegrees(graph: Graph, nodeId: string): {
|
|
5
|
+
in: number;
|
|
6
|
+
out: number;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/graph/analyzer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,wBAAgB,eAAe,CAC7B,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,SAAI,GACX,MAAM,EAAE,GAAG,IAAI,CAUjB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAMxF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { bidirectional } from 'graphology-shortest-path';
|
|
2
|
+
import { loadGraphFromDb } from './loader.js';
|
|
3
|
+
export function getShortestPath(db, sourceId, targetId, maxDepth = 6) {
|
|
4
|
+
const graph = loadGraphFromDb(db);
|
|
5
|
+
if (!graph.hasNode(sourceId) || !graph.hasNode(targetId))
|
|
6
|
+
return null;
|
|
7
|
+
try {
|
|
8
|
+
const path = bidirectional(graph, sourceId, targetId);
|
|
9
|
+
if (path && path.length <= maxDepth + 1)
|
|
10
|
+
return path;
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function getNodeDegrees(graph, nodeId) {
|
|
18
|
+
if (!graph.hasNode(nodeId))
|
|
19
|
+
return { in: 0, out: 0 };
|
|
20
|
+
return {
|
|
21
|
+
in: graph.inDegree ? graph.inDegree(nodeId) : 0,
|
|
22
|
+
out: graph.outDegree ? graph.outDegree(nodeId) : 0,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../../src/graph/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,UAAU,eAAe,CAC7B,EAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,QAAQ,GAAG,CAAC;IAEZ,MAAM,KAAK,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACtD,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,MAAc;IACzD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IACrD,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MonographNode, MonographEdge } from '../types.js';
|
|
2
|
+
export interface GraphSnapshot {
|
|
3
|
+
nodes: MonographNode[];
|
|
4
|
+
edges: MonographEdge[];
|
|
5
|
+
capturedAt: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GraphDiff {
|
|
8
|
+
newNodes: MonographNode[];
|
|
9
|
+
removedNodes: MonographNode[];
|
|
10
|
+
newEdges: MonographEdge[];
|
|
11
|
+
removedEdges: MonographEdge[];
|
|
12
|
+
modifiedNodes: Array<{
|
|
13
|
+
before: MonographNode;
|
|
14
|
+
after: MonographNode;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export declare function diffSnapshots(before: GraphSnapshot, after: GraphSnapshot): GraphDiff;
|
|
18
|
+
export declare function snapshotFromDb(db: import('../storage/db.js').MonographDb): GraphSnapshot;
|
|
19
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/graph/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,aAAa,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;CACvE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,CAgBpF;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,kBAAkB,EAAE,WAAW,GAAG,aAAa,CA8BxF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export function diffSnapshots(before, after) {
|
|
2
|
+
const beforeNodeIds = new Map(before.nodes.map(n => [n.id, n]));
|
|
3
|
+
const afterNodeIds = new Map(after.nodes.map(n => [n.id, n]));
|
|
4
|
+
const beforeEdgeIds = new Set(before.edges.map(e => e.id));
|
|
5
|
+
const afterEdgeIds = new Set(after.edges.map(e => e.id));
|
|
6
|
+
return {
|
|
7
|
+
newNodes: after.nodes.filter(n => !beforeNodeIds.has(n.id)),
|
|
8
|
+
removedNodes: before.nodes.filter(n => !afterNodeIds.has(n.id)),
|
|
9
|
+
newEdges: after.edges.filter(e => !beforeEdgeIds.has(e.id)),
|
|
10
|
+
removedEdges: before.edges.filter(e => !afterEdgeIds.has(e.id)),
|
|
11
|
+
modifiedNodes: after.nodes
|
|
12
|
+
.filter(n => beforeNodeIds.has(n.id))
|
|
13
|
+
.filter(n => JSON.stringify(n) !== JSON.stringify(beforeNodeIds.get(n.id)))
|
|
14
|
+
.map(n => ({ before: beforeNodeIds.get(n.id), after: n })),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function snapshotFromDb(db) {
|
|
18
|
+
const rawNodes = db.prepare(`
|
|
19
|
+
SELECT id, label, name,
|
|
20
|
+
norm_label AS normLabel,
|
|
21
|
+
file_path AS filePath,
|
|
22
|
+
start_line AS startLine,
|
|
23
|
+
end_line AS endLine,
|
|
24
|
+
community_id AS communityId,
|
|
25
|
+
is_exported AS isExported,
|
|
26
|
+
language, properties
|
|
27
|
+
FROM nodes
|
|
28
|
+
`).all();
|
|
29
|
+
const rawEdges = db.prepare(`
|
|
30
|
+
SELECT id,
|
|
31
|
+
source_id AS sourceId,
|
|
32
|
+
target_id AS targetId,
|
|
33
|
+
relation, confidence,
|
|
34
|
+
confidence_score AS confidenceScore
|
|
35
|
+
FROM edges
|
|
36
|
+
`).all();
|
|
37
|
+
const nodes = rawNodes.map(r => ({
|
|
38
|
+
...r,
|
|
39
|
+
isExported: Boolean(r['isExported']),
|
|
40
|
+
}));
|
|
41
|
+
const edges = rawEdges;
|
|
42
|
+
return { nodes, edges, capturedAt: new Date().toISOString() };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/graph/diff.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,aAAa,CAAC,MAAqB,EAAE,KAAoB;IACvE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;I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AAG,CAAC,CAAC,CAAC,EAAE,CAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;KAC9D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAA0C;IACvE,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC;;;;;;;;;;GAU3B,CAAC,CAAC,GAAG,EAAoC,CAAC;IAE3C,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC;;;;;;;GAO3B,CAAC,CAAC,GAAG,EAAoC,CAAC;IAE3C,MAAM,KAAK,GAAoB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAChD,GAAG,CAAC;QACJ,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;KACnB,CAAA,CAAC,CAAC;IAErB,MAAM,KAAK,GAAG,QAAsC,CAAC;IAErD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Graph from 'graphology';
|
|
2
|
+
import type { MonographEdge } from '../types.js';
|
|
3
|
+
export declare function loadGraphFromEdges(edges: MonographEdge[]): Graph;
|
|
4
|
+
export declare function loadGraphFromDb(db: import('../storage/db.js').MonographDb): Graph;
|
|
5
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/graph/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,KAAK,CAahE;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,kBAAkB,EAAE,WAAW,GAAG,KAAK,CAsBjF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Graph from 'graphology';
|
|
2
|
+
export function loadGraphFromEdges(edges) {
|
|
3
|
+
const graph = new Graph({ multi: true, type: 'directed' });
|
|
4
|
+
for (const edge of edges) {
|
|
5
|
+
if (!graph.hasNode(edge.sourceId))
|
|
6
|
+
graph.addNode(edge.sourceId);
|
|
7
|
+
if (!graph.hasNode(edge.targetId))
|
|
8
|
+
graph.addNode(edge.targetId);
|
|
9
|
+
try {
|
|
10
|
+
graph.addEdge(edge.sourceId, edge.targetId, {
|
|
11
|
+
id: edge.id, relation: edge.relation,
|
|
12
|
+
confidence: edge.confidence, confidenceScore: edge.confidenceScore,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
catch { /* duplicate edge */ }
|
|
16
|
+
}
|
|
17
|
+
return graph;
|
|
18
|
+
}
|
|
19
|
+
export function loadGraphFromDb(db) {
|
|
20
|
+
const nodes = db.prepare('SELECT id FROM nodes').all();
|
|
21
|
+
const edges = db.prepare('SELECT * FROM edges').all();
|
|
22
|
+
const graph = new Graph({ multi: true, type: 'directed' });
|
|
23
|
+
for (const n of nodes) {
|
|
24
|
+
if (!graph.hasNode(n.id))
|
|
25
|
+
graph.addNode(n.id);
|
|
26
|
+
}
|
|
27
|
+
for (const e of edges) {
|
|
28
|
+
if (!graph.hasNode(e.source_id))
|
|
29
|
+
graph.addNode(e.source_id);
|
|
30
|
+
if (!graph.hasNode(e.target_id))
|
|
31
|
+
graph.addNode(e.target_id);
|
|
32
|
+
try {
|
|
33
|
+
graph.addEdge(e.source_id, e.target_id, {
|
|
34
|
+
id: e.id, relation: e.relation,
|
|
35
|
+
confidence: e.confidence, confidenceScore: e.confidence_score,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch { /* skip */ }
|
|
39
|
+
}
|
|
40
|
+
return graph;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0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,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAC3D,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC;YACH,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE;gBACtC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBAC9B,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC,gBAAgB;aAC9D,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './storage/db.js';
|
|
3
|
+
export * from './storage/node-store.js';
|
|
4
|
+
export * from './storage/edge-store.js';
|
|
5
|
+
export * from './storage/fts-store.js';
|
|
6
|
+
export * from './pipeline/runner.js';
|
|
7
|
+
export * from './pipeline/types.js';
|
|
8
|
+
export * from './pipeline/orchestrator.js';
|
|
9
|
+
export * from './graph/loader.js';
|
|
10
|
+
export * from './graph/analyzer.js';
|
|
11
|
+
export * from './graph/diff.js';
|
|
12
|
+
export * from './watch/watcher.js';
|
|
13
|
+
export * from './export/json.js';
|
|
14
|
+
export * from './export/html.js';
|
|
15
|
+
export * from './export/cypher.js';
|
|
16
|
+
export * from './export/graphml.js';
|
|
17
|
+
export * from './export/svg.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './storage/db.js';
|
|
3
|
+
export * from './storage/node-store.js';
|
|
4
|
+
export * from './storage/edge-store.js';
|
|
5
|
+
export * from './storage/fts-store.js';
|
|
6
|
+
export * from './pipeline/runner.js';
|
|
7
|
+
export * from './pipeline/types.js';
|
|
8
|
+
export * from './pipeline/orchestrator.js';
|
|
9
|
+
export * from './graph/loader.js';
|
|
10
|
+
export * from './graph/analyzer.js';
|
|
11
|
+
export * from './graph/diff.js';
|
|
12
|
+
export * from './watch/watcher.js';
|
|
13
|
+
export * from './export/json.js';
|
|
14
|
+
export * from './export/html.js';
|
|
15
|
+
export * from './export/cypher.js';
|
|
16
|
+
export * from './export/graphml.js';
|
|
17
|
+
export * from './export/svg.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MCPResource {
|
|
2
|
+
uri: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
handler: (uri: string) => Promise<{
|
|
7
|
+
content: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare const monographResources: MCPResource[];
|
|
11
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/mcp/resources.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD;AAYD,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAkD3C,CAAC"}
|