@kernel.chat/kbot 2.18.0 → 2.19.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/dist/cli.js +77 -0
- package/dist/cli.js.map +1 -1
- package/dist/tools/audit.d.ts +20 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +440 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/contribute.d.ts +2 -0
- package/dist/tools/contribute.d.ts.map +1 -0
- package/dist/tools/contribute.js +262 -0
- package/dist/tools/contribute.js.map +1 -0
- package/dist/tools/documents.d.ts +2 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +460 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +14 -3
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
// K:BOT Audit Tools — Full-spectrum audit of any GitHub repository
|
|
2
|
+
//
|
|
3
|
+
// Security, code quality, documentation, dependency health — all in one report.
|
|
4
|
+
// Designed to be shared. Every audit links back to kbot.
|
|
5
|
+
import { registerTool } from './index.js';
|
|
6
|
+
const GITHUB_API = 'https://api.github.com';
|
|
7
|
+
const HEADERS = {
|
|
8
|
+
'User-Agent': 'KBot/2.18 (Audit)',
|
|
9
|
+
'Accept': 'application/vnd.github.v3+json',
|
|
10
|
+
};
|
|
11
|
+
async function githubFetch(path) {
|
|
12
|
+
const res = await fetch(`${GITHUB_API}${path}`, { headers: HEADERS });
|
|
13
|
+
if (!res.ok)
|
|
14
|
+
throw new Error(`GitHub API ${res.status}: ${path}`);
|
|
15
|
+
return res.json();
|
|
16
|
+
}
|
|
17
|
+
async function rawFetch(repo, path, branch = 'main') {
|
|
18
|
+
for (const b of [branch, 'master']) {
|
|
19
|
+
try {
|
|
20
|
+
const res = await fetch(`https://raw.githubusercontent.com/${repo}/${b}/${path}`, { headers: { 'User-Agent': 'KBot/2.18' } });
|
|
21
|
+
if (res.ok)
|
|
22
|
+
return res.text();
|
|
23
|
+
}
|
|
24
|
+
catch { /* try next */ }
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
function gradeFromPercent(pct) {
|
|
29
|
+
if (pct >= 90)
|
|
30
|
+
return 'A';
|
|
31
|
+
if (pct >= 80)
|
|
32
|
+
return 'B';
|
|
33
|
+
if (pct >= 70)
|
|
34
|
+
return 'C';
|
|
35
|
+
if (pct >= 60)
|
|
36
|
+
return 'D';
|
|
37
|
+
return 'F';
|
|
38
|
+
}
|
|
39
|
+
async function auditRepo(repo) {
|
|
40
|
+
const sections = [];
|
|
41
|
+
// 1. Repository health
|
|
42
|
+
const repoHealth = { name: 'Repository Health', score: 0, maxScore: 20, findings: [], status: 'pass' };
|
|
43
|
+
try {
|
|
44
|
+
const data = await githubFetch(`/repos/${repo}`);
|
|
45
|
+
if (data.description) {
|
|
46
|
+
repoHealth.score += 3;
|
|
47
|
+
repoHealth.findings.push('Has description');
|
|
48
|
+
}
|
|
49
|
+
else
|
|
50
|
+
repoHealth.findings.push('Missing description');
|
|
51
|
+
if (data.license) {
|
|
52
|
+
repoHealth.score += 3;
|
|
53
|
+
repoHealth.findings.push(`License: ${data.license.spdx_id}`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
repoHealth.findings.push('No license detected');
|
|
57
|
+
repoHealth.status = 'warn';
|
|
58
|
+
}
|
|
59
|
+
if (data.topics?.length > 0) {
|
|
60
|
+
repoHealth.score += 2;
|
|
61
|
+
repoHealth.findings.push(`${data.topics.length} topics`);
|
|
62
|
+
}
|
|
63
|
+
else
|
|
64
|
+
repoHealth.findings.push('No topics/tags');
|
|
65
|
+
if (!data.archived) {
|
|
66
|
+
repoHealth.score += 2;
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
repoHealth.findings.push('Repository is archived');
|
|
70
|
+
if (data.has_issues)
|
|
71
|
+
repoHealth.score += 1;
|
|
72
|
+
if (data.has_wiki)
|
|
73
|
+
repoHealth.score += 1;
|
|
74
|
+
// Activity: updated in last 90 days
|
|
75
|
+
const lastUpdate = new Date(data.updated_at);
|
|
76
|
+
const daysAgo = (Date.now() - lastUpdate.getTime()) / 86400000;
|
|
77
|
+
if (daysAgo < 30) {
|
|
78
|
+
repoHealth.score += 4;
|
|
79
|
+
repoHealth.findings.push(`Active — updated ${Math.floor(daysAgo)}d ago`);
|
|
80
|
+
}
|
|
81
|
+
else if (daysAgo < 90) {
|
|
82
|
+
repoHealth.score += 2;
|
|
83
|
+
repoHealth.findings.push(`Updated ${Math.floor(daysAgo)}d ago`);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
repoHealth.findings.push(`Stale — last updated ${Math.floor(daysAgo)}d ago`);
|
|
87
|
+
repoHealth.status = 'warn';
|
|
88
|
+
}
|
|
89
|
+
// Stars as social proof
|
|
90
|
+
if (data.stargazers_count >= 100) {
|
|
91
|
+
repoHealth.score += 4;
|
|
92
|
+
repoHealth.findings.push(`${data.stargazers_count} stars`);
|
|
93
|
+
}
|
|
94
|
+
else if (data.stargazers_count >= 10) {
|
|
95
|
+
repoHealth.score += 2;
|
|
96
|
+
repoHealth.findings.push(`${data.stargazers_count} stars`);
|
|
97
|
+
}
|
|
98
|
+
else
|
|
99
|
+
repoHealth.findings.push(`${data.stargazers_count} stars`);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
repoHealth.findings.push(`Could not fetch repo: ${err.message}`);
|
|
103
|
+
repoHealth.status = 'fail';
|
|
104
|
+
}
|
|
105
|
+
sections.push(repoHealth);
|
|
106
|
+
// 2. Documentation
|
|
107
|
+
const docs = { name: 'Documentation', score: 0, maxScore: 15, findings: [], status: 'pass' };
|
|
108
|
+
const readme = await rawFetch(repo, 'README.md');
|
|
109
|
+
if (readme) {
|
|
110
|
+
docs.score += 3;
|
|
111
|
+
docs.findings.push('Has README.md');
|
|
112
|
+
if (readme.length > 500) {
|
|
113
|
+
docs.score += 2;
|
|
114
|
+
docs.findings.push(`README: ${(readme.length / 1024).toFixed(1)}KB`);
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
docs.findings.push('README is short (< 500 chars)');
|
|
118
|
+
if (/install/i.test(readme)) {
|
|
119
|
+
docs.score += 2;
|
|
120
|
+
docs.findings.push('Has install instructions');
|
|
121
|
+
}
|
|
122
|
+
else
|
|
123
|
+
docs.findings.push('No install instructions found');
|
|
124
|
+
if (/usage|example|getting started/i.test(readme)) {
|
|
125
|
+
docs.score += 2;
|
|
126
|
+
docs.findings.push('Has usage examples');
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
docs.findings.push('No usage examples');
|
|
130
|
+
if (/api|reference|docs/i.test(readme)) {
|
|
131
|
+
docs.score += 1;
|
|
132
|
+
}
|
|
133
|
+
if (/badge|shield/i.test(readme)) {
|
|
134
|
+
docs.score += 1;
|
|
135
|
+
docs.findings.push('Has badges');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
docs.findings.push('No README.md found');
|
|
140
|
+
docs.status = 'fail';
|
|
141
|
+
}
|
|
142
|
+
const contributing = await rawFetch(repo, 'CONTRIBUTING.md');
|
|
143
|
+
if (contributing) {
|
|
144
|
+
docs.score += 2;
|
|
145
|
+
docs.findings.push('Has CONTRIBUTING.md');
|
|
146
|
+
}
|
|
147
|
+
const changelog = await rawFetch(repo, 'CHANGELOG.md');
|
|
148
|
+
if (changelog) {
|
|
149
|
+
docs.score += 2;
|
|
150
|
+
docs.findings.push('Has CHANGELOG.md');
|
|
151
|
+
}
|
|
152
|
+
sections.push(docs);
|
|
153
|
+
// 3. Security
|
|
154
|
+
const security = { name: 'Security', score: 0, maxScore: 15, findings: [], status: 'pass' };
|
|
155
|
+
const securityMd = await rawFetch(repo, 'SECURITY.md');
|
|
156
|
+
if (securityMd) {
|
|
157
|
+
security.score += 3;
|
|
158
|
+
security.findings.push('Has SECURITY.md');
|
|
159
|
+
}
|
|
160
|
+
else
|
|
161
|
+
security.findings.push('No SECURITY.md');
|
|
162
|
+
const gitignore = await rawFetch(repo, '.gitignore');
|
|
163
|
+
if (gitignore) {
|
|
164
|
+
security.score += 2;
|
|
165
|
+
security.findings.push('Has .gitignore');
|
|
166
|
+
if (/\.env/m.test(gitignore)) {
|
|
167
|
+
security.score += 3;
|
|
168
|
+
security.findings.push('.env is gitignored');
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
security.findings.push('.env NOT in .gitignore');
|
|
172
|
+
security.status = 'warn';
|
|
173
|
+
}
|
|
174
|
+
if (/node_modules|__pycache__|target\//m.test(gitignore))
|
|
175
|
+
security.score += 1;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
security.findings.push('No .gitignore');
|
|
179
|
+
security.status = 'warn';
|
|
180
|
+
}
|
|
181
|
+
// Check for common security files
|
|
182
|
+
const codeowners = await rawFetch(repo, 'CODEOWNERS') || await rawFetch(repo, '.github/CODEOWNERS');
|
|
183
|
+
if (codeowners) {
|
|
184
|
+
security.score += 2;
|
|
185
|
+
security.findings.push('Has CODEOWNERS');
|
|
186
|
+
}
|
|
187
|
+
// Check branch protection via API (may fail without auth)
|
|
188
|
+
try {
|
|
189
|
+
const branches = await githubFetch(`/repos/${repo}/branches?per_page=5`);
|
|
190
|
+
const defaultBranch = branches.find((b) => b.name === 'main' || b.name === 'master');
|
|
191
|
+
if (defaultBranch?.protected) {
|
|
192
|
+
security.score += 4;
|
|
193
|
+
security.findings.push('Default branch is protected');
|
|
194
|
+
}
|
|
195
|
+
else
|
|
196
|
+
security.findings.push('Default branch is NOT protected');
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
security.findings.push('Could not check branch protection');
|
|
200
|
+
}
|
|
201
|
+
sections.push(security);
|
|
202
|
+
// 4. Code Quality
|
|
203
|
+
const quality = { name: 'Code Quality', score: 0, maxScore: 20, findings: [], status: 'pass' };
|
|
204
|
+
// Check for linter/formatter configs
|
|
205
|
+
const eslint = await rawFetch(repo, '.eslintrc.json') || await rawFetch(repo, '.eslintrc.js') || await rawFetch(repo, 'eslint.config.js');
|
|
206
|
+
if (eslint) {
|
|
207
|
+
quality.score += 3;
|
|
208
|
+
quality.findings.push('Has ESLint config');
|
|
209
|
+
}
|
|
210
|
+
const prettier = await rawFetch(repo, '.prettierrc') || await rawFetch(repo, '.prettierrc.json');
|
|
211
|
+
if (prettier) {
|
|
212
|
+
quality.score += 2;
|
|
213
|
+
quality.findings.push('Has Prettier config');
|
|
214
|
+
}
|
|
215
|
+
const editorconfig = await rawFetch(repo, '.editorconfig');
|
|
216
|
+
if (editorconfig) {
|
|
217
|
+
quality.score += 1;
|
|
218
|
+
quality.findings.push('Has .editorconfig');
|
|
219
|
+
}
|
|
220
|
+
// TypeScript
|
|
221
|
+
const tsconfig = await rawFetch(repo, 'tsconfig.json');
|
|
222
|
+
if (tsconfig) {
|
|
223
|
+
quality.score += 3;
|
|
224
|
+
quality.findings.push('Uses TypeScript');
|
|
225
|
+
if (/"strict"\s*:\s*true/i.test(tsconfig)) {
|
|
226
|
+
quality.score += 2;
|
|
227
|
+
quality.findings.push('Strict mode enabled');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// CI/CD
|
|
231
|
+
const ghaWorkflow = await rawFetch(repo, '.github/workflows/ci.yml') ||
|
|
232
|
+
await rawFetch(repo, '.github/workflows/ci.yaml') ||
|
|
233
|
+
await rawFetch(repo, '.github/workflows/test.yml') ||
|
|
234
|
+
await rawFetch(repo, '.circleci/config.yml') ||
|
|
235
|
+
await rawFetch(repo, '.travis.yml');
|
|
236
|
+
if (ghaWorkflow) {
|
|
237
|
+
quality.score += 4;
|
|
238
|
+
quality.findings.push('Has CI/CD pipeline');
|
|
239
|
+
}
|
|
240
|
+
else
|
|
241
|
+
quality.findings.push('No CI/CD detected');
|
|
242
|
+
// Tests
|
|
243
|
+
const pkg = await rawFetch(repo, 'package.json');
|
|
244
|
+
if (pkg) {
|
|
245
|
+
try {
|
|
246
|
+
const pkgData = JSON.parse(pkg);
|
|
247
|
+
if (pkgData.scripts?.test && pkgData.scripts.test !== 'echo "Error: no test specified" && exit 1') {
|
|
248
|
+
quality.score += 3;
|
|
249
|
+
quality.findings.push(`Test script: ${pkgData.scripts.test.slice(0, 60)}`);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
quality.findings.push('No test script configured');
|
|
253
|
+
quality.status = 'warn';
|
|
254
|
+
}
|
|
255
|
+
// Check for outdated/vulnerable patterns
|
|
256
|
+
const deps = { ...pkgData.dependencies, ...pkgData.devDependencies };
|
|
257
|
+
const depCount = Object.keys(deps || {}).length;
|
|
258
|
+
quality.findings.push(`${depCount} dependencies`);
|
|
259
|
+
if (depCount > 100) {
|
|
260
|
+
quality.findings.push('High dependency count (>100) — supply chain risk');
|
|
261
|
+
quality.status = 'warn';
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
catch { /* not valid JSON */ }
|
|
265
|
+
}
|
|
266
|
+
const pyproject = await rawFetch(repo, 'pyproject.toml');
|
|
267
|
+
if (pyproject) {
|
|
268
|
+
quality.score += 2;
|
|
269
|
+
quality.findings.push('Has pyproject.toml');
|
|
270
|
+
if (/\[tool\.pytest/m.test(pyproject)) {
|
|
271
|
+
quality.score += 2;
|
|
272
|
+
quality.findings.push('Has pytest config');
|
|
273
|
+
}
|
|
274
|
+
if (/\[tool\.(ruff|black|isort)/m.test(pyproject)) {
|
|
275
|
+
quality.score += 1;
|
|
276
|
+
quality.findings.push('Has Python linter config');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const cargoToml = await rawFetch(repo, 'Cargo.toml');
|
|
280
|
+
if (cargoToml) {
|
|
281
|
+
quality.score += 2;
|
|
282
|
+
quality.findings.push('Uses Rust (Cargo.toml)');
|
|
283
|
+
if (/clippy/i.test(ghaWorkflow || '')) {
|
|
284
|
+
quality.score += 2;
|
|
285
|
+
quality.findings.push('Runs clippy in CI');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
sections.push(quality);
|
|
289
|
+
// 5. Community & Governance
|
|
290
|
+
const community = { name: 'Community', score: 0, maxScore: 15, findings: [], status: 'pass' };
|
|
291
|
+
const coc = await rawFetch(repo, 'CODE_OF_CONDUCT.md');
|
|
292
|
+
if (coc) {
|
|
293
|
+
community.score += 3;
|
|
294
|
+
community.findings.push('Has Code of Conduct');
|
|
295
|
+
}
|
|
296
|
+
if (contributing)
|
|
297
|
+
community.score += 3;
|
|
298
|
+
try {
|
|
299
|
+
const issues = await githubFetch(`/repos/${repo}/issues?state=open&per_page=5`);
|
|
300
|
+
if (Array.isArray(issues)) {
|
|
301
|
+
community.findings.push(`${issues.length}+ open issues`);
|
|
302
|
+
// Check if issues have labels
|
|
303
|
+
const labeled = issues.filter((i) => i.labels?.length > 0);
|
|
304
|
+
if (labeled.length > 0) {
|
|
305
|
+
community.score += 2;
|
|
306
|
+
community.findings.push('Issues are labeled');
|
|
307
|
+
}
|
|
308
|
+
// Check for issue templates
|
|
309
|
+
const issueTemplate = await rawFetch(repo, '.github/ISSUE_TEMPLATE/bug_report.md') ||
|
|
310
|
+
await rawFetch(repo, '.github/ISSUE_TEMPLATE.md');
|
|
311
|
+
if (issueTemplate) {
|
|
312
|
+
community.score += 2;
|
|
313
|
+
community.findings.push('Has issue templates');
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
catch { /* rate limited */ }
|
|
318
|
+
const prTemplate = await rawFetch(repo, '.github/PULL_REQUEST_TEMPLATE.md');
|
|
319
|
+
if (prTemplate) {
|
|
320
|
+
community.score += 2;
|
|
321
|
+
community.findings.push('Has PR template');
|
|
322
|
+
}
|
|
323
|
+
try {
|
|
324
|
+
const contributors = await githubFetch(`/repos/${repo}/contributors?per_page=100`);
|
|
325
|
+
if (Array.isArray(contributors)) {
|
|
326
|
+
community.score += Math.min(3, Math.floor(contributors.length / 5));
|
|
327
|
+
community.findings.push(`${contributors.length} contributors`);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
catch { /* rate limited */ }
|
|
331
|
+
sections.push(community);
|
|
332
|
+
// 6. DevOps & Infrastructure
|
|
333
|
+
const devops = { name: 'DevOps', score: 0, maxScore: 15, findings: [], status: 'pass' };
|
|
334
|
+
const dockerfile = await rawFetch(repo, 'Dockerfile');
|
|
335
|
+
if (dockerfile) {
|
|
336
|
+
devops.score += 3;
|
|
337
|
+
devops.findings.push('Has Dockerfile');
|
|
338
|
+
if (/HEALTHCHECK/i.test(dockerfile)) {
|
|
339
|
+
devops.score += 1;
|
|
340
|
+
devops.findings.push('Docker health check configured');
|
|
341
|
+
}
|
|
342
|
+
if (/FROM .* AS /i.test(dockerfile)) {
|
|
343
|
+
devops.score += 1;
|
|
344
|
+
devops.findings.push('Multi-stage Docker build');
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const compose = await rawFetch(repo, 'docker-compose.yml') || await rawFetch(repo, 'docker-compose.yaml');
|
|
348
|
+
if (compose) {
|
|
349
|
+
devops.score += 2;
|
|
350
|
+
devops.findings.push('Has docker-compose');
|
|
351
|
+
}
|
|
352
|
+
if (ghaWorkflow)
|
|
353
|
+
devops.score += 3;
|
|
354
|
+
const lockfile = await rawFetch(repo, 'package-lock.json') || await rawFetch(repo, 'yarn.lock') ||
|
|
355
|
+
await rawFetch(repo, 'pnpm-lock.yaml') || await rawFetch(repo, 'Cargo.lock') ||
|
|
356
|
+
await rawFetch(repo, 'poetry.lock');
|
|
357
|
+
if (lockfile !== null) {
|
|
358
|
+
devops.score += 3;
|
|
359
|
+
devops.findings.push('Has lockfile (reproducible builds)');
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
devops.findings.push('No lockfile');
|
|
363
|
+
devops.status = 'warn';
|
|
364
|
+
}
|
|
365
|
+
const renovate = await rawFetch(repo, 'renovate.json') || await rawFetch(repo, '.github/dependabot.yml');
|
|
366
|
+
if (renovate) {
|
|
367
|
+
devops.score += 3;
|
|
368
|
+
devops.findings.push('Has automated dependency updates');
|
|
369
|
+
}
|
|
370
|
+
sections.push(devops);
|
|
371
|
+
// Calculate totals
|
|
372
|
+
const totalScore = sections.reduce((sum, s) => sum + s.score, 0);
|
|
373
|
+
const totalMax = sections.reduce((sum, s) => sum + s.maxScore, 0);
|
|
374
|
+
const pct = Math.round((totalScore / totalMax) * 100);
|
|
375
|
+
const grade = gradeFromPercent(pct);
|
|
376
|
+
// Set section statuses
|
|
377
|
+
for (const s of sections) {
|
|
378
|
+
const sPct = s.maxScore > 0 ? (s.score / s.maxScore) * 100 : 0;
|
|
379
|
+
if (s.status !== 'fail') {
|
|
380
|
+
s.status = sPct >= 60 ? 'pass' : 'warn';
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// Generate summary
|
|
384
|
+
const fails = sections.filter(s => s.status === 'fail');
|
|
385
|
+
const warns = sections.filter(s => s.status === 'warn');
|
|
386
|
+
const summary = fails.length > 0
|
|
387
|
+
? `${fails.length} critical issue(s) found. ${warns.length} warning(s).`
|
|
388
|
+
: warns.length > 0
|
|
389
|
+
? `No critical issues. ${warns.length} area(s) need improvement.`
|
|
390
|
+
: 'All checks passed. Well-maintained repository.';
|
|
391
|
+
return { repo, score: totalScore, maxScore: totalMax, grade, sections, summary };
|
|
392
|
+
}
|
|
393
|
+
function formatAuditReport(result) {
|
|
394
|
+
const statusIcon = (s) => s === 'pass' ? '✅' : s === 'warn' ? '⚠️' : '❌';
|
|
395
|
+
const pct = Math.round((result.score / result.maxScore) * 100);
|
|
396
|
+
const lines = [
|
|
397
|
+
`# Audit Report: ${result.repo}`,
|
|
398
|
+
'',
|
|
399
|
+
`> Generated by [K:BOT](https://www.npmjs.com/package/@kernel.chat/kbot) — open-source AI agent`,
|
|
400
|
+
'',
|
|
401
|
+
`## Score: ${result.score}/${result.maxScore} (${pct}%) — Grade ${result.grade}`,
|
|
402
|
+
'',
|
|
403
|
+
`**${result.summary}**`,
|
|
404
|
+
'',
|
|
405
|
+
];
|
|
406
|
+
for (const section of result.sections) {
|
|
407
|
+
const sPct = section.maxScore > 0 ? Math.round((section.score / section.maxScore) * 100) : 0;
|
|
408
|
+
lines.push(`### ${statusIcon(section.status)} ${section.name} — ${section.score}/${section.maxScore} (${sPct}%)`);
|
|
409
|
+
for (const f of section.findings) {
|
|
410
|
+
lines.push(`- ${f}`);
|
|
411
|
+
}
|
|
412
|
+
lines.push('');
|
|
413
|
+
}
|
|
414
|
+
lines.push('---', '', `*Audited by [K:BOT](https://www.npmjs.com/package/@kernel.chat/kbot) — 39 specialists, 216 tools, 20 AI providers*`, `*Install: \`npm install -g @kernel.chat/kbot\` | [GitHub](https://github.com/isaacsight/kernel)*`);
|
|
415
|
+
return lines.join('\n');
|
|
416
|
+
}
|
|
417
|
+
export function registerAuditTools() {
|
|
418
|
+
registerTool({
|
|
419
|
+
name: 'repo_audit',
|
|
420
|
+
description: 'Run a full audit on any GitHub repository. Checks security, documentation, code quality, CI/CD, community health, and DevOps practices. Returns a scored report with grade (A-F). Use to evaluate any open-source project before using or contributing.',
|
|
421
|
+
parameters: {
|
|
422
|
+
repo: { type: 'string', description: 'Repository in "owner/repo" format (e.g., "facebook/react")', required: true },
|
|
423
|
+
},
|
|
424
|
+
tier: 'free',
|
|
425
|
+
timeout: 60_000,
|
|
426
|
+
async execute(args) {
|
|
427
|
+
const repo = String(args.repo);
|
|
428
|
+
try {
|
|
429
|
+
const result = await auditRepo(repo);
|
|
430
|
+
return formatAuditReport(result);
|
|
431
|
+
}
|
|
432
|
+
catch (err) {
|
|
433
|
+
return `Audit failed: ${err instanceof Error ? err.message : String(err)}`;
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
// Export for CLI subcommand
|
|
439
|
+
export { auditRepo, formatAuditReport };
|
|
440
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","source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