@kb-labs/quality-entry 2.94.0 → 2.96.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/commands/build-order.d.ts +5 -12
- package/dist/cli/commands/build-order.js +45 -97
- package/dist/cli/commands/build-order.js.map +1 -1
- package/dist/cli/commands/check-layers.d.ts +9 -0
- package/dist/cli/commands/check-layers.js +48 -0
- package/dist/cli/commands/check-layers.js.map +1 -0
- package/dist/cli/commands/context.d.ts +9 -0
- package/dist/cli/commands/context.js +94 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/coupling.d.ts +9 -0
- package/dist/cli/commands/coupling.js +35 -0
- package/dist/cli/commands/coupling.js.map +1 -0
- package/dist/cli/commands/dead-code.d.ts +4 -5
- package/dist/cli/commands/dead-code.js +41 -197
- package/dist/cli/commands/dead-code.js.map +1 -1
- package/dist/cli/commands/fix-deps.d.ts +2 -5
- package/dist/cli/commands/fix-deps.js +74 -83
- package/dist/cli/commands/fix-deps.js.map +1 -1
- package/dist/cli/commands/flags.d.ts +115 -1
- package/dist/cli/commands/flags.js +46 -1
- package/dist/cli/commands/flags.js.map +1 -1
- package/dist/cli/commands/gate.d.ts +9 -0
- package/dist/cli/commands/gate.js +59 -0
- package/dist/cli/commands/gate.js.map +1 -0
- package/dist/cli/commands/health.d.ts +4 -5
- package/dist/cli/commands/health.js +42 -191
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.d.ts +9 -0
- package/dist/cli/commands/history.js +55 -0
- package/dist/cli/commands/history.js.map +1 -0
- package/dist/cli/commands/index.d.ts +6 -2
- package/dist/cli/commands/index.js +411 -828
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/snapshot.d.ts +9 -0
- package/dist/cli/commands/snapshot.js +91 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +4 -5
- package/dist/cli/commands/stats.js +17 -265
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +198 -306
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +95 -82
- package/dist/manifest.js +198 -306
- package/dist/manifest.js.map +1 -1
- package/dist/rest/handlers/build-order-handler.d.ts +5 -13
- package/dist/rest/handlers/build-order-handler.js +14 -17
- package/dist/rest/handlers/build-order-handler.js.map +1 -1
- package/dist/rest/handlers/builds-handler.js +10 -6
- package/dist/rest/handlers/builds-handler.js.map +1 -1
- package/dist/rest/handlers/coupling-handler.d.ts +8 -0
- package/dist/rest/handlers/coupling-handler.js +28 -0
- package/dist/rest/handlers/coupling-handler.js.map +1 -0
- package/dist/rest/handlers/cycles-handler.js +16 -12
- package/dist/rest/handlers/cycles-handler.js.map +1 -1
- package/dist/rest/handlers/dependencies-handler.js +12 -8
- package/dist/rest/handlers/dependencies-handler.js.map +1 -1
- package/dist/rest/handlers/graph-handler.js +77 -73
- package/dist/rest/handlers/graph-handler.js.map +1 -1
- package/dist/rest/handlers/health-handler.d.ts +4 -11
- package/dist/rest/handlers/health-handler.js +35 -9
- package/dist/rest/handlers/health-handler.js.map +1 -1
- package/dist/rest/handlers/history-handler.d.ts +7 -0
- package/dist/rest/handlers/history-handler.js +21 -0
- package/dist/rest/handlers/history-handler.js.map +1 -0
- package/dist/rest/handlers/knip-handler.d.ts +8 -0
- package/dist/rest/handlers/knip-handler.js +31 -0
- package/dist/rest/handlers/knip-handler.js.map +1 -0
- package/dist/rest/handlers/layers-handler.d.ts +8 -0
- package/dist/rest/handlers/layers-handler.js +28 -0
- package/dist/rest/handlers/layers-handler.js.map +1 -0
- package/dist/rest/handlers/snapshot-handler.d.ts +7 -0
- package/dist/rest/handlers/snapshot-handler.js +67 -0
- package/dist/rest/handlers/snapshot-handler.js.map +1 -0
- package/dist/rest/handlers/stale-handler.js +13 -9
- package/dist/rest/handlers/stale-handler.js.map +1 -1
- package/dist/rest/handlers/stats-handler.d.ts +4 -9
- package/dist/rest/handlers/stats-handler.js +22 -18
- package/dist/rest/handlers/stats-handler.js.map +1 -1
- package/dist/rest/handlers/tests-handler.js +12 -8
- package/dist/rest/handlers/tests-handler.js.map +1 -1
- package/dist/rest/handlers/types-handler.js +10 -6
- package/dist/rest/handlers/types-handler.js.map +1 -1
- package/dist/widgets/117.js +24 -1
- package/dist/widgets/117.js.map +1 -1
- package/dist/widgets/370.js +1 -1
- package/dist/widgets/370.js.map +1 -1
- package/dist/widgets/62.js +97 -0
- package/dist/widgets/62.js.map +1 -0
- package/dist/widgets/__federation_expose_QualityOverview.js +1 -1
- package/dist/widgets/__federation_expose_QualityOverview.js.map +1 -1
- package/dist/widgets/mf-manifest.json +27 -27
- package/dist/widgets/mf-stats.json +27 -27
- package/dist/widgets/remoteEntry.js +2 -2
- package/dist/widgets/remoteEntry.js.map +1 -1
- package/package.json +9 -8
- package/dist/widgets/418.js +0 -39
- package/dist/widgets/418.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -42,6 +42,11 @@ var healthFlags = {
|
|
|
42
42
|
description: "Show detailed breakdown",
|
|
43
43
|
default: false,
|
|
44
44
|
alias: "d"
|
|
45
|
+
},
|
|
46
|
+
refresh: {
|
|
47
|
+
type: "boolean",
|
|
48
|
+
description: "Bypass cache and recompute",
|
|
49
|
+
default: false
|
|
45
50
|
}
|
|
46
51
|
};
|
|
47
52
|
var fixDepsFlags = {
|
|
@@ -223,6 +228,22 @@ var checkTestsFlags = {
|
|
|
223
228
|
default: false
|
|
224
229
|
}
|
|
225
230
|
};
|
|
231
|
+
var checkLayersFlags = {
|
|
232
|
+
json: { type: "boolean", description: "Output JSON format", default: false },
|
|
233
|
+
package: { type: "string", description: "Filter violations by package name", alias: "p" }
|
|
234
|
+
};
|
|
235
|
+
var couplingFlags = {
|
|
236
|
+
json: { type: "boolean", description: "Output JSON format", default: false },
|
|
237
|
+
sort: { type: "string", description: "Sort by: instability | coupled", default: "instability" },
|
|
238
|
+
top: { type: "number", description: "Show top N packages", default: 10 }
|
|
239
|
+
};
|
|
240
|
+
var snapshotFlags = {
|
|
241
|
+
json: { type: "boolean", description: "Output JSON format", default: false }
|
|
242
|
+
};
|
|
243
|
+
var historyFlags = {
|
|
244
|
+
json: { type: "boolean", description: "Output JSON format", default: false },
|
|
245
|
+
limit: { type: "number", description: "Number of entries to show", default: 10 }
|
|
246
|
+
};
|
|
226
247
|
var deadCodeFlags = {
|
|
227
248
|
package: {
|
|
228
249
|
type: "string",
|
|
@@ -265,375 +286,246 @@ var deadCodeFlags = {
|
|
|
265
286
|
default: false
|
|
266
287
|
}
|
|
267
288
|
};
|
|
289
|
+
var contextFlags = {
|
|
290
|
+
package: {
|
|
291
|
+
type: "string",
|
|
292
|
+
description: "Package name to get context for",
|
|
293
|
+
alias: "p"
|
|
294
|
+
},
|
|
295
|
+
json: {
|
|
296
|
+
type: "boolean",
|
|
297
|
+
description: "Output JSON format",
|
|
298
|
+
default: false
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
var gateFlags = {
|
|
302
|
+
json: {
|
|
303
|
+
type: "boolean",
|
|
304
|
+
description: "Output JSON format",
|
|
305
|
+
default: false
|
|
306
|
+
},
|
|
307
|
+
strict: {
|
|
308
|
+
type: "boolean",
|
|
309
|
+
description: "Fail even on pre-existing violations (not just new ones)",
|
|
310
|
+
default: false
|
|
311
|
+
}
|
|
312
|
+
};
|
|
268
313
|
|
|
269
314
|
// src/manifest.ts
|
|
270
|
-
var pluginPermissions = combinePermissions().with(kbPlatformPreset).withFs({
|
|
271
|
-
|
|
272
|
-
allow: ["**"]
|
|
273
|
-
// Access to entire monorepo
|
|
274
|
-
}).withPlatform({
|
|
275
|
-
cache: ["quality:"],
|
|
276
|
-
// Cache namespace prefix
|
|
277
|
-
analytics: true
|
|
278
|
-
// Track command usage
|
|
279
|
-
}).withQuotas({
|
|
280
|
-
timeoutMs: 3e5,
|
|
281
|
-
// 5 minutes for long-running operations
|
|
282
|
-
memoryMb: 1024
|
|
283
|
-
// 1GB memory
|
|
284
|
-
}).build();
|
|
285
|
-
var heavyOperationsPermissions = combinePermissions().with(kbPlatformPreset).withFs({
|
|
286
|
-
mode: "readWrite",
|
|
287
|
-
allow: ["**"]
|
|
288
|
-
}).withPlatform({
|
|
289
|
-
cache: ["quality:"],
|
|
290
|
-
analytics: true
|
|
291
|
-
}).withQuotas({
|
|
292
|
-
timeoutMs: 6e5,
|
|
293
|
-
// 10 minutes for heavy operations
|
|
294
|
-
memoryMb: 2048
|
|
295
|
-
// 2GB memory
|
|
296
|
-
}).build();
|
|
315
|
+
var pluginPermissions = combinePermissions().with(kbPlatformPreset).withFs({ mode: "readWrite", allow: ["**"] }).withShell({ allow: ["pnpm", "git"] }).withPlatform({ cache: ["quality:"], analytics: true }).withQuotas({ timeoutMs: 3e5, memoryMb: 1024 }).build();
|
|
316
|
+
var heavyPermissions = combinePermissions().with(kbPlatformPreset).withFs({ mode: "readWrite", allow: ["**"] }).withShell({ allow: ["pnpm", "git"] }).withPlatform({ cache: ["quality:"], analytics: true }).withQuotas({ timeoutMs: 6e5, memoryMb: 2048 }).build();
|
|
297
317
|
var manifest = {
|
|
298
318
|
schema: "kb.plugin/3",
|
|
299
319
|
id: "@kb-labs/quality",
|
|
300
320
|
version: "0.1.0",
|
|
321
|
+
configSection: "quality",
|
|
301
322
|
display: {
|
|
302
|
-
name: "Quality
|
|
303
|
-
description: "
|
|
304
|
-
tags: ["quality", "
|
|
323
|
+
name: "Quality",
|
|
324
|
+
description: "Code quality, architecture analysis, and trend tracking",
|
|
325
|
+
tags: ["quality", "architecture", "coupling", "monorepo"]
|
|
305
326
|
},
|
|
306
327
|
platform: {
|
|
307
328
|
requires: ["storage", "cache"],
|
|
308
329
|
optional: ["analytics", "logger"]
|
|
309
330
|
},
|
|
310
331
|
cli: {
|
|
332
|
+
groupMeta: [
|
|
333
|
+
{ path: "quality", describe: "Code quality, architecture analysis, and trend tracking." },
|
|
334
|
+
{ path: "quality check", describe: "Static analysis checks (layers, types, builds, tests)" },
|
|
335
|
+
{ path: "quality fix", describe: "Auto-fix quality issues" }
|
|
336
|
+
],
|
|
311
337
|
commands: [
|
|
312
|
-
//
|
|
313
|
-
// quality:stats - Monorepo statistics and health score
|
|
314
|
-
// ======================================================================
|
|
338
|
+
// ── Overview ────────────────────────────────────────────────────────────
|
|
315
339
|
{
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
340
|
+
path: "quality stats",
|
|
341
|
+
category: "Overview",
|
|
342
|
+
operationType: "read",
|
|
343
|
+
describe: "Monorepo statistics",
|
|
320
344
|
handler: "./cli/commands/stats.js#default",
|
|
321
|
-
handlerPath: "./cli/commands/stats.js",
|
|
322
345
|
flags: defineCommandFlags(statsFlags),
|
|
323
|
-
examples: [
|
|
324
|
-
"kb quality:stats",
|
|
325
|
-
"kb quality:stats --health",
|
|
326
|
-
"kb quality:stats --json",
|
|
327
|
-
"kb quality:stats --md"
|
|
328
|
-
],
|
|
346
|
+
examples: ["kb quality stats", "kb quality stats --json"],
|
|
329
347
|
permissions: pluginPermissions
|
|
330
348
|
},
|
|
331
|
-
// ======================================================================
|
|
332
|
-
// quality:health - Monorepo health check
|
|
333
|
-
// ======================================================================
|
|
334
349
|
{
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
350
|
+
path: "quality health",
|
|
351
|
+
category: "Overview",
|
|
352
|
+
operationType: "analyze",
|
|
353
|
+
describe: "Multidimensional health score (architecture, TypeScript, dead code, deps)",
|
|
339
354
|
handler: "./cli/commands/health.js#default",
|
|
340
|
-
handlerPath: "./cli/commands/health.js",
|
|
341
355
|
flags: defineCommandFlags(healthFlags),
|
|
342
|
-
examples: [
|
|
343
|
-
"kb quality:health",
|
|
344
|
-
"kb quality:health --detailed",
|
|
345
|
-
"kb quality:health --package @kb-labs/core",
|
|
346
|
-
"kb quality:health --json"
|
|
347
|
-
],
|
|
356
|
+
examples: ["kb quality health", "kb quality health --json", "kb quality health --detailed"],
|
|
348
357
|
permissions: pluginPermissions
|
|
349
358
|
},
|
|
350
|
-
// ======================================================================
|
|
351
|
-
// quality:fix-deps - Dependency auto-fixer
|
|
352
|
-
// ======================================================================
|
|
353
359
|
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
handler: "./cli/commands/
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
examples: [
|
|
362
|
-
"kb quality:fix-deps --stats",
|
|
363
|
-
"kb quality:fix-deps --remove-unused --dry-run",
|
|
364
|
-
"kb quality:fix-deps --align-versions",
|
|
365
|
-
"kb quality:fix-deps --all --dry-run"
|
|
366
|
-
],
|
|
360
|
+
path: "quality snapshot",
|
|
361
|
+
category: "Overview",
|
|
362
|
+
operationType: "mutate",
|
|
363
|
+
describe: "Collect all metrics and save a snapshot for trend tracking",
|
|
364
|
+
handler: "./cli/commands/snapshot.js#default",
|
|
365
|
+
flags: defineCommandFlags(snapshotFlags),
|
|
366
|
+
examples: ["kb quality snapshot", "kb quality snapshot --json"],
|
|
367
367
|
permissions: pluginPermissions
|
|
368
368
|
},
|
|
369
|
-
// ======================================================================
|
|
370
|
-
// quality:build-order - Calculate build order with topological sort
|
|
371
|
-
// ======================================================================
|
|
372
369
|
{
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
handler: "./cli/commands/
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
examples: [
|
|
381
|
-
"kb quality:build-order",
|
|
382
|
-
"kb quality:build-order --layers",
|
|
383
|
-
"kb quality:build-order --package @kb-labs/core",
|
|
384
|
-
"kb quality:build-order --script > build.sh"
|
|
385
|
-
],
|
|
370
|
+
path: "quality history",
|
|
371
|
+
category: "Overview",
|
|
372
|
+
operationType: "read",
|
|
373
|
+
describe: "Show quality snapshot history and delta trends",
|
|
374
|
+
handler: "./cli/commands/history.js#default",
|
|
375
|
+
flags: defineCommandFlags(historyFlags),
|
|
376
|
+
examples: ["kb quality history", "kb quality history --json", "kb quality history --limit 20"],
|
|
386
377
|
permissions: pluginPermissions
|
|
387
378
|
},
|
|
388
|
-
//
|
|
389
|
-
// quality:cycles - Detect circular dependencies
|
|
390
|
-
// ======================================================================
|
|
379
|
+
// ── Agent ────────────────────────────────────────────────────────────────
|
|
391
380
|
{
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
handler: "./cli/commands/
|
|
397
|
-
|
|
398
|
-
flags: defineCommandFlags(cyclesFlags),
|
|
381
|
+
path: "quality context",
|
|
382
|
+
category: "Agent",
|
|
383
|
+
operationType: "read",
|
|
384
|
+
describe: "Package context for agents: layer, dependents, dependencies (fast, stateless)",
|
|
385
|
+
handler: "./cli/commands/context.js#default",
|
|
386
|
+
flags: defineCommandFlags(contextFlags),
|
|
399
387
|
examples: [
|
|
400
|
-
"kb quality
|
|
401
|
-
"kb quality
|
|
388
|
+
"kb quality context --package @kb-labs/sdk",
|
|
389
|
+
"kb quality context --package @kb-labs/sdk --json",
|
|
390
|
+
"kb quality context --json"
|
|
402
391
|
],
|
|
403
392
|
permissions: pluginPermissions
|
|
404
393
|
},
|
|
405
|
-
// ======================================================================
|
|
406
|
-
// quality:visualize - Visualize dependency graph
|
|
407
|
-
// ======================================================================
|
|
408
394
|
{
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
handler: "./cli/commands/
|
|
414
|
-
|
|
415
|
-
flags: defineCommandFlags(visualizeFlags),
|
|
395
|
+
path: "quality gate",
|
|
396
|
+
category: "Agent",
|
|
397
|
+
operationType: "analyze",
|
|
398
|
+
describe: "Architecture gate: fail if new layering violations introduced",
|
|
399
|
+
handler: "./cli/commands/gate.js#default",
|
|
400
|
+
flags: defineCommandFlags(gateFlags),
|
|
416
401
|
examples: [
|
|
417
|
-
"kb quality
|
|
418
|
-
"kb quality
|
|
419
|
-
"kb quality
|
|
420
|
-
"kb quality:visualize --impact --package @kb-labs/core",
|
|
421
|
-
"kb quality:visualize --dot > deps.dot"
|
|
402
|
+
"kb quality gate",
|
|
403
|
+
"kb quality gate --json",
|
|
404
|
+
"kb quality gate --strict"
|
|
422
405
|
],
|
|
423
406
|
permissions: pluginPermissions
|
|
424
407
|
},
|
|
425
|
-
//
|
|
426
|
-
// quality:check-builds - Check build status across monorepo
|
|
427
|
-
// ======================================================================
|
|
428
|
-
{
|
|
429
|
-
id: "check-builds",
|
|
430
|
-
group: "quality",
|
|
431
|
-
describe: "Check build status across monorepo",
|
|
432
|
-
longDescription: "Analyzes build status across all packages with build scripts. Detects build failures with error messages and stale builds (dist/ older than src/). Results are cached for 10 minutes.",
|
|
433
|
-
handler: "./cli/commands/check-builds.js#default",
|
|
434
|
-
handlerPath: "./cli/commands/check-builds.js",
|
|
435
|
-
flags: defineCommandFlags(checkBuildsFlags),
|
|
436
|
-
examples: [
|
|
437
|
-
"kb quality:check-builds",
|
|
438
|
-
"kb quality:check-builds --package @kb-labs/core",
|
|
439
|
-
"kb quality:check-builds --timeout 60000",
|
|
440
|
-
"kb quality:check-builds --json",
|
|
441
|
-
"kb quality:check-builds --refresh"
|
|
442
|
-
],
|
|
443
|
-
permissions: heavyOperationsPermissions
|
|
444
|
-
},
|
|
445
|
-
// ======================================================================
|
|
446
|
-
// quality:check-types - TypeScript type safety analysis
|
|
447
|
-
// ======================================================================
|
|
408
|
+
// ── Architecture ─────────────────────────────────────────────────────────
|
|
448
409
|
{
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
handler: "./cli/commands/check-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
examples: [
|
|
457
|
-
"kb quality:check-types",
|
|
458
|
-
"kb quality:check-types --package @kb-labs/core",
|
|
459
|
-
"kb quality:check-types --errors-only",
|
|
460
|
-
"kb quality:check-types --json",
|
|
461
|
-
"kb quality:check-types --refresh"
|
|
462
|
-
],
|
|
463
|
-
permissions: heavyOperationsPermissions
|
|
464
|
-
},
|
|
465
|
-
// ======================================================================
|
|
466
|
-
// quality:check-tests - Test execution and coverage tracking
|
|
467
|
-
// ======================================================================
|
|
468
|
-
{
|
|
469
|
-
id: "check-tests",
|
|
470
|
-
group: "quality",
|
|
471
|
-
describe: "Run tests and track coverage across monorepo",
|
|
472
|
-
longDescription: "Runs tests across all packages with test scripts and collects coverage statistics. Parses test output (vitest/jest) to extract test counts and reads coverage-summary.json. Results are cached for 5 minutes.",
|
|
473
|
-
handler: "./cli/commands/check-tests.js#default",
|
|
474
|
-
handlerPath: "./cli/commands/check-tests.js",
|
|
475
|
-
flags: defineCommandFlags(checkTestsFlags),
|
|
476
|
-
examples: [
|
|
477
|
-
"kb quality:check-tests",
|
|
478
|
-
"kb quality:check-tests --package @kb-labs/core",
|
|
479
|
-
"kb quality:check-tests --with-coverage",
|
|
480
|
-
"kb quality:check-tests --coverage-only",
|
|
481
|
-
"kb quality:check-tests --timeout 120000",
|
|
482
|
-
"kb quality:check-tests --json"
|
|
483
|
-
],
|
|
484
|
-
permissions: heavyOperationsPermissions
|
|
485
|
-
},
|
|
486
|
-
// ======================================================================
|
|
487
|
-
// quality:dead-code - Dead code file detection
|
|
488
|
-
// ======================================================================
|
|
489
|
-
{
|
|
490
|
-
id: "dead-code",
|
|
491
|
-
group: "quality",
|
|
492
|
-
describe: "Detect dead (unreachable) source files",
|
|
493
|
-
longDescription: "Analyzes import graph to find source files not reachable from any entry point (package.json, tsup.config.ts, manifest.ts). Supports automated removal with backup and restore capabilities. Zero false positives by design.",
|
|
494
|
-
handler: "./cli/commands/dead-code.js#default",
|
|
495
|
-
handlerPath: "./cli/commands/dead-code.js",
|
|
496
|
-
flags: defineCommandFlags(deadCodeFlags),
|
|
497
|
-
examples: [
|
|
498
|
-
"kb quality:dead-code",
|
|
499
|
-
"kb quality:dead-code --package @kb-labs/core",
|
|
500
|
-
"kb quality:dead-code --auto-remove --dry-run",
|
|
501
|
-
"kb quality:dead-code --auto-remove",
|
|
502
|
-
"kb quality:dead-code --list-backups",
|
|
503
|
-
"kb quality:dead-code --restore 2026-02-15T10-30-00",
|
|
504
|
-
"kb quality:dead-code --json"
|
|
505
|
-
],
|
|
410
|
+
path: "quality check layers",
|
|
411
|
+
category: "Architecture",
|
|
412
|
+
operationType: "analyze",
|
|
413
|
+
describe: "Detect layering violations (lower layer importing higher layer)",
|
|
414
|
+
handler: "./cli/commands/check-layers.js#default",
|
|
415
|
+
flags: defineCommandFlags(checkLayersFlags),
|
|
416
|
+
examples: ["kb quality check layers", "kb quality check layers --json", "kb quality check layers --package @kb-labs/plugins-qa"],
|
|
506
417
|
permissions: pluginPermissions
|
|
507
|
-
}
|
|
508
|
-
]
|
|
509
|
-
},
|
|
510
|
-
// REST API routes
|
|
511
|
-
rest: {
|
|
512
|
-
basePath: QUALITY_BASE_PATH,
|
|
513
|
-
routes: [
|
|
514
|
-
// GET /stats
|
|
515
|
-
{
|
|
516
|
-
method: "GET",
|
|
517
|
-
path: QUALITY_ROUTES.STATS,
|
|
518
|
-
handler: "./rest/handlers/stats-handler.js#default",
|
|
519
|
-
input: {
|
|
520
|
-
zod: "@kb-labs/quality-contracts#StatsRequestSchema"
|
|
521
|
-
},
|
|
522
|
-
output: {
|
|
523
|
-
zod: "@kb-labs/quality-contracts#StatsResponseSchema"
|
|
524
|
-
}
|
|
525
418
|
},
|
|
526
|
-
// GET /health
|
|
527
419
|
{
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
420
|
+
path: "quality coupling",
|
|
421
|
+
category: "Architecture",
|
|
422
|
+
operationType: "analyze",
|
|
423
|
+
describe: "Show coupling metrics per package (Ca/Ce/instability)",
|
|
424
|
+
handler: "./cli/commands/coupling.js#default",
|
|
425
|
+
flags: defineCommandFlags(couplingFlags),
|
|
426
|
+
examples: ["kb quality coupling", "kb quality coupling --json", "kb quality coupling --sort coupled --top 20"],
|
|
427
|
+
permissions: pluginPermissions
|
|
537
428
|
},
|
|
538
|
-
// GET /dependencies
|
|
539
429
|
{
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
430
|
+
path: "quality build order",
|
|
431
|
+
category: "Architecture",
|
|
432
|
+
operationType: "analyze",
|
|
433
|
+
describe: "Topological build order",
|
|
434
|
+
handler: "./cli/commands/build-order.js#default",
|
|
435
|
+
flags: defineCommandFlags(buildOrderFlags),
|
|
436
|
+
examples: ["kb quality build order", "kb quality build order --json"],
|
|
437
|
+
permissions: pluginPermissions
|
|
549
438
|
},
|
|
550
|
-
// GET /build-order
|
|
551
439
|
{
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
440
|
+
path: "quality cycles",
|
|
441
|
+
category: "Architecture",
|
|
442
|
+
operationType: "analyze",
|
|
443
|
+
describe: "Detect circular dependencies",
|
|
444
|
+
handler: "./cli/commands/cycles.js#default",
|
|
445
|
+
flags: defineCommandFlags(cyclesFlags),
|
|
446
|
+
examples: ["kb quality cycles", "kb quality cycles --json"],
|
|
447
|
+
permissions: pluginPermissions
|
|
561
448
|
},
|
|
562
|
-
//
|
|
449
|
+
// ── Checks ───────────────────────────────────────────────────────────────
|
|
563
450
|
{
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}
|
|
451
|
+
path: "quality dead code",
|
|
452
|
+
category: "Checks",
|
|
453
|
+
operationType: "analyze",
|
|
454
|
+
describe: "Detect unused files, exports, and deps via knip",
|
|
455
|
+
handler: "./cli/commands/dead-code.js#default",
|
|
456
|
+
flags: defineCommandFlags(deadCodeFlags),
|
|
457
|
+
examples: ["kb quality dead code", "kb quality dead code --json"],
|
|
458
|
+
permissions: pluginPermissions
|
|
573
459
|
},
|
|
574
|
-
// GET /graph
|
|
575
460
|
{
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}
|
|
461
|
+
path: "quality check types",
|
|
462
|
+
category: "Checks",
|
|
463
|
+
operationType: "analyze",
|
|
464
|
+
describe: "TypeScript type safety analysis (any count, ts-ignore, errors)",
|
|
465
|
+
handler: "./cli/commands/check-types.js#default",
|
|
466
|
+
flags: defineCommandFlags(checkTypesFlags),
|
|
467
|
+
examples: ["kb quality check types", "kb quality check types --json"],
|
|
468
|
+
permissions: heavyPermissions
|
|
585
469
|
},
|
|
586
|
-
// GET /stale
|
|
587
470
|
{
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
}
|
|
471
|
+
path: "quality check builds",
|
|
472
|
+
category: "Checks",
|
|
473
|
+
operationType: "analyze",
|
|
474
|
+
describe: "Build status across monorepo",
|
|
475
|
+
handler: "./cli/commands/check-builds.js#default",
|
|
476
|
+
flags: defineCommandFlags(checkBuildsFlags),
|
|
477
|
+
examples: ["kb quality check builds", "kb quality check builds --json"],
|
|
478
|
+
permissions: heavyPermissions
|
|
597
479
|
},
|
|
598
|
-
// GET /builds
|
|
599
480
|
{
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
481
|
+
path: "quality check tests",
|
|
482
|
+
category: "Checks",
|
|
483
|
+
operationType: "execute",
|
|
484
|
+
describe: "Run tests and track coverage",
|
|
485
|
+
handler: "./cli/commands/check-tests.js#default",
|
|
486
|
+
flags: defineCommandFlags(checkTestsFlags),
|
|
487
|
+
examples: ["kb quality check tests", "kb quality check tests --with-coverage"],
|
|
488
|
+
permissions: heavyPermissions
|
|
609
489
|
},
|
|
610
|
-
// GET /types
|
|
611
490
|
{
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
491
|
+
path: "quality fix deps",
|
|
492
|
+
category: "Fixes",
|
|
493
|
+
operationType: "mutate",
|
|
494
|
+
describe: "Auto-fix dependency issues",
|
|
495
|
+
handler: "./cli/commands/fix-deps.js#default",
|
|
496
|
+
flags: defineCommandFlags(fixDepsFlags),
|
|
497
|
+
examples: ["kb quality fix deps --dry-run", "kb quality fix deps --all"],
|
|
498
|
+
permissions: pluginPermissions
|
|
621
499
|
},
|
|
622
|
-
// GET /tests
|
|
623
500
|
{
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}
|
|
501
|
+
path: "quality visualize",
|
|
502
|
+
category: "Fixes",
|
|
503
|
+
operationType: "analyze",
|
|
504
|
+
describe: "Visualize dependency graph",
|
|
505
|
+
handler: "./cli/commands/visualize.js#default",
|
|
506
|
+
flags: defineCommandFlags(visualizeFlags),
|
|
507
|
+
examples: ["kb quality visualize --tree", "kb quality visualize --dot"],
|
|
508
|
+
permissions: pluginPermissions
|
|
633
509
|
}
|
|
634
510
|
]
|
|
635
511
|
},
|
|
636
|
-
|
|
512
|
+
rest: {
|
|
513
|
+
basePath: QUALITY_BASE_PATH,
|
|
514
|
+
routes: [
|
|
515
|
+
{ method: "GET", path: QUALITY_ROUTES.STATS, handler: "./rest/handlers/stats-handler.js#default", timeoutMs: 12e4 },
|
|
516
|
+
{ method: "GET", path: QUALITY_ROUTES.HEALTH, handler: "./rest/handlers/health-handler.js#default" },
|
|
517
|
+
{ method: "GET", path: QUALITY_ROUTES.LAYERS, handler: "./rest/handlers/layers-handler.js#default" },
|
|
518
|
+
{ method: "GET", path: QUALITY_ROUTES.COUPLING, handler: "./rest/handlers/coupling-handler.js#default" },
|
|
519
|
+
{ method: "GET", path: QUALITY_ROUTES.DEAD_CODE, handler: "./rest/handlers/knip-handler.js#default" },
|
|
520
|
+
{ method: "GET", path: QUALITY_ROUTES.HISTORY, handler: "./rest/handlers/history-handler.js#default" },
|
|
521
|
+
{ method: "POST", path: QUALITY_ROUTES.SNAPSHOT, handler: "./rest/handlers/snapshot-handler.js#default" },
|
|
522
|
+
{ method: "GET", path: QUALITY_ROUTES.DEPENDENCIES, handler: "./rest/handlers/dependencies-handler.js#default" },
|
|
523
|
+
{ method: "GET", path: QUALITY_ROUTES.BUILD_ORDER, handler: "./rest/handlers/build-order-handler.js#default" },
|
|
524
|
+
{ method: "GET", path: QUALITY_ROUTES.CYCLES, handler: "./rest/handlers/cycles-handler.js#default" },
|
|
525
|
+
{ method: "GET", path: QUALITY_ROUTES.GRAPH, handler: "./rest/handlers/graph-handler.js#default" },
|
|
526
|
+
{ method: "GET", path: QUALITY_ROUTES.STALE, handler: "./rest/handlers/stale-handler.js#default" }
|
|
527
|
+
]
|
|
528
|
+
},
|
|
637
529
|
studio: {
|
|
638
530
|
version: 2,
|
|
639
531
|
remoteName: "qualityPlugin",
|