@archaic-ai/mcp 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/build/db/client.d.ts +1 -0
- package/build/db/client.js +18 -0
- package/build/db/client.js.map +1 -0
- package/build/db/repositories.d.ts +3 -0
- package/build/db/repositories.js +15 -0
- package/build/db/repositories.js.map +1 -0
- package/build/db/workspaces.d.ts +3 -0
- package/build/db/workspaces.js +15 -0
- package/build/db/workspaces.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +20 -0
- package/build/index.js.map +1 -0
- package/build/render/architecture.d.ts +3 -0
- package/build/render/architecture.js +361 -0
- package/build/render/architecture.js.map +1 -0
- package/build/render/codemap.d.ts +2 -0
- package/build/render/codemap.js +200 -0
- package/build/render/codemap.js.map +1 -0
- package/build/render/open.d.ts +1 -0
- package/build/render/open.js +16 -0
- package/build/render/open.js.map +1 -0
- package/build/render/traces.d.ts +2 -0
- package/build/render/traces.js +147 -0
- package/build/render/traces.js.map +1 -0
- package/build/render/workflows.d.ts +3 -0
- package/build/render/workflows.js +177 -0
- package/build/render/workflows.js.map +1 -0
- package/build/summary/architecture.d.ts +3 -0
- package/build/summary/architecture.js +74 -0
- package/build/summary/architecture.js.map +1 -0
- package/build/summary/codemap.d.ts +2 -0
- package/build/summary/codemap.js +46 -0
- package/build/summary/codemap.js.map +1 -0
- package/build/summary/traces.d.ts +2 -0
- package/build/summary/traces.js +42 -0
- package/build/summary/traces.js.map +1 -0
- package/build/summary/workflows.d.ts +3 -0
- package/build/summary/workflows.js +29 -0
- package/build/summary/workflows.js.map +1 -0
- package/build/tools/repos.d.ts +2 -0
- package/build/tools/repos.js +93 -0
- package/build/tools/repos.js.map +1 -0
- package/build/tools/workspaces.d.ts +2 -0
- package/build/tools/workspaces.js +50 -0
- package/build/tools/workspaces.js.map +1 -0
- package/build/types.d.ts +238 -0
- package/build/types.js +4 -0
- package/build/types.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export function summarizeArchitecture(data, repoName) {
|
|
2
|
+
const lines = [];
|
|
3
|
+
lines.push(`Architecture: ${repoName}`);
|
|
4
|
+
lines.push(`Type: ${data.repoType}`);
|
|
5
|
+
lines.push(`Nodes: ${data.nodes.length}, Edges: ${data.edges.length}, Groups: ${data.groups.length}`);
|
|
6
|
+
if (data.detectedServices.length > 0) {
|
|
7
|
+
lines.push(`Services: ${data.detectedServices.join(", ")}`);
|
|
8
|
+
}
|
|
9
|
+
if (data.detectedInfrastructure.length > 0) {
|
|
10
|
+
lines.push(`Infrastructure: ${data.detectedInfrastructure.join(", ")}`);
|
|
11
|
+
}
|
|
12
|
+
// Group node counts by kind
|
|
13
|
+
const kindCounts = {};
|
|
14
|
+
for (const node of data.nodes) {
|
|
15
|
+
kindCounts[node.kind] = (kindCounts[node.kind] ?? 0) + 1;
|
|
16
|
+
}
|
|
17
|
+
const kindSummary = Object.entries(kindCounts)
|
|
18
|
+
.sort((a, b) => b[1] - a[1])
|
|
19
|
+
.map(([kind, count]) => `${kind}(${count})`)
|
|
20
|
+
.join(", ");
|
|
21
|
+
lines.push(`Node kinds: ${kindSummary}`);
|
|
22
|
+
// Top connected nodes
|
|
23
|
+
const connCount = {};
|
|
24
|
+
for (const edge of data.edges) {
|
|
25
|
+
connCount[edge.source] = (connCount[edge.source] ?? 0) + 1;
|
|
26
|
+
connCount[edge.target] = (connCount[edge.target] ?? 0) + 1;
|
|
27
|
+
}
|
|
28
|
+
const topNodes = Object.entries(connCount)
|
|
29
|
+
.sort((a, b) => b[1] - a[1])
|
|
30
|
+
.slice(0, 5)
|
|
31
|
+
.map(([id, count]) => {
|
|
32
|
+
const node = data.nodes.find(n => n.id === id);
|
|
33
|
+
return `${node?.name ?? id}(${count})`;
|
|
34
|
+
});
|
|
35
|
+
if (topNodes.length > 0) {
|
|
36
|
+
lines.push(`Most connected: ${topNodes.join(", ")}`);
|
|
37
|
+
}
|
|
38
|
+
if (data.groups.length > 0) {
|
|
39
|
+
lines.push(`Groups: ${data.groups.map(g => g.name).join(", ")}`);
|
|
40
|
+
}
|
|
41
|
+
lines.push(`Analyzed: ${data.analyzedAt?.split("T")[0] ?? "—"}`);
|
|
42
|
+
return lines.join("\n");
|
|
43
|
+
}
|
|
44
|
+
export function summarizeCrossRepoArchitecture(data, workspaceName) {
|
|
45
|
+
const lines = [];
|
|
46
|
+
lines.push(`Cross-Repo Architecture: ${workspaceName}`);
|
|
47
|
+
lines.push(`Nodes: ${data.nodes.length}, Edges: ${data.edges.length}`);
|
|
48
|
+
const crossRepoEdges = data.edges.filter(e => e.isCrossRepo);
|
|
49
|
+
lines.push(`Cross-repo edges: ${crossRepoEdges.length}`);
|
|
50
|
+
// Repos involved
|
|
51
|
+
const repos = [...new Set(data.nodes.map(n => n.repoName))];
|
|
52
|
+
lines.push(`Repos: ${repos.join(", ")}`);
|
|
53
|
+
if (data.sharedResources.length > 0) {
|
|
54
|
+
lines.push(`Shared resources: ${data.sharedResources.map(r => `${r.name}(${r.type})`).join(", ")}`);
|
|
55
|
+
}
|
|
56
|
+
if (data.crossRepoConnections.length > 0) {
|
|
57
|
+
lines.push("Connections:");
|
|
58
|
+
for (const conn of data.crossRepoConnections) {
|
|
59
|
+
lines.push(` ${conn.sourceRepo} → ${conn.targetRepo}: ${conn.connectionType} — ${conn.description}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (data.systemOverview) {
|
|
63
|
+
lines.push(`System type: ${data.systemOverview.systemType}`);
|
|
64
|
+
if (data.systemOverview.detectedServices.length > 0) {
|
|
65
|
+
lines.push(`Services: ${data.systemOverview.detectedServices.join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
for (const repo of data.systemOverview.repoSummaries) {
|
|
68
|
+
lines.push(` ${repo.repoName}: ${repo.role} [${repo.techStack.join(", ")}]`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
lines.push(`Analyzed: ${data.analyzedAt?.split("T")[0] ?? "—"}`);
|
|
72
|
+
return lines.join("\n");
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=architecture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../src/summary/architecture.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,IAA0B,EAAE,QAAgB;IAChF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrC,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,YAAY,IAAI,CAAC,KAAK,CAAC,MAAM,aAAa,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAEtG,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,mBAAmB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,4BAA4B;IAC5B,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,C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,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IACjE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export function summarizeCodeMap(data) {
|
|
2
|
+
const lines = [];
|
|
3
|
+
lines.push(`Code Map: ${data.functions.length} functions, ${data.dependencies.length} dependencies`);
|
|
4
|
+
// Kind distribution
|
|
5
|
+
const kindCounts = {};
|
|
6
|
+
for (const fn of data.functions) {
|
|
7
|
+
kindCounts[fn.kind] = (kindCounts[fn.kind] ?? 0) + 1;
|
|
8
|
+
}
|
|
9
|
+
const kindSummary = Object.entries(kindCounts)
|
|
10
|
+
.sort((a, b) => b[1] - a[1])
|
|
11
|
+
.map(([kind, count]) => `${kind}(${count})`)
|
|
12
|
+
.join(", ");
|
|
13
|
+
lines.push(`Kinds: ${kindSummary}`);
|
|
14
|
+
// Dependency type distribution
|
|
15
|
+
const depTypeCounts = {};
|
|
16
|
+
for (const dep of data.dependencies) {
|
|
17
|
+
depTypeCounts[dep.type] = (depTypeCounts[dep.type] ?? 0) + 1;
|
|
18
|
+
}
|
|
19
|
+
const depSummary = Object.entries(depTypeCounts)
|
|
20
|
+
.sort((a, b) => b[1] - a[1])
|
|
21
|
+
.map(([type, count]) => `${type}(${count})`)
|
|
22
|
+
.join(", ");
|
|
23
|
+
lines.push(`Dependency types: ${depSummary}`);
|
|
24
|
+
// Most connected functions
|
|
25
|
+
const connCount = {};
|
|
26
|
+
for (const dep of data.dependencies) {
|
|
27
|
+
connCount[dep.source] = (connCount[dep.source] ?? 0) + 1;
|
|
28
|
+
connCount[dep.target] = (connCount[dep.target] ?? 0) + 1;
|
|
29
|
+
}
|
|
30
|
+
const topFns = Object.entries(connCount)
|
|
31
|
+
.sort((a, b) => b[1] - a[1])
|
|
32
|
+
.slice(0, 8)
|
|
33
|
+
.map(([id, count]) => {
|
|
34
|
+
const fn = data.functions.find(f => f.id === id);
|
|
35
|
+
return `${fn?.name ?? id}(${count})`;
|
|
36
|
+
});
|
|
37
|
+
if (topFns.length > 0) {
|
|
38
|
+
lines.push(`Most connected: ${topFns.join(", ")}`);
|
|
39
|
+
}
|
|
40
|
+
// File distribution
|
|
41
|
+
const files = [...new Set(data.functions.map(f => f.filePath))];
|
|
42
|
+
lines.push(`Files: ${files.length}`);
|
|
43
|
+
lines.push(`Analyzed: ${data.analyzedAt?.split("T")[0] ?? "—"}`);
|
|
44
|
+
return lines.join("\n");
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=codemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemap.js","sourceRoot":"","sources":["../../src/summary/codemap.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,MAAM,eAAe,IAAI,CAAC,YAAY,CAAC,MAAM,eAAe,CAAC,CAAC;IAErG,oBAAoB;IACpB,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;SAC3C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,C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|
+
let maxDepth = depth;
|
|
3
|
+
for (const entry of entries) {
|
|
4
|
+
if (entry.children) {
|
|
5
|
+
maxDepth = Math.max(maxDepth, countDepth(entry.children, depth + 1));
|
|
6
|
+
}
|
|
7
|
+
if (entry.branches) {
|
|
8
|
+
for (const branch of entry.branches) {
|
|
9
|
+
maxDepth = Math.max(maxDepth, countDepth(branch.children, depth + 1));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return maxDepth;
|
|
14
|
+
}
|
|
15
|
+
function countNodes(entries) {
|
|
16
|
+
let count = entries.length;
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
if (entry.children)
|
|
19
|
+
count += countNodes(entry.children);
|
|
20
|
+
if (entry.branches) {
|
|
21
|
+
for (const branch of entry.branches) {
|
|
22
|
+
count += countNodes(branch.children);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return count;
|
|
27
|
+
}
|
|
28
|
+
export function summarizeTraces(traces) {
|
|
29
|
+
const lines = [];
|
|
30
|
+
lines.push(`Deep Dive Traces: ${traces.length}`);
|
|
31
|
+
for (const trace of traces) {
|
|
32
|
+
const depth = countDepth(trace.root, 1);
|
|
33
|
+
const nodeCount = countNodes(trace.root);
|
|
34
|
+
lines.push(`\n• ${trace.name}`);
|
|
35
|
+
lines.push(` Category: ${trace.category}`);
|
|
36
|
+
lines.push(` Entry point: ${trace.entryPoint}`);
|
|
37
|
+
lines.push(` Description: ${trace.description}`);
|
|
38
|
+
lines.push(` Depth: ${depth}, Nodes: ${nodeCount}`);
|
|
39
|
+
}
|
|
40
|
+
return lines.join("\n");
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=traces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traces.js","sourceRoot":"","sources":["../../src/summary/traces.ts"],"names":[],"mappings":"AAEA,SAAS,UAAU,CAAC,OAAqB,EAAE,KAAa;IACtD,IAAI,QAAQ,GA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,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACxC,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,eAAe,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,kBAAkB,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,kBAAkB,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,YAAY,SAAS,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function summarizeWorkflows(workflows) {
|
|
2
|
+
const lines = [];
|
|
3
|
+
lines.push(`Execution Flows: ${workflows.length}`);
|
|
4
|
+
for (const flow of workflows) {
|
|
5
|
+
const totalSteps = flow.phases.reduce((sum, p) => sum + p.steps.length, 0);
|
|
6
|
+
lines.push(`\n• ${flow.name}`);
|
|
7
|
+
lines.push(` Trigger: ${flow.trigger}`);
|
|
8
|
+
lines.push(` Phases: ${flow.phases.length}, Steps: ${totalSteps}`);
|
|
9
|
+
// List phase names
|
|
10
|
+
for (const phase of flow.phases) {
|
|
11
|
+
const stepKinds = phase.steps.map(s => s.kind).join(", ");
|
|
12
|
+
lines.push(` ${phase.label ? `Phase "${phase.label}"` : "Phase"}: ${phase.steps.length} steps [${stepKinds}]`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return lines.join("\n");
|
|
16
|
+
}
|
|
17
|
+
export function summarizeCrossRepoWorkflows(workflows) {
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(`Cross-Repo Workflows: ${workflows.length}`);
|
|
20
|
+
for (const flow of workflows) {
|
|
21
|
+
const totalSteps = flow.phases.reduce((sum, p) => sum + p.steps.length, 0);
|
|
22
|
+
lines.push(`\n• ${flow.name}`);
|
|
23
|
+
lines.push(` Trigger: ${flow.trigger}`);
|
|
24
|
+
lines.push(` Repos: ${flow.involvedRepos.join(", ")}`);
|
|
25
|
+
lines.push(` Phases: ${flow.phases.length}, Steps: ${totalSteps}`);
|
|
26
|
+
}
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/summary/workflows.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,SAAyB;IAC1D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,oBAAoB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3E,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,MAAM,YAAY,UAAU,EAAE,CAAC,CAAC;QAEpE,mBAAmB;QACnB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAA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UserId, getRepositoryById } from "../db/repositories.js";
|
|
3
|
+
import { renderArchitectureHtml } from "../render/architecture.js";
|
|
4
|
+
import { renderWorkflowsHtml } from "../render/workflows.js";
|
|
5
|
+
import { renderTracesHtml } from "../render/traces.js";
|
|
6
|
+
import { renderCodeMapHtml } from "../render/codemap.js";
|
|
7
|
+
import { openHtml } from "../render/open.js";
|
|
8
|
+
import { summarizeArchitecture } from "../summary/architecture.js";
|
|
9
|
+
import { summarizeWorkflows } from "../summary/workflows.js";
|
|
10
|
+
import { summarizeTraces } from "../summary/traces.js";
|
|
11
|
+
import { summarizeCodeMap } from "../summary/codemap.js";
|
|
12
|
+
export function registerRepoTools(server) {
|
|
13
|
+
server.tool("list_repos", "List all repositories the user has added to Archaic, with their analysis status. Use this when the user asks about their repos, architecture, or code analysis.", {}, async () => {
|
|
14
|
+
const repos = await getRepositoriesByUserId();
|
|
15
|
+
if (repos.length === 0) {
|
|
16
|
+
return { content: [{ type: "text", text: "No repositories found." }] };
|
|
17
|
+
}
|
|
18
|
+
const lines = repos.map((r) => {
|
|
19
|
+
const parts = [`${r.fullName} (${r.status})`];
|
|
20
|
+
if (r.architectureData)
|
|
21
|
+
parts.push("[architecture]");
|
|
22
|
+
if (r.codeMapData)
|
|
23
|
+
parts.push("[codemap]");
|
|
24
|
+
if (r.architectureData?.workflows?.length)
|
|
25
|
+
parts.push("[workflows]");
|
|
26
|
+
if (r.architectureData?.traces?.length)
|
|
27
|
+
parts.push("[traces]");
|
|
28
|
+
if (r.lastAnalyzedAt)
|
|
29
|
+
parts.push(`analyzed: ${r.lastAnalyzedAt.split("T")[0]}`);
|
|
30
|
+
parts.push(`id: ${r.id}`);
|
|
31
|
+
return parts.join(" ");
|
|
32
|
+
});
|
|
33
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
34
|
+
});
|
|
35
|
+
server.tool("get_architecture", "Show the architecture diagram for a repository. Opens an interactive D3 force-directed graph in the browser and returns a text summary.", { repoId: z.string().describe("Repository ID") }, async ({ repoId }) => {
|
|
36
|
+
const repo = await getRepositoryById(repoId);
|
|
37
|
+
if (!repo) {
|
|
38
|
+
return { content: [{ type: "text", text: `Repository ${repoId} not found.` }], isError: true };
|
|
39
|
+
}
|
|
40
|
+
if (!repo.architectureData) {
|
|
41
|
+
return { content: [{ type: "text", text: `No architecture data for ${repo.fullName}. Run analysis first.` }], isError: true };
|
|
42
|
+
}
|
|
43
|
+
const html = renderArchitectureHtml(repo.architectureData, repo.fullName);
|
|
44
|
+
const filePath = await openHtml(html, `arch-${repo.name}`);
|
|
45
|
+
const summary = summarizeArchitecture(repo.architectureData, repo.fullName);
|
|
46
|
+
return { content: [{ type: "text", text: `Opened architecture diagram at ${filePath}\n\n${summary}` }] };
|
|
47
|
+
});
|
|
48
|
+
server.tool("get_execution_flows", "Show execution flow diagrams for a repository. Opens a vertical timeline visualization in the browser and returns a text summary.", { repoId: z.string().describe("Repository ID") }, async ({ repoId }) => {
|
|
49
|
+
const repo = await getRepositoryById(repoId);
|
|
50
|
+
if (!repo) {
|
|
51
|
+
return { content: [{ type: "text", text: `Repository ${repoId} not found.` }], isError: true };
|
|
52
|
+
}
|
|
53
|
+
if (!repo.architectureData?.workflows?.length) {
|
|
54
|
+
return { content: [{ type: "text", text: `No execution flows for ${repo.fullName}. Run architecture analysis first.` }], isError: true };
|
|
55
|
+
}
|
|
56
|
+
const workflows = repo.architectureData.workflows;
|
|
57
|
+
const html = renderWorkflowsHtml(workflows, repo.fullName);
|
|
58
|
+
const filePath = await openHtml(html, `flows-${repo.name}`);
|
|
59
|
+
const summary = summarizeWorkflows(workflows);
|
|
60
|
+
return { content: [{ type: "text", text: `Opened execution flows at ${filePath}\n\n${summary}` }] };
|
|
61
|
+
});
|
|
62
|
+
server.tool("get_deep_dive", "Show deep-dive trace trees for a repository. Opens a collapsible tree visualization in the browser and returns a text summary.", {
|
|
63
|
+
repoId: z.string().describe("Repository ID"),
|
|
64
|
+
traceId: z.string().optional().describe("Specific trace ID to focus on (optional)"),
|
|
65
|
+
}, async ({ repoId, traceId }) => {
|
|
66
|
+
const repo = await getRepositoryById(repoId);
|
|
67
|
+
if (!repo) {
|
|
68
|
+
return { content: [{ type: "text", text: `Repository ${repoId} not found.` }], isError: true };
|
|
69
|
+
}
|
|
70
|
+
if (!repo.architectureData?.traces?.length) {
|
|
71
|
+
return { content: [{ type: "text", text: `No deep-dive traces for ${repo.fullName}. Run architecture analysis first.` }], isError: true };
|
|
72
|
+
}
|
|
73
|
+
const traces = repo.architectureData.traces;
|
|
74
|
+
const html = renderTracesHtml(traces, repo.fullName, traceId);
|
|
75
|
+
const filePath = await openHtml(html, `traces-${repo.name}`);
|
|
76
|
+
const summary = summarizeTraces(traces);
|
|
77
|
+
return { content: [{ type: "text", text: `Opened deep-dive traces at ${filePath}\n\n${summary}` }] };
|
|
78
|
+
});
|
|
79
|
+
server.tool("get_code_map", "Show the code map (function dependency graph) for a repository. Opens an interactive D3 force-directed graph in the browser and returns a text summary.", { repoId: z.string().describe("Repository ID") }, async ({ repoId }) => {
|
|
80
|
+
const repo = await getRepositoryById(repoId);
|
|
81
|
+
if (!repo) {
|
|
82
|
+
return { content: [{ type: "text", text: `Repository ${repoId} not found.` }], isError: true };
|
|
83
|
+
}
|
|
84
|
+
if (!repo.codeMapData) {
|
|
85
|
+
return { content: [{ type: "text", text: `No code map data for ${repo.fullName}. Run code map analysis first.` }], isError: true };
|
|
86
|
+
}
|
|
87
|
+
const html = renderCodeMapHtml(repo.codeMapData, repo.fullName);
|
|
88
|
+
const filePath = await openHtml(html, `codemap-${repo.name}`);
|
|
89
|
+
const summary = summarizeCodeMap(repo.codeMapData);
|
|
90
|
+
return { content: [{ type: "text", text: `Opened code map at ${filePath}\n\n${summary}` }] };
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=repos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repos.js","sourceRoot":"","sources":["../../src/tools/repos.ts"],"names":[],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;QAED,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEnD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,QAAQ,OAAO,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC;IAC/F,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getWorkspacesByUserId, getWorkspaceById } from "../db/workspaces.js";
|
|
3
|
+
import { renderCrossRepoArchitectureHtml } from "../render/architecture.js";
|
|
4
|
+
import { renderCrossRepoWorkflowsHtml } from "../render/workflows.js";
|
|
5
|
+
import { openHtml } from "../render/open.js";
|
|
6
|
+
import { summarizeCrossRepoArchitecture } from "../summary/architecture.js";
|
|
7
|
+
import { summarizeCrossRepoWorkflows } from "../summary/workflows.js";
|
|
8
|
+
export function registerWorkspaceTools(server) {
|
|
9
|
+
server.tool("list_workspaces", "List all workspaces (cross-repo analysis groups) for the current user", {}, async () => {
|
|
10
|
+
const workspaces = await getWorkspacesByUserId();
|
|
11
|
+
if (workspaces.length === 0) {
|
|
12
|
+
return { content: [{ type: "text", text: "No workspaces found." }] };
|
|
13
|
+
}
|
|
14
|
+
const lines = workspaces.map((w) => {
|
|
15
|
+
const parts = [`${w.name} (${w.repoIds.length} repos)`];
|
|
16
|
+
if (w.architectureData)
|
|
17
|
+
parts.push("[architecture]");
|
|
18
|
+
if (w.architectureData?.workflows?.length)
|
|
19
|
+
parts.push("[workflows]");
|
|
20
|
+
parts.push(`id: ${w.id}`);
|
|
21
|
+
return parts.join(" ");
|
|
22
|
+
});
|
|
23
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
24
|
+
});
|
|
25
|
+
server.tool("get_workspace_architecture", "Show the cross-repo architecture diagram for a workspace. Opens an interactive diagram with shared resources and cross-repo connections in the browser, and returns a text summary.", { workspaceId: z.string().describe("Workspace ID") }, async ({ workspaceId }) => {
|
|
26
|
+
const workspace = await getWorkspaceById(workspaceId);
|
|
27
|
+
if (!workspace) {
|
|
28
|
+
return { content: [{ type: "text", text: `Workspace ${workspaceId} not found.` }], isError: true };
|
|
29
|
+
}
|
|
30
|
+
if (!workspace.architectureData) {
|
|
31
|
+
return { content: [{ type: "text", text: `No architecture data for workspace "${workspace.name}". Run workspace analysis first.` }], isError: true };
|
|
32
|
+
}
|
|
33
|
+
const data = workspace.architectureData;
|
|
34
|
+
const results = [];
|
|
35
|
+
// Architecture diagram
|
|
36
|
+
const archHtml = renderCrossRepoArchitectureHtml(data, workspace.name);
|
|
37
|
+
const archPath = await openHtml(archHtml, `workspace-arch-${workspace.name.replace(/\s+/g, "-")}`);
|
|
38
|
+
const archSummary = summarizeCrossRepoArchitecture(data, workspace.name);
|
|
39
|
+
results.push({ type: "text", text: `Opened cross-repo architecture diagram at ${archPath}\n\n${archSummary}` });
|
|
40
|
+
// If workflows exist, also generate workflow page
|
|
41
|
+
if (data.workflows?.length) {
|
|
42
|
+
const wfHtml = renderCrossRepoWorkflowsHtml(data.workflows, workspace.name);
|
|
43
|
+
const wfPath = await openHtml(wfHtml, `workspace-flows-${workspace.name.replace(/\s+/g, "-")}`);
|
|
44
|
+
const wfSummary = summarizeCrossRepoWorkflows(data.workflows);
|
|
45
|
+
results.push({ type: "text", text: `\nOpened cross-repo workflows at ${wfPath}\n\n${wfSummary}` });
|
|
46
|
+
}
|
|
47
|
+
return { content: results };
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=workspaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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CAAC,CAAC;QACnG,MAAM,WAAW,GAAG,8BAA8B,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6CAA6C,QAAQ,OAAO,WAAW,EAAE,EAAE,CAAC,CAAC;QAEhH,kDAAkD;QAClD,IAAI,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,4BAA4B,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5E,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,mBAAmB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;YAChG,MAAM,SAAS,GAAG,2BAA2B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC,MAAM,OAAO,SAAS,EAAE,EAAE,CAAC,CAAC;QACrG,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
export interface AnalysisData {
|
|
2
|
+
stars: number;
|
|
3
|
+
forks: number;
|
|
4
|
+
openIssues: number;
|
|
5
|
+
sizeKb: number;
|
|
6
|
+
topics: string[];
|
|
7
|
+
description: string | null;
|
|
8
|
+
isPrivate: boolean;
|
|
9
|
+
htmlUrl: string;
|
|
10
|
+
languages: Record<string, number>;
|
|
11
|
+
analyzedAt: string;
|
|
12
|
+
commitSha?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ArchitectureNode {
|
|
15
|
+
id: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
technology?: string;
|
|
20
|
+
group?: string;
|
|
21
|
+
position?: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
filePaths?: string[];
|
|
26
|
+
filePatterns?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface ArchitectureEdge {
|
|
29
|
+
id: string;
|
|
30
|
+
source: string;
|
|
31
|
+
target: string;
|
|
32
|
+
type: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ArchitectureGroup {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
}
|
|
39
|
+
export interface FileTreeEntry {
|
|
40
|
+
path: string;
|
|
41
|
+
type: "blob" | "tree";
|
|
42
|
+
size?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface WorkflowStep {
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
kind: string;
|
|
49
|
+
filePaths?: string[];
|
|
50
|
+
functions?: string[];
|
|
51
|
+
packages?: string[];
|
|
52
|
+
technology?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface WorkflowPhase {
|
|
55
|
+
id: string;
|
|
56
|
+
label?: string;
|
|
57
|
+
steps: WorkflowStep[];
|
|
58
|
+
}
|
|
59
|
+
export interface WorkflowFlow {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
trigger: string;
|
|
63
|
+
phases: WorkflowPhase[];
|
|
64
|
+
}
|
|
65
|
+
export interface TraceEntry {
|
|
66
|
+
id: string;
|
|
67
|
+
label: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
kind: string;
|
|
70
|
+
filePath?: string;
|
|
71
|
+
functions?: string[];
|
|
72
|
+
packages?: string[];
|
|
73
|
+
returnValue?: string;
|
|
74
|
+
children?: TraceEntry[];
|
|
75
|
+
branches?: TraceBranch[];
|
|
76
|
+
}
|
|
77
|
+
export interface TraceBranch {
|
|
78
|
+
label: string;
|
|
79
|
+
outcome: "success" | "error" | "fallback";
|
|
80
|
+
children: TraceEntry[];
|
|
81
|
+
}
|
|
82
|
+
export interface DeepDiveTrace {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
entryPoint: string;
|
|
86
|
+
description: string;
|
|
87
|
+
category: string;
|
|
88
|
+
root: TraceEntry[];
|
|
89
|
+
}
|
|
90
|
+
export interface ArchitectureAnalysis {
|
|
91
|
+
repoType: string;
|
|
92
|
+
nodes: ArchitectureNode[];
|
|
93
|
+
edges: ArchitectureEdge[];
|
|
94
|
+
groups: ArchitectureGroup[];
|
|
95
|
+
detectedServices: string[];
|
|
96
|
+
detectedInfrastructure: string[];
|
|
97
|
+
fileTree: FileTreeEntry[];
|
|
98
|
+
workflows?: WorkflowFlow[];
|
|
99
|
+
traces?: DeepDiveTrace[];
|
|
100
|
+
analyzedAt: string;
|
|
101
|
+
commitSha?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface CodeMapFunction {
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
filePath: string;
|
|
107
|
+
line?: number;
|
|
108
|
+
kind: "function" | "method" | "component" | "hook" | "handler" | "class" | "module";
|
|
109
|
+
}
|
|
110
|
+
export interface CodeMapDependency {
|
|
111
|
+
id: string;
|
|
112
|
+
source: string;
|
|
113
|
+
target: string;
|
|
114
|
+
type: "calls" | "imports" | "extends" | "implements" | "uses" | "emits" | "subscribes";
|
|
115
|
+
label?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface CodeMapAnalysis {
|
|
118
|
+
functions: CodeMapFunction[];
|
|
119
|
+
dependencies: CodeMapDependency[];
|
|
120
|
+
analyzedAt: string;
|
|
121
|
+
commitSha?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface Repository {
|
|
124
|
+
id: string;
|
|
125
|
+
userId: string;
|
|
126
|
+
name: string;
|
|
127
|
+
fullName: string;
|
|
128
|
+
defaultBranch: string;
|
|
129
|
+
status: "active" | "pending" | "error";
|
|
130
|
+
lastAnalyzedAt?: string;
|
|
131
|
+
analysisData?: AnalysisData;
|
|
132
|
+
architectureData?: ArchitectureAnalysis;
|
|
133
|
+
codeMapData?: CodeMapAnalysis;
|
|
134
|
+
latestCommitSha?: string;
|
|
135
|
+
errorMessage?: string;
|
|
136
|
+
activeJobId?: string;
|
|
137
|
+
activeJobType?: "architecture" | "codemap";
|
|
138
|
+
activeJobStatus?: "queued" | "processing" | "completed" | "failed";
|
|
139
|
+
activeJobError?: string;
|
|
140
|
+
activeJobCreatedAt?: string;
|
|
141
|
+
createdAt: string;
|
|
142
|
+
updatedAt: string;
|
|
143
|
+
}
|
|
144
|
+
export interface Workspace {
|
|
145
|
+
id: string;
|
|
146
|
+
userId: string;
|
|
147
|
+
name: string;
|
|
148
|
+
repoIds: string[];
|
|
149
|
+
architectureData?: CrossRepoArchitecture;
|
|
150
|
+
activeJobId?: string;
|
|
151
|
+
activeJobStatus?: "queued" | "processing" | "completed" | "failed";
|
|
152
|
+
activeJobError?: string;
|
|
153
|
+
activeJobCreatedAt?: string;
|
|
154
|
+
createdAt: string;
|
|
155
|
+
updatedAt: string;
|
|
156
|
+
}
|
|
157
|
+
export interface CrossRepoNode {
|
|
158
|
+
id: string;
|
|
159
|
+
kind: string;
|
|
160
|
+
name: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
technology?: string;
|
|
163
|
+
repoId: string;
|
|
164
|
+
repoName: string;
|
|
165
|
+
group?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface CrossRepoEdge {
|
|
168
|
+
id: string;
|
|
169
|
+
source: string;
|
|
170
|
+
target: string;
|
|
171
|
+
type: string;
|
|
172
|
+
label?: string;
|
|
173
|
+
isCrossRepo: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface CrossRepoGroup {
|
|
176
|
+
id: string;
|
|
177
|
+
name: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SharedResource {
|
|
180
|
+
name: string;
|
|
181
|
+
type: string;
|
|
182
|
+
repos: string[];
|
|
183
|
+
description?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface CrossRepoConnection {
|
|
186
|
+
sourceRepo: string;
|
|
187
|
+
targetRepo: string;
|
|
188
|
+
connectionType: string;
|
|
189
|
+
description: string;
|
|
190
|
+
}
|
|
191
|
+
export interface CrossRepoWorkflowStep {
|
|
192
|
+
id: string;
|
|
193
|
+
title: string;
|
|
194
|
+
description: string;
|
|
195
|
+
kind: string;
|
|
196
|
+
repoId: string;
|
|
197
|
+
repoName: string;
|
|
198
|
+
technology?: string;
|
|
199
|
+
}
|
|
200
|
+
export interface CrossRepoWorkflowPhase {
|
|
201
|
+
id: string;
|
|
202
|
+
label?: string;
|
|
203
|
+
steps: CrossRepoWorkflowStep[];
|
|
204
|
+
}
|
|
205
|
+
export interface CrossRepoWorkflow {
|
|
206
|
+
id: string;
|
|
207
|
+
name: string;
|
|
208
|
+
trigger: string;
|
|
209
|
+
involvedRepos: string[];
|
|
210
|
+
phases: CrossRepoWorkflowPhase[];
|
|
211
|
+
}
|
|
212
|
+
export interface RepoSummary {
|
|
213
|
+
repoName: string;
|
|
214
|
+
role: string;
|
|
215
|
+
techStack: string[];
|
|
216
|
+
}
|
|
217
|
+
export interface DependencyEntry {
|
|
218
|
+
source: string;
|
|
219
|
+
target: string;
|
|
220
|
+
dependencies: string[];
|
|
221
|
+
}
|
|
222
|
+
export interface SystemOverview {
|
|
223
|
+
systemType: string;
|
|
224
|
+
detectedServices: string[];
|
|
225
|
+
detectedInfrastructure: string[];
|
|
226
|
+
repoSummaries: RepoSummary[];
|
|
227
|
+
dependencyMatrix: DependencyEntry[];
|
|
228
|
+
}
|
|
229
|
+
export interface CrossRepoArchitecture {
|
|
230
|
+
nodes: CrossRepoNode[];
|
|
231
|
+
edges: CrossRepoEdge[];
|
|
232
|
+
groups: CrossRepoGroup[];
|
|
233
|
+
sharedResources: SharedResource[];
|
|
234
|
+
crossRepoConnections: CrossRepoConnection[];
|
|
235
|
+
workflows?: CrossRepoWorkflow[];
|
|
236
|
+
systemOverview?: SystemOverview;
|
|
237
|
+
analyzedAt: string;
|
|
238
|
+
}
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,4CAA4C"}
|