@aiready/core 0.23.3 → 0.23.5

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/client.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export { e as AIReadyConfig, g as AcceptancePrediction, A as AnalysisResult, o as AnalysisStatus, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, h as ComprehensionDifficulty, t as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, l as ExportInfo, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, I as ImportInfo, K as Issue, Q as IssueType, U as LANGUAGE_EXTENSIONS, k as Language, V as LanguageConfig, L as LanguageParser, W as Location, Y as Metrics, M as ModelContextTier, N as NamingConvention, a0 as ParseError, m as ParseResult, a1 as ParseStatistics, P as ProductivityImpact, a2 as ReadinessRating, a3 as RecommendationPriority, a4 as SCORING_PROFILES, a5 as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, a6 as ScanResult, a7 as ScoringConfig, a8 as ScoringProfile, a9 as ScoringResult, c as Severity, c as SeverityType, ab as SourceLocation, ac as SourceRange, a as SpokeOutput, ag as TOOL_NAME_MAP, j as TechnicalValueChain, i as TechnicalValueChainSummary, f as TokenBudget, T as ToolName, ai as ToolOptions, aj as ToolOutput, b as ToolScoringOutput, ak as UnifiedReport, al as UnifiedReportSchema, am as calculateOverallScore, an as formatScore, ao as formatToolScore, ap as generateHTML, aq as getProjectSizeTier, ar as getRating, as as getRatingDisplay, at as getRatingSlug, au as getRatingWithContext, av as getRecommendedThreshold, aw as getToolWeight, ax as normalizeToolName, ay as parseWeightString } from './client-D-cn9ydj.mjs';
1
+ export { e as AIReadyConfig, g as AcceptancePrediction, A as AnalysisResult, o as AnalysisStatus, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, h as ComprehensionDifficulty, t as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, l as ExportInfo, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, I as ImportInfo, K as Issue, Q as IssueType, U as LANGUAGE_EXTENSIONS, k as Language, V as LanguageConfig, L as LanguageParser, W as Lead, X as LeadSchema, Y as LeadSource, Z as LeadSourceSchema, _ as LeadSubmission, $ as LeadSubmissionSchema, a0 as Location, a4 as Metrics, M as ModelContextTier, N as NamingConvention, a8 as ParseError, m as ParseResult, a9 as ParseStatistics, P as ProductivityImpact, aa as ReadinessRating, ab as RecommendationPriority, ac as SCORING_PROFILES, ad as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ae as ScanResult, af as ScoringConfig, ag as ScoringProfile, ah as ScoringResult, c as Severity, c as SeverityType, aj as SourceLocation, ak as SourceRange, a as SpokeOutput, ao as TOOL_NAME_MAP, j as TechnicalValueChain, i as TechnicalValueChainSummary, f as TokenBudget, T as ToolName, aq as ToolOptions, ar as ToolOutput, b as ToolScoringOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-BF9NjhE8.mjs';
2
2
  import 'zod';
package/dist/client.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { e as AIReadyConfig, g as AcceptancePrediction, A as AnalysisResult, o as AnalysisStatus, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, h as ComprehensionDifficulty, t as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, l as ExportInfo, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, I as ImportInfo, K as Issue, Q as IssueType, U as LANGUAGE_EXTENSIONS, k as Language, V as LanguageConfig, L as LanguageParser, W as Location, Y as Metrics, M as ModelContextTier, N as NamingConvention, a0 as ParseError, m as ParseResult, a1 as ParseStatistics, P as ProductivityImpact, a2 as ReadinessRating, a3 as RecommendationPriority, a4 as SCORING_PROFILES, a5 as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, a6 as ScanResult, a7 as ScoringConfig, a8 as ScoringProfile, a9 as ScoringResult, c as Severity, c as SeverityType, ab as SourceLocation, ac as SourceRange, a as SpokeOutput, ag as TOOL_NAME_MAP, j as TechnicalValueChain, i as TechnicalValueChainSummary, f as TokenBudget, T as ToolName, ai as ToolOptions, aj as ToolOutput, b as ToolScoringOutput, ak as UnifiedReport, al as UnifiedReportSchema, am as calculateOverallScore, an as formatScore, ao as formatToolScore, ap as generateHTML, aq as getProjectSizeTier, ar as getRating, as as getRatingDisplay, at as getRatingSlug, au as getRatingWithContext, av as getRecommendedThreshold, aw as getToolWeight, ax as normalizeToolName, ay as parseWeightString } from './client-D-cn9ydj.js';
1
+ export { e as AIReadyConfig, g as AcceptancePrediction, A as AnalysisResult, o as AnalysisStatus, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, h as ComprehensionDifficulty, t as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, l as ExportInfo, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, I as ImportInfo, K as Issue, Q as IssueType, U as LANGUAGE_EXTENSIONS, k as Language, V as LanguageConfig, L as LanguageParser, W as Lead, X as LeadSchema, Y as LeadSource, Z as LeadSourceSchema, _ as LeadSubmission, $ as LeadSubmissionSchema, a0 as Location, a4 as Metrics, M as ModelContextTier, N as NamingConvention, a8 as ParseError, m as ParseResult, a9 as ParseStatistics, P as ProductivityImpact, aa as ReadinessRating, ab as RecommendationPriority, ac as SCORING_PROFILES, ad as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ae as ScanResult, af as ScoringConfig, ag as ScoringProfile, ah as ScoringResult, c as Severity, c as SeverityType, aj as SourceLocation, ak as SourceRange, a as SpokeOutput, ao as TOOL_NAME_MAP, j as TechnicalValueChain, i as TechnicalValueChainSummary, f as TokenBudget, T as ToolName, aq as ToolOptions, ar as ToolOutput, b as ToolScoringOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-BF9NjhE8.js';
2
2
  import 'zod';
package/dist/client.js CHANGED
@@ -30,6 +30,10 @@ __export(client_exports, {
30
30
  IssueType: () => IssueType,
31
31
  LANGUAGE_EXTENSIONS: () => LANGUAGE_EXTENSIONS,
32
32
  Language: () => Language,
33
+ LeadSchema: () => LeadSchema,
34
+ LeadSource: () => LeadSource,
35
+ LeadSourceSchema: () => LeadSourceSchema,
36
+ LeadSubmissionSchema: () => LeadSubmissionSchema,
33
37
  ParseError: () => ParseError,
34
38
  ReadinessRating: () => ReadinessRating,
35
39
  RecommendationPriority: () => RecommendationPriority,
@@ -217,6 +221,64 @@ var UnifiedReportSchema = import_zod.z.object({
217
221
  }).optional()
218
222
  }).catchall(import_zod.z.any());
219
223
 
224
+ // src/types/business.ts
225
+ var import_zod2 = require("zod");
226
+ var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
227
+ LeadSource2["ClawMoreHero"] = "clawmore-hero";
228
+ LeadSource2["ClawMoreWaitlist"] = "clawmore-waitlist";
229
+ LeadSource2["ClawMoreBeta"] = "clawmore-beta";
230
+ LeadSource2["AiReadyPlatform"] = "aiready-platform";
231
+ return LeadSource2;
232
+ })(LeadSource || {});
233
+ var LeadSourceSchema = import_zod2.z.nativeEnum(LeadSource);
234
+ var LeadSchema = import_zod2.z.object({
235
+ id: import_zod2.z.string(),
236
+ email: import_zod2.z.string().email(),
237
+ name: import_zod2.z.string().min(1),
238
+ interest: import_zod2.z.string().default("General"),
239
+ notes: import_zod2.z.string().optional(),
240
+ timestamp: import_zod2.z.string().datetime(),
241
+ source: LeadSourceSchema,
242
+ status: import_zod2.z.enum(["new", "contacted", "qualified", "converted", "archived"]).default("new")
243
+ });
244
+ var LeadSubmissionSchema = LeadSchema.omit({
245
+ id: true,
246
+ timestamp: true,
247
+ status: true
248
+ });
249
+ var ManagedAccountSchema = import_zod2.z.object({
250
+ id: import_zod2.z.string(),
251
+ // Internal UUID
252
+ accountId: import_zod2.z.string(),
253
+ // AWS Account ID
254
+ userId: import_zod2.z.string(),
255
+ // Owner (caopengau@gmail.com)
256
+ stripeSubscriptionId: import_zod2.z.string(),
257
+ // AI Token Management
258
+ tokenStrategy: import_zod2.z.enum(["managed", "byok"]).default("managed"),
259
+ byokConfig: import_zod2.z.object({
260
+ openaiKey: import_zod2.z.string().optional(),
261
+ anthropicKey: import_zod2.z.string().optional(),
262
+ openrouterKey: import_zod2.z.string().optional()
263
+ }).optional(),
264
+ // Financials (in cents)
265
+ baseFeeCents: import_zod2.z.number().default(2900),
266
+ includedComputeCents: import_zod2.z.number().default(1500),
267
+ // $15.00 AWS included
268
+ includedTokenCents: import_zod2.z.number().default(500),
269
+ // $5.00 Managed Tokens included
270
+ // Pre-paid Balance (credits)
271
+ prepaidTokenBalanceCents: import_zod2.z.number().default(0),
272
+ // Users buy these in $10 packs
273
+ currentMonthlyTokenSpendCents: import_zod2.z.number().default(0),
274
+ // Governance
275
+ status: import_zod2.z.enum(["provisioning", "active", "warning", "quarantined", "suspended"]).default("provisioning"),
276
+ lastCostSyncAt: import_zod2.z.string().datetime().optional(),
277
+ region: import_zod2.z.string().default("ap-southeast-2"),
278
+ // Alerting thresholds (percentage of includedComputeCents)
279
+ alertThresholds: import_zod2.z.array(import_zod2.z.number()).default([50, 80, 100, 150])
280
+ });
281
+
220
282
  // src/types.ts
221
283
  var GLOBAL_INFRA_OPTIONS = [
222
284
  "rootDir",
@@ -717,6 +779,10 @@ function generateHTML(graph) {
717
779
  IssueType,
718
780
  LANGUAGE_EXTENSIONS,
719
781
  Language,
782
+ LeadSchema,
783
+ LeadSource,
784
+ LeadSourceSchema,
785
+ LeadSubmissionSchema,
720
786
  ParseError,
721
787
  ReadinessRating,
722
788
  RecommendationPriority,
package/dist/client.mjs CHANGED
@@ -9,6 +9,10 @@ import {
9
9
  IssueType,
10
10
  LANGUAGE_EXTENSIONS,
11
11
  Language,
12
+ LeadSchema,
13
+ LeadSource,
14
+ LeadSourceSchema,
15
+ LeadSubmissionSchema,
12
16
  ParseError,
13
17
  ReadinessRating,
14
18
  RecommendationPriority,
@@ -32,7 +36,7 @@ import {
32
36
  getToolWeight,
33
37
  normalizeToolName,
34
38
  parseWeightString
35
- } from "./chunk-NGHT7JOG.mjs";
39
+ } from "./chunk-Q55AMEFV.mjs";
36
40
  export {
37
41
  AnalysisStatus,
38
42
  COMMON_FINE_TUNING_OPTIONS,
@@ -44,6 +48,10 @@ export {
44
48
  IssueType,
45
49
  LANGUAGE_EXTENSIONS,
46
50
  Language,
51
+ LeadSchema,
52
+ LeadSource,
53
+ LeadSourceSchema,
54
+ LeadSubmissionSchema,
47
55
  ParseError,
48
56
  ReadinessRating,
49
57
  RecommendationPriority,
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as Severity, A as AnalysisResult, E as ExportWithImports, d as ASTNode, F as FileImport, e as AIReadyConfig, M as ModelContextTier, C as CostConfig, f as TokenBudget, P as ProductivityImpact, g as AcceptancePrediction, h as ComprehensionDifficulty, i as TechnicalValueChainSummary, j as TechnicalValueChain, L as LanguageParser, k as Language, l as ExportInfo, m as ParseResult, N as NamingConvention, I as ImportInfo } from './client-D-cn9ydj.mjs';
2
- export { n as AnalysisResultSchema, o as AnalysisStatus, p as AnalysisStatusSchema, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, t as Config, D as DEFAULT_TOOL_WEIGHTS, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, K as Issue, O as IssueSchema, Q as IssueType, R as IssueTypeSchema, U as LANGUAGE_EXTENSIONS, V as LanguageConfig, W as Location, X as LocationSchema, Y as Metrics, Z as MetricsSchema, _ as ModelTier, $ as ModelTierSchema, a0 as ParseError, a1 as ParseStatistics, a2 as ReadinessRating, a3 as RecommendationPriority, a4 as SCORING_PROFILES, a5 as SIZE_ADJUSTED_THRESHOLDS, a6 as ScanResult, a7 as ScoringConfig, a8 as ScoringProfile, a9 as ScoringResult, aa as SeveritySchema, ab as SourceLocation, ac as SourceRange, ad as SpokeOutputSchema, ae as SpokeSummary, af as SpokeSummarySchema, ag as TOOL_NAME_MAP, ah as ToolNameSchema, ai as ToolOptions, aj as ToolOutput, ak as UnifiedReport, al as UnifiedReportSchema, am as calculateOverallScore, an as formatScore, ao as formatToolScore, ap as generateHTML, aq as getProjectSizeTier, ar as getRating, as as getRatingDisplay, at as getRatingSlug, au as getRatingWithContext, av as getRecommendedThreshold, aw as getToolWeight, ax as normalizeToolName, ay as parseWeightString } from './client-D-cn9ydj.mjs';
1
+ import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as Severity, A as AnalysisResult, E as ExportWithImports, d as ASTNode, F as FileImport, e as AIReadyConfig, M as ModelContextTier, C as CostConfig, f as TokenBudget, P as ProductivityImpact, g as AcceptancePrediction, h as ComprehensionDifficulty, i as TechnicalValueChainSummary, j as TechnicalValueChain, L as LanguageParser, k as Language, l as ExportInfo, m as ParseResult, N as NamingConvention, I as ImportInfo } from './client-BF9NjhE8.mjs';
2
+ export { n as AnalysisResultSchema, o as AnalysisStatus, p as AnalysisStatusSchema, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, t as Config, D as DEFAULT_TOOL_WEIGHTS, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, K as Issue, O as IssueSchema, Q as IssueType, R as IssueTypeSchema, U as LANGUAGE_EXTENSIONS, V as LanguageConfig, W as Lead, X as LeadSchema, Y as LeadSource, Z as LeadSourceSchema, _ as LeadSubmission, $ as LeadSubmissionSchema, a0 as Location, a1 as LocationSchema, a2 as ManagedAccount, a3 as ManagedAccountSchema, a4 as Metrics, a5 as MetricsSchema, a6 as ModelTier, a7 as ModelTierSchema, a8 as ParseError, a9 as ParseStatistics, aa as ReadinessRating, ab as RecommendationPriority, ac as SCORING_PROFILES, ad as SIZE_ADJUSTED_THRESHOLDS, ae as ScanResult, af as ScoringConfig, ag as ScoringProfile, ah as ScoringResult, ai as SeveritySchema, aj as SourceLocation, ak as SourceRange, al as SpokeOutputSchema, am as SpokeSummary, an as SpokeSummarySchema, ao as TOOL_NAME_MAP, ap as ToolNameSchema, aq as ToolOptions, ar as ToolOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-BF9NjhE8.mjs';
3
3
  import { z } from 'zod';
4
4
  import * as Parser from 'web-tree-sitter';
5
5
  import { TSESTree } from '@typescript-eslint/typescript-estree';
@@ -376,7 +376,7 @@ declare function calculateImportSimilarity(export1: ExportWithImports, export2:
376
376
  * @param language - Target language
377
377
  * @returns Generic AST node or null if unsupported
378
378
  */
379
- declare function parseCode(code: string, language: string): ASTNode | null;
379
+ declare function parseCode(_code: string, _language: string): ASTNode | null;
380
380
  /**
381
381
  * Extract functions from an AST.
382
382
  * @deprecated Use parseFileExports instead for complete export metadata.
@@ -384,7 +384,7 @@ declare function parseCode(code: string, language: string): ASTNode | null;
384
384
  * @param ast - The AST to scan
385
385
  * @returns Array of function nodes
386
386
  */
387
- declare function extractFunctions(ast: ASTNode): ASTNode[];
387
+ declare function extractFunctions(_ast: ASTNode): ASTNode[];
388
388
  /**
389
389
  * Extract imports from an AST.
390
390
  * @deprecated Use parseFileExports instead for structured import info.
@@ -392,7 +392,7 @@ declare function extractFunctions(ast: ASTNode): ASTNode[];
392
392
  * @param ast - The AST to scan
393
393
  * @returns Array of imported module names
394
394
  */
395
- declare function extractImports(ast: ASTNode): string[];
395
+ declare function extractImports(_ast: ASTNode): string[];
396
396
 
397
397
  /**
398
398
  * Estimate token count for text (rough approximation)
@@ -774,7 +774,7 @@ declare abstract class BaseLanguageParser implements LanguageParser {
774
774
  * Get the parser name for tree-sitter setup
775
775
  */
776
776
  protected abstract getParserName(): string;
777
- getAST(code: string, filePath: string): Promise<Parser.Tree | null>;
777
+ getAST(code: string, _filePath?: string): Promise<Parser.Tree | null>;
778
778
  abstract analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
779
779
  parse(code: string, filePath: string): ParseResult;
780
780
  protected abstract extractImportsAST(rootNode: Parser.Node): ImportInfo[];
@@ -810,7 +810,7 @@ declare class JavaParser extends BaseLanguageParser {
810
810
  readonly extensions: string[];
811
811
  protected getParserName(): string;
812
812
  analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
813
- protected parseRegex(code: string, filePath: string): ParseResult;
813
+ protected parseRegex(code: string): ParseResult;
814
814
  protected extractImportsAST(rootNode: Parser.Node): ImportInfo[];
815
815
  protected extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
816
816
  private getModifiers;
@@ -828,7 +828,7 @@ declare class CSharpParser extends BaseLanguageParser {
828
828
  readonly extensions: string[];
829
829
  protected getParserName(): string;
830
830
  analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
831
- protected parseRegex(code: string, filePath: string): ParseResult;
831
+ protected parseRegex(code: string): ParseResult;
832
832
  protected extractImportsAST(rootNode: Parser.Node): ImportInfo[];
833
833
  protected extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
834
834
  private getModifiers;
@@ -845,7 +845,7 @@ declare class GoParser extends BaseLanguageParser {
845
845
  readonly extensions: string[];
846
846
  protected getParserName(): string;
847
847
  analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
848
- protected parseRegex(code: string, filePath: string): ParseResult;
848
+ protected parseRegex(code: string): ParseResult;
849
849
  protected extractImportsAST(rootNode: Parser.Node): ImportInfo[];
850
850
  protected extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
851
851
  private extractParameters;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as Severity, A as AnalysisResult, E as ExportWithImports, d as ASTNode, F as FileImport, e as AIReadyConfig, M as ModelContextTier, C as CostConfig, f as TokenBudget, P as ProductivityImpact, g as AcceptancePrediction, h as ComprehensionDifficulty, i as TechnicalValueChainSummary, j as TechnicalValueChain, L as LanguageParser, k as Language, l as ExportInfo, m as ParseResult, N as NamingConvention, I as ImportInfo } from './client-D-cn9ydj.js';
2
- export { n as AnalysisResultSchema, o as AnalysisStatus, p as AnalysisStatusSchema, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, t as Config, D as DEFAULT_TOOL_WEIGHTS, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, K as Issue, O as IssueSchema, Q as IssueType, R as IssueTypeSchema, U as LANGUAGE_EXTENSIONS, V as LanguageConfig, W as Location, X as LocationSchema, Y as Metrics, Z as MetricsSchema, _ as ModelTier, $ as ModelTierSchema, a0 as ParseError, a1 as ParseStatistics, a2 as ReadinessRating, a3 as RecommendationPriority, a4 as SCORING_PROFILES, a5 as SIZE_ADJUSTED_THRESHOLDS, a6 as ScanResult, a7 as ScoringConfig, a8 as ScoringProfile, a9 as ScoringResult, aa as SeveritySchema, ab as SourceLocation, ac as SourceRange, ad as SpokeOutputSchema, ae as SpokeSummary, af as SpokeSummarySchema, ag as TOOL_NAME_MAP, ah as ToolNameSchema, ai as ToolOptions, aj as ToolOutput, ak as UnifiedReport, al as UnifiedReportSchema, am as calculateOverallScore, an as formatScore, ao as formatToolScore, ap as generateHTML, aq as getProjectSizeTier, ar as getRating, as as getRatingDisplay, at as getRatingSlug, au as getRatingWithContext, av as getRecommendedThreshold, aw as getToolWeight, ax as normalizeToolName, ay as parseWeightString } from './client-D-cn9ydj.js';
1
+ import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as Severity, A as AnalysisResult, E as ExportWithImports, d as ASTNode, F as FileImport, e as AIReadyConfig, M as ModelContextTier, C as CostConfig, f as TokenBudget, P as ProductivityImpact, g as AcceptancePrediction, h as ComprehensionDifficulty, i as TechnicalValueChainSummary, j as TechnicalValueChain, L as LanguageParser, k as Language, l as ExportInfo, m as ParseResult, N as NamingConvention, I as ImportInfo } from './client-BF9NjhE8.js';
2
+ export { n as AnalysisResultSchema, o as AnalysisStatus, p as AnalysisStatusSchema, B as BusinessMetrics, q as COMMON_FINE_TUNING_OPTIONS, r as CONTEXT_TIER_THRESHOLDS, s as CommonASTNode, t as Config, D as DEFAULT_TOOL_WEIGHTS, u as FRIENDLY_TOOL_NAMES, v as FileContent, G as GLOBAL_INFRA_OPTIONS, w as GLOBAL_SCAN_OPTIONS, x as GraphData, y as GraphEdge, z as GraphIssueSeverity, H as GraphMetadata, J as GraphNode, K as Issue, O as IssueSchema, Q as IssueType, R as IssueTypeSchema, U as LANGUAGE_EXTENSIONS, V as LanguageConfig, W as Lead, X as LeadSchema, Y as LeadSource, Z as LeadSourceSchema, _ as LeadSubmission, $ as LeadSubmissionSchema, a0 as Location, a1 as LocationSchema, a2 as ManagedAccount, a3 as ManagedAccountSchema, a4 as Metrics, a5 as MetricsSchema, a6 as ModelTier, a7 as ModelTierSchema, a8 as ParseError, a9 as ParseStatistics, aa as ReadinessRating, ab as RecommendationPriority, ac as SCORING_PROFILES, ad as SIZE_ADJUSTED_THRESHOLDS, ae as ScanResult, af as ScoringConfig, ag as ScoringProfile, ah as ScoringResult, ai as SeveritySchema, aj as SourceLocation, ak as SourceRange, al as SpokeOutputSchema, am as SpokeSummary, an as SpokeSummarySchema, ao as TOOL_NAME_MAP, ap as ToolNameSchema, aq as ToolOptions, ar as ToolOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-BF9NjhE8.js';
3
3
  import { z } from 'zod';
4
4
  import * as Parser from 'web-tree-sitter';
5
5
  import { TSESTree } from '@typescript-eslint/typescript-estree';
@@ -376,7 +376,7 @@ declare function calculateImportSimilarity(export1: ExportWithImports, export2:
376
376
  * @param language - Target language
377
377
  * @returns Generic AST node or null if unsupported
378
378
  */
379
- declare function parseCode(code: string, language: string): ASTNode | null;
379
+ declare function parseCode(_code: string, _language: string): ASTNode | null;
380
380
  /**
381
381
  * Extract functions from an AST.
382
382
  * @deprecated Use parseFileExports instead for complete export metadata.
@@ -384,7 +384,7 @@ declare function parseCode(code: string, language: string): ASTNode | null;
384
384
  * @param ast - The AST to scan
385
385
  * @returns Array of function nodes
386
386
  */
387
- declare function extractFunctions(ast: ASTNode): ASTNode[];
387
+ declare function extractFunctions(_ast: ASTNode): ASTNode[];
388
388
  /**
389
389
  * Extract imports from an AST.
390
390
  * @deprecated Use parseFileExports instead for structured import info.
@@ -392,7 +392,7 @@ declare function extractFunctions(ast: ASTNode): ASTNode[];
392
392
  * @param ast - The AST to scan
393
393
  * @returns Array of imported module names
394
394
  */
395
- declare function extractImports(ast: ASTNode): string[];
395
+ declare function extractImports(_ast: ASTNode): string[];
396
396
 
397
397
  /**
398
398
  * Estimate token count for text (rough approximation)
@@ -774,7 +774,7 @@ declare abstract class BaseLanguageParser implements LanguageParser {
774
774
  * Get the parser name for tree-sitter setup
775
775
  */
776
776
  protected abstract getParserName(): string;
777
- getAST(code: string, filePath: string): Promise<Parser.Tree | null>;
777
+ getAST(code: string, _filePath?: string): Promise<Parser.Tree | null>;
778
778
  abstract analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
779
779
  parse(code: string, filePath: string): ParseResult;
780
780
  protected abstract extractImportsAST(rootNode: Parser.Node): ImportInfo[];
@@ -810,7 +810,7 @@ declare class JavaParser extends BaseLanguageParser {
810
810
  readonly extensions: string[];
811
811
  protected getParserName(): string;
812
812
  analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
813
- protected parseRegex(code: string, filePath: string): ParseResult;
813
+ protected parseRegex(code: string): ParseResult;
814
814
  protected extractImportsAST(rootNode: Parser.Node): ImportInfo[];
815
815
  protected extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
816
816
  private getModifiers;
@@ -828,7 +828,7 @@ declare class CSharpParser extends BaseLanguageParser {
828
828
  readonly extensions: string[];
829
829
  protected getParserName(): string;
830
830
  analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
831
- protected parseRegex(code: string, filePath: string): ParseResult;
831
+ protected parseRegex(code: string): ParseResult;
832
832
  protected extractImportsAST(rootNode: Parser.Node): ImportInfo[];
833
833
  protected extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
834
834
  private getModifiers;
@@ -845,7 +845,7 @@ declare class GoParser extends BaseLanguageParser {
845
845
  readonly extensions: string[];
846
846
  protected getParserName(): string;
847
847
  analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
848
- protected parseRegex(code: string, filePath: string): ParseResult;
848
+ protected parseRegex(code: string): ParseResult;
849
849
  protected extractImportsAST(rootNode: Parser.Node): ImportInfo[];
850
850
  protected extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
851
851
  private extractParameters;
package/dist/index.js CHANGED
@@ -49,8 +49,13 @@ __export(index_exports, {
49
49
  JavaParser: () => JavaParser,
50
50
  LANGUAGE_EXTENSIONS: () => LANGUAGE_EXTENSIONS,
51
51
  Language: () => Language,
52
+ LeadSchema: () => LeadSchema,
53
+ LeadSource: () => LeadSource,
54
+ LeadSourceSchema: () => LeadSourceSchema,
55
+ LeadSubmissionSchema: () => LeadSubmissionSchema,
52
56
  LocationSchema: () => LocationSchema,
53
57
  MODEL_PRICING_PRESETS: () => MODEL_PRICING_PRESETS,
58
+ ManagedAccountSchema: () => ManagedAccountSchema,
54
59
  MetricsSchema: () => MetricsSchema,
55
60
  ModelTier: () => ModelTier,
56
61
  ModelTierSchema: () => ModelTierSchema,
@@ -330,6 +335,64 @@ var UnifiedReportSchema = import_zod.z.object({
330
335
  }).optional()
331
336
  }).catchall(import_zod.z.any());
332
337
 
338
+ // src/types/business.ts
339
+ var import_zod2 = require("zod");
340
+ var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
341
+ LeadSource2["ClawMoreHero"] = "clawmore-hero";
342
+ LeadSource2["ClawMoreWaitlist"] = "clawmore-waitlist";
343
+ LeadSource2["ClawMoreBeta"] = "clawmore-beta";
344
+ LeadSource2["AiReadyPlatform"] = "aiready-platform";
345
+ return LeadSource2;
346
+ })(LeadSource || {});
347
+ var LeadSourceSchema = import_zod2.z.nativeEnum(LeadSource);
348
+ var LeadSchema = import_zod2.z.object({
349
+ id: import_zod2.z.string(),
350
+ email: import_zod2.z.string().email(),
351
+ name: import_zod2.z.string().min(1),
352
+ interest: import_zod2.z.string().default("General"),
353
+ notes: import_zod2.z.string().optional(),
354
+ timestamp: import_zod2.z.string().datetime(),
355
+ source: LeadSourceSchema,
356
+ status: import_zod2.z.enum(["new", "contacted", "qualified", "converted", "archived"]).default("new")
357
+ });
358
+ var LeadSubmissionSchema = LeadSchema.omit({
359
+ id: true,
360
+ timestamp: true,
361
+ status: true
362
+ });
363
+ var ManagedAccountSchema = import_zod2.z.object({
364
+ id: import_zod2.z.string(),
365
+ // Internal UUID
366
+ accountId: import_zod2.z.string(),
367
+ // AWS Account ID
368
+ userId: import_zod2.z.string(),
369
+ // Owner (caopengau@gmail.com)
370
+ stripeSubscriptionId: import_zod2.z.string(),
371
+ // AI Token Management
372
+ tokenStrategy: import_zod2.z.enum(["managed", "byok"]).default("managed"),
373
+ byokConfig: import_zod2.z.object({
374
+ openaiKey: import_zod2.z.string().optional(),
375
+ anthropicKey: import_zod2.z.string().optional(),
376
+ openrouterKey: import_zod2.z.string().optional()
377
+ }).optional(),
378
+ // Financials (in cents)
379
+ baseFeeCents: import_zod2.z.number().default(2900),
380
+ includedComputeCents: import_zod2.z.number().default(1500),
381
+ // $15.00 AWS included
382
+ includedTokenCents: import_zod2.z.number().default(500),
383
+ // $5.00 Managed Tokens included
384
+ // Pre-paid Balance (credits)
385
+ prepaidTokenBalanceCents: import_zod2.z.number().default(0),
386
+ // Users buy these in $10 packs
387
+ currentMonthlyTokenSpendCents: import_zod2.z.number().default(0),
388
+ // Governance
389
+ status: import_zod2.z.enum(["provisioning", "active", "warning", "quarantined", "suspended"]).default("provisioning"),
390
+ lastCostSyncAt: import_zod2.z.string().datetime().optional(),
391
+ region: import_zod2.z.string().default("ap-southeast-2"),
392
+ // Alerting thresholds (percentage of includedComputeCents)
393
+ alertThresholds: import_zod2.z.array(import_zod2.z.number()).default([50, 80, 100, 150])
394
+ });
395
+
333
396
  // src/types.ts
334
397
  var GLOBAL_INFRA_OPTIONS = [
335
398
  "rootDir",
@@ -645,7 +708,7 @@ async function scanFiles(options) {
645
708
  try {
646
709
  const txt = await (0, import_promises.readFile)(ignoreFilePath, "utf-8");
647
710
  ignoreFromFile = txt.split(/\r?\n/).map((s) => s.trim()).filter(Boolean).filter((l) => !l.startsWith("#")).filter((l) => !l.startsWith("!"));
648
- } catch (e) {
711
+ } catch {
649
712
  ignoreFromFile = [];
650
713
  }
651
714
  }
@@ -699,7 +762,7 @@ async function scanFiles(options) {
699
762
  return !ig.ignores(rel);
700
763
  });
701
764
  return filtered;
702
- } catch (e) {
765
+ } catch {
703
766
  return files;
704
767
  }
705
768
  }
@@ -707,14 +770,14 @@ async function scanFiles(options) {
707
770
  }
708
771
  async function scanEntries(options) {
709
772
  const files = await scanFiles(options);
710
- const { rootDir, include = ["**/*"], exclude, includeTests } = options;
773
+ const { rootDir, exclude, includeTests } = options;
711
774
  const ignoreFilePath = (0, import_path.join)(rootDir || ".", ".aireadyignore");
712
775
  let ignoreFromFile = [];
713
776
  if ((0, import_fs.existsSync)(ignoreFilePath)) {
714
777
  try {
715
778
  const txt = await (0, import_promises.readFile)(ignoreFilePath, "utf-8");
716
779
  ignoreFromFile = txt.split(/\r?\n/).map((s) => s.trim()).filter(Boolean).filter((l) => !l.startsWith("#")).filter((l) => !l.startsWith("!"));
717
- } catch (e) {
780
+ } catch {
718
781
  ignoreFromFile = [];
719
782
  }
720
783
  }
@@ -789,7 +852,14 @@ function resolveOutputPath(userPath, defaultFilename, workingDir = process.cwd()
789
852
  if (userPath) {
790
853
  outputPath = userPath;
791
854
  } else {
792
- const aireadyDir = (0, import_path2.join)(workingDir, ".aiready");
855
+ let baseDir = workingDir;
856
+ try {
857
+ if ((0, import_fs2.statSync)(workingDir).isFile()) {
858
+ baseDir = (0, import_path2.dirname)(workingDir);
859
+ }
860
+ } catch (e) {
861
+ }
862
+ const aireadyDir = (0, import_path2.join)(baseDir, ".aiready");
793
863
  outputPath = (0, import_path2.join)(aireadyDir, defaultFilename);
794
864
  }
795
865
  const parentDir = (0, import_path2.dirname)(outputPath);
@@ -1509,7 +1579,7 @@ function findFileRecursively(dir, fileName, depth) {
1509
1579
  if (found) return found;
1510
1580
  }
1511
1581
  }
1512
- } catch (err) {
1582
+ } catch {
1513
1583
  }
1514
1584
  return null;
1515
1585
  }
@@ -1543,7 +1613,7 @@ async function setupParser(language) {
1543
1613
  const Lang = await Parser.Language.load(wasmPath);
1544
1614
  parser.setLanguage(Lang);
1545
1615
  return parser;
1546
- } catch (error) {
1616
+ } catch {
1547
1617
  return null;
1548
1618
  }
1549
1619
  }
@@ -1566,7 +1636,8 @@ var BaseLanguageParser = class {
1566
1636
  console.warn(`Failed to initialize ${this.language} parser:`, error);
1567
1637
  }
1568
1638
  }
1569
- async getAST(code, filePath) {
1639
+ async getAST(code, _filePath) {
1640
+ void _filePath;
1570
1641
  if (!this.initialized) await this.initialize();
1571
1642
  if (!this.parser) return null;
1572
1643
  return this.parser.parse(code);
@@ -1801,10 +1872,11 @@ var PythonParser = class extends BaseLanguageParser {
1801
1872
  ]
1802
1873
  };
1803
1874
  } catch (error) {
1804
- throw new ParseError(
1805
- `Failed to parse Python file ${filePath}: ${error.message}`,
1806
- filePath
1875
+ const wrapper = new Error(
1876
+ `Failed to parse Python file ${filePath}: ${error.message}`
1807
1877
  );
1878
+ wrapper.cause = error;
1879
+ throw wrapper;
1808
1880
  }
1809
1881
  }
1810
1882
  getNamingConventions() {
@@ -1835,6 +1907,7 @@ var PythonParser = class extends BaseLanguageParser {
1835
1907
  return filePath.toLowerCase().endsWith(".py");
1836
1908
  }
1837
1909
  extractImportsRegex(code, _filePath) {
1910
+ void _filePath;
1838
1911
  const imports = [];
1839
1912
  const lines = code.split("\n");
1840
1913
  const importRegex = /^\s*import\s+([a-zA-Z0-9_., ]+)/;
@@ -1885,6 +1958,7 @@ var PythonParser = class extends BaseLanguageParser {
1885
1958
  return imports;
1886
1959
  }
1887
1960
  extractExportsRegex(code, _filePath) {
1961
+ void _filePath;
1888
1962
  const exports2 = [];
1889
1963
  const lines = code.split("\n");
1890
1964
  const funcRegex = /^def\s+([a-zA-Z0-9_]+)\s*\(/;
@@ -2068,7 +2142,7 @@ var JavaParser = class extends BaseLanguageParser {
2068
2142
  ]
2069
2143
  });
2070
2144
  }
2071
- parseRegex(code, filePath) {
2145
+ parseRegex(code) {
2072
2146
  const lines = code.split("\n");
2073
2147
  const exports2 = [];
2074
2148
  const imports = [];
@@ -2142,10 +2216,8 @@ var JavaParser = class extends BaseLanguageParser {
2142
2216
  for (const node of rootNode.children) {
2143
2217
  if (node.type === "import_declaration") {
2144
2218
  const sourceArr = [];
2145
- let isStatic = false;
2146
2219
  let isWildcard = false;
2147
2220
  for (const child of node.children) {
2148
- if (child.type === "static") isStatic = true;
2149
2221
  if (child.type === "scoped_identifier" || child.type === "identifier") {
2150
2222
  sourceArr.push(child.text);
2151
2223
  }
@@ -2270,7 +2342,7 @@ var CSharpParser = class extends BaseLanguageParser {
2270
2342
  sideEffectSignatures: ["Console.Write", "File.Write", "Logging."]
2271
2343
  });
2272
2344
  }
2273
- parseRegex(code, filePath) {
2345
+ parseRegex(code) {
2274
2346
  const lines = code.split("\n");
2275
2347
  const exports2 = [];
2276
2348
  const imports = [];
@@ -2480,7 +2552,7 @@ var GoParser = class extends BaseLanguageParser {
2480
2552
  sideEffectSignatures: ["<-", "fmt.Print", "fmt.Fprintf", "os.Exit"]
2481
2553
  });
2482
2554
  }
2483
- parseRegex(code, filePath) {
2555
+ parseRegex(code) {
2484
2556
  const lines = code.split("\n");
2485
2557
  const exports2 = [];
2486
2558
  const imports = [];
@@ -2970,7 +3042,7 @@ function parseFileExports(code, filePath) {
2970
3042
  isTypeOnly: i.isTypeOnly || false
2971
3043
  }))
2972
3044
  };
2973
- } catch (e) {
3045
+ } catch {
2974
3046
  return { exports: [], imports: [] };
2975
3047
  }
2976
3048
  }
@@ -2984,7 +3056,7 @@ function parseFileExports(code, filePath) {
2984
3056
  const imports = extractFileImports(ast);
2985
3057
  const exports2 = extractExportsWithDependencies(ast, imports);
2986
3058
  return { exports: exports2, imports };
2987
- } catch (error) {
3059
+ } catch {
2988
3060
  return { exports: [], imports: [] };
2989
3061
  }
2990
3062
  }
@@ -2998,13 +3070,17 @@ function calculateImportSimilarity(export1, export2) {
2998
3070
  const union = /* @__PURE__ */ new Set([...set1, ...set2]);
2999
3071
  return intersection.size / union.size;
3000
3072
  }
3001
- function parseCode(code, language) {
3073
+ function parseCode(_code, _language) {
3074
+ void _code;
3075
+ void _language;
3002
3076
  return null;
3003
3077
  }
3004
- function extractFunctions(ast) {
3078
+ function extractFunctions(_ast) {
3079
+ void _ast;
3005
3080
  return [];
3006
3081
  }
3007
- function extractImports(ast) {
3082
+ function extractImports(_ast) {
3083
+ void _ast;
3008
3084
  return [];
3009
3085
  }
3010
3086
 
@@ -4546,18 +4622,20 @@ function calculateDocDrift(params) {
4546
4622
  undocumentedComplexity
4547
4623
  } = params;
4548
4624
  const uncommentedRatio = totalExports > 0 ? uncommentedExports / totalExports : 0;
4549
- const outdatedScore = Math.min(100, outdatedComments * 15);
4550
- const uncommentedScore = Math.min(100, uncommentedRatio * 100);
4551
- const complexityScore = Math.min(100, undocumentedComplexity * 10);
4552
- const score = Math.round(
4553
- outdatedScore * 0.6 + uncommentedScore * 0.2 + complexityScore * 0.2
4625
+ const outdatedRisk = Math.min(100, outdatedComments * 15);
4626
+ const uncommentedRisk = Math.min(100, uncommentedRatio * 100);
4627
+ const complexityRisk = Math.min(100, undocumentedComplexity * 10);
4628
+ const risk = Math.round(
4629
+ outdatedRisk * 0.6 + uncommentedRisk * 0.2 + complexityRisk * 0.2
4554
4630
  );
4555
- const finalScore = Math.min(100, Math.max(0, score));
4631
+ const finalRisk = Math.min(100, Math.max(0, risk));
4632
+ const score = totalExports > 0 ? 100 - finalRisk : 100;
4556
4633
  let rating;
4557
- if (finalScore < 10) rating = "minimal";
4558
- else if (finalScore < 30) rating = "low";
4559
- else if (finalScore < 60) rating = "moderate";
4560
- else if (finalScore < 85) rating = "high";
4634
+ if (score >= 90)
4635
+ rating = "minimal";
4636
+ else if (score >= 75) rating = "low";
4637
+ else if (score >= 60) rating = "moderate";
4638
+ else if (score >= 40) rating = "high";
4561
4639
  else rating = "severe";
4562
4640
  const recommendations = [];
4563
4641
  if (outdatedComments > 0)
@@ -4573,7 +4651,7 @@ function calculateDocDrift(params) {
4573
4651
  `Explain the business logic for ${undocumentedComplexity} highly complex functions.`
4574
4652
  );
4575
4653
  return {
4576
- score: finalScore,
4654
+ score,
4577
4655
  rating,
4578
4656
  dimensions: {
4579
4657
  uncommentedExports,
@@ -5012,8 +5090,13 @@ function emitIssuesAsAnnotations(issues) {
5012
5090
  JavaParser,
5013
5091
  LANGUAGE_EXTENSIONS,
5014
5092
  Language,
5093
+ LeadSchema,
5094
+ LeadSource,
5095
+ LeadSourceSchema,
5096
+ LeadSubmissionSchema,
5015
5097
  LocationSchema,
5016
5098
  MODEL_PRICING_PRESETS,
5099
+ ManagedAccountSchema,
5017
5100
  MetricsSchema,
5018
5101
  ModelTier,
5019
5102
  ModelTierSchema,