@aiready/cli 0.9.43 → 0.9.46

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/index.js CHANGED
@@ -31,12 +31,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  analyzeUnified: () => analyzeUnified,
34
- generateUnifiedSummary: () => generateUnifiedSummary
34
+ generateUnifiedSummary: () => generateUnifiedSummary,
35
+ scoreUnified: () => scoreUnified
35
36
  });
36
37
  module.exports = __toCommonJS(index_exports);
37
38
  var import_pattern_detect = require("@aiready/pattern-detect");
38
39
  var import_context_analyzer = require("@aiready/context-analyzer");
39
40
  var import_consistency = require("@aiready/consistency");
41
+ var import_core = require("@aiready/core");
40
42
  var severityOrder = {
41
43
  critical: 4,
42
44
  major: 3,
@@ -211,6 +213,150 @@ async function analyzeUnified(options) {
211
213
  result.summary.executionTime = Date.now() - startTime;
212
214
  return result;
213
215
  }
216
+ async function scoreUnified(results, options) {
217
+ const toolScores = /* @__PURE__ */ new Map();
218
+ if (results.duplicates) {
219
+ const { calculatePatternScore } = await import("@aiready/pattern-detect");
220
+ try {
221
+ const patternScore = calculatePatternScore(
222
+ results.duplicates,
223
+ results.patterns?.length || 0
224
+ );
225
+ const wastedTokens = results.duplicates.reduce(
226
+ (sum, d) => sum + (d.tokenCost || 0),
227
+ 0
228
+ );
229
+ patternScore.tokenBudget = (0, import_core.calculateTokenBudget)({
230
+ totalContextTokens: wastedTokens * 2,
231
+ // Estimated context
232
+ wastedTokens: {
233
+ duplication: wastedTokens,
234
+ fragmentation: 0,
235
+ chattiness: 0
236
+ }
237
+ });
238
+ toolScores.set("pattern-detect", patternScore);
239
+ } catch (err) {
240
+ void err;
241
+ }
242
+ }
243
+ if (results.context) {
244
+ const { generateSummary: genContextSummary, calculateContextScore } = await import("@aiready/context-analyzer");
245
+ try {
246
+ const ctxSummary = genContextSummary(results.context);
247
+ const contextScore = calculateContextScore(ctxSummary);
248
+ contextScore.tokenBudget = (0, import_core.calculateTokenBudget)({
249
+ totalContextTokens: ctxSummary.totalTokens,
250
+ wastedTokens: {
251
+ duplication: 0,
252
+ fragmentation: ctxSummary.totalPotentialSavings || 0,
253
+ chattiness: 0
254
+ }
255
+ });
256
+ toolScores.set("context-analyzer", contextScore);
257
+ } catch (err) {
258
+ void err;
259
+ }
260
+ }
261
+ if (results.consistency) {
262
+ const { calculateConsistencyScore } = await import("@aiready/consistency");
263
+ try {
264
+ const issues = results.consistency.results?.flatMap((r) => r.issues) || [];
265
+ const totalFiles = results.consistency.summary?.filesAnalyzed || 0;
266
+ const consistencyScore = calculateConsistencyScore(issues, totalFiles);
267
+ toolScores.set("consistency", consistencyScore);
268
+ } catch (err) {
269
+ void err;
270
+ }
271
+ }
272
+ if (results.aiSignalClarity) {
273
+ const { calculateAiSignalClarityScore } = await import("@aiready/ai-signal-clarity");
274
+ try {
275
+ const hrScore = calculateAiSignalClarityScore(results.aiSignalClarity);
276
+ toolScores.set("ai-signal-clarity", hrScore);
277
+ } catch (err) {
278
+ void err;
279
+ }
280
+ }
281
+ if (results.grounding) {
282
+ const { calculateGroundingScore } = await import("@aiready/agent-grounding");
283
+ try {
284
+ const agScore = calculateGroundingScore(results.grounding);
285
+ toolScores.set("agent-grounding", agScore);
286
+ } catch (err) {
287
+ void err;
288
+ }
289
+ }
290
+ if (results.testability) {
291
+ const { calculateTestabilityScore } = await import("@aiready/testability");
292
+ try {
293
+ const tbScore = calculateTestabilityScore(results.testability);
294
+ toolScores.set("testability", tbScore);
295
+ } catch (err) {
296
+ void err;
297
+ }
298
+ }
299
+ if (results.docDrift) {
300
+ toolScores.set("doc-drift", {
301
+ toolName: "doc-drift",
302
+ score: results.docDrift.summary.score,
303
+ rawMetrics: results.docDrift.rawData,
304
+ factors: [],
305
+ recommendations: (results.docDrift.recommendations || []).map(
306
+ (action) => ({
307
+ action,
308
+ estimatedImpact: 5,
309
+ priority: "medium"
310
+ })
311
+ )
312
+ });
313
+ }
314
+ if (results.deps) {
315
+ toolScores.set("dependency-health", {
316
+ toolName: "dependency-health",
317
+ score: results.deps.summary.score,
318
+ rawMetrics: results.deps.rawData,
319
+ factors: [],
320
+ recommendations: (results.deps.recommendations || []).map(
321
+ (action) => ({
322
+ action,
323
+ estimatedImpact: 5,
324
+ priority: "medium"
325
+ })
326
+ )
327
+ });
328
+ }
329
+ if (results.changeAmplification) {
330
+ toolScores.set("change-amplification", {
331
+ toolName: "change-amplification",
332
+ score: results.changeAmplification.summary.score,
333
+ rawMetrics: results.changeAmplification.rawData,
334
+ factors: [],
335
+ recommendations: (results.changeAmplification.recommendations || []).map(
336
+ (action) => ({
337
+ action,
338
+ estimatedImpact: 5,
339
+ priority: "medium"
340
+ })
341
+ )
342
+ });
343
+ }
344
+ if (toolScores.size === 0) {
345
+ return {
346
+ overall: 0,
347
+ rating: "Critical",
348
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
349
+ toolsUsed: [],
350
+ breakdown: [],
351
+ calculation: {
352
+ formula: "0 / 0 = 0",
353
+ weights: {},
354
+ normalized: "0 / 0 = 0"
355
+ }
356
+ };
357
+ }
358
+ return (0, import_core.calculateOverallScore)(toolScores, options, void 0);
359
+ }
214
360
  function generateUnifiedSummary(result) {
215
361
  const { summary } = result;
216
362
  let output = `\u{1F680} AIReady Analysis Complete
@@ -266,5 +412,6 @@ function generateUnifiedSummary(result) {
266
412
  // Annotate the CommonJS export names for ESM import in node:
267
413
  0 && (module.exports = {
268
414
  analyzeUnified,
269
- generateUnifiedSummary
415
+ generateUnifiedSummary,
416
+ scoreUnified
270
417
  });
package/dist/index.mjs CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  analyzeUnified,
3
- generateUnifiedSummary
4
- } from "./chunk-LLJMKNBI.mjs";
3
+ generateUnifiedSummary,
4
+ scoreUnified
5
+ } from "./chunk-6FOVC2OE.mjs";
5
6
  export {
6
7
  analyzeUnified,
7
- generateUnifiedSummary
8
+ generateUnifiedSummary,
9
+ scoreUnified
8
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/cli",
3
- "version": "0.9.43",
3
+ "version": "0.9.46",
4
4
  "description": "Unified CLI for AIReady analysis tools",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -11,17 +11,17 @@
11
11
  "dependencies": {
12
12
  "chalk": "^5.3.0",
13
13
  "commander": "^14.0.0",
14
- "@aiready/core": "0.9.35",
15
- "@aiready/ai-signal-clarity": "0.1.8",
16
- "@aiready/agent-grounding": "0.1.8",
17
- "@aiready/pattern-detect": "0.11.34",
18
- "@aiready/testability": "0.1.8",
19
- "@aiready/context-analyzer": "0.9.38",
20
- "@aiready/visualizer": "0.1.40",
21
- "@aiready/consistency": "0.8.34",
22
- "@aiready/deps": "0.1.8",
23
- "@aiready/change-amplification": "0.1.8",
24
- "@aiready/doc-drift": "0.1.8"
14
+ "@aiready/core": "0.9.38",
15
+ "@aiready/change-amplification": "0.1.11",
16
+ "@aiready/doc-drift": "0.1.11",
17
+ "@aiready/agent-grounding": "0.1.11",
18
+ "@aiready/testability": "0.1.11",
19
+ "@aiready/deps": "0.1.11",
20
+ "@aiready/visualizer": "0.1.43",
21
+ "@aiready/ai-signal-clarity": "0.1.11",
22
+ "@aiready/context-analyzer": "0.9.41",
23
+ "@aiready/pattern-detect": "0.11.37",
24
+ "@aiready/consistency": "0.8.37"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^24.0.0",