@mohantn/gate-keeper 2.2.0 → 2.2.2
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 +82 -46
- package/package.json +2 -2
- package/dist/cli/query-repl.d.ts +0 -37
- package/dist/cli/query-repl.d.ts.map +0 -1
- package/dist/cli/query-repl.js +0 -298
- package/dist/cli/query-repl.js.map +0 -1
- package/dist/cli/repl-algorithms.d.ts +0 -49
- package/dist/cli/repl-algorithms.d.ts.map +0 -1
- package/dist/cli/repl-algorithms.js +0 -147
- package/dist/cli/repl-algorithms.js.map +0 -1
- package/dist/cli/setup-core.d.ts +0 -38
- package/dist/cli/setup-core.d.ts.map +0 -1
- package/dist/cli/setup-core.js +0 -427
- package/dist/cli/setup-core.js.map +0 -1
- package/dist/cli/setup.d.ts +0 -25
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js +0 -159
- package/dist/cli/setup.js.map +0 -1
- package/dist/github/app.d.ts +0 -34
- package/dist/github/app.d.ts.map +0 -1
- package/dist/github/app.js +0 -261
- package/dist/github/app.js.map +0 -1
- package/dist/github/commenter.d.ts +0 -67
- package/dist/github/commenter.d.ts.map +0 -1
- package/dist/github/commenter.js +0 -155
- package/dist/github/commenter.js.map +0 -1
- package/dist/hooks/git-hooks.d.ts +0 -30
- package/dist/hooks/git-hooks.d.ts.map +0 -1
- package/dist/hooks/git-hooks.js +0 -179
- package/dist/hooks/git-hooks.js.map +0 -1
- package/dist/mcp/cache-preload.d.ts +0 -29
- package/dist/mcp/cache-preload.d.ts.map +0 -1
- package/dist/mcp/cache-preload.js +0 -103
- package/dist/mcp/cache-preload.js.map +0 -1
- package/dist/mcp/handlers/context.d.ts +0 -25
- package/dist/mcp/handlers/context.d.ts.map +0 -1
- package/dist/mcp/handlers/context.js +0 -382
- package/dist/mcp/handlers/context.js.map +0 -1
- package/dist/mcp/handlers/graph-intelligence.d.ts +0 -26
- package/dist/mcp/handlers/graph-intelligence.d.ts.map +0 -1
- package/dist/mcp/handlers/graph-intelligence.js +0 -371
- package/dist/mcp/handlers/graph-intelligence.js.map +0 -1
- package/dist/mcp/handlers/graph-query.d.ts +0 -25
- package/dist/mcp/handlers/graph-query.d.ts.map +0 -1
- package/dist/mcp/handlers/graph-query.js +0 -410
- package/dist/mcp/handlers/graph-query.js.map +0 -1
- package/dist/mcp/handlers/impact.d.ts +0 -4
- package/dist/mcp/handlers/impact.d.ts.map +0 -1
- package/dist/mcp/handlers/impact.js +0 -139
- package/dist/mcp/handlers/impact.js.map +0 -1
- package/dist/mcp/handlers/improvement.d.ts +0 -4
- package/dist/mcp/handlers/improvement.d.ts.map +0 -1
- package/dist/mcp/handlers/improvement.js +0 -136
- package/dist/mcp/handlers/improvement.js.map +0 -1
- package/dist/mcp/handlers/platform-installer.d.ts +0 -10
- package/dist/mcp/handlers/platform-installer.d.ts.map +0 -1
- package/dist/mcp/handlers/platform-installer.js +0 -168
- package/dist/mcp/handlers/platform-installer.js.map +0 -1
- package/dist/mcp/handlers/pr-review.d.ts +0 -33
- package/dist/mcp/handlers/pr-review.d.ts.map +0 -1
- package/dist/mcp/handlers/pr-review.js +0 -170
- package/dist/mcp/handlers/pr-review.js.map +0 -1
- package/dist/mcp/token-tracker.d.ts +0 -47
- package/dist/mcp/token-tracker.d.ts.map +0 -1
- package/dist/mcp/token-tracker.js +0 -93
- package/dist/mcp/token-tracker.js.map +0 -1
- package/dist/quality-loop/file-lock.d.ts +0 -12
- package/dist/quality-loop/file-lock.d.ts.map +0 -1
- package/dist/quality-loop/file-lock.js +0 -38
- package/dist/quality-loop/file-lock.js.map +0 -1
- package/dist/quality-loop/fix-worker.d.ts +0 -44
- package/dist/quality-loop/fix-worker.d.ts.map +0 -1
- package/dist/quality-loop/fix-worker.js +0 -414
- package/dist/quality-loop/fix-worker.js.map +0 -1
- package/dist/quality-loop/orchestrator.d.ts +0 -137
- package/dist/quality-loop/orchestrator.d.ts.map +0 -1
- package/dist/quality-loop/orchestrator.js +0 -894
- package/dist/quality-loop/orchestrator.js.map +0 -1
- package/dist/quality-loop/queue-manager.d.ts +0 -45
- package/dist/quality-loop/queue-manager.d.ts.map +0 -1
- package/dist/quality-loop/queue-manager.js +0 -173
- package/dist/quality-loop/queue-manager.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repl-algorithms.d.ts","sourceRoot":"","sources":["../../src/cli/repl-algorithms.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAA;KAAE,CAAC;IACpF,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AAID,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMpE;AAID,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,GAAG,eAAe,EAAE,CAc3E;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,oBAAoB,EAAE,CAiC/F;AAID,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAezE;AAID,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAchG"}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Pure graph-algorithm functions used by the query REPL.
|
|
4
|
-
* No I/O — all functions take graph data and return results.
|
|
5
|
-
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.getModule = getModule;
|
|
41
|
-
exports.computeDegreeCentrality = computeDegreeCentrality;
|
|
42
|
-
exports.findSurprising = findSurprising;
|
|
43
|
-
exports.suggestQuestions = suggestQuestions;
|
|
44
|
-
exports.findPath = findPath;
|
|
45
|
-
const path = __importStar(require("path"));
|
|
46
|
-
// ── Module detection ───────────────────────────────────────
|
|
47
|
-
function getModule(filePath, repoRoot) {
|
|
48
|
-
const rel = path.relative(repoRoot, filePath);
|
|
49
|
-
const parts = rel.split(path.sep).filter(Boolean);
|
|
50
|
-
if (parts.length <= 1)
|
|
51
|
-
return '(root)';
|
|
52
|
-
if (['src', 'lib', 'app'].includes(parts[0]) && parts.length > 2)
|
|
53
|
-
return parts[1];
|
|
54
|
-
return parts[0];
|
|
55
|
-
}
|
|
56
|
-
// ── Degree centrality ──────────────────────────────────────
|
|
57
|
-
function computeDegreeCentrality(graph) {
|
|
58
|
-
const inDeg = new Map();
|
|
59
|
-
const outDeg = new Map();
|
|
60
|
-
for (const n of graph.nodes) {
|
|
61
|
-
inDeg.set(n.id, 0);
|
|
62
|
-
outDeg.set(n.id, 0);
|
|
63
|
-
}
|
|
64
|
-
for (const e of graph.edges) {
|
|
65
|
-
outDeg.set(e.source, (outDeg.get(e.source) ?? 0) + 1);
|
|
66
|
-
inDeg.set(e.target, (inDeg.get(e.target) ?? 0) + 1);
|
|
67
|
-
}
|
|
68
|
-
return graph.nodes.map(n => ({
|
|
69
|
-
path: n.id, label: n.label, rating: n.rating,
|
|
70
|
-
inDegree: inDeg.get(n.id) ?? 0,
|
|
71
|
-
outDegree: outDeg.get(n.id) ?? 0,
|
|
72
|
-
totalDegree: (inDeg.get(n.id) ?? 0) + (outDeg.get(n.id) ?? 0),
|
|
73
|
-
})).sort((a, b) => b.totalDegree - a.totalDegree);
|
|
74
|
-
}
|
|
75
|
-
// ── Surprising cross-module connections ────────────────────
|
|
76
|
-
function findSurprising(graph, repo, topN = 5) {
|
|
77
|
-
const nodeIds = new Set(graph.nodes.map(n => n.id));
|
|
78
|
-
const moduleOf = new Map();
|
|
79
|
-
for (const n of graph.nodes)
|
|
80
|
-
moduleOf.set(n.id, getModule(n.id, repo));
|
|
81
|
-
const pairCounts = new Map();
|
|
82
|
-
for (const e of graph.edges) {
|
|
83
|
-
if (!nodeIds.has(e.source) || !nodeIds.has(e.target))
|
|
84
|
-
continue;
|
|
85
|
-
const sm = moduleOf.get(e.source) ?? '(?)';
|
|
86
|
-
const tm = moduleOf.get(e.target) ?? '(?)';
|
|
87
|
-
if (sm !== tm) {
|
|
88
|
-
const key = `${sm}→${tm}`;
|
|
89
|
-
pairCounts.set(key, (pairCounts.get(key) ?? 0) + 1);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const results = [];
|
|
93
|
-
for (const e of graph.edges) {
|
|
94
|
-
if (!nodeIds.has(e.source) || !nodeIds.has(e.target))
|
|
95
|
-
continue;
|
|
96
|
-
const sm = moduleOf.get(e.source) ?? '(?)';
|
|
97
|
-
const tm = moduleOf.get(e.target) ?? '(?)';
|
|
98
|
-
if (sm === tm)
|
|
99
|
-
continue;
|
|
100
|
-
const pairCount = pairCounts.get(`${sm}→${tm}`) ?? 1;
|
|
101
|
-
results.push({ src: e.source, dst: e.target, S: sm, T: tm, score: 1 / Math.log(pairCount + 1) });
|
|
102
|
-
}
|
|
103
|
-
const seen = new Set();
|
|
104
|
-
return results.sort((a, b) => b.score - a.score).filter(r => {
|
|
105
|
-
const k = `${r.src}|${r.dst}`;
|
|
106
|
-
if (seen.has(k))
|
|
107
|
-
return false;
|
|
108
|
-
seen.add(k);
|
|
109
|
-
return true;
|
|
110
|
-
}).slice(0, topN);
|
|
111
|
-
}
|
|
112
|
-
// ── Suggested questions ────────────────────────────────────
|
|
113
|
-
function suggestQuestions(graph, repo) {
|
|
114
|
-
const centrality = computeDegreeCentrality(graph);
|
|
115
|
-
const top = centrality.slice(0, 3);
|
|
116
|
-
const worst = [...graph.nodes].sort((a, b) => a.rating - b.rating)[0];
|
|
117
|
-
const qs = [];
|
|
118
|
-
for (const god of top) {
|
|
119
|
-
qs.push(`What would break if "${path.relative(repo, god.path)}" changed?`);
|
|
120
|
-
}
|
|
121
|
-
if (worst && top[0] && worst.id !== top[0].path) {
|
|
122
|
-
qs.push(`How does "${path.relative(repo, top[0].path)}" connect to "${path.relative(repo, worst.id)}" (worst-rated file)?`);
|
|
123
|
-
}
|
|
124
|
-
if (worst && worst.rating < 7) {
|
|
125
|
-
qs.push(`What's wrong with "${path.relative(repo, worst.id)}" (rating ${worst.rating}/10)?`);
|
|
126
|
-
}
|
|
127
|
-
return qs;
|
|
128
|
-
}
|
|
129
|
-
// ── BFS path finding ───────────────────────────────────────
|
|
130
|
-
function findPath(startId, endId, edges) {
|
|
131
|
-
const queue = [{ id: startId, trail: [startId] }];
|
|
132
|
-
const visited = new Set([startId]);
|
|
133
|
-
while (queue.length > 0) {
|
|
134
|
-
const node = queue.shift();
|
|
135
|
-
for (const edge of edges) {
|
|
136
|
-
if (edge.source !== node.id || visited.has(edge.target))
|
|
137
|
-
continue;
|
|
138
|
-
const trail = [...node.trail, edge.target];
|
|
139
|
-
if (edge.target === endId)
|
|
140
|
-
return trail;
|
|
141
|
-
visited.add(edge.target);
|
|
142
|
-
queue.push({ id: edge.target, trail });
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=repl-algorithms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repl-algorithms.js","sourceRoot":"","sources":["../../src/cli/repl-algorithms.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CH,8BAMC;AAID,0DAcC;AAID,wCAiCC;AAID,4CAeC;AAID,4BAcC;AA7ID,2CAA6B;AAyC7B,8DAA8D;AAE9D,SAAgB,SAAS,CAAC,QAAgB,EAAE,QAAgB;IAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,CAAE,CAAC;IACpF,OAAO,KAAK,CAAC,CAAC,CAAE,CAAC;AACnB,CAAC;AAED,8DAA8D;AAE9D,SAAgB,uBAAuB,CAAC,KAAgB;IACtD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,CAAC,I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gB,QAAQ,CAAC,OAAe,EAAE,KAAa,EAAE,KAAsB;IAC7E,MAAM,KAAK,GAA2C,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAG,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;gBAAE,SAAS;YAClE,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK;gBAAE,OAAO,KAAK,CAAC;YACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cli/setup-core.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core setup logic — pure installation functions used by the `setup` CLI command.
|
|
3
|
-
*
|
|
4
|
-
* Each function returns a SetupResult with a step name, icon, message, and
|
|
5
|
-
* optional file path. Independent steps so partial failures don't cascade.
|
|
6
|
-
*/
|
|
7
|
-
export interface SetupOptions {
|
|
8
|
-
all: boolean;
|
|
9
|
-
claude: boolean;
|
|
10
|
-
copilot: boolean;
|
|
11
|
-
cursor: boolean;
|
|
12
|
-
gitHooks: boolean;
|
|
13
|
-
githubAction: boolean;
|
|
14
|
-
scan: boolean;
|
|
15
|
-
force: boolean;
|
|
16
|
-
repoRoot: string;
|
|
17
|
-
gkDir: string;
|
|
18
|
-
}
|
|
19
|
-
export interface SetupResult {
|
|
20
|
-
step: string;
|
|
21
|
-
icon: string;
|
|
22
|
-
message: string;
|
|
23
|
-
path: string | null;
|
|
24
|
-
}
|
|
25
|
-
export interface InstallationStep {
|
|
26
|
-
label: string;
|
|
27
|
-
run: () => Promise<SetupResult>;
|
|
28
|
-
}
|
|
29
|
-
export declare function defaultGraphifyIgnore(opts: SetupOptions): Promise<SetupResult>;
|
|
30
|
-
export declare function installClaudeHooks(opts: SetupOptions): Promise<SetupResult>;
|
|
31
|
-
export declare function installCopilotInstructions(opts: SetupOptions): Promise<SetupResult>;
|
|
32
|
-
export declare function installVscodeMcp(opts: SetupOptions): Promise<SetupResult>;
|
|
33
|
-
export declare function installCursorRules(opts: SetupOptions): Promise<SetupResult>;
|
|
34
|
-
export declare function installGitHubWorkflow(opts: SetupOptions): Promise<SetupResult>;
|
|
35
|
-
export declare function installGitHooks(opts: SetupOptions): Promise<SetupResult>;
|
|
36
|
-
export declare function runInitialScan(opts: SetupOptions): Promise<SetupResult>;
|
|
37
|
-
export declare function printSummary(results: SetupResult[], repoRoot: string): void;
|
|
38
|
-
//# sourceMappingURL=setup-core.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-core.d.ts","sourceRoot":"","sources":["../../src/cli/setup-core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,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core setup logic — pure installation functions used by the `setup` CLI command.
|
|
4
|
-
*
|
|
5
|
-
* Each function returns a SetupResult with a step name, icon, message, and
|
|
6
|
-
* optional file path. Independent steps so partial failures don't cascade.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.defaultGraphifyIgnore = defaultGraphifyIgnore;
|
|
43
|
-
exports.installClaudeHooks = installClaudeHooks;
|
|
44
|
-
exports.installCopilotInstructions = installCopilotInstructions;
|
|
45
|
-
exports.installVscodeMcp = installVscodeMcp;
|
|
46
|
-
exports.installCursorRules = installCursorRules;
|
|
47
|
-
exports.installGitHubWorkflow = installGitHubWorkflow;
|
|
48
|
-
exports.installGitHooks = installGitHooks;
|
|
49
|
-
exports.runInitialScan = runInitialScan;
|
|
50
|
-
exports.printSummary = printSummary;
|
|
51
|
-
const fs = __importStar(require("fs"));
|
|
52
|
-
const path = __importStar(require("path"));
|
|
53
|
-
const os = __importStar(require("os"));
|
|
54
|
-
const child_process_1 = require("child_process");
|
|
55
|
-
const installer_1 = require("../mcp/installer");
|
|
56
|
-
// ── 1. .graphifyignore ────────────────────────────────────
|
|
57
|
-
async function defaultGraphifyIgnore(opts) {
|
|
58
|
-
const filePath = path.join(opts.repoRoot, '.graphifyignore');
|
|
59
|
-
if (fs.existsSync(filePath) && !opts.force) {
|
|
60
|
-
return { step: 'Create .graphifyignore', icon: '⏭', message: 'Already exists (use --force to overwrite)', path: filePath };
|
|
61
|
-
}
|
|
62
|
-
const defaults = [
|
|
63
|
-
'# Gate Keeper — graphify ignore patterns',
|
|
64
|
-
'# Files matching these patterns are excluded from the dependency graph.',
|
|
65
|
-
'',
|
|
66
|
-
'# Generated files',
|
|
67
|
-
'*.generated.*',
|
|
68
|
-
'*.g.cs',
|
|
69
|
-
'*.Designer.cs',
|
|
70
|
-
'',
|
|
71
|
-
'# Build output',
|
|
72
|
-
'dist/',
|
|
73
|
-
'build/',
|
|
74
|
-
'out/',
|
|
75
|
-
'',
|
|
76
|
-
'# Dependencies',
|
|
77
|
-
'node_modules/',
|
|
78
|
-
'vendor/',
|
|
79
|
-
'',
|
|
80
|
-
'# Test fixtures and mocks',
|
|
81
|
-
'**/__snapshots__/**',
|
|
82
|
-
'**/fixtures/**',
|
|
83
|
-
'',
|
|
84
|
-
'# Minified and bundled',
|
|
85
|
-
'*.min.js',
|
|
86
|
-
'*.bundle.js',
|
|
87
|
-
'*.d.ts',
|
|
88
|
-
];
|
|
89
|
-
fs.writeFileSync(filePath, defaults.join('\n') + '\n', 'utf8');
|
|
90
|
-
return { step: 'Create .graphifyignore', icon: '✅', message: 'Created with defaults (8 patterns)', path: filePath };
|
|
91
|
-
}
|
|
92
|
-
// ── 2. Claude Code hooks ──────────────────────────────────
|
|
93
|
-
function ensureHookRegistered(hooks, event, checkStr, entry) {
|
|
94
|
-
if (!hooks[event])
|
|
95
|
-
hooks[event] = [];
|
|
96
|
-
const already = hooks[event].some(h => JSON.stringify(h).includes(checkStr));
|
|
97
|
-
if (!already)
|
|
98
|
-
hooks[event].push(entry);
|
|
99
|
-
}
|
|
100
|
-
function buildPreToolUseCommand(gkDir) {
|
|
101
|
-
const preEditScript = path.join(gkDir, 'dist', 'hook-pre-tool-use.js');
|
|
102
|
-
if (fs.existsSync(preEditScript))
|
|
103
|
-
return `node ${preEditScript}`;
|
|
104
|
-
return `node -e "
|
|
105
|
-
const http = require('http');
|
|
106
|
-
const payload = JSON.parse(process.argv[1] || '{}');
|
|
107
|
-
const fp = payload?.tool_input?.file_path || payload?.tool_input?.path;
|
|
108
|
-
if (!fp || !fp.match(/\\\\.(ts|tsx|js|jsx|cs)$/)) process.exit(0);
|
|
109
|
-
const encRepo = encodeURIComponent(require('child_process').execSync('git rev-parse --show-toplevel 2>/dev/null').toString().trim());
|
|
110
|
-
const body = JSON.stringify({ file_path: fp, depth: 2, repo: encRepo });
|
|
111
|
-
const req = http.request({ hostname:'127.0.0.1', port:5378, path:'/api/impact-set', method:'POST', headers:{'Content-Type':'application/json','Content-Length':body.length} }, res => {
|
|
112
|
-
let d = '';
|
|
113
|
-
res.on('data', c => d += c);
|
|
114
|
-
res.on('end', () => {
|
|
115
|
-
try {
|
|
116
|
-
const r = JSON.parse(d);
|
|
117
|
-
if (r.verdict === 'block' || (r.fragileCount || 0) >= 3) {
|
|
118
|
-
process.stderr.write('[Gate Keeper] WARNING: ' + fp + ' has ' + (r.fragileCount || 0) + ' fragile dependents — proceed with care\\n');
|
|
119
|
-
}
|
|
120
|
-
} catch (e) { process.stderr.write('[Gate Keeper] parse error: ' + e + '\\n'); }
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
req.write(body); req.end();
|
|
124
|
-
setTimeout(() => process.exit(0), 3000);
|
|
125
|
-
" \`cat\``.replace(/\n\s*/g, ' ');
|
|
126
|
-
}
|
|
127
|
-
async function installClaudeHooks(opts) {
|
|
128
|
-
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
|
|
129
|
-
const hookScript = path.join(opts.gkDir, 'dist', 'hook-receiver.js');
|
|
130
|
-
if (!fs.existsSync(hookScript)) {
|
|
131
|
-
return { step: 'Install Claude Code hooks', icon: '⚠️', message: `hook-receiver not built at ${hookScript}. Run 'npm run build' first.`, path: settingsPath };
|
|
132
|
-
}
|
|
133
|
-
fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
|
|
134
|
-
let settings;
|
|
135
|
-
try {
|
|
136
|
-
settings = fs.existsSync(settingsPath)
|
|
137
|
-
? JSON.parse(fs.readFileSync(settingsPath, 'utf8'))
|
|
138
|
-
: {};
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
settings = {};
|
|
142
|
-
}
|
|
143
|
-
const hooks = settings['hooks'] ?? {};
|
|
144
|
-
const nodeHook = (cmd) => ({ hooks: [{ type: 'command', command: cmd }] });
|
|
145
|
-
const nodeHookMatcher = (cmd) => ({ matcher: 'Write|Edit', hooks: [{ type: 'command', command: cmd }] });
|
|
146
|
-
ensureHookRegistered(hooks, 'SessionStart', 'hook-receiver', nodeHook(`node ${hookScript}`));
|
|
147
|
-
ensureHookRegistered(hooks, 'PreToolUse', 'hook-pre-tool-use', nodeHookMatcher(buildPreToolUseCommand(opts.gkDir)));
|
|
148
|
-
ensureHookRegistered(hooks, 'PostToolUse', 'hook-receiver', nodeHookMatcher(`node ${hookScript}`));
|
|
149
|
-
ensureHookRegistered(hooks, 'UserPromptSubmit', 'hook-receiver', nodeHook(`node ${hookScript}`));
|
|
150
|
-
settings['hooks'] = hooks;
|
|
151
|
-
const dirs = settings['additionalDirectories'] ?? [];
|
|
152
|
-
if (!dirs.includes(opts.repoRoot)) {
|
|
153
|
-
dirs.push(opts.repoRoot);
|
|
154
|
-
settings['additionalDirectories'] = dirs;
|
|
155
|
-
}
|
|
156
|
-
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
|
|
157
|
-
return { step: 'Install Claude Code hooks', icon: '✅', message: 'SessionStart + PreToolUse + PostToolUse + UserPromptSubmit configured', path: settingsPath };
|
|
158
|
-
}
|
|
159
|
-
// ── 3. Copilot instructions (.github/copilot-instructions.md) ──
|
|
160
|
-
async function installCopilotInstructions(opts) {
|
|
161
|
-
const config = (0, installer_1.copilotConfig)(opts.repoRoot);
|
|
162
|
-
const targetPath = config.filePath;
|
|
163
|
-
if (fs.existsSync(targetPath) && !opts.force) {
|
|
164
|
-
return { step: 'Create Copilot instructions', icon: '⏭', message: 'Already exists (use --force to overwrite)', path: targetPath };
|
|
165
|
-
}
|
|
166
|
-
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
167
|
-
fs.writeFileSync(targetPath, config.content, 'utf8');
|
|
168
|
-
return { step: 'Create Copilot instructions', icon: '✅', message: `.github/copilot-instructions.md created (${config.content.length} bytes)`, path: targetPath };
|
|
169
|
-
}
|
|
170
|
-
// ── 4. VS Code / Copilot MCP ─────────────────────────────
|
|
171
|
-
async function installVscodeMcp(opts) {
|
|
172
|
-
const mcpDir = path.join(opts.repoRoot, '.vscode');
|
|
173
|
-
const mcpFile = path.join(mcpDir, 'mcp.json');
|
|
174
|
-
fs.mkdirSync(mcpDir, { recursive: true });
|
|
175
|
-
const config = {
|
|
176
|
-
servers: {
|
|
177
|
-
'gate-keeper': {
|
|
178
|
-
command: 'node',
|
|
179
|
-
args: [path.join(opts.gkDir, 'dist', 'mcp', 'server.js')],
|
|
180
|
-
cwd: opts.gkDir,
|
|
181
|
-
env: {},
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
// Check if copilot-insights.yml exists
|
|
186
|
-
const insightsFile = path.join(opts.repoRoot, '.github', 'copilot-insights.yml');
|
|
187
|
-
const hasInsights = fs.existsSync(insightsFile);
|
|
188
|
-
if (fs.existsSync(mcpFile) && !opts.force) {
|
|
189
|
-
return { step: 'Configure VS Code / Copilot MCP', icon: '⏭', message: 'Already exists (use --force to overwrite)', path: mcpFile };
|
|
190
|
-
}
|
|
191
|
-
fs.writeFileSync(mcpFile, JSON.stringify(config, null, 2), 'utf8');
|
|
192
|
-
const extras = hasInsights ? ' + copilot-insights.yml found' : '';
|
|
193
|
-
return { step: 'Configure VS Code / Copilot MCP', icon: '✅', message: `.vscode/mcp.json created${extras}`, path: mcpFile };
|
|
194
|
-
}
|
|
195
|
-
// ── 4. Cursor rules ───────────────────────────────────────
|
|
196
|
-
async function installCursorRules(opts) {
|
|
197
|
-
const cursorFile = path.join(opts.repoRoot, '.cursorrules');
|
|
198
|
-
if (fs.existsSync(cursorFile) && !opts.force) {
|
|
199
|
-
return { step: 'Configure Cursor rules', icon: '⏭', message: 'Already exists (use --force to overwrite)', path: cursorFile };
|
|
200
|
-
}
|
|
201
|
-
const rules = [
|
|
202
|
-
'# Gate Keeper — Cursor Rules',
|
|
203
|
-
'',
|
|
204
|
-
'## Before editing any file',
|
|
205
|
-
'- Call `check_pre_edit_safety` with the file path',
|
|
206
|
-
'- If verdict is "warn": also call `get_impact_set` to see affected files',
|
|
207
|
-
'- If verdict is "block": fix fragile dependents first',
|
|
208
|
-
'',
|
|
209
|
-
'## Architecture awareness',
|
|
210
|
-
'- Call `get_graph_report` once per session',
|
|
211
|
-
'- Use `summarize_file` instead of reading raw files for context',
|
|
212
|
-
'- Use `find_callers` before renaming any export',
|
|
213
|
-
'',
|
|
214
|
-
'## Quality gates',
|
|
215
|
-
'- After every edit: `analyze_file` → target ≥ 7.0/10',
|
|
216
|
-
'- If rating < 7.0: `suggest_refactoring` → fix → re-analyze',
|
|
217
|
-
'',
|
|
218
|
-
'## MCP Server: node dist/mcp/server.js (in repo root)',
|
|
219
|
-
'',
|
|
220
|
-
];
|
|
221
|
-
fs.writeFileSync(cursorFile, rules.join('\n'), 'utf8');
|
|
222
|
-
return { step: 'Configure Cursor rules', icon: '✅', message: '.cursorrules created', path: cursorFile };
|
|
223
|
-
}
|
|
224
|
-
// ── 5. GitHub Actions workflow ────────────────────────────
|
|
225
|
-
async function installGitHubWorkflow(opts) {
|
|
226
|
-
const workflowDir = path.join(opts.repoRoot, '.github', 'workflows');
|
|
227
|
-
const workflowFile = path.join(workflowDir, 'gate-keeper.yml');
|
|
228
|
-
if (fs.existsSync(workflowFile) && !opts.force) {
|
|
229
|
-
return { step: 'Create GitHub Actions workflow', icon: '⏭', message: 'Already exists (use --force to overwrite)', path: workflowFile };
|
|
230
|
-
}
|
|
231
|
-
fs.mkdirSync(workflowDir, { recursive: true });
|
|
232
|
-
const workflow = `name: Gate Keeper — Quality Gate
|
|
233
|
-
|
|
234
|
-
on:
|
|
235
|
-
push:
|
|
236
|
-
branches: ["**"]
|
|
237
|
-
pull_request:
|
|
238
|
-
branches: [main, master]
|
|
239
|
-
|
|
240
|
-
permissions:
|
|
241
|
-
contents: read
|
|
242
|
-
pull-requests: write
|
|
243
|
-
|
|
244
|
-
jobs:
|
|
245
|
-
quality-gate:
|
|
246
|
-
name: Gate Keeper analysis
|
|
247
|
-
runs-on: ubuntu-latest
|
|
248
|
-
steps:
|
|
249
|
-
- uses: actions/checkout@v4
|
|
250
|
-
- uses: actions/setup-node@v4
|
|
251
|
-
with:
|
|
252
|
-
node-version: '20'
|
|
253
|
-
cache: 'npm'
|
|
254
|
-
|
|
255
|
-
- run: npm ci
|
|
256
|
-
|
|
257
|
-
- name: Build gate-keeper
|
|
258
|
-
run: npm run build
|
|
259
|
-
|
|
260
|
-
- name: Run quality analysis
|
|
261
|
-
id: analysis
|
|
262
|
-
run: |
|
|
263
|
-
node -e "
|
|
264
|
-
const { findSourceFiles } = require('${opts.gkDir}/dist/mcp/helpers');
|
|
265
|
-
const { UniversalAnalyzer } = require('${opts.gkDir}/dist/analyzer/universal-analyzer');
|
|
266
|
-
const files = findSourceFiles('.', 200);
|
|
267
|
-
Promise.all(files.map(f => new UniversalAnalyzer().analyze(f).catch(() => null)))
|
|
268
|
-
.then(results => {
|
|
269
|
-
const valid = results.filter(Boolean);
|
|
270
|
-
const avg = valid.reduce((s, r) => s + r.rating, 0) / (valid.length || 1);
|
|
271
|
-
const below = valid.filter(r => r.rating < 7.0);
|
|
272
|
-
console.log('overall_rating=' + avg.toFixed(1));
|
|
273
|
-
console.log('files_analyzed=' + valid.length);
|
|
274
|
-
console.log('below_threshold=' + below.length);
|
|
275
|
-
below.forEach(r => console.log(' FAIL: ' + r.path.split('/').pop() + ' — ' + r.rating + '/10'));
|
|
276
|
-
});
|
|
277
|
-
" 2>&1 | tee -a \$GITHUB_OUTPUT
|
|
278
|
-
|
|
279
|
-
- name: Post PR comment
|
|
280
|
-
if: github.event_name == 'pull_request'
|
|
281
|
-
uses: actions/github-script@v7
|
|
282
|
-
with:
|
|
283
|
-
github-token: \${{ github.token }}
|
|
284
|
-
script: |
|
|
285
|
-
const fs = require('fs');
|
|
286
|
-
const env = require('process').env;
|
|
287
|
-
github.rest.issues.createComment({
|
|
288
|
-
issue_number: context.issue.number,
|
|
289
|
-
owner: context.repo.owner,
|
|
290
|
-
repo: context.repo.repo,
|
|
291
|
-
body: \`## Gate Keeper Quality Report
|
|
292
|
-
**Overall rating:** \${env.overall_rating || 'N/A'}/10
|
|
293
|
-
**Files analyzed:** \${env.files_analyzed || 0}
|
|
294
|
-
**Files below threshold:** \${env.below_threshold || 0}
|
|
295
|
-
|
|
296
|
-
*Analysis by Gate Keeper MCP server.*\`
|
|
297
|
-
});
|
|
298
|
-
`;
|
|
299
|
-
fs.writeFileSync(workflowFile, workflow, 'utf8');
|
|
300
|
-
return { step: 'Create GitHub Actions workflow', icon: '✅', message: '.github/workflows/gate-keeper.yml created', path: workflowFile };
|
|
301
|
-
}
|
|
302
|
-
// ── 6. Git hooks ──────────────────────────────────────────
|
|
303
|
-
async function installGitHooks(opts) {
|
|
304
|
-
const hooksDir = path.join(opts.repoRoot, '.git', 'hooks');
|
|
305
|
-
if (!fs.existsSync(hooksDir)) {
|
|
306
|
-
return { step: 'Install git hooks', icon: '⚠️', message: 'Not a git repository — skipping', path: null };
|
|
307
|
-
}
|
|
308
|
-
const hookScript = path.join(opts.gkDir, 'dist', 'hook-receiver.js');
|
|
309
|
-
if (!fs.existsSync(hookScript)) {
|
|
310
|
-
return { step: 'Install git hooks', icon: '⚠️', message: 'hook-receiver not built — skipping', path: hooksDir };
|
|
311
|
-
}
|
|
312
|
-
const hooks = [
|
|
313
|
-
{
|
|
314
|
-
name: 'post-commit',
|
|
315
|
-
content: `#!/bin/sh
|
|
316
|
-
# Gate Keeper — post-commit hook (non-blocking)
|
|
317
|
-
HOOK="${hookScript}"
|
|
318
|
-
if [ ! -f "$HOOK" ]; then exit 0; fi
|
|
319
|
-
git diff-tree --no-commit-id -r --name-only HEAD | grep -E '\\.(ts|tsx|js|jsx|cs)$' | while read -r file; do
|
|
320
|
-
FP="$(git rev-parse --show-toplevel)/$file"
|
|
321
|
-
[ -f "$FP" ] && echo '{"tool_name":"Write","tool_input":{"file_path":"'"$FP"'"}}' | node "$HOOK" 2>/dev/null &
|
|
322
|
-
done
|
|
323
|
-
exit 0
|
|
324
|
-
`,
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
name: 'post-checkout',
|
|
328
|
-
content: `#!/bin/sh
|
|
329
|
-
# Gate Keeper — post-checkout hook (non-blocking)
|
|
330
|
-
PREV="$1"; NEW="$2"; BRANCH="$3"
|
|
331
|
-
if [ "$BRANCH" != "1" ]; then exit 0; fi
|
|
332
|
-
HOOK="${hookScript}"
|
|
333
|
-
if [ ! -f "$HOOK" ]; then exit 0; fi
|
|
334
|
-
git diff --name-only "$PREV" "$NEW" | grep -E '\\.(ts|tsx|js|jsx|cs)$' | head -20 | while read -r file; do
|
|
335
|
-
FP="$(git rev-parse --show-toplevel)/$file"
|
|
336
|
-
[ -f "$FP" ] && echo '{"tool_name":"Write","tool_input":{"file_path":"'"$FP"'"}}' | node "$HOOK" 2>/dev/null &
|
|
337
|
-
done
|
|
338
|
-
exit 0
|
|
339
|
-
`,
|
|
340
|
-
},
|
|
341
|
-
];
|
|
342
|
-
let created = 0;
|
|
343
|
-
let skipped = 0;
|
|
344
|
-
for (const { name, content } of hooks) {
|
|
345
|
-
const hookPath = path.join(hooksDir, name);
|
|
346
|
-
if (fs.existsSync(hookPath) && !opts.force) {
|
|
347
|
-
skipped++;
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
fs.writeFileSync(hookPath, content, { mode: 0o755 });
|
|
351
|
-
created++;
|
|
352
|
-
}
|
|
353
|
-
if (created === 0 && skipped > 0) {
|
|
354
|
-
return { step: 'Install git hooks', icon: '⏭', message: `${skipped} hook(s) already exist (use --force to overwrite)`, path: hooksDir };
|
|
355
|
-
}
|
|
356
|
-
return { step: 'Install git hooks', icon: '✅', message: `${created} hook(s) installed (${skipped} skipped)`, path: hooksDir };
|
|
357
|
-
}
|
|
358
|
-
// ── 7. Initial scan ───────────────────────────────────────
|
|
359
|
-
async function runInitialScan(opts) {
|
|
360
|
-
const daemonScript = path.join(opts.gkDir, 'dist', 'daemon.js');
|
|
361
|
-
if (!fs.existsSync(daemonScript)) {
|
|
362
|
-
return { step: 'Start daemon & run initial scan', icon: '⚠️', message: `Daemon not built at ${daemonScript}. Run 'npm run build' first.`, path: null };
|
|
363
|
-
}
|
|
364
|
-
// Kill any existing daemon first
|
|
365
|
-
const pidFile = path.join(os.homedir(), '.gate-keeper', 'daemon.pid');
|
|
366
|
-
if (fs.existsSync(pidFile)) {
|
|
367
|
-
try {
|
|
368
|
-
const pid = parseInt(fs.readFileSync(pidFile, 'utf8').trim(), 10);
|
|
369
|
-
if (!isNaN(pid)) {
|
|
370
|
-
try {
|
|
371
|
-
process.kill(pid, 0);
|
|
372
|
-
process.kill(pid);
|
|
373
|
-
}
|
|
374
|
-
catch { /* not running */ }
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
catch { /* ignore */ }
|
|
378
|
-
try {
|
|
379
|
-
fs.unlinkSync(pidFile);
|
|
380
|
-
}
|
|
381
|
-
catch { /* ignore */ }
|
|
382
|
-
}
|
|
383
|
-
// Start the daemon
|
|
384
|
-
const child = (0, child_process_1.spawn)(process.execPath, [daemonScript, '--no-scan'], {
|
|
385
|
-
cwd: opts.gkDir,
|
|
386
|
-
detached: true,
|
|
387
|
-
stdio: 'ignore',
|
|
388
|
-
env: { ...process.env },
|
|
389
|
-
});
|
|
390
|
-
child.unref();
|
|
391
|
-
// Wait for it to start
|
|
392
|
-
await sleep(1500);
|
|
393
|
-
// Trigger scan via API
|
|
394
|
-
const scanResult = (0, child_process_1.spawnSync)('curl', [
|
|
395
|
-
'-s', '-X', 'POST',
|
|
396
|
-
'http://127.0.0.1:5379/scan',
|
|
397
|
-
'-H', 'Content-Type: application/json',
|
|
398
|
-
'-d', JSON.stringify({}),
|
|
399
|
-
], { timeout: 5000, encoding: 'utf8' });
|
|
400
|
-
if (scanResult.status !== 0) {
|
|
401
|
-
return { step: 'Start daemon & run initial scan', icon: '⚠️', message: 'Daemon started but scan trigger failed (try `npm run dev` manually)', path: null };
|
|
402
|
-
}
|
|
403
|
-
return { step: 'Start daemon & run initial scan', icon: '✅', message: 'Daemon started, initial scan triggered (check dashboard at http://localhost:5378/viz)', path: null };
|
|
404
|
-
}
|
|
405
|
-
// ── Summary ───────────────────────────────────────────────
|
|
406
|
-
function printSummary(results, repoRoot) {
|
|
407
|
-
const successes = results.filter(r => r.icon === '✅').length;
|
|
408
|
-
const warnings = results.filter(r => r.icon === '⚠️').length;
|
|
409
|
-
const skipped = results.filter(r => r.icon === '⏭').length;
|
|
410
|
-
const failures = results.filter(r => r.icon === '❌').length;
|
|
411
|
-
const out = process.stdout.write.bind(process.stdout);
|
|
412
|
-
out(`\n ═══════════════════════════════════\n`);
|
|
413
|
-
out(` Setup complete for ${path.basename(repoRoot)}\n`);
|
|
414
|
-
out(` ${successes} installed · ${skipped} skipped · ${warnings} warnings · ${failures} failed\n`);
|
|
415
|
-
out(` ═══════════════════════════════════\n\n`);
|
|
416
|
-
if (successes > 0) {
|
|
417
|
-
out(' Next steps:\n');
|
|
418
|
-
out(' - Open the dashboard: http://localhost:5378/viz\n');
|
|
419
|
-
out(' - Run npm run dev to restart the daemon manually\n');
|
|
420
|
-
out(' - Use `get_graph_report` in your AI assistant\n');
|
|
421
|
-
out(' - The PostToolUse hook will auto-analyze files on Write/Edit\n\n');
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function sleep(ms) {
|
|
425
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
426
|
-
}
|
|
427
|
-
//# sourceMappingURL=setup-core.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-core.js","sourceRoot":"","sources":["../../src/cli/setup-core.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCH,sDAoCC;AA4CD,gDAsCC;AAID,gEAWC;AAID,4CA6BC;AAID,gDA8BC;AAID,sDAgFC;AAID,0CA6DC;AAID,wCA4CC;AAID,oCAmBC;AArcD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,iDAAiD;AACjD,gDAAiD;AA2BjD,6DAA6D;AAEtD,KAAK,UAAU,qBAAqB,CAAC,IAAkB;IAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC7D,IAAI,EAA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