@aiready/core 0.23.4 → 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';
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';
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",
@@ -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);
@@ -4552,18 +4622,20 @@ function calculateDocDrift(params) {
4552
4622
  undocumentedComplexity
4553
4623
  } = params;
4554
4624
  const uncommentedRatio = totalExports > 0 ? uncommentedExports / totalExports : 0;
4555
- const outdatedScore = Math.min(100, outdatedComments * 15);
4556
- const uncommentedScore = Math.min(100, uncommentedRatio * 100);
4557
- const complexityScore = Math.min(100, undocumentedComplexity * 10);
4558
- const score = Math.round(
4559
- 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
4560
4630
  );
4561
- 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;
4562
4633
  let rating;
4563
- if (finalScore < 10) rating = "minimal";
4564
- else if (finalScore < 30) rating = "low";
4565
- else if (finalScore < 60) rating = "moderate";
4566
- 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";
4567
4639
  else rating = "severe";
4568
4640
  const recommendations = [];
4569
4641
  if (outdatedComments > 0)
@@ -4579,7 +4651,7 @@ function calculateDocDrift(params) {
4579
4651
  `Explain the business logic for ${undocumentedComplexity} highly complex functions.`
4580
4652
  );
4581
4653
  return {
4582
- score: finalScore,
4654
+ score,
4583
4655
  rating,
4584
4656
  dimensions: {
4585
4657
  uncommentedExports,
@@ -5018,8 +5090,13 @@ function emitIssuesAsAnnotations(issues) {
5018
5090
  JavaParser,
5019
5091
  LANGUAGE_EXTENSIONS,
5020
5092
  Language,
5093
+ LeadSchema,
5094
+ LeadSource,
5095
+ LeadSourceSchema,
5096
+ LeadSubmissionSchema,
5021
5097
  LocationSchema,
5022
5098
  MODEL_PRICING_PRESETS,
5099
+ ManagedAccountSchema,
5023
5100
  MetricsSchema,
5024
5101
  ModelTier,
5025
5102
  ModelTierSchema,
package/dist/index.mjs CHANGED
@@ -13,7 +13,12 @@ import {
13
13
  IssueTypeSchema,
14
14
  LANGUAGE_EXTENSIONS,
15
15
  Language,
16
+ LeadSchema,
17
+ LeadSource,
18
+ LeadSourceSchema,
19
+ LeadSubmissionSchema,
16
20
  LocationSchema,
21
+ ManagedAccountSchema,
17
22
  MetricsSchema,
18
23
  ModelTier,
19
24
  ModelTierSchema,
@@ -44,7 +49,7 @@ import {
44
49
  getToolWeight,
45
50
  normalizeToolName,
46
51
  parseWeightString
47
- } from "./chunk-NGHT7JOG.mjs";
52
+ } from "./chunk-Q55AMEFV.mjs";
48
53
 
49
54
  // src/types/contract.ts
50
55
  function validateSpokeOutput(toolName, output) {
@@ -454,7 +459,14 @@ function resolveOutputPath(userPath, defaultFilename, workingDir = process.cwd()
454
459
  if (userPath) {
455
460
  outputPath = userPath;
456
461
  } else {
457
- const aireadyDir = join2(workingDir, ".aiready");
462
+ let baseDir = workingDir;
463
+ try {
464
+ if (statSync(workingDir).isFile()) {
465
+ baseDir = dirname2(workingDir);
466
+ }
467
+ } catch (e) {
468
+ }
469
+ const aireadyDir = join2(baseDir, ".aiready");
458
470
  outputPath = join2(aireadyDir, defaultFilename);
459
471
  }
460
472
  const parentDir = dirname2(outputPath);
@@ -3785,18 +3797,20 @@ function calculateDocDrift(params) {
3785
3797
  undocumentedComplexity
3786
3798
  } = params;
3787
3799
  const uncommentedRatio = totalExports > 0 ? uncommentedExports / totalExports : 0;
3788
- const outdatedScore = Math.min(100, outdatedComments * 15);
3789
- const uncommentedScore = Math.min(100, uncommentedRatio * 100);
3790
- const complexityScore = Math.min(100, undocumentedComplexity * 10);
3791
- const score = Math.round(
3792
- outdatedScore * 0.6 + uncommentedScore * 0.2 + complexityScore * 0.2
3800
+ const outdatedRisk = Math.min(100, outdatedComments * 15);
3801
+ const uncommentedRisk = Math.min(100, uncommentedRatio * 100);
3802
+ const complexityRisk = Math.min(100, undocumentedComplexity * 10);
3803
+ const risk = Math.round(
3804
+ outdatedRisk * 0.6 + uncommentedRisk * 0.2 + complexityRisk * 0.2
3793
3805
  );
3794
- const finalScore = Math.min(100, Math.max(0, score));
3806
+ const finalRisk = Math.min(100, Math.max(0, risk));
3807
+ const score = totalExports > 0 ? 100 - finalRisk : 100;
3795
3808
  let rating;
3796
- if (finalScore < 10) rating = "minimal";
3797
- else if (finalScore < 30) rating = "low";
3798
- else if (finalScore < 60) rating = "moderate";
3799
- else if (finalScore < 85) rating = "high";
3809
+ if (score >= 90)
3810
+ rating = "minimal";
3811
+ else if (score >= 75) rating = "low";
3812
+ else if (score >= 60) rating = "moderate";
3813
+ else if (score >= 40) rating = "high";
3800
3814
  else rating = "severe";
3801
3815
  const recommendations = [];
3802
3816
  if (outdatedComments > 0)
@@ -3812,7 +3826,7 @@ function calculateDocDrift(params) {
3812
3826
  `Explain the business logic for ${undocumentedComplexity} highly complex functions.`
3813
3827
  );
3814
3828
  return {
3815
- score: finalScore,
3829
+ score,
3816
3830
  rating,
3817
3831
  dimensions: {
3818
3832
  uncommentedExports,
@@ -4250,8 +4264,13 @@ export {
4250
4264
  JavaParser,
4251
4265
  LANGUAGE_EXTENSIONS,
4252
4266
  Language,
4267
+ LeadSchema,
4268
+ LeadSource,
4269
+ LeadSourceSchema,
4270
+ LeadSubmissionSchema,
4253
4271
  LocationSchema,
4254
4272
  MODEL_PRICING_PRESETS,
4273
+ ManagedAccountSchema,
4255
4274
  MetricsSchema,
4256
4275
  ModelTier,
4257
4276
  ModelTierSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/core",
3
- "version": "0.23.4",
3
+ "version": "0.23.5",
4
4
  "description": "Shared utilities for AIReady analysis tools",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",