@aiready/context-analyzer 0.21.26 → 0.22.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.
Files changed (78) hide show
  1. package/.turbo/turbo-build.log +16 -10
  2. package/.turbo/turbo-test.log +31 -69
  3. package/coverage/clover.xml +392 -1878
  4. package/coverage/coverage-final.json +15 -19
  5. package/coverage/index.html +48 -63
  6. package/coverage/src/analyzers/index.html +21 -21
  7. package/coverage/src/analyzers/python-context.ts.html +96 -96
  8. package/coverage/src/ast-utils.ts.html +34 -109
  9. package/coverage/src/classifier.ts.html +104 -104
  10. package/coverage/src/classify/classification-patterns.ts.html +1 -1
  11. package/coverage/src/classify/file-classifiers.ts.html +1 -1
  12. package/coverage/src/classify/index.html +1 -1
  13. package/coverage/src/cluster-detector.ts.html +72 -72
  14. package/coverage/src/defaults.ts.html +1 -1
  15. package/coverage/src/graph-builder.ts.html +131 -131
  16. package/coverage/src/index.html +101 -116
  17. package/coverage/src/index.ts.html +2 -2
  18. package/coverage/src/issue-analyzer.ts.html +32 -83
  19. package/coverage/src/mapper.ts.html +20 -2
  20. package/coverage/src/metrics.ts.html +127 -130
  21. package/coverage/src/orchestrator.ts.html +13 -13
  22. package/coverage/src/provider.ts.html +19 -19
  23. package/coverage/src/remediation.ts.html +59 -59
  24. package/coverage/src/report/console-report.ts.html +2 -2
  25. package/coverage/src/report/html-report.ts.html +60 -84
  26. package/coverage/src/report/index.html +7 -7
  27. package/coverage/src/report/interactive-setup.ts.html +1 -1
  28. package/coverage/src/scoring.ts.html +62 -62
  29. package/coverage/src/semantic/co-usage.ts.html +1 -1
  30. package/coverage/src/semantic/consolidation.ts.html +1 -1
  31. package/coverage/src/semantic/domain-inference.ts.html +1 -1
  32. package/coverage/src/semantic/index.html +1 -1
  33. package/coverage/src/semantic/type-graph.ts.html +1 -1
  34. package/coverage/src/summary.ts.html +67 -67
  35. package/coverage/src/types.ts.html +1 -1
  36. package/coverage/src/utils/dependency-graph-utils.ts.html +41 -41
  37. package/coverage/src/utils/index.html +21 -21
  38. package/coverage/src/utils/string-utils.ts.html +1 -1
  39. package/dist/chunk-22ZO4EKZ.mjs +1297 -0
  40. package/dist/chunk-4U4LDWGF.mjs +360 -0
  41. package/dist/chunk-BA7QGUHN.mjs +1722 -0
  42. package/dist/chunk-BCEZGRXI.mjs +1297 -0
  43. package/dist/chunk-BQCISA2F.mjs +91 -0
  44. package/dist/chunk-EMYD7NS6.mjs +137 -0
  45. package/dist/chunk-EWFR366Y.mjs +1740 -0
  46. package/dist/chunk-FO6YT6RG.mjs +1751 -0
  47. package/dist/chunk-J3SZQZNU.mjs +221 -0
  48. package/dist/chunk-OZE3FVZT.mjs +1089 -0
  49. package/dist/chunk-WHB7QI7N.mjs +91 -0
  50. package/dist/cli-action-CXIHOVAC.mjs +95 -0
  51. package/dist/cli-action-SA7SCYNV.mjs +95 -0
  52. package/dist/cli-action-YAJOJCXJ.mjs +95 -0
  53. package/dist/cli.js +688 -566
  54. package/dist/cli.mjs +4 -88
  55. package/dist/index.js +889 -773
  56. package/dist/index.mjs +21 -14
  57. package/dist/orchestrator-3L3NAZYP.mjs +10 -0
  58. package/dist/orchestrator-MONOZHVW.mjs +10 -0
  59. package/dist/orchestrator-ZR7JSKWI.mjs +10 -0
  60. package/dist/summary-7PZVW72O.mjs +7 -0
  61. package/dist/summary-LKUCJAIS.mjs +7 -0
  62. package/package.json +2 -2
  63. package/src/__tests__/analyzer.test.ts +1 -1
  64. package/src/__tests__/enhanced-cohesion.test.ts +4 -1
  65. package/src/__tests__/orchestrator.test.ts +19 -4
  66. package/src/__tests__/python-context.test.ts +6 -0
  67. package/src/__tests__/report/html-report.test.ts +8 -2
  68. package/src/ast-utils.ts +1 -26
  69. package/src/cli-definition.ts +4 -2
  70. package/src/issue-analyzer.ts +4 -19
  71. package/src/metrics.ts +1 -2
  72. package/src/provider.ts +4 -4
  73. package/src/report/html-report.ts +43 -59
  74. package/coverage/dist/chunk-64U3PNO3.mjs.html +0 -367
  75. package/coverage/dist/chunk-J3MUOWHC.mjs.html +0 -5326
  76. package/coverage/dist/index.html +0 -146
  77. package/coverage/dist/index.mjs.html +0 -1396
  78. package/coverage/src/analyzer.ts.html +0 -88
package/dist/cli.mjs CHANGED
@@ -1,95 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- analyzeContext,
4
- displayConsoleReport,
5
- generateHTMLReport,
6
- generateSummary,
7
- runInteractiveSetup
8
- } from "./chunk-VLV6MXPL.mjs";
9
- import "./chunk-64U3PNO3.mjs";
10
2
 
11
3
  // src/cli.ts
12
4
  import { Command } from "commander";
13
5
 
14
- // src/cli-action.ts
15
- import {
16
- loadMergedConfig,
17
- handleJSONOutput,
18
- handleCLIError,
19
- getElapsedTime,
20
- resolveOutputPath
21
- } from "@aiready/core";
22
- import chalk from "chalk";
23
- import { writeFileSync } from "fs";
24
- async function contextActionHandler(directory, options) {
25
- console.log(chalk.blue("\u{1F50D} Analyzing context window costs...\n"));
26
- const startTime = Date.now();
27
- try {
28
- const defaults = {
29
- maxDepth: 5,
30
- maxContextBudget: 1e4,
31
- minCohesion: 0.6,
32
- maxFragmentation: 0.5,
33
- focus: "all",
34
- includeNodeModules: false,
35
- include: void 0,
36
- exclude: void 0,
37
- maxResults: 10
38
- };
39
- let finalOptions = await loadMergedConfig(directory, defaults, {
40
- maxDepth: options.maxDepth ? parseInt(options.maxDepth) : void 0,
41
- maxContextBudget: options.maxContext ? parseInt(options.maxContext) : void 0,
42
- minCohesion: options.minCohesion ? parseFloat(options.minCohesion) : void 0,
43
- maxFragmentation: options.maxFragmentation ? parseFloat(options.maxFragmentation) : void 0,
44
- focus: options.focus || void 0,
45
- includeNodeModules: options.includeNodeModules,
46
- include: options.include?.split(","),
47
- exclude: options.exclude?.split(","),
48
- maxResults: options.maxResults ? parseInt(options.maxResults) : void 0
49
- });
50
- if (options.interactive) {
51
- finalOptions = await runInteractiveSetup(directory, finalOptions);
52
- }
53
- const results = await analyzeContext(finalOptions);
54
- const summary = generateSummary(results, finalOptions);
55
- const duration = getElapsedTime(startTime);
56
- if (options.output === "json") {
57
- handleJSONOutput(
58
- {
59
- summary: {
60
- ...summary,
61
- executionTime: duration,
62
- config: {
63
- scan: { tools: ["context"] },
64
- tools: { context: finalOptions }
65
- },
66
- toolConfigs: { context: finalOptions }
67
- },
68
- context: { results }
69
- },
70
- options.outputFile
71
- );
72
- } else if (options.output === "html") {
73
- const html = generateHTMLReport(summary, results);
74
- const outputPath = resolveOutputPath(
75
- directory,
76
- options.outputFile,
77
- "context-report.html"
78
- );
79
- writeFileSync(outputPath, html, "utf-8");
80
- console.log(chalk.green(`
81
- \u2705 HTML report saved to: ${outputPath}`));
82
- } else {
83
- displayConsoleReport(summary, results, finalOptions.maxResults);
84
- console.log(chalk.dim(`
85
- \u2728 Analysis completed in ${duration}ms
86
- `));
87
- }
88
- } catch (error) {
89
- handleCLIError(error, "context-analyzer");
90
- }
91
- }
92
-
93
6
  // src/cli-definition.ts
94
7
  function defineContextCommand(program2) {
95
8
  program2.name("aiready-context").description("Analyze AI context window cost and code structure").version("0.1.0").addHelpText(
@@ -123,7 +36,10 @@ function defineContextCommand(program2) {
123
36
  ).option("--output-file <path>", "Output file path (for json/html)").option(
124
37
  "--interactive",
125
38
  "Run interactive setup to suggest excludes and focus areas"
126
- ).action(contextActionHandler);
39
+ ).action(async (directory, options) => {
40
+ const { contextActionHandler } = await import("./cli-action-SA7SCYNV.mjs");
41
+ await contextActionHandler(directory, options);
42
+ });
127
43
  }
128
44
 
129
45
  // src/cli.ts