lean-claudient-core 0.1.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.
- package/.reports/detailed-analysis_2026-06-20_01ed326b.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_08d39381.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_0a331144.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_0d54ffef.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_14bfa31c.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_211feac4.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_22381bc2.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_29b4ea0a.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_2df0ad14.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_343ec84c.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_3a01030d.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_3b4c99ec.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_3d368827.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_53544d3d.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_5721164a.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_57caf5e7.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_624302f5.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_62456384.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_636a52f1.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_63d1ad41.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_7451ccd7.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_74da4e9a.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_83a90083.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_867fbdd9.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_974c3299.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_a04639a2.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_a8e23d6d.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_aa9150f0.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_acbeee08.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_c4ffa0e2.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_c5f7684b.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_c963b1fa.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_d4bde41f.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_d6eb2497.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_ea6f7f58.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_ebf4e060.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_ec4313a9.html +200 -0
- package/.reports/detailed-analysis_2026-06-20_fc65d18e.html +200 -0
- package/.reports/executive-summary_2026-06-20_00406d50.html +109 -0
- package/.reports/executive-summary_2026-06-20_0bb202d3.html +109 -0
- package/.reports/executive-summary_2026-06-20_0bcd7481.html +109 -0
- package/.reports/executive-summary_2026-06-20_11506445.html +109 -0
- package/.reports/executive-summary_2026-06-20_13616cda.html +109 -0
- package/.reports/executive-summary_2026-06-20_19d41c2f.html +109 -0
- package/.reports/executive-summary_2026-06-20_1b0d6e96.html +109 -0
- package/.reports/executive-summary_2026-06-20_1e38670b.html +109 -0
- package/.reports/executive-summary_2026-06-20_1f32f793.html +109 -0
- package/.reports/executive-summary_2026-06-20_1f40f7d3.html +109 -0
- package/.reports/executive-summary_2026-06-20_25a40a7e.html +109 -0
- package/.reports/executive-summary_2026-06-20_26d11818.html +109 -0
- package/.reports/executive-summary_2026-06-20_26ed4593.html +109 -0
- package/.reports/executive-summary_2026-06-20_291b90a8.html +109 -0
- package/.reports/executive-summary_2026-06-20_2957a848.html +109 -0
- package/.reports/executive-summary_2026-06-20_2a04eb77.html +109 -0
- package/.reports/executive-summary_2026-06-20_2fa701f9.html +109 -0
- package/.reports/executive-summary_2026-06-20_327af8f5.html +109 -0
- package/.reports/executive-summary_2026-06-20_3418c729.html +109 -0
- package/.reports/executive-summary_2026-06-20_3571763d.html +109 -0
- package/.reports/executive-summary_2026-06-20_36225353.html +109 -0
- package/.reports/executive-summary_2026-06-20_3b2de891.html +109 -0
- package/.reports/executive-summary_2026-06-20_45b980c2.html +109 -0
- package/.reports/executive-summary_2026-06-20_46fcbf17.html +109 -0
- package/.reports/executive-summary_2026-06-20_48c8fa5e.html +109 -0
- package/.reports/executive-summary_2026-06-20_4ba55c43.html +109 -0
- package/.reports/executive-summary_2026-06-20_4f4498e6.html +109 -0
- package/.reports/executive-summary_2026-06-20_54c33bf0.html +109 -0
- package/.reports/executive-summary_2026-06-20_54cc7077.html +109 -0
- package/.reports/executive-summary_2026-06-20_5a12912e.html +109 -0
- package/.reports/executive-summary_2026-06-20_636fac87.html +109 -0
- package/.reports/executive-summary_2026-06-20_6587faaf.html +109 -0
- package/.reports/executive-summary_2026-06-20_6adbdd03.html +109 -0
- package/.reports/executive-summary_2026-06-20_6bf344ec.html +109 -0
- package/.reports/executive-summary_2026-06-20_7142aeed.html +109 -0
- package/.reports/executive-summary_2026-06-20_72bc0ceb.html +109 -0
- package/.reports/executive-summary_2026-06-20_775752ac.html +109 -0
- package/.reports/executive-summary_2026-06-20_7a9c3223.html +109 -0
- package/.reports/executive-summary_2026-06-20_808e6376.html +109 -0
- package/.reports/executive-summary_2026-06-20_8de9142d.html +109 -0
- package/.reports/executive-summary_2026-06-20_91981fbe.html +109 -0
- package/.reports/executive-summary_2026-06-20_93191c8c.html +109 -0
- package/.reports/executive-summary_2026-06-20_9be48a87.html +109 -0
- package/.reports/executive-summary_2026-06-20_9c127198.html +109 -0
- package/.reports/executive-summary_2026-06-20_9ee303ac.html +109 -0
- package/.reports/executive-summary_2026-06-20_9ee52709.html +109 -0
- package/.reports/executive-summary_2026-06-20_a0fa27de.html +109 -0
- package/.reports/executive-summary_2026-06-20_a1813e47.html +109 -0
- package/.reports/executive-summary_2026-06-20_a974edc1.html +109 -0
- package/.reports/executive-summary_2026-06-20_aa711737.html +109 -0
- package/.reports/executive-summary_2026-06-20_aa752246.html +109 -0
- package/.reports/executive-summary_2026-06-20_ac6f0927.html +109 -0
- package/.reports/executive-summary_2026-06-20_b231b143.html +109 -0
- package/.reports/executive-summary_2026-06-20_b570a2bd.html +109 -0
- package/.reports/executive-summary_2026-06-20_b6fbf650.html +109 -0
- package/.reports/executive-summary_2026-06-20_b9f8ddf3.html +109 -0
- package/.reports/executive-summary_2026-06-20_bf95cc63.html +109 -0
- package/.reports/executive-summary_2026-06-20_c0d0aefe.html +109 -0
- package/.reports/executive-summary_2026-06-20_c1933c36.html +109 -0
- package/.reports/executive-summary_2026-06-20_c99bba8a.html +109 -0
- package/.reports/executive-summary_2026-06-20_cc3846ac.html +109 -0
- package/.reports/executive-summary_2026-06-20_d485993c.html +109 -0
- package/.reports/executive-summary_2026-06-20_d56f75f7.html +109 -0
- package/.reports/executive-summary_2026-06-20_d57660cc.html +109 -0
- package/.reports/executive-summary_2026-06-20_dc036f62.html +109 -0
- package/.reports/executive-summary_2026-06-20_df783f47.html +109 -0
- package/.reports/executive-summary_2026-06-20_e2191adb.html +109 -0
- package/.reports/executive-summary_2026-06-20_e9f1d504.html +109 -0
- package/.reports/executive-summary_2026-06-20_ea82f5e1.html +109 -0
- package/.reports/executive-summary_2026-06-20_ec3e70cb.html +109 -0
- package/.reports/executive-summary_2026-06-20_ee6cf902.html +109 -0
- package/.reports/executive-summary_2026-06-20_f6cb657c.html +109 -0
- package/.reports/executive-summary_2026-06-20_f8c60046.html +109 -0
- package/.reports/executive-summary_2026-06-20_fa184840.html +109 -0
- package/.reports/executive-summary_2026-06-20_fc88bcb4.html +109 -0
- package/.reports/executive-summary_2026-06-20_ffa79c4e.html +109 -0
- package/README.md +53 -0
- package/dist/automation/actionApprover.d.ts +89 -0
- package/dist/automation/actionApprover.d.ts.map +1 -0
- package/dist/automation/actionApprover.js +264 -0
- package/dist/automation/actionApprover.js.map +1 -0
- package/dist/automation/actionExecutor.d.ts +125 -0
- package/dist/automation/actionExecutor.d.ts.map +1 -0
- package/dist/automation/actionExecutor.js +304 -0
- package/dist/automation/actionExecutor.js.map +1 -0
- package/dist/automation/alertRules.d.ts +55 -0
- package/dist/automation/alertRules.d.ts.map +1 -0
- package/dist/automation/alertRules.js +70 -0
- package/dist/automation/alertRules.js.map +1 -0
- package/dist/automation/alertSystem.d.ts +109 -0
- package/dist/automation/alertSystem.d.ts.map +1 -0
- package/dist/automation/alertSystem.js +303 -0
- package/dist/automation/alertSystem.js.map +1 -0
- package/dist/automation/competitorResponse.d.ts +119 -0
- package/dist/automation/competitorResponse.d.ts.map +1 -0
- package/dist/automation/competitorResponse.js +343 -0
- package/dist/automation/competitorResponse.js.map +1 -0
- package/dist/automation/composioClient.d.ts +107 -0
- package/dist/automation/composioClient.d.ts.map +1 -0
- package/dist/automation/composioClient.js +286 -0
- package/dist/automation/composioClient.js.map +1 -0
- package/dist/automation/crmExport.d.ts +116 -0
- package/dist/automation/crmExport.d.ts.map +1 -0
- package/dist/automation/crmExport.js +282 -0
- package/dist/automation/crmExport.js.map +1 -0
- package/dist/automation/crmIntegration.d.ts +83 -0
- package/dist/automation/crmIntegration.d.ts.map +1 -0
- package/dist/automation/crmIntegration.js +207 -0
- package/dist/automation/crmIntegration.js.map +1 -0
- package/dist/automation/gmailIntegration.d.ts +73 -0
- package/dist/automation/gmailIntegration.d.ts.map +1 -0
- package/dist/automation/gmailIntegration.js +184 -0
- package/dist/automation/gmailIntegration.js.map +1 -0
- package/dist/automation/index.d.ts +17 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +17 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/jiraIntegration.d.ts +103 -0
- package/dist/automation/jiraIntegration.d.ts.map +1 -0
- package/dist/automation/jiraIntegration.js +222 -0
- package/dist/automation/jiraIntegration.js.map +1 -0
- package/dist/automation/jobQueue.d.ts +98 -0
- package/dist/automation/jobQueue.d.ts.map +1 -0
- package/dist/automation/jobQueue.js +207 -0
- package/dist/automation/jobQueue.js.map +1 -0
- package/dist/automation/leadQualification.d.ts +60 -0
- package/dist/automation/leadQualification.d.ts.map +1 -0
- package/dist/automation/leadQualification.js +204 -0
- package/dist/automation/leadQualification.js.map +1 -0
- package/dist/automation/qualificationRules.d.ts +100 -0
- package/dist/automation/qualificationRules.d.ts.map +1 -0
- package/dist/automation/qualificationRules.js +202 -0
- package/dist/automation/qualificationRules.js.map +1 -0
- package/dist/automation/responseTemplates.d.ts +64 -0
- package/dist/automation/responseTemplates.d.ts.map +1 -0
- package/dist/automation/responseTemplates.js +374 -0
- package/dist/automation/responseTemplates.js.map +1 -0
- package/dist/automation/scheduler.d.ts +85 -0
- package/dist/automation/scheduler.d.ts.map +1 -0
- package/dist/automation/scheduler.js +194 -0
- package/dist/automation/scheduler.js.map +1 -0
- package/dist/automation/types.d.ts +223 -0
- package/dist/automation/types.d.ts.map +1 -0
- package/dist/automation/types.js +32 -0
- package/dist/automation/types.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +575 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compression/caveman.d.ts +14 -0
- package/dist/compression/caveman.d.ts.map +1 -0
- package/dist/compression/caveman.js +188 -0
- package/dist/compression/caveman.js.map +1 -0
- package/dist/compression/caveman.test.d.ts +2 -0
- package/dist/compression/caveman.test.d.ts.map +1 -0
- package/dist/compression/caveman.test.js.map +1 -0
- package/dist/config/configManager.d.ts +6 -0
- package/dist/config/configManager.d.ts.map +1 -0
- package/dist/config/configManager.js +62 -0
- package/dist/config/configManager.js.map +1 -0
- package/dist/config/schema.d.ts +95 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +19 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/context/autoCompact.d.ts +19 -0
- package/dist/context/autoCompact.d.ts.map +1 -0
- package/dist/context/autoCompact.js +101 -0
- package/dist/context/autoCompact.js.map +1 -0
- package/dist/context/readDedup.d.ts +21 -0
- package/dist/context/readDedup.d.ts.map +1 -0
- package/dist/context/readDedup.js +55 -0
- package/dist/context/readDedup.js.map +1 -0
- package/dist/context/toolBudgets.d.ts +15 -0
- package/dist/context/toolBudgets.d.ts.map +1 -0
- package/dist/context/toolBudgets.js +35 -0
- package/dist/context/toolBudgets.js.map +1 -0
- package/dist/core/auditLogger.d.ts +30 -0
- package/dist/core/auditLogger.d.ts.map +1 -0
- package/dist/core/auditLogger.js +51 -0
- package/dist/core/auditLogger.js.map +1 -0
- package/dist/core/stateManager.d.ts +10 -0
- package/dist/core/stateManager.d.ts.map +1 -0
- package/dist/core/stateManager.js +59 -0
- package/dist/core/stateManager.js.map +1 -0
- package/dist/database/feedbackSchema.d.ts +80 -0
- package/dist/database/feedbackSchema.d.ts.map +1 -0
- package/dist/database/feedbackSchema.js +94 -0
- package/dist/database/feedbackSchema.js.map +1 -0
- package/dist/database/leadsSchema.d.ts +99 -0
- package/dist/database/leadsSchema.d.ts.map +1 -0
- package/dist/database/leadsSchema.js +136 -0
- package/dist/database/leadsSchema.js.map +1 -0
- package/dist/intelligence/competitorScoring.d.ts +25 -0
- package/dist/intelligence/competitorScoring.d.ts.map +1 -0
- package/dist/intelligence/competitorScoring.js +181 -0
- package/dist/intelligence/competitorScoring.js.map +1 -0
- package/dist/intelligence/competitorTracker.d.ts +36 -0
- package/dist/intelligence/competitorTracker.d.ts.map +1 -0
- package/dist/intelligence/competitorTracker.js +286 -0
- package/dist/intelligence/competitorTracker.js.map +1 -0
- package/dist/intelligence/competitorTypes.d.ts +93 -0
- package/dist/intelligence/competitorTypes.d.ts.map +1 -0
- package/dist/intelligence/competitorTypes.js +6 -0
- package/dist/intelligence/competitorTypes.js.map +1 -0
- package/dist/intelligence/competitors.json +76 -0
- package/dist/intelligence/feedbackLoop.d.ts +118 -0
- package/dist/intelligence/feedbackLoop.d.ts.map +1 -0
- package/dist/intelligence/feedbackLoop.js +368 -0
- package/dist/intelligence/feedbackLoop.js.map +1 -0
- package/dist/intelligence/gitHubTracker.d.ts +14 -0
- package/dist/intelligence/gitHubTracker.d.ts.map +1 -0
- package/dist/intelligence/gitHubTracker.js +153 -0
- package/dist/intelligence/gitHubTracker.js.map +1 -0
- package/dist/intelligence/hackerNewsScanner.d.ts +21 -0
- package/dist/intelligence/hackerNewsScanner.d.ts.map +1 -0
- package/dist/intelligence/hackerNewsScanner.js +88 -0
- package/dist/intelligence/hackerNewsScanner.js.map +1 -0
- package/dist/intelligence/hiringSignals.d.ts +16 -0
- package/dist/intelligence/hiringSignals.d.ts.map +1 -0
- package/dist/intelligence/hiringSignals.js +132 -0
- package/dist/intelligence/hiringSignals.js.map +1 -0
- package/dist/intelligence/index.d.ts +9 -0
- package/dist/intelligence/index.d.ts.map +1 -0
- package/dist/intelligence/index.js +9 -0
- package/dist/intelligence/index.js.map +1 -0
- package/dist/intelligence/leadEnrichment.d.ts +59 -0
- package/dist/intelligence/leadEnrichment.d.ts.map +1 -0
- package/dist/intelligence/leadEnrichment.js +209 -0
- package/dist/intelligence/leadEnrichment.js.map +1 -0
- package/dist/intelligence/leadEnrichmentTypes.d.ts +49 -0
- package/dist/intelligence/leadEnrichmentTypes.d.ts.map +1 -0
- package/dist/intelligence/leadEnrichmentTypes.js +7 -0
- package/dist/intelligence/leadEnrichmentTypes.js.map +1 -0
- package/dist/intelligence/marketScanner.d.ts +18 -0
- package/dist/intelligence/marketScanner.d.ts.map +1 -0
- package/dist/intelligence/marketScanner.js +225 -0
- package/dist/intelligence/marketScanner.js.map +1 -0
- package/dist/intelligence/polymarketScanner.d.ts +20 -0
- package/dist/intelligence/polymarketScanner.d.ts.map +1 -0
- package/dist/intelligence/polymarketScanner.js +88 -0
- package/dist/intelligence/polymarketScanner.js.map +1 -0
- package/dist/intelligence/redditScanner.d.ts +22 -0
- package/dist/intelligence/redditScanner.d.ts.map +1 -0
- package/dist/intelligence/redditScanner.js +89 -0
- package/dist/intelligence/redditScanner.js.map +1 -0
- package/dist/intelligence/signalAggregator.d.ts +10 -0
- package/dist/intelligence/signalAggregator.d.ts.map +1 -0
- package/dist/intelligence/signalAggregator.js +64 -0
- package/dist/intelligence/signalAggregator.js.map +1 -0
- package/dist/intelligence/trendAnalysis.d.ts +13 -0
- package/dist/intelligence/trendAnalysis.d.ts.map +1 -0
- package/dist/intelligence/trendAnalysis.js +106 -0
- package/dist/intelligence/trendAnalysis.js.map +1 -0
- package/dist/intelligence/twitterScanner.d.ts +22 -0
- package/dist/intelligence/twitterScanner.d.ts.map +1 -0
- package/dist/intelligence/twitterScanner.js +63 -0
- package/dist/intelligence/twitterScanner.js.map +1 -0
- package/dist/intelligence/types.d.ts +566 -0
- package/dist/intelligence/types.d.ts.map +1 -0
- package/dist/intelligence/types.js +87 -0
- package/dist/intelligence/types.js.map +1 -0
- package/dist/intelligence/userComplaints.d.ts +15 -0
- package/dist/intelligence/userComplaints.d.ts.map +1 -0
- package/dist/intelligence/userComplaints.js +193 -0
- package/dist/intelligence/userComplaints.js.map +1 -0
- package/dist/metrics/businessMetrics.d.ts +41 -0
- package/dist/metrics/businessMetrics.d.ts.map +1 -0
- package/dist/metrics/businessMetrics.js +120 -0
- package/dist/metrics/businessMetrics.js.map +1 -0
- package/dist/metrics/businessMetrics.test.d.ts +2 -0
- package/dist/metrics/businessMetrics.test.d.ts.map +1 -0
- package/dist/metrics/businessMetrics.test.js.map +1 -0
- package/dist/metrics/businessMetricsAgg.d.ts +85 -0
- package/dist/metrics/businessMetricsAgg.d.ts.map +1 -0
- package/dist/metrics/businessMetricsAgg.js +406 -0
- package/dist/metrics/businessMetricsAgg.js.map +1 -0
- package/dist/metrics/competitorMetrics.d.ts +57 -0
- package/dist/metrics/competitorMetrics.d.ts.map +1 -0
- package/dist/metrics/competitorMetrics.js +94 -0
- package/dist/metrics/competitorMetrics.js.map +1 -0
- package/dist/metrics/dashboardGenerator.d.ts +16 -0
- package/dist/metrics/dashboardGenerator.d.ts.map +1 -0
- package/dist/metrics/dashboardGenerator.js +313 -0
- package/dist/metrics/dashboardGenerator.js.map +1 -0
- package/dist/metrics/dashboardHTML.d.ts +18 -0
- package/dist/metrics/dashboardHTML.d.ts.map +1 -0
- package/dist/metrics/dashboardHTML.js +613 -0
- package/dist/metrics/dashboardHTML.js.map +1 -0
- package/dist/metrics/grafanaExport.d.ts +53 -0
- package/dist/metrics/grafanaExport.d.ts.map +1 -0
- package/dist/metrics/grafanaExport.js +277 -0
- package/dist/metrics/grafanaExport.js.map +1 -0
- package/dist/metrics/index.d.ts +17 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +17 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/leadsMetrics.d.ts +48 -0
- package/dist/metrics/leadsMetrics.d.ts.map +1 -0
- package/dist/metrics/leadsMetrics.js +82 -0
- package/dist/metrics/leadsMetrics.js.map +1 -0
- package/dist/metrics/leadsMetrics.test.d.ts +2 -0
- package/dist/metrics/leadsMetrics.test.d.ts.map +1 -0
- package/dist/metrics/leadsMetrics.test.js.map +1 -0
- package/dist/metrics/metricsTypes.d.ts +114 -0
- package/dist/metrics/metricsTypes.d.ts.map +1 -0
- package/dist/metrics/metricsTypes.js +7 -0
- package/dist/metrics/metricsTypes.js.map +1 -0
- package/dist/metrics/revenueProjection.d.ts +44 -0
- package/dist/metrics/revenueProjection.d.ts.map +1 -0
- package/dist/metrics/revenueProjection.js +239 -0
- package/dist/metrics/revenueProjection.js.map +1 -0
- package/dist/metrics/revenueTypes.d.ts +62 -0
- package/dist/metrics/revenueTypes.d.ts.map +1 -0
- package/dist/metrics/revenueTypes.js +7 -0
- package/dist/metrics/revenueTypes.js.map +1 -0
- package/dist/metrics/roiCalculator.d.ts +39 -0
- package/dist/metrics/roiCalculator.d.ts.map +1 -0
- package/dist/metrics/roiCalculator.js +128 -0
- package/dist/metrics/roiCalculator.js.map +1 -0
- package/dist/metrics/roiCalculator.test.d.ts +2 -0
- package/dist/metrics/roiCalculator.test.d.ts.map +1 -0
- package/dist/metrics/roiCalculator.test.js.map +1 -0
- package/dist/metrics/trendMetrics.d.ts +51 -0
- package/dist/metrics/trendMetrics.d.ts.map +1 -0
- package/dist/metrics/trendMetrics.js +116 -0
- package/dist/metrics/trendMetrics.js.map +1 -0
- package/dist/modes/conservativeCTOMode.d.ts +32 -0
- package/dist/modes/conservativeCTOMode.d.ts.map +1 -0
- package/dist/modes/conservativeCTOMode.js +98 -0
- package/dist/modes/conservativeCTOMode.js.map +1 -0
- package/dist/modes/index.d.ts +3 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +3 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/seniorDeveloperMode.d.ts +17 -0
- package/dist/modes/seniorDeveloperMode.d.ts.map +1 -0
- package/dist/modes/seniorDeveloperMode.js +77 -0
- package/dist/modes/seniorDeveloperMode.js.map +1 -0
- package/dist/recovery/contextRecovery.d.ts +28 -0
- package/dist/recovery/contextRecovery.d.ts.map +1 -0
- package/dist/recovery/contextRecovery.js +113 -0
- package/dist/recovery/contextRecovery.js.map +1 -0
- package/dist/repair/errorDiagnostics.d.ts +28 -0
- package/dist/repair/errorDiagnostics.d.ts.map +1 -0
- package/dist/repair/errorDiagnostics.js +158 -0
- package/dist/repair/errorDiagnostics.js.map +1 -0
- package/dist/repair/skillCapture.d.ts +22 -0
- package/dist/repair/skillCapture.d.ts.map +1 -0
- package/dist/repair/skillCapture.js +119 -0
- package/dist/repair/skillCapture.js.map +1 -0
- package/dist/reporting/reportGenerator.d.ts +117 -0
- package/dist/reporting/reportGenerator.d.ts.map +1 -0
- package/dist/reporting/reportGenerator.js +613 -0
- package/dist/reporting/reportGenerator.js.map +1 -0
- package/dist/reporting/templates.d.ts +68 -0
- package/dist/reporting/templates.d.ts.map +1 -0
- package/dist/reporting/templates.js +629 -0
- package/dist/reporting/templates.js.map +1 -0
- package/dist/security/owaspScanner.d.ts +74 -0
- package/dist/security/owaspScanner.d.ts.map +1 -0
- package/dist/security/owaspScanner.js +309 -0
- package/dist/security/owaspScanner.js.map +1 -0
- package/dist/security/piiRedaction.d.ts +67 -0
- package/dist/security/piiRedaction.d.ts.map +1 -0
- package/dist/security/piiRedaction.js +189 -0
- package/dist/security/piiRedaction.js.map +1 -0
- package/dist/security/secretsDetection.d.ts +47 -0
- package/dist/security/secretsDetection.d.ts.map +1 -0
- package/dist/security/secretsDetection.js +272 -0
- package/dist/security/secretsDetection.js.map +1 -0
- package/dist/subagents/builder.d.ts +33 -0
- package/dist/subagents/builder.d.ts.map +1 -0
- package/dist/subagents/builder.js +158 -0
- package/dist/subagents/builder.js.map +1 -0
- package/dist/subagents/investigator.d.ts +31 -0
- package/dist/subagents/investigator.d.ts.map +1 -0
- package/dist/subagents/investigator.js +166 -0
- package/dist/subagents/investigator.js.map +1 -0
- package/dist/subagents/orchestrator.d.ts +48 -0
- package/dist/subagents/orchestrator.d.ts.map +1 -0
- package/dist/subagents/orchestrator.js +151 -0
- package/dist/subagents/orchestrator.js.map +1 -0
- package/dist/subagents/reviewer.d.ts +31 -0
- package/dist/subagents/reviewer.d.ts.map +1 -0
- package/dist/subagents/reviewer.js +154 -0
- package/dist/subagents/reviewer.js.map +1 -0
- package/dist/telemetry/tokenCounter.d.ts +21 -0
- package/dist/telemetry/tokenCounter.d.ts.map +1 -0
- package/dist/telemetry/tokenCounter.js +49 -0
- package/dist/telemetry/tokenCounter.js.map +1 -0
- package/package.json +61 -0
- package/src/automation/actionApprover.ts +342 -0
- package/src/automation/actionExecutor.ts +399 -0
- package/src/automation/alertRules.ts +113 -0
- package/src/automation/alertSystem.ts +402 -0
- package/src/automation/competitorResponse.ts +511 -0
- package/src/automation/composioClient.ts +360 -0
- package/src/automation/crmExport.ts +407 -0
- package/src/automation/crmIntegration.ts +268 -0
- package/src/automation/gmailIntegration.ts +244 -0
- package/src/automation/index.ts +17 -0
- package/src/automation/jiraIntegration.ts +310 -0
- package/src/automation/jobQueue.ts +278 -0
- package/src/automation/leadQualification.ts +270 -0
- package/src/automation/qualificationRules.ts +304 -0
- package/src/automation/responseTemplates.ts +419 -0
- package/src/automation/scheduler.ts +254 -0
- package/src/automation/types.ts +270 -0
- package/src/cli/index.ts +646 -0
- package/src/compression/caveman.ts +257 -0
- package/src/config/configManager.ts +63 -0
- package/src/config/schema.ts +27 -0
- package/src/context/autoCompact.ts +123 -0
- package/src/context/readDedup.ts +84 -0
- package/src/context/toolBudgets.ts +43 -0
- package/src/core/auditLogger.ts +69 -0
- package/src/core/stateManager.ts +73 -0
- package/src/database/feedbackSchema.ts +168 -0
- package/src/database/leadsSchema.ts +205 -0
- package/src/intelligence/competitorScoring.ts +292 -0
- package/src/intelligence/competitorTracker.ts +362 -0
- package/src/intelligence/competitorTypes.ts +100 -0
- package/src/intelligence/competitors.json +76 -0
- package/src/intelligence/feedbackLoop.ts +538 -0
- package/src/intelligence/gitHubTracker.ts +204 -0
- package/src/intelligence/hackerNewsScanner.ts +121 -0
- package/src/intelligence/hiringSignals.ts +162 -0
- package/src/intelligence/index.ts +9 -0
- package/src/intelligence/leadEnrichment.ts +275 -0
- package/src/intelligence/leadEnrichmentTypes.ts +54 -0
- package/src/intelligence/marketScanner.ts +285 -0
- package/src/intelligence/polymarketScanner.ts +120 -0
- package/src/intelligence/redditScanner.ts +122 -0
- package/src/intelligence/signalAggregator.ts +94 -0
- package/src/intelligence/trendAnalysis.ts +140 -0
- package/src/intelligence/twitterScanner.ts +94 -0
- package/src/intelligence/types.ts +130 -0
- package/src/intelligence/userComplaints.ts +236 -0
- package/src/metrics/businessMetrics.ts +186 -0
- package/src/metrics/businessMetricsAgg.ts +554 -0
- package/src/metrics/competitorMetrics.ts +175 -0
- package/src/metrics/dashboardGenerator.ts +335 -0
- package/src/metrics/dashboardHTML.ts +637 -0
- package/src/metrics/grafanaExport.ts +347 -0
- package/src/metrics/index.ts +17 -0
- package/src/metrics/leadsMetrics.ts +145 -0
- package/src/metrics/metricsTypes.ts +129 -0
- package/src/metrics/revenueProjection.ts +319 -0
- package/src/metrics/revenueTypes.ts +67 -0
- package/src/metrics/roiCalculator.ts +199 -0
- package/src/metrics/trendMetrics.ts +190 -0
- package/src/modes/conservativeCTOMode.ts +124 -0
- package/src/modes/index.ts +6 -0
- package/src/modes/seniorDeveloperMode.ts +94 -0
- package/src/recovery/contextRecovery.ts +141 -0
- package/src/repair/errorDiagnostics.ts +198 -0
- package/src/repair/skillCapture.ts +157 -0
- package/src/reporting/reportGenerator.ts +802 -0
- package/src/reporting/templates.ts +677 -0
- package/src/security/owaspScanner.ts +390 -0
- package/src/security/phase8Hardening.ts +536 -0
- package/src/security/piiRedaction.ts +215 -0
- package/src/security/secretsDetection.js +271 -0
- package/src/security/secretsDetection.ts +318 -0
- package/src/subagents/builder.ts +277 -0
- package/src/subagents/investigator.ts +224 -0
- package/src/subagents/orchestrator.ts +212 -0
- package/src/subagents/reviewer.ts +215 -0
- package/src/telemetry/tokenCounter.ts +81 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import { createHash } from 'crypto';
|
|
5
|
+
|
|
6
|
+
const TASK_PLAN = 'task_plan.md';
|
|
7
|
+
const FINDINGS = 'findings.md';
|
|
8
|
+
const PROGRESS = 'progress.md';
|
|
9
|
+
|
|
10
|
+
const TEMPLATES = {
|
|
11
|
+
[TASK_PLAN]: '# Task Plan\n\n## Overview\n\n## Tasks\n\n',
|
|
12
|
+
[FINDINGS]: '# Findings\n\n## Summary\n\n',
|
|
13
|
+
[PROGRESS]: '# Progress\n\n## Checkpoint\n\n',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export interface StateCheckpoint {
|
|
17
|
+
gitHead: string;
|
|
18
|
+
timestamp: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function initializeState(cwd: string): void {
|
|
22
|
+
const stateDir = resolve(cwd);
|
|
23
|
+
|
|
24
|
+
Object.entries(TEMPLATES).forEach(([filename, template]) => {
|
|
25
|
+
const filepath = resolve(stateDir, filename);
|
|
26
|
+
if (!existsSync(filepath)) {
|
|
27
|
+
writeFileSync(filepath, template, 'utf-8');
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function readState(filepath: string): string {
|
|
33
|
+
const fullPath = resolve(filepath);
|
|
34
|
+
if (!existsSync(fullPath)) {
|
|
35
|
+
throw new Error(`State file not found: ${fullPath}`);
|
|
36
|
+
}
|
|
37
|
+
return readFileSync(fullPath, 'utf-8');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function appendState(filepath: string, section: string, content: string): void {
|
|
41
|
+
const fullPath = resolve(filepath);
|
|
42
|
+
if (!existsSync(fullPath)) {
|
|
43
|
+
throw new Error(`State file not found: ${fullPath}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const existing = readFileSync(fullPath, 'utf-8');
|
|
47
|
+
const timestamp = new Date().toISOString();
|
|
48
|
+
const entry = `\n### ${section} (${timestamp})\n${content}\n`;
|
|
49
|
+
|
|
50
|
+
writeFileSync(fullPath, existing + entry, 'utf-8');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getCheckpoint(cwd?: string): StateCheckpoint {
|
|
54
|
+
try {
|
|
55
|
+
const dir = cwd ? resolve(cwd) : process.cwd();
|
|
56
|
+
const gitHead = execSync('git rev-parse HEAD', {
|
|
57
|
+
cwd: dir,
|
|
58
|
+
encoding: 'utf-8',
|
|
59
|
+
}).trim();
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
gitHead,
|
|
63
|
+
timestamp: new Date().toISOString(),
|
|
64
|
+
};
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw new Error(`Failed to get git checkpoint: ${(error as Error).message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function hashCheckpoint(checkpoint: StateCheckpoint): string {
|
|
71
|
+
const data = `${checkpoint.gitHead}:${checkpoint.timestamp}`;
|
|
72
|
+
return createHash('sha256').update(data).digest('hex').slice(0, 8);
|
|
73
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lead Feedback Schema
|
|
3
|
+
* SQLite schema for storing conversion feedback and model reweighting history
|
|
4
|
+
* Phase 8C Task 10
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const FEEDBACK_SCHEMA_VERSION = '1.0.0';
|
|
8
|
+
|
|
9
|
+
export const feedbackDatabaseSchema = {
|
|
10
|
+
// Main feedback table
|
|
11
|
+
lead_feedback: `
|
|
12
|
+
CREATE TABLE IF NOT EXISTS lead_feedback (
|
|
13
|
+
id TEXT PRIMARY KEY,
|
|
14
|
+
lead_id TEXT NOT NULL,
|
|
15
|
+
projected_revenue REAL NOT NULL,
|
|
16
|
+
actual_revenue REAL NOT NULL,
|
|
17
|
+
error_pct REAL NOT NULL,
|
|
18
|
+
closed_date TIMESTAMP NOT NULL,
|
|
19
|
+
stage TEXT DEFAULT 'won',
|
|
20
|
+
metadata TEXT,
|
|
21
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
22
|
+
FOREIGN KEY (lead_id) REFERENCES leads(id) ON DELETE CASCADE,
|
|
23
|
+
INDEX idx_lead_id (lead_id),
|
|
24
|
+
INDEX idx_closed_date (closed_date DESC),
|
|
25
|
+
INDEX idx_created_at (created_at DESC),
|
|
26
|
+
INDEX idx_stage (stage)
|
|
27
|
+
)
|
|
28
|
+
`,
|
|
29
|
+
|
|
30
|
+
// Model update history
|
|
31
|
+
model_updates: `
|
|
32
|
+
CREATE TABLE IF NOT EXISTS model_updates (
|
|
33
|
+
id TEXT PRIMARY KEY,
|
|
34
|
+
update_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
35
|
+
factor_name TEXT NOT NULL,
|
|
36
|
+
old_weight REAL NOT NULL,
|
|
37
|
+
new_weight REAL NOT NULL,
|
|
38
|
+
change_pct REAL NOT NULL,
|
|
39
|
+
confidence REAL NOT NULL,
|
|
40
|
+
rationale TEXT,
|
|
41
|
+
samples_used INTEGER,
|
|
42
|
+
applied BOOLEAN DEFAULT 0,
|
|
43
|
+
INDEX idx_update_date (update_date DESC),
|
|
44
|
+
INDEX idx_factor_name (factor_name),
|
|
45
|
+
INDEX idx_applied (applied)
|
|
46
|
+
)
|
|
47
|
+
`,
|
|
48
|
+
|
|
49
|
+
// Monthly accuracy metrics
|
|
50
|
+
accuracy_metrics: `
|
|
51
|
+
CREATE TABLE IF NOT EXISTS accuracy_metrics (
|
|
52
|
+
id TEXT PRIMARY KEY,
|
|
53
|
+
metric_date DATE NOT NULL,
|
|
54
|
+
mape REAL NOT NULL,
|
|
55
|
+
mae REAL NOT NULL,
|
|
56
|
+
rmse REAL NOT NULL,
|
|
57
|
+
total_samples INTEGER NOT NULL,
|
|
58
|
+
overestimate_count INTEGER,
|
|
59
|
+
underestimate_count INTEGER,
|
|
60
|
+
avg_overestimate REAL,
|
|
61
|
+
avg_underestimate REAL,
|
|
62
|
+
very_accurate_pct INTEGER,
|
|
63
|
+
accurate_pct INTEGER,
|
|
64
|
+
acceptable_pct INTEGER,
|
|
65
|
+
poor_pct INTEGER,
|
|
66
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
67
|
+
INDEX idx_metric_date (metric_date DESC),
|
|
68
|
+
INDEX idx_created_at (created_at DESC),
|
|
69
|
+
UNIQUE(metric_date)
|
|
70
|
+
)
|
|
71
|
+
`,
|
|
72
|
+
|
|
73
|
+
// Factor accuracy history
|
|
74
|
+
factor_accuracy: `
|
|
75
|
+
CREATE TABLE IF NOT EXISTS factor_accuracy (
|
|
76
|
+
id TEXT PRIMARY KEY,
|
|
77
|
+
analysis_date DATE NOT NULL,
|
|
78
|
+
factor_name TEXT NOT NULL,
|
|
79
|
+
contribution_pct REAL NOT NULL,
|
|
80
|
+
accuracy REAL NOT NULL,
|
|
81
|
+
trend TEXT,
|
|
82
|
+
samples INTEGER,
|
|
83
|
+
recommendation TEXT,
|
|
84
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
85
|
+
INDEX idx_analysis_date (analysis_date DESC),
|
|
86
|
+
INDEX idx_factor_name (factor_name),
|
|
87
|
+
UNIQUE(analysis_date, factor_name)
|
|
88
|
+
)
|
|
89
|
+
`,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* TypeScript interface for lead_feedback
|
|
94
|
+
*/
|
|
95
|
+
export interface LeadFeedbackRecord {
|
|
96
|
+
id: string;
|
|
97
|
+
lead_id: string;
|
|
98
|
+
projected_revenue: number;
|
|
99
|
+
actual_revenue: number;
|
|
100
|
+
error_pct: number;
|
|
101
|
+
closed_date: string;
|
|
102
|
+
stage: 'cold' | 'warm' | 'hot' | 'sales-ready' | 'won' | 'lost';
|
|
103
|
+
metadata?: string; // JSON serialized
|
|
104
|
+
created_at: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* TypeScript interface for model_updates
|
|
109
|
+
*/
|
|
110
|
+
export interface ModelUpdateRecord {
|
|
111
|
+
id: string;
|
|
112
|
+
update_date: string;
|
|
113
|
+
factor_name: string;
|
|
114
|
+
old_weight: number;
|
|
115
|
+
new_weight: number;
|
|
116
|
+
change_pct: number;
|
|
117
|
+
confidence: number;
|
|
118
|
+
rationale?: string;
|
|
119
|
+
samples_used?: number;
|
|
120
|
+
applied: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* TypeScript interface for accuracy_metrics
|
|
125
|
+
*/
|
|
126
|
+
export interface AccuracyMetricsRecord {
|
|
127
|
+
id: string;
|
|
128
|
+
metric_date: string;
|
|
129
|
+
mape: number;
|
|
130
|
+
mae: number;
|
|
131
|
+
rmse: number;
|
|
132
|
+
total_samples: number;
|
|
133
|
+
overestimate_count?: number;
|
|
134
|
+
underestimate_count?: number;
|
|
135
|
+
avg_overestimate?: number;
|
|
136
|
+
avg_underestimate?: number;
|
|
137
|
+
very_accurate_pct?: number;
|
|
138
|
+
accurate_pct?: number;
|
|
139
|
+
acceptable_pct?: number;
|
|
140
|
+
poor_pct?: number;
|
|
141
|
+
created_at: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* TypeScript interface for factor_accuracy
|
|
146
|
+
*/
|
|
147
|
+
export interface FactorAccuracyRecord {
|
|
148
|
+
id: string;
|
|
149
|
+
analysis_date: string;
|
|
150
|
+
factor_name: string;
|
|
151
|
+
contribution_pct: number;
|
|
152
|
+
accuracy: number;
|
|
153
|
+
trend?: 'improving' | 'stable' | 'degrading';
|
|
154
|
+
samples?: number;
|
|
155
|
+
recommendation?: string;
|
|
156
|
+
created_at: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Initialize feedback database tables
|
|
161
|
+
*/
|
|
162
|
+
export async function initializeFeedbackDatabase(db: any): Promise<void> {
|
|
163
|
+
for (const [tableName, schema] of Object.entries(
|
|
164
|
+
feedbackDatabaseSchema
|
|
165
|
+
)) {
|
|
166
|
+
await db.exec(schema as string);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lead Database Schema
|
|
3
|
+
* SQLite schema for persistent lead storage, signals, actions, and scoring history
|
|
4
|
+
* Optimized for token efficiency and query performance
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const SCHEMA_VERSION = '1.0.0';
|
|
8
|
+
|
|
9
|
+
export const leadDatabaseSchema = {
|
|
10
|
+
// Main leads table
|
|
11
|
+
leads: `
|
|
12
|
+
CREATE TABLE IF NOT EXISTS leads (
|
|
13
|
+
id TEXT PRIMARY KEY,
|
|
14
|
+
name TEXT NOT NULL,
|
|
15
|
+
email TEXT UNIQUE NOT NULL,
|
|
16
|
+
company TEXT,
|
|
17
|
+
industry TEXT,
|
|
18
|
+
pain_point TEXT,
|
|
19
|
+
source TEXT NOT NULL,
|
|
20
|
+
score REAL DEFAULT 0,
|
|
21
|
+
status TEXT DEFAULT 'new',
|
|
22
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
23
|
+
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
24
|
+
INDEX idx_email (email),
|
|
25
|
+
INDEX idx_company (company),
|
|
26
|
+
INDEX idx_score (score DESC),
|
|
27
|
+
INDEX idx_status (status),
|
|
28
|
+
INDEX idx_created_at (created_at DESC)
|
|
29
|
+
)
|
|
30
|
+
`,
|
|
31
|
+
|
|
32
|
+
// Signals from various intelligence sources
|
|
33
|
+
signals: `
|
|
34
|
+
CREATE TABLE IF NOT EXISTS signals (
|
|
35
|
+
id TEXT PRIMARY KEY,
|
|
36
|
+
lead_id TEXT NOT NULL,
|
|
37
|
+
signal_type TEXT NOT NULL,
|
|
38
|
+
strength REAL DEFAULT 0.5,
|
|
39
|
+
source_url TEXT,
|
|
40
|
+
source_type TEXT,
|
|
41
|
+
description TEXT,
|
|
42
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
43
|
+
FOREIGN KEY (lead_id) REFERENCES leads(id) ON DELETE CASCADE,
|
|
44
|
+
INDEX idx_lead_id (lead_id),
|
|
45
|
+
INDEX idx_signal_type (signal_type),
|
|
46
|
+
INDEX idx_created_at (created_at DESC)
|
|
47
|
+
)
|
|
48
|
+
`,
|
|
49
|
+
|
|
50
|
+
// Automated actions taken (email, Salesforce, Jira)
|
|
51
|
+
actions: `
|
|
52
|
+
CREATE TABLE IF NOT EXISTS actions (
|
|
53
|
+
id TEXT PRIMARY KEY,
|
|
54
|
+
lead_id TEXT NOT NULL,
|
|
55
|
+
action_type TEXT NOT NULL,
|
|
56
|
+
status TEXT DEFAULT 'pending',
|
|
57
|
+
action_id TEXT,
|
|
58
|
+
details TEXT,
|
|
59
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
60
|
+
executed_at TIMESTAMP,
|
|
61
|
+
FOREIGN KEY (lead_id) REFERENCES leads(id) ON DELETE CASCADE,
|
|
62
|
+
INDEX idx_lead_id (lead_id),
|
|
63
|
+
INDEX idx_action_type (action_type),
|
|
64
|
+
INDEX idx_status (status),
|
|
65
|
+
INDEX idx_created_at (created_at DESC)
|
|
66
|
+
)
|
|
67
|
+
`,
|
|
68
|
+
|
|
69
|
+
// Score history for audit trail
|
|
70
|
+
scoring_history: `
|
|
71
|
+
CREATE TABLE IF NOT EXISTS scoring_history (
|
|
72
|
+
id TEXT PRIMARY KEY,
|
|
73
|
+
lead_id TEXT NOT NULL,
|
|
74
|
+
old_score REAL,
|
|
75
|
+
new_score REAL NOT NULL,
|
|
76
|
+
reason TEXT,
|
|
77
|
+
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
78
|
+
FOREIGN KEY (lead_id) REFERENCES leads(id) ON DELETE CASCADE,
|
|
79
|
+
INDEX idx_lead_id (lead_id),
|
|
80
|
+
INDEX idx_updated_at (updated_at DESC)
|
|
81
|
+
)
|
|
82
|
+
`,
|
|
83
|
+
|
|
84
|
+
// Deduplication metadata
|
|
85
|
+
lead_duplicates: `
|
|
86
|
+
CREATE TABLE IF NOT EXISTS lead_duplicates (
|
|
87
|
+
id TEXT PRIMARY KEY,
|
|
88
|
+
source_lead_id TEXT NOT NULL,
|
|
89
|
+
merged_into_lead_id TEXT NOT NULL,
|
|
90
|
+
match_type TEXT NOT NULL,
|
|
91
|
+
match_confidence REAL,
|
|
92
|
+
merged_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
93
|
+
FOREIGN KEY (source_lead_id) REFERENCES leads(id) ON DELETE CASCADE,
|
|
94
|
+
FOREIGN KEY (merged_into_lead_id) REFERENCES leads(id) ON DELETE CASCADE,
|
|
95
|
+
INDEX idx_source_lead (source_lead_id),
|
|
96
|
+
INDEX idx_merged_into (merged_into_lead_id),
|
|
97
|
+
INDEX idx_merged_at (merged_at DESC)
|
|
98
|
+
)
|
|
99
|
+
`,
|
|
100
|
+
|
|
101
|
+
// Database metadata
|
|
102
|
+
metadata: `
|
|
103
|
+
CREATE TABLE IF NOT EXISTS metadata (
|
|
104
|
+
key TEXT PRIMARY KEY,
|
|
105
|
+
value TEXT,
|
|
106
|
+
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
107
|
+
)
|
|
108
|
+
`,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export interface Lead {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
email: string;
|
|
115
|
+
company?: string;
|
|
116
|
+
industry?: string;
|
|
117
|
+
pain_point?: string;
|
|
118
|
+
source: string;
|
|
119
|
+
score: number;
|
|
120
|
+
status: 'new' | 'contacted' | 'qualified' | 'converted' | 'rejected';
|
|
121
|
+
created_at: string;
|
|
122
|
+
updated_at: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface Signal {
|
|
126
|
+
id: string;
|
|
127
|
+
lead_id: string;
|
|
128
|
+
signal_type: string;
|
|
129
|
+
strength: number; // 0-1
|
|
130
|
+
source_url?: string;
|
|
131
|
+
source_type?: string; // twitter, reddit, hn, polymarket
|
|
132
|
+
description?: string;
|
|
133
|
+
created_at: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface Action {
|
|
137
|
+
id: string;
|
|
138
|
+
lead_id: string;
|
|
139
|
+
action_type: string; // email, salesforce, jira
|
|
140
|
+
status: 'pending' | 'executed' | 'failed';
|
|
141
|
+
action_id?: string;
|
|
142
|
+
details?: string;
|
|
143
|
+
created_at: string;
|
|
144
|
+
executed_at?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ScoringHistory {
|
|
148
|
+
id: string;
|
|
149
|
+
lead_id: string;
|
|
150
|
+
old_score?: number;
|
|
151
|
+
new_score: number;
|
|
152
|
+
reason?: string;
|
|
153
|
+
updated_at: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface LeadDuplicate {
|
|
157
|
+
id: string;
|
|
158
|
+
source_lead_id: string;
|
|
159
|
+
merged_into_lead_id: string;
|
|
160
|
+
match_type: 'email' | 'company_name' | 'domain';
|
|
161
|
+
match_confidence: number;
|
|
162
|
+
merged_at: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface DatabaseMetadata {
|
|
166
|
+
key: string;
|
|
167
|
+
value: string;
|
|
168
|
+
updated_at: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Signal type constants
|
|
172
|
+
export const SIGNAL_TYPES = {
|
|
173
|
+
GITHUB_COMMIT: 'github_commit',
|
|
174
|
+
GITHUB_ISSUE: 'github_issue',
|
|
175
|
+
GITHUB_RELEASE: 'github_release',
|
|
176
|
+
TWITTER_MENTION: 'twitter_mention',
|
|
177
|
+
TWITTER_TREND: 'twitter_trend',
|
|
178
|
+
REDDIT_POST: 'reddit_post',
|
|
179
|
+
REDDIT_COMMENT: 'reddit_comment',
|
|
180
|
+
HN_POST: 'hn_post',
|
|
181
|
+
HN_COMMENT: 'hn_comment',
|
|
182
|
+
POLYMARKET_ACTIVITY: 'polymarket_activity',
|
|
183
|
+
LINKEDIN_HIRING: 'linkedin_hiring',
|
|
184
|
+
JOB_POSTING: 'job_posting',
|
|
185
|
+
USER_COMPLAINT: 'user_complaint',
|
|
186
|
+
MARKET_TREND: 'market_trend',
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// Source credibility weights
|
|
190
|
+
export const SOURCE_CREDIBILITY = {
|
|
191
|
+
polymarket: 1.0,
|
|
192
|
+
github: 0.9,
|
|
193
|
+
linkedin: 0.85,
|
|
194
|
+
twitter: 0.7,
|
|
195
|
+
reddit: 0.6,
|
|
196
|
+
hn: 0.75,
|
|
197
|
+
job_boards: 0.8,
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// Company size multipliers for scoring
|
|
201
|
+
export const COMPANY_SIZE_MULTIPLIER = {
|
|
202
|
+
enterprise: 1.0,
|
|
203
|
+
mid_market: 0.8,
|
|
204
|
+
startup: 0.6,
|
|
205
|
+
};
|