@cachly-dev/mcp-server 0.10.82 → 0.10.83
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/dist/src/handlers/brain.js +10 -1
- package/dist/src/handlers/brain.js.map +1 -1
- package/dist/src/handlers/viz.d.ts +6 -0
- package/dist/src/handlers/viz.js +148 -0
- package/dist/src/handlers/viz.js.map +1 -0
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools.d.ts +30 -0
- package/dist/src/tools.js +20 -0
- package/dist/src/tools.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Redis } from 'ioredis';
|
|
2
|
+
type GetConnection = (instanceId: string) => Promise<Redis>;
|
|
3
|
+
type ApiFetch = <T>(path: string, options?: RequestInit) => Promise<T>;
|
|
4
|
+
export declare const VIZ_TOOL_NAMES: Set<string>;
|
|
5
|
+
export declare function handleVizTool(name: string, args: Record<string, unknown>, getConnection: GetConnection, _apiFetch: ApiFetch): Promise<string | null>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { safeJsonParse } from '../utils.js';
|
|
2
|
+
export const VIZ_TOOL_NAMES = new Set(['brain_graph']);
|
|
3
|
+
// Stable color groups so the 3D frontend can theme node kinds consistently.
|
|
4
|
+
const NODE_GROUP = {
|
|
5
|
+
concept: 1, person: 2, file: 3, service: 4,
|
|
6
|
+
};
|
|
7
|
+
function nodeKind(id) {
|
|
8
|
+
if (id.startsWith('person:'))
|
|
9
|
+
return 'person';
|
|
10
|
+
if (id.startsWith('file:'))
|
|
11
|
+
return 'file';
|
|
12
|
+
if (id.startsWith('service:'))
|
|
13
|
+
return 'service';
|
|
14
|
+
return 'concept';
|
|
15
|
+
}
|
|
16
|
+
function nodeLabel(n, kind) {
|
|
17
|
+
if (kind === 'person')
|
|
18
|
+
return n.handle ?? n.id.replace(/^person:/, '');
|
|
19
|
+
if (kind === 'file')
|
|
20
|
+
return (n.path ?? n.id.replace(/^file:/, '')).split('/').slice(-1)[0] ?? n.id;
|
|
21
|
+
if (kind === 'service')
|
|
22
|
+
return n.name ?? n.id.replace(/^service:/, '');
|
|
23
|
+
return n.id;
|
|
24
|
+
}
|
|
25
|
+
async function scanAll(redis, match, limit) {
|
|
26
|
+
const keys = [];
|
|
27
|
+
const stream = redis.scanStream({ match, count: 200 });
|
|
28
|
+
await new Promise((resolve, reject) => {
|
|
29
|
+
stream.on('data', (batch) => {
|
|
30
|
+
for (const k of batch) {
|
|
31
|
+
if (keys.length < limit)
|
|
32
|
+
keys.push(k);
|
|
33
|
+
}
|
|
34
|
+
if (keys.length >= limit)
|
|
35
|
+
stream.destroy();
|
|
36
|
+
});
|
|
37
|
+
stream.on('end', resolve);
|
|
38
|
+
stream.on('close', resolve);
|
|
39
|
+
stream.on('error', reject);
|
|
40
|
+
});
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
export async function handleVizTool(name, args, getConnection, _apiFetch) {
|
|
44
|
+
if (name !== 'brain_graph')
|
|
45
|
+
return null;
|
|
46
|
+
const { instance_id, max_nodes = 400, domain = '', min_confidence = 0, format = 'json', } = args;
|
|
47
|
+
const redis = await getConnection(instance_id);
|
|
48
|
+
const nodeCap = Math.max(1, Math.min(2000, Number(max_nodes) || 400));
|
|
49
|
+
const minConf = Math.max(0, Math.min(1, Number(min_confidence) || 0));
|
|
50
|
+
const domainFilter = String(domain || '').toLowerCase().trim();
|
|
51
|
+
// ── Nodes ────────────────────────────────────────────────────────────────
|
|
52
|
+
const nodeKeys = await scanAll(redis, 'cachly:ckg:node:*', nodeCap);
|
|
53
|
+
const nodes = [];
|
|
54
|
+
const present = new Set();
|
|
55
|
+
for (const key of nodeKeys) {
|
|
56
|
+
const raw = await redis.get(key);
|
|
57
|
+
const stored = safeJsonParse(raw, null);
|
|
58
|
+
if (!stored || !stored.id)
|
|
59
|
+
continue;
|
|
60
|
+
const kind = nodeKind(stored.id);
|
|
61
|
+
const ndomain = String(stored.domain ?? '').toLowerCase();
|
|
62
|
+
if (domainFilter && !ndomain.includes(domainFilter) && !stored.id.toLowerCase().includes(domainFilter))
|
|
63
|
+
continue;
|
|
64
|
+
const count = Number(stored.count ?? 1) || 1;
|
|
65
|
+
nodes.push({
|
|
66
|
+
id: stored.id,
|
|
67
|
+
name: nodeLabel(stored, kind),
|
|
68
|
+
type: kind,
|
|
69
|
+
group: NODE_GROUP[kind] ?? 0,
|
|
70
|
+
domain: stored.domain ?? '',
|
|
71
|
+
val: Math.max(1, Math.round(Math.sqrt(count) * 3)),
|
|
72
|
+
count,
|
|
73
|
+
});
|
|
74
|
+
present.add(stored.id);
|
|
75
|
+
}
|
|
76
|
+
// ── Edges ──────────────────────────────────────────────────────────────────
|
|
77
|
+
// Edge keys: cachly:ckg:edge:{from}:{edgeType}:{to}. We read the stored CKGEdge
|
|
78
|
+
// (not the key) so from/to/confidence come straight from the value — robust to
|
|
79
|
+
// ids that themselves contain ':' (e.g. "docker:layer-cache").
|
|
80
|
+
const edgeKeys = await scanAll(redis, 'cachly:ckg:edge:*', nodeCap * 8);
|
|
81
|
+
const links = [];
|
|
82
|
+
let edgesSkippedConf = 0;
|
|
83
|
+
let edgesSkippedDangling = 0;
|
|
84
|
+
for (const key of edgeKeys) {
|
|
85
|
+
const raw = await redis.get(key);
|
|
86
|
+
const edge = safeJsonParse(raw, null);
|
|
87
|
+
if (!edge || !edge.from || !edge.to)
|
|
88
|
+
continue;
|
|
89
|
+
if ((edge.confidence ?? 0) < minConf) {
|
|
90
|
+
edgesSkippedConf++;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
// Drop dangling edges (endpoint filtered out) so the 3D graph stays consistent.
|
|
94
|
+
if (!present.has(edge.from) || !present.has(edge.to)) {
|
|
95
|
+
edgesSkippedDangling++;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
links.push({
|
|
99
|
+
source: edge.from,
|
|
100
|
+
target: edge.to,
|
|
101
|
+
type: edge.edgeType ?? 'related',
|
|
102
|
+
value: Number((edge.confidence ?? 0).toFixed(3)),
|
|
103
|
+
trials: edge.trials ?? 0,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const byType = {};
|
|
107
|
+
for (const n of nodes)
|
|
108
|
+
byType[n.type] = (byType[n.type] ?? 0) + 1;
|
|
109
|
+
const graph = {
|
|
110
|
+
schema: 'cachly.brain_graph/v1',
|
|
111
|
+
nodes,
|
|
112
|
+
links,
|
|
113
|
+
meta: {
|
|
114
|
+
instance_id,
|
|
115
|
+
generated_at: new Date().toISOString(),
|
|
116
|
+
node_count: nodes.length,
|
|
117
|
+
link_count: links.length,
|
|
118
|
+
node_types: byType,
|
|
119
|
+
truncated: nodeKeys.length >= nodeCap,
|
|
120
|
+
filters: { domain: domainFilter || null, min_confidence: minConf, max_nodes: nodeCap },
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
if (format === 'summary') {
|
|
124
|
+
const lines = [
|
|
125
|
+
`## 🧠 Brain Graph — 3D Viz Export`,
|
|
126
|
+
'',
|
|
127
|
+
`**${nodes.length}** nodes · **${links.length}** links`,
|
|
128
|
+
...Object.entries(byType).map(([t, c]) => ` • ${t}: ${c}`),
|
|
129
|
+
edgesSkippedConf ? ` • ${edgesSkippedConf} edges below confidence ${minConf}` : '',
|
|
130
|
+
edgesSkippedDangling ? ` • ${edgesSkippedDangling} dangling edges dropped` : '',
|
|
131
|
+
'',
|
|
132
|
+
graph.meta.truncated ? `⚠️ Truncated at ${nodeCap} nodes — raise \`max_nodes\` for the full graph.` : '',
|
|
133
|
+
'',
|
|
134
|
+
`Call \`brain_graph(instance_id="${instance_id}", format="json")\` for the full payload the 3D frontend renders.`,
|
|
135
|
+
].filter(Boolean);
|
|
136
|
+
return lines.join('\n');
|
|
137
|
+
}
|
|
138
|
+
// Default: emit the renderable payload in a fenced block so the frontend /
|
|
139
|
+
// API can lift it verbatim into react-force-graph-3d.
|
|
140
|
+
return [
|
|
141
|
+
`🧠 **Brain Graph** — ${nodes.length} nodes, ${links.length} links (schema \`cachly.brain_graph/v1\`)`,
|
|
142
|
+
'',
|
|
143
|
+
'```json',
|
|
144
|
+
JSON.stringify(graph, null, 2),
|
|
145
|
+
'```',
|
|
146
|
+
].join('\n');
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=viz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viz.js","sourceRoot":"","sources":["../../../src/handlers/viz.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoB5C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvD,4EAA4E;AAC5E,MAAM,UAAU,GAA2B;IACzC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;CAC3C,CAAC;AA0BF,SAAS,QAAQ,CAAC,EAAU;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC9C,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IAChD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,SAAS,CAAC,CAAa,EAAE,IAAqB;IACrD,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACvE,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE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is';
|
|
|
65
65
|
let API_URL = process.env.CACHLY_API_URL ?? 'https://api.cachly.dev';
|
|
66
66
|
let JWT = process.env.CACHLY_JWT ?? '';
|
|
67
67
|
const _EMBED_MODEL = process.env.CACHLY_EMBED_MODEL ?? '';
|
|
68
|
-
const CURRENT_VERSION = '0.10.
|
|
68
|
+
const CURRENT_VERSION = '0.10.83';
|
|
69
69
|
// Max time to wait for a freshly-provisioned instance to become "running" before
|
|
70
70
|
// giving up. Free-tier provisioning in high-latency regions can take 45–90s, so the
|
|
71
71
|
// old hard-coded 25s caused spurious "instance_not_reachable" on first run.
|
|
@@ -610,6 +610,7 @@ import { handleAdvancedTool } from './handlers/advanced.js';
|
|
|
610
610
|
import { handleSyndicateTool } from './handlers/syndicate.js';
|
|
611
611
|
import { handleFedbrainTool, _lastBrainFromGitCounts } from './handlers/fedbrain.js';
|
|
612
612
|
import { handleShareTool } from './handlers/share.js';
|
|
613
|
+
import { handleVizTool } from './handlers/viz.js';
|
|
613
614
|
// ── Tools (imported from tools.ts) ─────────────────────────────────────────
|
|
614
615
|
import { TOOLS } from './tools.js';
|
|
615
616
|
// ── Handlers ──────────────────────────────────────────────────────────────────
|
|
@@ -882,6 +883,9 @@ async function handleTool(name, args) {
|
|
|
882
883
|
const shareResult = await handleShareTool(name, args, getConnection, apiFetch);
|
|
883
884
|
if (shareResult !== null)
|
|
884
885
|
return shareResult;
|
|
886
|
+
const vizResult = await handleVizTool(name, args, getConnection, apiFetch);
|
|
887
|
+
if (vizResult !== null)
|
|
888
|
+
return vizResult;
|
|
885
889
|
const fedbrainResult = await handleFedbrainTool(name, args, getConnection, apiFetch);
|
|
886
890
|
if (fedbrainResult !== null) {
|
|
887
891
|
// brain_from_git and brain_predict_failures are in fedbrain handler.
|