erosolar-cli 2.1.249 → 2.1.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (470) hide show
  1. package/agents/general.rules.json +10 -133
  2. package/agents/general.rules.json.bak +278 -0
  3. package/agents/general.rules.json.bak2 +306 -0
  4. package/dist/bin/erosolar.js +9 -5
  5. package/dist/bin/erosolar.js.map +1 -1
  6. package/dist/capabilities/bidirectionalAuditCapability.d.ts +26 -0
  7. package/dist/capabilities/bidirectionalAuditCapability.d.ts.map +1 -0
  8. package/dist/capabilities/bidirectionalAuditCapability.js +44 -0
  9. package/dist/capabilities/bidirectionalAuditCapability.js.map +1 -0
  10. package/dist/capabilities/globCapability.d.ts +3 -6
  11. package/dist/capabilities/globCapability.d.ts.map +1 -1
  12. package/dist/capabilities/globCapability.js +6 -10
  13. package/dist/capabilities/globCapability.js.map +1 -1
  14. package/dist/capabilities/index.d.ts +1 -18
  15. package/dist/capabilities/index.d.ts.map +1 -1
  16. package/dist/capabilities/index.js +1 -18
  17. package/dist/capabilities/index.js.map +1 -1
  18. package/dist/capabilities/orchestrationCapability.d.ts +2 -0
  19. package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
  20. package/dist/capabilities/orchestrationCapability.js +980 -2
  21. package/dist/capabilities/orchestrationCapability.js.map +1 -1
  22. package/dist/capabilities/searchCapability.d.ts +8 -2
  23. package/dist/capabilities/searchCapability.d.ts.map +1 -1
  24. package/dist/capabilities/searchCapability.js +11 -6
  25. package/dist/capabilities/searchCapability.js.map +1 -1
  26. package/dist/contracts/tools.schema.json +9 -133
  27. package/dist/core/aiErrorFixer.d.ts +1 -14
  28. package/dist/core/aiErrorFixer.d.ts.map +1 -1
  29. package/dist/core/aiErrorFixer.js +51 -239
  30. package/dist/core/aiErrorFixer.js.map +1 -1
  31. package/dist/core/alphaZeroEngine.d.ts +16 -256
  32. package/dist/core/alphaZeroEngine.d.ts.map +1 -1
  33. package/dist/core/alphaZeroEngine.js +22 -513
  34. package/dist/core/alphaZeroEngine.js.map +1 -1
  35. package/dist/core/completeAttackOrchestrator.d.ts +102 -0
  36. package/dist/core/completeAttackOrchestrator.d.ts.map +1 -0
  37. package/dist/core/completeAttackOrchestrator.js +293 -0
  38. package/dist/core/completeAttackOrchestrator.js.map +1 -0
  39. package/dist/core/defensiveSecurityToolkit.d.ts +373 -0
  40. package/dist/core/defensiveSecurityToolkit.d.ts.map +1 -0
  41. package/dist/core/defensiveSecurityToolkit.js +1304 -0
  42. package/dist/core/defensiveSecurityToolkit.js.map +1 -0
  43. package/dist/core/errors/errorTypes.d.ts +30 -57
  44. package/dist/core/errors/errorTypes.d.ts.map +1 -1
  45. package/dist/core/errors/errorTypes.js +51 -228
  46. package/dist/core/errors/errorTypes.js.map +1 -1
  47. package/dist/core/errors/safetyValidator.d.ts +19 -3
  48. package/dist/core/errors/safetyValidator.d.ts.map +1 -1
  49. package/dist/core/errors/safetyValidator.js +33 -71
  50. package/dist/core/errors/safetyValidator.js.map +1 -1
  51. package/dist/core/failureRecovery.d.ts +4 -100
  52. package/dist/core/failureRecovery.d.ts.map +1 -1
  53. package/dist/core/failureRecovery.js +16 -440
  54. package/dist/core/failureRecovery.js.map +1 -1
  55. package/dist/core/intelligentTargetResearcher.d.ts +142 -0
  56. package/dist/core/intelligentTargetResearcher.d.ts.map +1 -0
  57. package/dist/core/intelligentTargetResearcher.js +367 -0
  58. package/dist/core/intelligentTargetResearcher.js.map +1 -0
  59. package/dist/core/intelligentTestFlows.d.ts +26 -107
  60. package/dist/core/intelligentTestFlows.d.ts.map +1 -1
  61. package/dist/core/intelligentTestFlows.js +15 -659
  62. package/dist/core/intelligentTestFlows.js.map +1 -1
  63. package/dist/core/learningPersistence.d.ts +45 -132
  64. package/dist/core/learningPersistence.d.ts.map +1 -1
  65. package/dist/core/learningPersistence.js +32 -463
  66. package/dist/core/learningPersistence.js.map +1 -1
  67. package/dist/core/metricsTracker.d.ts +22 -139
  68. package/dist/core/metricsTracker.d.ts.map +1 -1
  69. package/dist/core/metricsTracker.js +51 -241
  70. package/dist/core/metricsTracker.js.map +1 -1
  71. package/dist/core/performanceMonitor.d.ts +15 -109
  72. package/dist/core/performanceMonitor.d.ts.map +1 -1
  73. package/dist/core/performanceMonitor.js +27 -184
  74. package/dist/core/performanceMonitor.js.map +1 -1
  75. package/dist/core/reliabilityPrompt.d.ts.map +1 -1
  76. package/dist/core/reliabilityPrompt.js +14 -0
  77. package/dist/core/reliabilityPrompt.js.map +1 -1
  78. package/dist/core/resultVerification.d.ts +6 -100
  79. package/dist/core/resultVerification.d.ts.map +1 -1
  80. package/dist/core/resultVerification.js +31 -400
  81. package/dist/core/resultVerification.js.map +1 -1
  82. package/dist/core/selfEvolution.d.ts +32 -126
  83. package/dist/core/selfEvolution.d.ts.map +1 -1
  84. package/dist/core/selfEvolution.js +24 -967
  85. package/dist/core/selfEvolution.js.map +1 -1
  86. package/dist/core/selfImprovement.d.ts +50 -109
  87. package/dist/core/selfImprovement.d.ts.map +1 -1
  88. package/dist/core/selfImprovement.js +14 -689
  89. package/dist/core/selfImprovement.js.map +1 -1
  90. package/dist/core/sourceCodeManager.d.ts +89 -0
  91. package/dist/core/sourceCodeManager.d.ts.map +1 -0
  92. package/dist/core/sourceCodeManager.js +332 -0
  93. package/dist/core/sourceCodeManager.js.map +1 -0
  94. package/dist/core/unifiedOrchestrator.d.ts +88 -0
  95. package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
  96. package/dist/core/unifiedOrchestrator.js +284 -0
  97. package/dist/core/unifiedOrchestrator.js.map +1 -0
  98. package/dist/core/userDefenseOrchestrator.d.ts +202 -0
  99. package/dist/core/userDefenseOrchestrator.d.ts.map +1 -0
  100. package/dist/core/userDefenseOrchestrator.js +1006 -0
  101. package/dist/core/userDefenseOrchestrator.js.map +1 -0
  102. package/dist/plugins/index.d.ts +1 -1
  103. package/dist/plugins/index.d.ts.map +1 -1
  104. package/dist/plugins/index.js +36 -26
  105. package/dist/plugins/index.js.map +1 -1
  106. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +8 -0
  107. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
  108. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +17 -0
  109. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
  110. package/dist/plugins/tools/nodeDefaults.d.ts +14 -0
  111. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  112. package/dist/plugins/tools/nodeDefaults.js +17 -54
  113. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  114. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +9 -0
  115. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
  116. package/dist/plugins/tools/orchestration/orchestrationPlugin.js +18 -0
  117. package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
  118. package/dist/shell/interactiveShell.d.ts +97 -2
  119. package/dist/shell/interactiveShell.d.ts.map +1 -1
  120. package/dist/shell/interactiveShell.js +1001 -6
  121. package/dist/shell/interactiveShell.js.map +1 -1
  122. package/dist/tools/appleExposureTools.d.ts +108 -0
  123. package/dist/tools/appleExposureTools.d.ts.map +1 -0
  124. package/dist/tools/appleExposureTools.js +850 -0
  125. package/dist/tools/appleExposureTools.js.map +1 -0
  126. package/dist/tools/bidirectionalAuditTools.d.ts +104 -0
  127. package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -0
  128. package/dist/tools/bidirectionalAuditTools.js +1280 -0
  129. package/dist/tools/bidirectionalAuditTools.js.map +1 -0
  130. package/dist/tools/defensiveSecurityTools.d.ts +152 -0
  131. package/dist/tools/defensiveSecurityTools.d.ts.map +1 -0
  132. package/dist/tools/defensiveSecurityTools.js +576 -0
  133. package/dist/tools/defensiveSecurityTools.js.map +1 -0
  134. package/dist/tools/forwardAttackChainTracer.d.ts +73 -0
  135. package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -0
  136. package/dist/tools/forwardAttackChainTracer.js +604 -0
  137. package/dist/tools/forwardAttackChainTracer.js.map +1 -0
  138. package/dist/tools/localExplore.d.ts +12 -199
  139. package/dist/tools/localExplore.d.ts.map +1 -1
  140. package/dist/tools/localExplore.js +18 -1352
  141. package/dist/tools/localExplore.js.map +1 -1
  142. package/dist/tools/offensiveTransparencyTools.d.ts +188 -0
  143. package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -0
  144. package/dist/tools/offensiveTransparencyTools.js +890 -0
  145. package/dist/tools/offensiveTransparencyTools.js.map +1 -0
  146. package/dist/tools/planningTools.d.ts +8 -17
  147. package/dist/tools/planningTools.d.ts.map +1 -1
  148. package/dist/tools/planningTools.js +31 -141
  149. package/dist/tools/planningTools.js.map +1 -1
  150. package/dist/tools/searchTools.d.ts +9 -0
  151. package/dist/tools/searchTools.d.ts.map +1 -1
  152. package/dist/tools/searchTools.js +305 -189
  153. package/dist/tools/searchTools.js.map +1 -1
  154. package/dist/tools/skillTools.d.ts +7 -5
  155. package/dist/tools/skillTools.d.ts.map +1 -1
  156. package/dist/tools/skillTools.js +13 -155
  157. package/dist/tools/skillTools.js.map +1 -1
  158. package/dist/tools/threatIntelligenceTools.d.ts +128 -0
  159. package/dist/tools/threatIntelligenceTools.d.ts.map +1 -0
  160. package/dist/tools/threatIntelligenceTools.js +712 -0
  161. package/dist/tools/threatIntelligenceTools.js.map +1 -0
  162. package/dist/ui/PromptController.d.ts +4 -0
  163. package/dist/ui/PromptController.d.ts.map +1 -1
  164. package/dist/ui/PromptController.js +32 -11
  165. package/dist/ui/PromptController.js.map +1 -1
  166. package/dist/ui/UnifiedUIRenderer.d.ts +20 -0
  167. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
  168. package/dist/ui/UnifiedUIRenderer.js +235 -28
  169. package/dist/ui/UnifiedUIRenderer.js.map +1 -1
  170. package/dist/ui/animatedStatus.d.ts +2 -0
  171. package/dist/ui/animatedStatus.d.ts.map +1 -1
  172. package/dist/ui/animatedStatus.js +36 -2
  173. package/dist/ui/animatedStatus.js.map +1 -1
  174. package/dist/ui/orchestration/StatusOrchestrator.d.ts +10 -0
  175. package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
  176. package/dist/ui/orchestration/StatusOrchestrator.js +36 -4
  177. package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
  178. package/package.json +1 -1
  179. package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
  180. package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
  181. package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
  182. package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
  183. package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
  184. package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
  185. package/dist/capabilities/browserAutomationCapability.js +0 -49
  186. package/dist/capabilities/browserAutomationCapability.js.map +0 -1
  187. package/dist/capabilities/buildCapability.d.ts +0 -24
  188. package/dist/capabilities/buildCapability.d.ts.map +0 -1
  189. package/dist/capabilities/buildCapability.js +0 -25
  190. package/dist/capabilities/buildCapability.js.map +0 -1
  191. package/dist/capabilities/cloudCapability.d.ts +0 -13
  192. package/dist/capabilities/cloudCapability.d.ts.map +0 -1
  193. package/dist/capabilities/cloudCapability.js +0 -38
  194. package/dist/capabilities/cloudCapability.js.map +0 -1
  195. package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
  196. package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
  197. package/dist/capabilities/codeAnalysisCapability.js +0 -24
  198. package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
  199. package/dist/capabilities/codeQualityCapability.d.ts +0 -13
  200. package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
  201. package/dist/capabilities/codeQualityCapability.js +0 -25
  202. package/dist/capabilities/codeQualityCapability.js.map +0 -1
  203. package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
  204. package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
  205. package/dist/capabilities/dependencySecurityCapability.js +0 -24
  206. package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
  207. package/dist/capabilities/devCapability.d.ts +0 -13
  208. package/dist/capabilities/devCapability.d.ts.map +0 -1
  209. package/dist/capabilities/devCapability.js +0 -24
  210. package/dist/capabilities/devCapability.js.map +0 -1
  211. package/dist/capabilities/emailCapability.d.ts +0 -12
  212. package/dist/capabilities/emailCapability.d.ts.map +0 -1
  213. package/dist/capabilities/emailCapability.js +0 -22
  214. package/dist/capabilities/emailCapability.js.map +0 -1
  215. package/dist/capabilities/enhancedAnalysisCapability.d.ts +0 -13
  216. package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +0 -1
  217. package/dist/capabilities/enhancedAnalysisCapability.js +0 -20
  218. package/dist/capabilities/enhancedAnalysisCapability.js.map +0 -1
  219. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
  220. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
  221. package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
  222. package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
  223. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
  224. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
  225. package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
  226. package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
  227. package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
  228. package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
  229. package/dist/capabilities/frontendTestingCapability.js +0 -28
  230. package/dist/capabilities/frontendTestingCapability.js.map +0 -1
  231. package/dist/capabilities/interactionCapability.d.ts +0 -12
  232. package/dist/capabilities/interactionCapability.d.ts.map +0 -1
  233. package/dist/capabilities/interactionCapability.js +0 -22
  234. package/dist/capabilities/interactionCapability.js.map +0 -1
  235. package/dist/capabilities/learnCapability.d.ts +0 -22
  236. package/dist/capabilities/learnCapability.d.ts.map +0 -1
  237. package/dist/capabilities/learnCapability.js +0 -37
  238. package/dist/capabilities/learnCapability.js.map +0 -1
  239. package/dist/capabilities/notebookCapability.d.ts +0 -17
  240. package/dist/capabilities/notebookCapability.d.ts.map +0 -1
  241. package/dist/capabilities/notebookCapability.js +0 -27
  242. package/dist/capabilities/notebookCapability.js.map +0 -1
  243. package/dist/capabilities/planningCapability.d.ts +0 -16
  244. package/dist/capabilities/planningCapability.d.ts.map +0 -1
  245. package/dist/capabilities/planningCapability.js +0 -26
  246. package/dist/capabilities/planningCapability.js.map +0 -1
  247. package/dist/capabilities/refactoringCapability.d.ts +0 -13
  248. package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
  249. package/dist/capabilities/refactoringCapability.js +0 -25
  250. package/dist/capabilities/refactoringCapability.js.map +0 -1
  251. package/dist/capabilities/repoChecksCapability.d.ts +0 -10
  252. package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
  253. package/dist/capabilities/repoChecksCapability.js +0 -24
  254. package/dist/capabilities/repoChecksCapability.js.map +0 -1
  255. package/dist/capabilities/taskManagementCapability.d.ts +0 -12
  256. package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
  257. package/dist/capabilities/taskManagementCapability.js +0 -22
  258. package/dist/capabilities/taskManagementCapability.js.map +0 -1
  259. package/dist/capabilities/testingCapability.d.ts +0 -13
  260. package/dist/capabilities/testingCapability.d.ts.map +0 -1
  261. package/dist/capabilities/testingCapability.js +0 -25
  262. package/dist/capabilities/testingCapability.js.map +0 -1
  263. package/dist/capabilities/validationCapability.d.ts +0 -13
  264. package/dist/capabilities/validationCapability.d.ts.map +0 -1
  265. package/dist/capabilities/validationCapability.js +0 -24
  266. package/dist/capabilities/validationCapability.js.map +0 -1
  267. package/dist/capabilities/webCapability.d.ts +0 -12
  268. package/dist/capabilities/webCapability.d.ts.map +0 -1
  269. package/dist/capabilities/webCapability.js +0 -22
  270. package/dist/capabilities/webCapability.js.map +0 -1
  271. package/dist/core/deepBugAnalyzer.d.ts +0 -128
  272. package/dist/core/deepBugAnalyzer.d.ts.map +0 -1
  273. package/dist/core/deepBugAnalyzer.js +0 -406
  274. package/dist/core/deepBugAnalyzer.js.map +0 -1
  275. package/dist/core/hypothesisEngine.d.ts +0 -113
  276. package/dist/core/hypothesisEngine.d.ts.map +0 -1
  277. package/dist/core/hypothesisEngine.js +0 -264
  278. package/dist/core/hypothesisEngine.js.map +0 -1
  279. package/dist/core/productTestHarness.d.ts +0 -113
  280. package/dist/core/productTestHarness.d.ts.map +0 -1
  281. package/dist/core/productTestHarness.js +0 -351
  282. package/dist/core/productTestHarness.js.map +0 -1
  283. package/dist/core/validationRunner.d.ts +0 -106
  284. package/dist/core/validationRunner.d.ts.map +0 -1
  285. package/dist/core/validationRunner.js +0 -892
  286. package/dist/core/validationRunner.js.map +0 -1
  287. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
  288. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
  289. package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
  290. package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
  291. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
  292. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
  293. package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
  294. package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
  295. package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
  296. package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
  297. package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
  298. package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
  299. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
  300. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
  301. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
  302. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
  303. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
  304. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
  305. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
  306. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
  307. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
  308. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
  309. package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
  310. package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
  311. package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
  312. package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
  313. package/dist/plugins/tools/development/devPlugin.js +0 -14
  314. package/dist/plugins/tools/development/devPlugin.js.map +0 -1
  315. package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
  316. package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
  317. package/dist/plugins/tools/email/emailPlugin.js +0 -12
  318. package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
  319. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +0 -3
  320. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +0 -1
  321. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +0 -14
  322. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +0 -1
  323. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +0 -3
  324. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +0 -1
  325. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +0 -12
  326. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +0 -1
  327. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +0 -3
  328. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +0 -1
  329. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +0 -12
  330. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +0 -1
  331. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
  332. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
  333. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
  334. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
  335. package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
  336. package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
  337. package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
  338. package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
  339. package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
  340. package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
  341. package/dist/plugins/tools/learn/learnPlugin.js +0 -14
  342. package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
  343. package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
  344. package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
  345. package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
  346. package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
  347. package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
  348. package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
  349. package/dist/plugins/tools/planning/planningPlugin.js +0 -15
  350. package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
  351. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
  352. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
  353. package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
  354. package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
  355. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
  356. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
  357. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
  358. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
  359. package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
  360. package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
  361. package/dist/plugins/tools/testing/testingPlugin.js +0 -12
  362. package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
  363. package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
  364. package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
  365. package/dist/plugins/tools/validation/validationPlugin.js +0 -14
  366. package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
  367. package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
  368. package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
  369. package/dist/plugins/tools/web/webPlugin.js +0 -12
  370. package/dist/plugins/tools/web/webPlugin.js.map +0 -1
  371. package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
  372. package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
  373. package/dist/tools/advancedTestGenerationTools.js +0 -304
  374. package/dist/tools/advancedTestGenerationTools.js.map +0 -1
  375. package/dist/tools/browserAutomationTools.d.ts +0 -23
  376. package/dist/tools/browserAutomationTools.d.ts.map +0 -1
  377. package/dist/tools/browserAutomationTools.js +0 -916
  378. package/dist/tools/browserAutomationTools.js.map +0 -1
  379. package/dist/tools/buildTools.d.ts +0 -9
  380. package/dist/tools/buildTools.d.ts.map +0 -1
  381. package/dist/tools/buildTools.js +0 -346
  382. package/dist/tools/buildTools.js.map +0 -1
  383. package/dist/tools/cloudTools.d.ts +0 -49
  384. package/dist/tools/cloudTools.d.ts.map +0 -1
  385. package/dist/tools/cloudTools.js +0 -1258
  386. package/dist/tools/cloudTools.js.map +0 -1
  387. package/dist/tools/codeAnalysisTools.d.ts +0 -74
  388. package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
  389. package/dist/tools/codeAnalysisTools.js +0 -664
  390. package/dist/tools/codeAnalysisTools.js.map +0 -1
  391. package/dist/tools/codeGenerationTools.d.ts +0 -3
  392. package/dist/tools/codeGenerationTools.d.ts.map +0 -1
  393. package/dist/tools/codeGenerationTools.js +0 -439
  394. package/dist/tools/codeGenerationTools.js.map +0 -1
  395. package/dist/tools/codeQualityTools.d.ts +0 -3
  396. package/dist/tools/codeQualityTools.d.ts.map +0 -1
  397. package/dist/tools/codeQualityTools.js +0 -297
  398. package/dist/tools/codeQualityTools.js.map +0 -1
  399. package/dist/tools/dependencyTools.d.ts +0 -3
  400. package/dist/tools/dependencyTools.d.ts.map +0 -1
  401. package/dist/tools/dependencyTools.js +0 -284
  402. package/dist/tools/dependencyTools.js.map +0 -1
  403. package/dist/tools/devTools.d.ts +0 -10
  404. package/dist/tools/devTools.d.ts.map +0 -1
  405. package/dist/tools/devTools.js +0 -2126
  406. package/dist/tools/devTools.js.map +0 -1
  407. package/dist/tools/emailTools.d.ts +0 -21
  408. package/dist/tools/emailTools.d.ts.map +0 -1
  409. package/dist/tools/emailTools.js +0 -449
  410. package/dist/tools/emailTools.js.map +0 -1
  411. package/dist/tools/enhancedAnalysisTools.d.ts +0 -9
  412. package/dist/tools/enhancedAnalysisTools.d.ts.map +0 -1
  413. package/dist/tools/enhancedAnalysisTools.js +0 -370
  414. package/dist/tools/enhancedAnalysisTools.js.map +0 -1
  415. package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -7
  416. package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
  417. package/dist/tools/enhancedCodeIntelligenceTools.js +0 -540
  418. package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
  419. package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -7
  420. package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
  421. package/dist/tools/enhancedDevWorkflowTools.js +0 -432
  422. package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
  423. package/dist/tools/frontendTestingTools.d.ts +0 -35
  424. package/dist/tools/frontendTestingTools.d.ts.map +0 -1
  425. package/dist/tools/frontendTestingTools.js +0 -1258
  426. package/dist/tools/frontendTestingTools.js.map +0 -1
  427. package/dist/tools/globTools.d.ts +0 -15
  428. package/dist/tools/globTools.d.ts.map +0 -1
  429. package/dist/tools/globTools.js +0 -174
  430. package/dist/tools/globTools.js.map +0 -1
  431. package/dist/tools/grepTools.d.ts +0 -19
  432. package/dist/tools/grepTools.d.ts.map +0 -1
  433. package/dist/tools/grepTools.js +0 -411
  434. package/dist/tools/grepTools.js.map +0 -1
  435. package/dist/tools/interactionTools.d.ts +0 -6
  436. package/dist/tools/interactionTools.d.ts.map +0 -1
  437. package/dist/tools/interactionTools.js +0 -209
  438. package/dist/tools/interactionTools.js.map +0 -1
  439. package/dist/tools/learnTools.d.ts +0 -164
  440. package/dist/tools/learnTools.d.ts.map +0 -1
  441. package/dist/tools/learnTools.js +0 -2098
  442. package/dist/tools/learnTools.js.map +0 -1
  443. package/dist/tools/notebookEditTools.d.ts +0 -15
  444. package/dist/tools/notebookEditTools.d.ts.map +0 -1
  445. package/dist/tools/notebookEditTools.js +0 -197
  446. package/dist/tools/notebookEditTools.js.map +0 -1
  447. package/dist/tools/refactoringTools.d.ts +0 -3
  448. package/dist/tools/refactoringTools.d.ts.map +0 -1
  449. package/dist/tools/refactoringTools.js +0 -294
  450. package/dist/tools/refactoringTools.js.map +0 -1
  451. package/dist/tools/repoChecksTools.d.ts +0 -3
  452. package/dist/tools/repoChecksTools.d.ts.map +0 -1
  453. package/dist/tools/repoChecksTools.js +0 -276
  454. package/dist/tools/repoChecksTools.js.map +0 -1
  455. package/dist/tools/taskManagementTools.d.ts +0 -10
  456. package/dist/tools/taskManagementTools.d.ts.map +0 -1
  457. package/dist/tools/taskManagementTools.js +0 -133
  458. package/dist/tools/taskManagementTools.js.map +0 -1
  459. package/dist/tools/testingTools.d.ts +0 -3
  460. package/dist/tools/testingTools.d.ts.map +0 -1
  461. package/dist/tools/testingTools.js +0 -237
  462. package/dist/tools/testingTools.js.map +0 -1
  463. package/dist/tools/validationTools.d.ts +0 -7
  464. package/dist/tools/validationTools.d.ts.map +0 -1
  465. package/dist/tools/validationTools.js +0 -344
  466. package/dist/tools/validationTools.js.map +0 -1
  467. package/dist/tools/webTools.d.ts +0 -3
  468. package/dist/tools/webTools.d.ts.map +0 -1
  469. package/dist/tools/webTools.js +0 -502
  470. package/dist/tools/webTools.js.map +0 -1
@@ -0,0 +1,1006 @@
1
+ /**
2
+ * User Defense Orchestrator
3
+ *
4
+ * Unified system for user defense against corporate privacy violations.
5
+ * Integrates all ethical offensive and defensive capabilities.
6
+ *
7
+ * CAPABILITIES:
8
+ * 1. Counter-Surveillance - Monitor corporate monitoring of YOUR systems
9
+ * 2. Evidence Collection - Automated, cryptographically-secured evidence gathering
10
+ * 3. Evidence Permanence - Distributed, censorship-resistant storage
11
+ * 4. Transparency Auditing - Continuous verification of corporate claims
12
+ * 5. Regulatory Automation - Mass filing of complaints
13
+ * 6. Coalition Coordination - Multi-user synchronized action
14
+ * 7. Symmetric Response - Mirror corporate capabilities ethically
15
+ * 8. Economic Pressure - Legal cost imposition strategies
16
+ * 9. Narrative Operations - Truth-based counter-messaging
17
+ * 10. Temporal Persistence - Sustained indefinite pressure
18
+ *
19
+ * ETHICAL FRAMEWORK:
20
+ * - All operations on user-owned systems only
21
+ * - All external data from public sources only
22
+ * - All actions legal and documented
23
+ * - No unauthorized system access
24
+ * - No attacks on infrastructure
25
+ * - Truth and transparency as weapons
26
+ */
27
+ import { execSync } from 'node:child_process';
28
+ import * as fs from 'node:fs';
29
+ import * as path from 'node:path';
30
+ import * as crypto from 'node:crypto';
31
+ import * as https from 'node:https';
32
+ import * as dns from 'node:dns';
33
+ import { promisify } from 'node:util';
34
+ import { EventEmitter } from 'node:events';
35
+ const dnsResolve4 = promisify(dns.resolve4);
36
+ // ═══════════════════════════════════════════════════════════════════════════════
37
+ // COUNTER-SURVEILLANCE SYSTEM
38
+ // ═══════════════════════════════════════════════════════════════════════════════
39
+ export class CounterSurveillanceSystem extends EventEmitter {
40
+ target;
41
+ logDir;
42
+ isRunning = false;
43
+ monitorInterval = null;
44
+ connections = new Map();
45
+ daemons = new Map();
46
+ // Target-specific IP ranges and services
47
+ targetSignatures = {
48
+ apple: {
49
+ ipPatterns: ['17.', '18.'],
50
+ daemons: ['identityservicesd', 'imagent', 'apsd', 'cloudd', 'assistantd', 'sharingd', 'IMDPersistenceAgent', 'nsurlsessiond', 'bird'],
51
+ services: {
52
+ '5223': 'APNs Push Notifications',
53
+ '443': 'HTTPS (iCloud/IDS/CloudKit)',
54
+ '80': 'HTTP (Updates)',
55
+ },
56
+ },
57
+ google: {
58
+ ipPatterns: ['142.', '172.217.', '216.58.', '74.125.'],
59
+ daemons: ['Google', 'Chrome', 'GoogleSoftwareUpdate'],
60
+ services: {
61
+ '443': 'Google Services',
62
+ '5228': 'GCM Push',
63
+ },
64
+ },
65
+ meta: {
66
+ ipPatterns: ['157.240.', '31.13.', '179.60.'],
67
+ daemons: ['Facebook', 'Messenger', 'WhatsApp', 'Instagram'],
68
+ services: {
69
+ '443': 'Meta Services',
70
+ '5222': 'XMPP',
71
+ },
72
+ },
73
+ microsoft: {
74
+ ipPatterns: ['13.', '20.', '40.', '52.', '104.'],
75
+ daemons: ['Microsoft', 'OneDrive', 'Teams', 'Outlook'],
76
+ services: {
77
+ '443': 'Microsoft Services',
78
+ },
79
+ },
80
+ amazon: {
81
+ ipPatterns: ['18.', '52.', '54.', '3.'],
82
+ daemons: ['Amazon', 'Alexa'],
83
+ services: {
84
+ '443': 'AWS Services',
85
+ },
86
+ },
87
+ };
88
+ constructor(target, logDir) {
89
+ super();
90
+ this.target = target;
91
+ this.logDir = logDir;
92
+ if (!fs.existsSync(logDir)) {
93
+ fs.mkdirSync(logDir, { recursive: true });
94
+ }
95
+ }
96
+ async start(intervalMs = 5000) {
97
+ if (this.isRunning)
98
+ return;
99
+ this.isRunning = true;
100
+ this.emit('started', { target: this.target, timestamp: new Date().toISOString() });
101
+ // Initial scan
102
+ await this.performScan();
103
+ // Continuous monitoring
104
+ this.monitorInterval = setInterval(async () => {
105
+ await this.performScan();
106
+ }, intervalMs);
107
+ }
108
+ stop() {
109
+ if (this.monitorInterval) {
110
+ clearInterval(this.monitorInterval);
111
+ this.monitorInterval = null;
112
+ }
113
+ this.isRunning = false;
114
+ this.emit('stopped', { target: this.target, timestamp: new Date().toISOString() });
115
+ }
116
+ async performScan() {
117
+ const timestamp = new Date().toISOString();
118
+ try {
119
+ // Scan network connections
120
+ const connections = await this.scanConnections();
121
+ this.processConnections(connections, timestamp);
122
+ // Scan daemon activity
123
+ const daemons = await this.scanDaemons();
124
+ this.processDaemons(daemons, timestamp);
125
+ this.emit('scan_complete', {
126
+ timestamp,
127
+ connections: connections.length,
128
+ daemons: daemons.length,
129
+ });
130
+ }
131
+ catch (error) {
132
+ this.emit('scan_error', { timestamp, error });
133
+ }
134
+ }
135
+ async scanConnections() {
136
+ const connections = [];
137
+ const signatures = this.targetSignatures[this.target];
138
+ try {
139
+ const netstat = this.exec('netstat -anv 2>/dev/null | grep ESTABLISHED');
140
+ const lines = netstat.split('\n').filter(l => l.trim());
141
+ for (const line of lines) {
142
+ for (const pattern of signatures.ipPatterns) {
143
+ if (line.includes(pattern)) {
144
+ const conn = this.parseNetstatLine(line, signatures);
145
+ if (conn) {
146
+ connections.push(conn);
147
+ }
148
+ break;
149
+ }
150
+ }
151
+ }
152
+ }
153
+ catch { }
154
+ return connections;
155
+ }
156
+ parseNetstatLine(line, signatures) {
157
+ const parts = line.trim().split(/\s+/);
158
+ if (parts.length < 9)
159
+ return null;
160
+ try {
161
+ const localAddr = parts[3] ?? '';
162
+ const remoteAddr = parts[4] ?? '';
163
+ const state = parts[5] ?? 'UNKNOWN';
164
+ const localMatch = localAddr.match(/^(.+)\.(\d+)$/);
165
+ const remoteMatch = remoteAddr.match(/^(.+)\.(\d+)$/);
166
+ if (!localMatch || !remoteMatch)
167
+ return null;
168
+ const remotePort = remoteMatch[2] ?? '0';
169
+ return {
170
+ timestamp: new Date().toISOString(),
171
+ localIP: localMatch[1] ?? '',
172
+ localPort: parseInt(localMatch[2] ?? '0', 10),
173
+ remoteIP: remoteMatch[1] ?? '',
174
+ remotePort: parseInt(remotePort, 10),
175
+ process: 'unknown',
176
+ pid: 0,
177
+ state,
178
+ bytesIn: 0,
179
+ bytesOut: 0,
180
+ service: signatures.services[remotePort] || 'Unknown Service',
181
+ riskLevel: this.assessConnectionRisk(parseInt(remotePort, 10)),
182
+ };
183
+ }
184
+ catch {
185
+ return null;
186
+ }
187
+ }
188
+ assessConnectionRisk(port) {
189
+ if (port === 5223)
190
+ return 'high'; // APNs - persistent surveillance channel
191
+ if (port === 443)
192
+ return 'medium'; // HTTPS - data exfiltration possible
193
+ return 'low';
194
+ }
195
+ async scanDaemons() {
196
+ const daemons = [];
197
+ const signatures = this.targetSignatures[this.target];
198
+ for (const daemonName of signatures.daemons) {
199
+ try {
200
+ const ps = this.exec(`ps aux | grep -i "${daemonName}" | grep -v grep | head -1`);
201
+ if (ps.trim()) {
202
+ const parts = ps.trim().split(/\s+/);
203
+ if (parts.length >= 11) {
204
+ daemons.push({
205
+ timestamp: new Date().toISOString(),
206
+ daemon: daemonName,
207
+ pid: parseInt(parts[1] ?? '0', 10),
208
+ cpu: parseFloat(parts[2] ?? '0'),
209
+ memory: parseFloat(parts[3] ?? '0'),
210
+ threads: 0,
211
+ openFiles: 0,
212
+ networkConnections: 0,
213
+ state: parts[7] ?? 'unknown',
214
+ });
215
+ }
216
+ }
217
+ }
218
+ catch { }
219
+ }
220
+ return daemons;
221
+ }
222
+ processConnections(connections, timestamp) {
223
+ for (const conn of connections) {
224
+ const key = `${conn.remoteIP}:${conn.remotePort}`;
225
+ if (!this.connections.has(key)) {
226
+ // New connection detected
227
+ this.emit('new_connection', conn);
228
+ this.logEvent('connection', conn);
229
+ }
230
+ this.connections.set(key, conn);
231
+ }
232
+ // Check for closed connections
233
+ const currentKeys = new Set(connections.map(c => `${c.remoteIP}:${c.remotePort}`));
234
+ for (const [key, conn] of this.connections) {
235
+ if (!currentKeys.has(key)) {
236
+ this.emit('closed_connection', conn);
237
+ this.connections.delete(key);
238
+ }
239
+ }
240
+ }
241
+ processDaemons(daemons, timestamp) {
242
+ for (const daemon of daemons) {
243
+ const prev = this.daemons.get(daemon.daemon);
244
+ if (prev) {
245
+ // Check for anomalies
246
+ if (daemon.cpu > prev.cpu * 3 && daemon.cpu > 5) {
247
+ this.emit('daemon_anomaly', {
248
+ daemon: daemon.daemon,
249
+ type: 'cpu_spike',
250
+ previous: prev.cpu,
251
+ current: daemon.cpu,
252
+ });
253
+ }
254
+ }
255
+ this.daemons.set(daemon.daemon, daemon);
256
+ }
257
+ this.logEvent('daemons', { timestamp, daemons });
258
+ }
259
+ logEvent(type, data) {
260
+ const logFile = path.join(this.logDir, `${type}-${new Date().toISOString().split('T')[0]}.jsonl`);
261
+ const entry = JSON.stringify({ timestamp: new Date().toISOString(), type, data }) + '\n';
262
+ fs.appendFileSync(logFile, entry);
263
+ }
264
+ getActiveConnections() {
265
+ return Array.from(this.connections.values());
266
+ }
267
+ getActiveDaemons() {
268
+ return Array.from(this.daemons.values());
269
+ }
270
+ exec(cmd) {
271
+ try {
272
+ return execSync(cmd, { encoding: 'utf-8', maxBuffer: 10 * 1024 * 1024 });
273
+ }
274
+ catch (e) {
275
+ const error = e;
276
+ return error.stdout || '';
277
+ }
278
+ }
279
+ }
280
+ // ═══════════════════════════════════════════════════════════════════════════════
281
+ // TRANSPARENCY AUDITOR
282
+ // ═══════════════════════════════════════════════════════════════════════════════
283
+ export class TransparencyAuditor extends EventEmitter {
284
+ target;
285
+ evidenceDir;
286
+ tests = [];
287
+ // Claims to verify per target
288
+ targetClaims = {
289
+ apple: [
290
+ {
291
+ claim: 'Key Transparency provides public audit capability',
292
+ testFn: async () => this.testDNSResolution('kt.ess.apple.com', 'Key Transparency should be publicly accessible'),
293
+ },
294
+ {
295
+ claim: 'Identity Services are verifiable',
296
+ testFn: async () => this.testHTTPEndpoint('https://identity.ess.apple.com/', 'IDS should allow public key verification'),
297
+ },
298
+ {
299
+ claim: 'Users can verify their encryption keys',
300
+ testFn: async () => this.testKeyVerification(),
301
+ },
302
+ ],
303
+ google: [
304
+ {
305
+ claim: 'Gmail end-to-end encryption is verifiable',
306
+ testFn: async () => this.testHTTPEndpoint('https://mail.google.com/', 'E2E verification endpoint'),
307
+ },
308
+ ],
309
+ meta: [
310
+ {
311
+ claim: 'WhatsApp key verification is public',
312
+ testFn: async () => this.testDNSResolution('key-transparency.whatsapp.com', 'Key transparency'),
313
+ },
314
+ ],
315
+ microsoft: [],
316
+ amazon: [],
317
+ };
318
+ constructor(target, evidenceDir) {
319
+ super();
320
+ this.target = target;
321
+ this.evidenceDir = evidenceDir;
322
+ }
323
+ async runAllTests() {
324
+ this.tests = [];
325
+ const claims = this.targetClaims[this.target] || [];
326
+ for (const { claim, testFn } of claims) {
327
+ try {
328
+ const test = await testFn();
329
+ this.tests.push(test);
330
+ this.emit('test_complete', test);
331
+ }
332
+ catch (error) {
333
+ this.emit('test_error', { claim, error });
334
+ }
335
+ }
336
+ this.saveResults();
337
+ return this.tests;
338
+ }
339
+ async testDNSResolution(hostname, description) {
340
+ const id = crypto.randomUUID();
341
+ const timestamp = new Date().toISOString();
342
+ try {
343
+ const ips = await dnsResolve4(hostname);
344
+ return {
345
+ id,
346
+ timestamp,
347
+ claim: description,
348
+ testMethod: `DNS resolution of ${hostname}`,
349
+ result: 'verified',
350
+ evidence: `Resolves to: ${ips.join(', ')}`,
351
+ hash: this.hashTest(id, timestamp, 'verified'),
352
+ };
353
+ }
354
+ catch {
355
+ return {
356
+ id,
357
+ timestamp,
358
+ claim: description,
359
+ testMethod: `DNS resolution of ${hostname}`,
360
+ result: 'falsified',
361
+ evidence: `DNS resolution FAILED - ${hostname} does not resolve publicly`,
362
+ hash: this.hashTest(id, timestamp, 'falsified'),
363
+ };
364
+ }
365
+ }
366
+ async testHTTPEndpoint(url, description) {
367
+ const id = crypto.randomUUID();
368
+ const timestamp = new Date().toISOString();
369
+ return new Promise((resolve) => {
370
+ try {
371
+ const urlObj = new URL(url);
372
+ const req = https.request({
373
+ hostname: urlObj.hostname,
374
+ path: urlObj.pathname || '/',
375
+ method: 'GET',
376
+ timeout: 10000,
377
+ }, (res) => {
378
+ const result = res.statusCode === 200 ? 'verified' : 'falsified';
379
+ resolve({
380
+ id,
381
+ timestamp,
382
+ claim: description,
383
+ testMethod: `HTTP request to ${url}`,
384
+ result,
385
+ evidence: `HTTP ${res.statusCode} - ${result === 'verified' ? 'Public access confirmed' : 'Public access denied'}`,
386
+ hash: this.hashTest(id, timestamp, result),
387
+ });
388
+ });
389
+ req.on('error', () => {
390
+ resolve({
391
+ id,
392
+ timestamp,
393
+ claim: description,
394
+ testMethod: `HTTP request to ${url}`,
395
+ result: 'falsified',
396
+ evidence: 'Connection failed - endpoint not publicly accessible',
397
+ hash: this.hashTest(id, timestamp, 'falsified'),
398
+ });
399
+ });
400
+ req.on('timeout', () => {
401
+ req.destroy();
402
+ resolve({
403
+ id,
404
+ timestamp,
405
+ claim: description,
406
+ testMethod: `HTTP request to ${url}`,
407
+ result: 'falsified',
408
+ evidence: 'Connection timeout - endpoint not responding',
409
+ hash: this.hashTest(id, timestamp, 'falsified'),
410
+ });
411
+ });
412
+ req.end();
413
+ }
414
+ catch {
415
+ resolve({
416
+ id,
417
+ timestamp,
418
+ claim: description,
419
+ testMethod: `HTTP request to ${url}`,
420
+ result: 'falsified',
421
+ evidence: 'Request failed',
422
+ hash: this.hashTest(id, timestamp, 'falsified'),
423
+ });
424
+ }
425
+ });
426
+ }
427
+ async testKeyVerification() {
428
+ const id = crypto.randomUUID();
429
+ const timestamp = new Date().toISOString();
430
+ // Check if user has any way to verify keys
431
+ const entitlements = this.exec('codesign -d --entitlements :- /System/Library/PrivateFrameworks/IDS.framework/identityservicesd.app 2>/dev/null');
432
+ const hasKTEntitlement = entitlements.includes('com.apple.transparency.kt');
433
+ return {
434
+ id,
435
+ timestamp,
436
+ claim: 'Users can independently verify their encryption keys',
437
+ testMethod: 'Check for public key verification API and user-accessible tools',
438
+ result: 'falsified',
439
+ evidence: hasKTEntitlement
440
+ ? 'Only Apple system daemons have Key Transparency access (com.apple.transparency.kt). No public API exists for users.'
441
+ : 'No Key Transparency entitlement found. System does not support user verification.',
442
+ hash: this.hashTest(id, timestamp, 'falsified'),
443
+ };
444
+ }
445
+ hashTest(id, timestamp, result) {
446
+ return crypto.createHash('sha256').update(`${id}:${timestamp}:${result}`).digest('hex');
447
+ }
448
+ saveResults() {
449
+ const reportPath = path.join(this.evidenceDir, `transparency-audit-${this.target}.json`);
450
+ fs.writeFileSync(reportPath, JSON.stringify({
451
+ target: this.target,
452
+ timestamp: new Date().toISOString(),
453
+ tests: this.tests,
454
+ summary: {
455
+ total: this.tests.length,
456
+ verified: this.tests.filter(t => t.result === 'verified').length,
457
+ falsified: this.tests.filter(t => t.result === 'falsified').length,
458
+ inconclusive: this.tests.filter(t => t.result === 'inconclusive').length,
459
+ },
460
+ }, null, 2));
461
+ }
462
+ exec(cmd) {
463
+ try {
464
+ return execSync(cmd, { encoding: 'utf-8', maxBuffer: 10 * 1024 * 1024 });
465
+ }
466
+ catch (e) {
467
+ const error = e;
468
+ return error.stdout || '';
469
+ }
470
+ }
471
+ }
472
+ // ═══════════════════════════════════════════════════════════════════════════════
473
+ // EVIDENCE PERMANENCE SYSTEM
474
+ // ═══════════════════════════════════════════════════════════════════════════════
475
+ export class EvidencePermanenceSystem {
476
+ evidenceDir;
477
+ hashes = new Map();
478
+ constructor(evidenceDir) {
479
+ this.evidenceDir = evidenceDir;
480
+ }
481
+ async hashAllEvidence() {
482
+ const files = fs.readdirSync(this.evidenceDir).filter(f => f.endsWith('.txt') || f.endsWith('.json'));
483
+ for (const file of files) {
484
+ const filePath = path.join(this.evidenceDir, file);
485
+ const content = fs.readFileSync(filePath);
486
+ const hash = crypto.createHash('sha256').update(content).digest('hex');
487
+ this.hashes.set(file, hash);
488
+ }
489
+ return this.hashes;
490
+ }
491
+ generateMasterHash() {
492
+ const sortedHashes = Array.from(this.hashes.entries())
493
+ .sort(([a], [b]) => a.localeCompare(b))
494
+ .map(([file, hash]) => `${hash} ${file}`)
495
+ .join('\n');
496
+ return crypto.createHash('sha256').update(sortedHashes).digest('hex');
497
+ }
498
+ generateBlockchainCommitScript() {
499
+ const masterHash = this.generateMasterHash();
500
+ return `#!/bin/bash
501
+ # Blockchain Evidence Commitment Script
502
+ # Commits evidence hash to Bitcoin using OP_RETURN
503
+
504
+ MASTER_HASH="${masterHash}"
505
+ TIMESTAMP="${new Date().toISOString()}"
506
+
507
+ echo "Evidence Master Hash: $MASTER_HASH"
508
+ echo "Timestamp: $TIMESTAMP"
509
+
510
+ # Option 1: OpenTimestamps (recommended - free)
511
+ # Install: pip install opentimestamps-client
512
+ # ots stamp evidence-hashes.txt
513
+
514
+ # Option 2: OriginStamp API
515
+ # curl -X POST "https://api.originstamp.com/v4/timestamp/create" \\
516
+ # -H "Authorization: YOUR_API_KEY" \\
517
+ # -H "Content-Type: application/json" \\
518
+ # -d '{"hash": "'$MASTER_HASH'"}'
519
+
520
+ # Option 3: Manual Bitcoin OP_RETURN (requires bitcoin-cli)
521
+ # bitcoin-cli createrawtransaction '[]' '{"data":"'$MASTER_HASH'"}'
522
+
523
+ echo "Use one of the above methods to commit hash to blockchain"
524
+ `;
525
+ }
526
+ generateIPFSPublishScript() {
527
+ return `#!/bin/bash
528
+ # IPFS Evidence Publication Script
529
+ # Publishes evidence to IPFS for permanent, distributed storage
530
+
531
+ EVIDENCE_DIR="${this.evidenceDir}"
532
+
533
+ # Check if IPFS is installed
534
+ if ! command -v ipfs &> /dev/null; then
535
+ echo "IPFS not installed. Install with: brew install ipfs"
536
+ exit 1
537
+ fi
538
+
539
+ # Initialize IPFS if needed
540
+ ipfs init 2>/dev/null || true
541
+
542
+ # Start IPFS daemon in background
543
+ ipfs daemon &
544
+ sleep 5
545
+
546
+ # Add evidence directory to IPFS
547
+ CID=$(ipfs add -r -Q "$EVIDENCE_DIR")
548
+
549
+ echo "Evidence published to IPFS"
550
+ echo "CID: $CID"
551
+ echo "Access via: https://ipfs.io/ipfs/$CID"
552
+ echo "Pin on Pinata: https://pinata.cloud"
553
+ echo "Pin on Infura: https://infura.io/product/ipfs"
554
+
555
+ # Save CID for reference
556
+ echo "$CID" > "$EVIDENCE_DIR/ipfs-cid.txt"
557
+ `;
558
+ }
559
+ async saveHashChain() {
560
+ await this.hashAllEvidence();
561
+ const masterHash = this.generateMasterHash();
562
+ const hashChainPath = path.join(this.evidenceDir, 'evidence-hash-chain.txt');
563
+ const content = `Evidence Hash Chain
564
+ Generated: ${new Date().toISOString()}
565
+ Master Hash: ${masterHash}
566
+
567
+ Individual File Hashes:
568
+ ${Array.from(this.hashes.entries()).map(([f, h]) => `${h} ${f}`).join('\n')}
569
+
570
+ Verification Command:
571
+ shasum -a 256 -c evidence-hash-chain.txt
572
+ `;
573
+ fs.writeFileSync(hashChainPath, content);
574
+ // Save scripts
575
+ fs.writeFileSync(path.join(this.evidenceDir, 'commit-to-blockchain.sh'), this.generateBlockchainCommitScript());
576
+ fs.writeFileSync(path.join(this.evidenceDir, 'publish-to-ipfs.sh'), this.generateIPFSPublishScript());
577
+ return masterHash;
578
+ }
579
+ }
580
+ // ═══════════════════════════════════════════════════════════════════════════════
581
+ // REGULATORY FILING GENERATOR
582
+ // ═══════════════════════════════════════════════════════════════════════════════
583
+ export class RegulatoryFilingGenerator {
584
+ target;
585
+ evidenceDir;
586
+ filings = [];
587
+ agencies = [
588
+ {
589
+ id: 'ftc',
590
+ name: 'Federal Trade Commission',
591
+ jurisdiction: 'US Federal',
592
+ type: 'Consumer Protection',
593
+ url: 'https://ftc.gov/complaint',
594
+ templateFn: (hash) => this.generateFTCComplaint(hash),
595
+ },
596
+ {
597
+ id: 'ca_ag',
598
+ name: 'California Attorney General',
599
+ jurisdiction: 'California',
600
+ type: 'Consumer Protection',
601
+ url: 'https://oag.ca.gov/contact/consumer-complaint-against-business-or-company',
602
+ templateFn: (hash) => this.generateStateAGComplaint('California', hash),
603
+ },
604
+ {
605
+ id: 'ireland_dpc',
606
+ name: 'Ireland Data Protection Commission',
607
+ jurisdiction: 'EU (Ireland)',
608
+ type: 'GDPR',
609
+ url: 'https://dataprotection.ie/en/individuals/raising-concern',
610
+ templateFn: (hash) => this.generateGDPRComplaint('Ireland', hash),
611
+ },
612
+ ];
613
+ constructor(target, evidenceDir) {
614
+ this.target = target;
615
+ this.evidenceDir = evidenceDir;
616
+ }
617
+ async generateAllFilings(evidenceHash) {
618
+ this.filings = [];
619
+ for (const agency of this.agencies) {
620
+ const content = agency.templateFn(evidenceHash);
621
+ const filing = {
622
+ id: crypto.randomUUID(),
623
+ agency: agency.name,
624
+ jurisdiction: agency.jurisdiction,
625
+ type: agency.type,
626
+ status: 'ready',
627
+ content,
628
+ evidenceHashes: [evidenceHash],
629
+ hash: crypto.createHash('sha256').update(content).digest('hex'),
630
+ };
631
+ this.filings.push(filing);
632
+ // Save filing
633
+ const filename = `regulatory-filing-${agency.id}.txt`;
634
+ fs.writeFileSync(path.join(this.evidenceDir, filename), content);
635
+ }
636
+ return this.filings;
637
+ }
638
+ generateFTCComplaint(evidenceHash) {
639
+ return `FEDERAL TRADE COMMISSION COMPLAINT
640
+
641
+ Date: ${new Date().toISOString().split('T')[0]}
642
+ Evidence Hash: ${evidenceHash}
643
+
644
+ RESPONDENT:
645
+ ${this.getTargetInfo()}
646
+
647
+ NATURE OF COMPLAINT:
648
+ Deceptive Trade Practices - False Privacy and Encryption Claims
649
+
650
+ FACTUAL ALLEGATIONS:
651
+
652
+ 1. Respondent markets its messaging service as providing "end-to-end encryption"
653
+ that prevents anyone, including the company, from accessing message content.
654
+
655
+ 2. Technical investigation reveals:
656
+ a) Key distribution is controlled by Respondent's servers
657
+ b) Key Transparency system has no public audit mechanism
658
+ c) System processes have entitlements to access message content
659
+ d) Users cannot independently verify encryption keys
660
+
661
+ 3. These facts contradict Respondent's marketing claims.
662
+
663
+ EVIDENCE:
664
+ See attached technical audit package (Hash: ${evidenceHash})
665
+
666
+ APPLICABLE LAW:
667
+ - FTC Act Section 5 (15 U.S.C. § 45) - Unfair or Deceptive Practices
668
+ - FTC Privacy Framework
669
+
670
+ REQUESTED ACTION:
671
+ 1. Investigation of Respondent's encryption marketing claims
672
+ 2. Enforcement action for deceptive practices
673
+ 3. Requirement for accurate disclosure
674
+
675
+ CONSUMER HARM:
676
+ Consumers rely on privacy claims when choosing communication platforms.
677
+ False encryption claims cause consumers to share sensitive information
678
+ under false pretenses of security.
679
+
680
+ [ATTACH EVIDENCE PACKAGE]
681
+ `;
682
+ }
683
+ generateStateAGComplaint(state, evidenceHash) {
684
+ return `${state.toUpperCase()} ATTORNEY GENERAL - CONSUMER COMPLAINT
685
+
686
+ Date: ${new Date().toISOString().split('T')[0]}
687
+ Evidence Hash: ${evidenceHash}
688
+
689
+ COMPANY:
690
+ ${this.getTargetInfo()}
691
+
692
+ COMPLAINT TYPE: Deceptive Business Practices / False Advertising
693
+
694
+ DESCRIPTION:
695
+ The company markets its services as providing "end-to-end encryption"
696
+ that prevents anyone from accessing user communications. Technical
697
+ investigation reveals this claim is materially false or misleading:
698
+
699
+ - Company controls encryption key distribution
700
+ - No public audit mechanism for key transparency
701
+ - System processes have documented access to content
702
+ - Users cannot verify encryption independently
703
+
704
+ APPLICABLE LAW:
705
+ - ${state} Consumer Protection Act
706
+ - ${state} False Advertising Law
707
+ - ${state} Unfair Competition Law
708
+
709
+ RELIEF REQUESTED:
710
+ - Investigation
711
+ - Civil penalties
712
+ - Injunctive relief requiring accurate disclosure
713
+ - Consumer restitution
714
+
715
+ EVIDENCE:
716
+ Technical audit package attached (Hash: ${evidenceHash})
717
+ `;
718
+ }
719
+ generateGDPRComplaint(country, evidenceHash) {
720
+ return `GDPR COMPLAINT - ${country.toUpperCase()} DATA PROTECTION AUTHORITY
721
+
722
+ Date: ${new Date().toISOString().split('T')[0]}
723
+ Evidence Hash: ${evidenceHash}
724
+
725
+ DATA CONTROLLER:
726
+ ${this.getTargetInfo()}
727
+
728
+ COMPLAINT UNDER GDPR ARTICLE 77
729
+
730
+ ALLEGED VIOLATIONS:
731
+
732
+ 1. Article 5(1)(a) - Lawfulness, Fairness, Transparency
733
+ Company represents "end-to-end encryption" while controlling
734
+ key distribution and lacking public audit mechanisms.
735
+
736
+ 2. Article 13 - Information to be Provided
737
+ Failure to adequately inform users about actual encryption
738
+ architecture and company access capabilities.
739
+
740
+ 3. Article 25 - Data Protection by Design
741
+ System architecture does not implement true end-to-end encryption
742
+ as marketed to users.
743
+
744
+ EVIDENCE:
745
+ Technical audit documenting encryption architecture.
746
+ Evidence Hash: ${evidenceHash}
747
+
748
+ REQUESTED ACTION:
749
+ - Investigation of data processing practices
750
+ - Order for accurate disclosure
751
+ - Administrative fine per GDPR Article 83
752
+
753
+ Maximum potential fine: 4% of global annual turnover
754
+ `;
755
+ }
756
+ getTargetInfo() {
757
+ const targetInfo = {
758
+ apple: 'Apple Inc.\nOne Apple Park Way\nCupertino, CA 95014',
759
+ google: 'Google LLC\n1600 Amphitheatre Parkway\nMountain View, CA 94043',
760
+ meta: 'Meta Platforms, Inc.\n1 Hacker Way\nMenlo Park, CA 94025',
761
+ microsoft: 'Microsoft Corporation\nOne Microsoft Way\nRedmond, WA 98052',
762
+ amazon: 'Amazon.com, Inc.\n410 Terry Avenue North\nSeattle, WA 98109',
763
+ };
764
+ return targetInfo[this.target];
765
+ }
766
+ }
767
+ // ═══════════════════════════════════════════════════════════════════════════════
768
+ // UNIFIED USER DEFENSE ORCHESTRATOR
769
+ // ═══════════════════════════════════════════════════════════════════════════════
770
+ export class UserDefenseOrchestrator extends EventEmitter {
771
+ session;
772
+ counterSurveillance = null;
773
+ transparencyAuditor = null;
774
+ evidencePermanence = null;
775
+ regulatoryGenerator = null;
776
+ constructor(target, evidenceDir) {
777
+ super();
778
+ this.session = {
779
+ id: crypto.randomUUID(),
780
+ target,
781
+ capabilities: [],
782
+ status: 'initializing',
783
+ created: new Date().toISOString(),
784
+ lastActivity: new Date().toISOString(),
785
+ evidenceDir,
786
+ findings: [],
787
+ actions: [],
788
+ metrics: {
789
+ surveillanceEventsLogged: 0,
790
+ claimsFalsified: 0,
791
+ evidenceFilesCreated: 0,
792
+ regulatoryFilingsPrepared: 0,
793
+ estimatedCostImposed: 0,
794
+ narrativeReach: 0,
795
+ coalitionSize: 1,
796
+ daysActive: 0,
797
+ },
798
+ hash: '',
799
+ };
800
+ // Ensure evidence directory exists
801
+ if (!fs.existsSync(evidenceDir)) {
802
+ fs.mkdirSync(evidenceDir, { recursive: true });
803
+ }
804
+ // Initialize subsystems
805
+ this.counterSurveillance = new CounterSurveillanceSystem(target, path.join(evidenceDir, 'surveillance-logs'));
806
+ this.transparencyAuditor = new TransparencyAuditor(target, evidenceDir);
807
+ this.evidencePermanence = new EvidencePermanenceSystem(evidenceDir);
808
+ this.regulatoryGenerator = new RegulatoryFilingGenerator(target, evidenceDir);
809
+ // Wire up events
810
+ this.setupEventHandlers();
811
+ }
812
+ setupEventHandlers() {
813
+ if (this.counterSurveillance) {
814
+ this.counterSurveillance.on('new_connection', (conn) => {
815
+ this.addFinding({
816
+ capability: 'counter_surveillance',
817
+ type: 'surveillance_detected',
818
+ severity: conn.riskLevel === 'high' ? 'high' : 'medium',
819
+ title: `New ${this.session.target} connection detected`,
820
+ description: `Connection to ${conn.remoteIP}:${conn.remotePort} (${conn.service})`,
821
+ evidence: conn,
822
+ actionable: true,
823
+ });
824
+ this.session.metrics.surveillanceEventsLogged++;
825
+ });
826
+ this.counterSurveillance.on('daemon_anomaly', (anomaly) => {
827
+ this.addFinding({
828
+ capability: 'counter_surveillance',
829
+ type: 'anomaly_detected',
830
+ severity: 'high',
831
+ title: `Daemon anomaly: ${anomaly.daemon}`,
832
+ description: `${anomaly.type}: ${anomaly.previous} → ${anomaly.current}`,
833
+ evidence: anomaly,
834
+ actionable: true,
835
+ });
836
+ });
837
+ }
838
+ if (this.transparencyAuditor) {
839
+ this.transparencyAuditor.on('test_complete', (test) => {
840
+ if (test.result === 'falsified') {
841
+ this.addFinding({
842
+ capability: 'transparency_audit',
843
+ type: 'claim_falsified',
844
+ severity: 'critical',
845
+ title: `Claim falsified: ${test.claim}`,
846
+ description: test.evidence,
847
+ evidence: test,
848
+ actionable: true,
849
+ });
850
+ this.session.metrics.claimsFalsified++;
851
+ }
852
+ });
853
+ }
854
+ }
855
+ addFinding(data) {
856
+ const finding = {
857
+ id: crypto.randomUUID(),
858
+ timestamp: new Date().toISOString(),
859
+ ...data,
860
+ hash: '',
861
+ };
862
+ finding.hash = crypto.createHash('sha256')
863
+ .update(JSON.stringify({ ...finding, hash: '' }))
864
+ .digest('hex');
865
+ this.session.findings.push(finding);
866
+ this.session.lastActivity = new Date().toISOString();
867
+ this.emit('finding', finding);
868
+ }
869
+ // ─────────────────────────────────────────────────────────────────────────────
870
+ // PUBLIC API
871
+ // ─────────────────────────────────────────────────────────────────────────────
872
+ async initialize() {
873
+ this.session.status = 'active';
874
+ this.session.capabilities = [
875
+ 'counter_surveillance',
876
+ 'evidence_collection',
877
+ 'evidence_permanence',
878
+ 'transparency_audit',
879
+ 'regulatory_filing',
880
+ 'symmetric_response',
881
+ ];
882
+ this.emit('initialized', { sessionId: this.session.id });
883
+ }
884
+ async startCounterSurveillance(intervalMs = 5000) {
885
+ if (this.counterSurveillance) {
886
+ await this.counterSurveillance.start(intervalMs);
887
+ this.emit('counter_surveillance_started');
888
+ }
889
+ }
890
+ stopCounterSurveillance() {
891
+ if (this.counterSurveillance) {
892
+ this.counterSurveillance.stop();
893
+ this.emit('counter_surveillance_stopped');
894
+ }
895
+ }
896
+ async runTransparencyAudit() {
897
+ if (!this.transparencyAuditor)
898
+ return [];
899
+ const tests = await this.transparencyAuditor.runAllTests();
900
+ this.session.metrics.evidenceFilesCreated++;
901
+ return tests;
902
+ }
903
+ async generateEvidencePackage() {
904
+ if (!this.evidencePermanence)
905
+ return '';
906
+ const masterHash = await this.evidencePermanence.saveHashChain();
907
+ this.session.metrics.evidenceFilesCreated += 3; // hash chain + 2 scripts
908
+ this.emit('evidence_package_generated', { masterHash });
909
+ return masterHash;
910
+ }
911
+ async generateRegulatoryFilings() {
912
+ if (!this.regulatoryGenerator || !this.evidencePermanence)
913
+ return [];
914
+ const masterHash = await this.evidencePermanence.saveHashChain();
915
+ const filings = await this.regulatoryGenerator.generateAllFilings(masterHash);
916
+ this.session.metrics.regulatoryFilingsPrepared = filings.length;
917
+ this.session.metrics.estimatedCostImposed += filings.length * 50000; // Estimated legal cost per filing
918
+ this.emit('regulatory_filings_generated', { count: filings.length });
919
+ return filings;
920
+ }
921
+ async runFullDefense() {
922
+ this.emit('full_defense_started');
923
+ // Initialize
924
+ await this.initialize();
925
+ // Run transparency audit
926
+ console.log('[1/4] Running transparency audit...');
927
+ await this.runTransparencyAudit();
928
+ // Generate evidence package
929
+ console.log('[2/4] Generating evidence package...');
930
+ await this.generateEvidencePackage();
931
+ // Generate regulatory filings
932
+ console.log('[3/4] Generating regulatory filings...');
933
+ await this.generateRegulatoryFilings();
934
+ // Start counter-surveillance
935
+ console.log('[4/4] Starting counter-surveillance...');
936
+ await this.startCounterSurveillance();
937
+ // Let it run for a bit to collect initial data
938
+ await new Promise(resolve => setTimeout(resolve, 10000));
939
+ this.stopCounterSurveillance();
940
+ // Generate final report
941
+ this.generateFinalReport();
942
+ this.session.status = 'complete';
943
+ this.emit('full_defense_complete', this.session);
944
+ return this.session;
945
+ }
946
+ generateFinalReport() {
947
+ const report = `================================================================================
948
+ USER DEFENSE SESSION REPORT
949
+ ================================================================================
950
+
951
+ Session ID: ${this.session.id}
952
+ Target: ${this.session.target.toUpperCase()}
953
+ Status: ${this.session.status}
954
+ Created: ${this.session.created}
955
+ Last Activity: ${this.session.lastActivity}
956
+
957
+ ================================================================================
958
+ CAPABILITIES DEPLOYED
959
+ ================================================================================
960
+
961
+ ${this.session.capabilities.map(c => `✓ ${c}`).join('\n')}
962
+
963
+ ================================================================================
964
+ FINDINGS
965
+ ================================================================================
966
+
967
+ ${this.session.findings.map(f => `
968
+ [${f.severity.toUpperCase()}] ${f.title}
969
+ Type: ${f.type}
970
+ Capability: ${f.capability}
971
+ ${f.description}
972
+ Hash: ${f.hash}
973
+ `).join('\n---\n')}
974
+
975
+ ================================================================================
976
+ METRICS
977
+ ================================================================================
978
+
979
+ Surveillance Events Logged: ${this.session.metrics.surveillanceEventsLogged}
980
+ Claims Falsified: ${this.session.metrics.claimsFalsified}
981
+ Evidence Files Created: ${this.session.metrics.evidenceFilesCreated}
982
+ Regulatory Filings Prepared: ${this.session.metrics.regulatoryFilingsPrepared}
983
+ Estimated Cost Imposed: $${this.session.metrics.estimatedCostImposed.toLocaleString()}
984
+
985
+ ================================================================================
986
+ GENERATED BY EROSOLAR-CLI
987
+ UserDefenseOrchestrator v1.0.0
988
+ ================================================================================
989
+ `;
990
+ fs.writeFileSync(path.join(this.session.evidenceDir, 'DEFENSE-SESSION-REPORT.txt'), report);
991
+ }
992
+ getSession() {
993
+ return this.session;
994
+ }
995
+ getFindings() {
996
+ return this.session.findings;
997
+ }
998
+ getMetrics() {
999
+ return this.session.metrics;
1000
+ }
1001
+ }
1002
+ // ═══════════════════════════════════════════════════════════════════════════════
1003
+ // EXPORTS
1004
+ // ═══════════════════════════════════════════════════════════════════════════════
1005
+ export default UserDefenseOrchestrator;
1006
+ //# sourceMappingURL=userDefenseOrchestrator.js.map