@aiready/context-analyzer 0.9.25 → 0.9.28

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.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  analyzeContext,
4
4
  generateSummary
5
- } from "./chunk-HOUDVRG2.mjs";
5
+ } from "./chunk-M64RHH4D.mjs";
6
6
  import "./chunk-Y6FXYEAI.mjs";
7
7
 
8
8
  // src/cli.ts
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ScanOptions, ToolScoringOutput } from '@aiready/core';
1
+ import { ScanOptions, CostConfig, ToolScoringOutput } from '@aiready/core';
2
2
 
3
3
  interface ContextAnalyzerOptions extends ScanOptions {
4
4
  maxDepth?: number;
@@ -32,7 +32,7 @@ interface ContextAnalysisResult {
32
32
  * Classification of file type for analysis context
33
33
  * Helps distinguish real issues from false positives
34
34
  */
35
- type FileClassification = 'barrel-export' | 'type-definition' | 'cohesive-module' | 'mixed-concerns' | 'unknown';
35
+ type FileClassification = 'barrel-export' | 'type-definition' | 'cohesive-module' | 'utility-module' | 'service-file' | 'lambda-handler' | 'email-template' | 'parser-file' | 'nextjs-page' | 'mixed-concerns' | 'unknown';
36
36
  interface ModuleCluster {
37
37
  domain: string;
38
38
  files: string[];
@@ -130,6 +130,11 @@ interface TypeDependency {
130
130
  * - barrel-export: Re-exports from other modules (index.ts files)
131
131
  * - type-definition: Primarily type/interface definitions
132
132
  * - cohesive-module: Single domain, high cohesion (acceptable large files)
133
+ * - utility-module: Utility/helper files with cohesive purpose despite multi-domain
134
+ * - service-file: Service files orchestrating multiple dependencies
135
+ * - lambda-handler: Lambda/API handlers with single business purpose
136
+ * - email-template: Email templates/layouts with structural cohesion
137
+ * - parser-file: Parser/transformer files with single transformation purpose
133
138
  * - mixed-concerns: Multiple domains, potential refactoring candidate
134
139
  * - unknown: Unable to classify
135
140
  */
@@ -141,6 +146,7 @@ declare function classifyFile(node: DependencyNode, cohesionScore: number, domai
141
146
  * - Ignoring fragmentation for barrel exports (they're meant to aggregate)
142
147
  * - Ignoring fragmentation for type definitions (centralized types are good)
143
148
  * - Reducing fragmentation for cohesive modules (large but focused is OK)
149
+ * - Reducing fragmentation for utility/service/handler/template files
144
150
  */
145
151
  declare function adjustFragmentationForClassification(baseFragmentation: number, classification: FileClassification): number;
146
152
 
@@ -152,8 +158,12 @@ declare function adjustFragmentationForClassification(baseFragmentation: number,
152
158
  * - Import depth (dependency chain length)
153
159
  * - Fragmentation score (code organization)
154
160
  * - Critical/major issues
161
+ *
162
+ * Includes business value metrics:
163
+ * - Estimated monthly cost of context waste
164
+ * - Estimated developer hours to fix
155
165
  */
156
- declare function calculateContextScore(summary: ContextSummary): ToolScoringOutput;
166
+ declare function calculateContextScore(summary: ContextSummary, costConfig?: Partial<CostConfig>): ToolScoringOutput;
157
167
 
158
168
  /**
159
169
  * Build co-usage matrix: track which files are imported together
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ScanOptions, ToolScoringOutput } from '@aiready/core';
1
+ import { ScanOptions, CostConfig, ToolScoringOutput } from '@aiready/core';
2
2
 
3
3
  interface ContextAnalyzerOptions extends ScanOptions {
4
4
  maxDepth?: number;
@@ -32,7 +32,7 @@ interface ContextAnalysisResult {
32
32
  * Classification of file type for analysis context
33
33
  * Helps distinguish real issues from false positives
34
34
  */
35
- type FileClassification = 'barrel-export' | 'type-definition' | 'cohesive-module' | 'mixed-concerns' | 'unknown';
35
+ type FileClassification = 'barrel-export' | 'type-definition' | 'cohesive-module' | 'utility-module' | 'service-file' | 'lambda-handler' | 'email-template' | 'parser-file' | 'nextjs-page' | 'mixed-concerns' | 'unknown';
36
36
  interface ModuleCluster {
37
37
  domain: string;
38
38
  files: string[];
@@ -130,6 +130,11 @@ interface TypeDependency {
130
130
  * - barrel-export: Re-exports from other modules (index.ts files)
131
131
  * - type-definition: Primarily type/interface definitions
132
132
  * - cohesive-module: Single domain, high cohesion (acceptable large files)
133
+ * - utility-module: Utility/helper files with cohesive purpose despite multi-domain
134
+ * - service-file: Service files orchestrating multiple dependencies
135
+ * - lambda-handler: Lambda/API handlers with single business purpose
136
+ * - email-template: Email templates/layouts with structural cohesion
137
+ * - parser-file: Parser/transformer files with single transformation purpose
133
138
  * - mixed-concerns: Multiple domains, potential refactoring candidate
134
139
  * - unknown: Unable to classify
135
140
  */
@@ -141,6 +146,7 @@ declare function classifyFile(node: DependencyNode, cohesionScore: number, domai
141
146
  * - Ignoring fragmentation for barrel exports (they're meant to aggregate)
142
147
  * - Ignoring fragmentation for type definitions (centralized types are good)
143
148
  * - Reducing fragmentation for cohesive modules (large but focused is OK)
149
+ * - Reducing fragmentation for utility/service/handler/template files
144
150
  */
145
151
  declare function adjustFragmentationForClassification(baseFragmentation: number, classification: FileClassification): number;
146
152
 
@@ -152,8 +158,12 @@ declare function adjustFragmentationForClassification(baseFragmentation: number,
152
158
  * - Import depth (dependency chain length)
153
159
  * - Fragmentation score (code organization)
154
160
  * - Critical/major issues
161
+ *
162
+ * Includes business value metrics:
163
+ * - Estimated monthly cost of context waste
164
+ * - Estimated developer hours to fix
155
165
  */
156
- declare function calculateContextScore(summary: ContextSummary): ToolScoringOutput;
166
+ declare function calculateContextScore(summary: ContextSummary, costConfig?: Partial<CostConfig>): ToolScoringOutput;
157
167
 
158
168
  /**
159
169
  * Build co-usage matrix: track which files are imported together