erosolar-cli 2.1.249 → 2.1.252

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 (467) 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/resultVerification.d.ts +6 -100
  76. package/dist/core/resultVerification.d.ts.map +1 -1
  77. package/dist/core/resultVerification.js +31 -400
  78. package/dist/core/resultVerification.js.map +1 -1
  79. package/dist/core/selfEvolution.d.ts +32 -126
  80. package/dist/core/selfEvolution.d.ts.map +1 -1
  81. package/dist/core/selfEvolution.js +24 -967
  82. package/dist/core/selfEvolution.js.map +1 -1
  83. package/dist/core/selfImprovement.d.ts +50 -109
  84. package/dist/core/selfImprovement.d.ts.map +1 -1
  85. package/dist/core/selfImprovement.js +14 -689
  86. package/dist/core/selfImprovement.js.map +1 -1
  87. package/dist/core/sourceCodeManager.d.ts +89 -0
  88. package/dist/core/sourceCodeManager.d.ts.map +1 -0
  89. package/dist/core/sourceCodeManager.js +332 -0
  90. package/dist/core/sourceCodeManager.js.map +1 -0
  91. package/dist/core/unifiedOrchestrator.d.ts +88 -0
  92. package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
  93. package/dist/core/unifiedOrchestrator.js +284 -0
  94. package/dist/core/unifiedOrchestrator.js.map +1 -0
  95. package/dist/core/userDefenseOrchestrator.d.ts +202 -0
  96. package/dist/core/userDefenseOrchestrator.d.ts.map +1 -0
  97. package/dist/core/userDefenseOrchestrator.js +1006 -0
  98. package/dist/core/userDefenseOrchestrator.js.map +1 -0
  99. package/dist/plugins/index.d.ts +1 -1
  100. package/dist/plugins/index.d.ts.map +1 -1
  101. package/dist/plugins/index.js +36 -26
  102. package/dist/plugins/index.js.map +1 -1
  103. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +8 -0
  104. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
  105. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +17 -0
  106. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
  107. package/dist/plugins/tools/nodeDefaults.d.ts +14 -0
  108. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  109. package/dist/plugins/tools/nodeDefaults.js +17 -54
  110. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  111. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +9 -0
  112. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
  113. package/dist/plugins/tools/orchestration/orchestrationPlugin.js +18 -0
  114. package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
  115. package/dist/shell/interactiveShell.d.ts +97 -2
  116. package/dist/shell/interactiveShell.d.ts.map +1 -1
  117. package/dist/shell/interactiveShell.js +1001 -6
  118. package/dist/shell/interactiveShell.js.map +1 -1
  119. package/dist/tools/appleExposureTools.d.ts +108 -0
  120. package/dist/tools/appleExposureTools.d.ts.map +1 -0
  121. package/dist/tools/appleExposureTools.js +850 -0
  122. package/dist/tools/appleExposureTools.js.map +1 -0
  123. package/dist/tools/bidirectionalAuditTools.d.ts +104 -0
  124. package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -0
  125. package/dist/tools/bidirectionalAuditTools.js +1280 -0
  126. package/dist/tools/bidirectionalAuditTools.js.map +1 -0
  127. package/dist/tools/defensiveSecurityTools.d.ts +152 -0
  128. package/dist/tools/defensiveSecurityTools.d.ts.map +1 -0
  129. package/dist/tools/defensiveSecurityTools.js +576 -0
  130. package/dist/tools/defensiveSecurityTools.js.map +1 -0
  131. package/dist/tools/forwardAttackChainTracer.d.ts +73 -0
  132. package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -0
  133. package/dist/tools/forwardAttackChainTracer.js +604 -0
  134. package/dist/tools/forwardAttackChainTracer.js.map +1 -0
  135. package/dist/tools/localExplore.d.ts +12 -199
  136. package/dist/tools/localExplore.d.ts.map +1 -1
  137. package/dist/tools/localExplore.js +18 -1352
  138. package/dist/tools/localExplore.js.map +1 -1
  139. package/dist/tools/offensiveTransparencyTools.d.ts +188 -0
  140. package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -0
  141. package/dist/tools/offensiveTransparencyTools.js +890 -0
  142. package/dist/tools/offensiveTransparencyTools.js.map +1 -0
  143. package/dist/tools/planningTools.d.ts +8 -17
  144. package/dist/tools/planningTools.d.ts.map +1 -1
  145. package/dist/tools/planningTools.js +31 -141
  146. package/dist/tools/planningTools.js.map +1 -1
  147. package/dist/tools/searchTools.d.ts +9 -0
  148. package/dist/tools/searchTools.d.ts.map +1 -1
  149. package/dist/tools/searchTools.js +305 -189
  150. package/dist/tools/searchTools.js.map +1 -1
  151. package/dist/tools/skillTools.d.ts +7 -5
  152. package/dist/tools/skillTools.d.ts.map +1 -1
  153. package/dist/tools/skillTools.js +13 -155
  154. package/dist/tools/skillTools.js.map +1 -1
  155. package/dist/tools/threatIntelligenceTools.d.ts +128 -0
  156. package/dist/tools/threatIntelligenceTools.d.ts.map +1 -0
  157. package/dist/tools/threatIntelligenceTools.js +712 -0
  158. package/dist/tools/threatIntelligenceTools.js.map +1 -0
  159. package/dist/ui/PromptController.d.ts +4 -0
  160. package/dist/ui/PromptController.d.ts.map +1 -1
  161. package/dist/ui/PromptController.js +32 -11
  162. package/dist/ui/PromptController.js.map +1 -1
  163. package/dist/ui/UnifiedUIRenderer.d.ts +20 -0
  164. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
  165. package/dist/ui/UnifiedUIRenderer.js +235 -28
  166. package/dist/ui/UnifiedUIRenderer.js.map +1 -1
  167. package/dist/ui/animatedStatus.d.ts +2 -0
  168. package/dist/ui/animatedStatus.d.ts.map +1 -1
  169. package/dist/ui/animatedStatus.js +36 -2
  170. package/dist/ui/animatedStatus.js.map +1 -1
  171. package/dist/ui/orchestration/StatusOrchestrator.d.ts +10 -0
  172. package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
  173. package/dist/ui/orchestration/StatusOrchestrator.js +36 -4
  174. package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
  175. package/package.json +1 -1
  176. package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
  177. package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
  178. package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
  179. package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
  180. package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
  181. package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
  182. package/dist/capabilities/browserAutomationCapability.js +0 -49
  183. package/dist/capabilities/browserAutomationCapability.js.map +0 -1
  184. package/dist/capabilities/buildCapability.d.ts +0 -24
  185. package/dist/capabilities/buildCapability.d.ts.map +0 -1
  186. package/dist/capabilities/buildCapability.js +0 -25
  187. package/dist/capabilities/buildCapability.js.map +0 -1
  188. package/dist/capabilities/cloudCapability.d.ts +0 -13
  189. package/dist/capabilities/cloudCapability.d.ts.map +0 -1
  190. package/dist/capabilities/cloudCapability.js +0 -38
  191. package/dist/capabilities/cloudCapability.js.map +0 -1
  192. package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
  193. package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
  194. package/dist/capabilities/codeAnalysisCapability.js +0 -24
  195. package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
  196. package/dist/capabilities/codeQualityCapability.d.ts +0 -13
  197. package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
  198. package/dist/capabilities/codeQualityCapability.js +0 -25
  199. package/dist/capabilities/codeQualityCapability.js.map +0 -1
  200. package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
  201. package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
  202. package/dist/capabilities/dependencySecurityCapability.js +0 -24
  203. package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
  204. package/dist/capabilities/devCapability.d.ts +0 -13
  205. package/dist/capabilities/devCapability.d.ts.map +0 -1
  206. package/dist/capabilities/devCapability.js +0 -24
  207. package/dist/capabilities/devCapability.js.map +0 -1
  208. package/dist/capabilities/emailCapability.d.ts +0 -12
  209. package/dist/capabilities/emailCapability.d.ts.map +0 -1
  210. package/dist/capabilities/emailCapability.js +0 -22
  211. package/dist/capabilities/emailCapability.js.map +0 -1
  212. package/dist/capabilities/enhancedAnalysisCapability.d.ts +0 -13
  213. package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +0 -1
  214. package/dist/capabilities/enhancedAnalysisCapability.js +0 -20
  215. package/dist/capabilities/enhancedAnalysisCapability.js.map +0 -1
  216. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
  217. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
  218. package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
  219. package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
  220. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
  221. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
  222. package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
  223. package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
  224. package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
  225. package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
  226. package/dist/capabilities/frontendTestingCapability.js +0 -28
  227. package/dist/capabilities/frontendTestingCapability.js.map +0 -1
  228. package/dist/capabilities/interactionCapability.d.ts +0 -12
  229. package/dist/capabilities/interactionCapability.d.ts.map +0 -1
  230. package/dist/capabilities/interactionCapability.js +0 -22
  231. package/dist/capabilities/interactionCapability.js.map +0 -1
  232. package/dist/capabilities/learnCapability.d.ts +0 -22
  233. package/dist/capabilities/learnCapability.d.ts.map +0 -1
  234. package/dist/capabilities/learnCapability.js +0 -37
  235. package/dist/capabilities/learnCapability.js.map +0 -1
  236. package/dist/capabilities/notebookCapability.d.ts +0 -17
  237. package/dist/capabilities/notebookCapability.d.ts.map +0 -1
  238. package/dist/capabilities/notebookCapability.js +0 -27
  239. package/dist/capabilities/notebookCapability.js.map +0 -1
  240. package/dist/capabilities/planningCapability.d.ts +0 -16
  241. package/dist/capabilities/planningCapability.d.ts.map +0 -1
  242. package/dist/capabilities/planningCapability.js +0 -26
  243. package/dist/capabilities/planningCapability.js.map +0 -1
  244. package/dist/capabilities/refactoringCapability.d.ts +0 -13
  245. package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
  246. package/dist/capabilities/refactoringCapability.js +0 -25
  247. package/dist/capabilities/refactoringCapability.js.map +0 -1
  248. package/dist/capabilities/repoChecksCapability.d.ts +0 -10
  249. package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
  250. package/dist/capabilities/repoChecksCapability.js +0 -24
  251. package/dist/capabilities/repoChecksCapability.js.map +0 -1
  252. package/dist/capabilities/taskManagementCapability.d.ts +0 -12
  253. package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
  254. package/dist/capabilities/taskManagementCapability.js +0 -22
  255. package/dist/capabilities/taskManagementCapability.js.map +0 -1
  256. package/dist/capabilities/testingCapability.d.ts +0 -13
  257. package/dist/capabilities/testingCapability.d.ts.map +0 -1
  258. package/dist/capabilities/testingCapability.js +0 -25
  259. package/dist/capabilities/testingCapability.js.map +0 -1
  260. package/dist/capabilities/validationCapability.d.ts +0 -13
  261. package/dist/capabilities/validationCapability.d.ts.map +0 -1
  262. package/dist/capabilities/validationCapability.js +0 -24
  263. package/dist/capabilities/validationCapability.js.map +0 -1
  264. package/dist/capabilities/webCapability.d.ts +0 -12
  265. package/dist/capabilities/webCapability.d.ts.map +0 -1
  266. package/dist/capabilities/webCapability.js +0 -22
  267. package/dist/capabilities/webCapability.js.map +0 -1
  268. package/dist/core/deepBugAnalyzer.d.ts +0 -128
  269. package/dist/core/deepBugAnalyzer.d.ts.map +0 -1
  270. package/dist/core/deepBugAnalyzer.js +0 -406
  271. package/dist/core/deepBugAnalyzer.js.map +0 -1
  272. package/dist/core/hypothesisEngine.d.ts +0 -113
  273. package/dist/core/hypothesisEngine.d.ts.map +0 -1
  274. package/dist/core/hypothesisEngine.js +0 -264
  275. package/dist/core/hypothesisEngine.js.map +0 -1
  276. package/dist/core/productTestHarness.d.ts +0 -113
  277. package/dist/core/productTestHarness.d.ts.map +0 -1
  278. package/dist/core/productTestHarness.js +0 -351
  279. package/dist/core/productTestHarness.js.map +0 -1
  280. package/dist/core/validationRunner.d.ts +0 -106
  281. package/dist/core/validationRunner.d.ts.map +0 -1
  282. package/dist/core/validationRunner.js +0 -892
  283. package/dist/core/validationRunner.js.map +0 -1
  284. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
  285. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
  286. package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
  287. package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
  288. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
  289. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
  290. package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
  291. package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
  292. package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
  293. package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
  294. package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
  295. package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
  296. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
  297. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
  298. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
  299. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
  300. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
  301. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
  302. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
  303. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
  304. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
  305. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
  306. package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
  307. package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
  308. package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
  309. package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
  310. package/dist/plugins/tools/development/devPlugin.js +0 -14
  311. package/dist/plugins/tools/development/devPlugin.js.map +0 -1
  312. package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
  313. package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
  314. package/dist/plugins/tools/email/emailPlugin.js +0 -12
  315. package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
  316. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +0 -3
  317. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +0 -1
  318. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +0 -14
  319. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +0 -1
  320. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +0 -3
  321. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +0 -1
  322. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +0 -12
  323. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +0 -1
  324. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +0 -3
  325. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +0 -1
  326. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +0 -12
  327. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +0 -1
  328. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
  329. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
  330. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
  331. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
  332. package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
  333. package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
  334. package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
  335. package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
  336. package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
  337. package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
  338. package/dist/plugins/tools/learn/learnPlugin.js +0 -14
  339. package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
  340. package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
  341. package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
  342. package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
  343. package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
  344. package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
  345. package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
  346. package/dist/plugins/tools/planning/planningPlugin.js +0 -15
  347. package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
  348. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
  349. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
  350. package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
  351. package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
  352. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
  353. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
  354. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
  355. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
  356. package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
  357. package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
  358. package/dist/plugins/tools/testing/testingPlugin.js +0 -12
  359. package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
  360. package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
  361. package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
  362. package/dist/plugins/tools/validation/validationPlugin.js +0 -14
  363. package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
  364. package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
  365. package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
  366. package/dist/plugins/tools/web/webPlugin.js +0 -12
  367. package/dist/plugins/tools/web/webPlugin.js.map +0 -1
  368. package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
  369. package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
  370. package/dist/tools/advancedTestGenerationTools.js +0 -304
  371. package/dist/tools/advancedTestGenerationTools.js.map +0 -1
  372. package/dist/tools/browserAutomationTools.d.ts +0 -23
  373. package/dist/tools/browserAutomationTools.d.ts.map +0 -1
  374. package/dist/tools/browserAutomationTools.js +0 -916
  375. package/dist/tools/browserAutomationTools.js.map +0 -1
  376. package/dist/tools/buildTools.d.ts +0 -9
  377. package/dist/tools/buildTools.d.ts.map +0 -1
  378. package/dist/tools/buildTools.js +0 -346
  379. package/dist/tools/buildTools.js.map +0 -1
  380. package/dist/tools/cloudTools.d.ts +0 -49
  381. package/dist/tools/cloudTools.d.ts.map +0 -1
  382. package/dist/tools/cloudTools.js +0 -1258
  383. package/dist/tools/cloudTools.js.map +0 -1
  384. package/dist/tools/codeAnalysisTools.d.ts +0 -74
  385. package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
  386. package/dist/tools/codeAnalysisTools.js +0 -664
  387. package/dist/tools/codeAnalysisTools.js.map +0 -1
  388. package/dist/tools/codeGenerationTools.d.ts +0 -3
  389. package/dist/tools/codeGenerationTools.d.ts.map +0 -1
  390. package/dist/tools/codeGenerationTools.js +0 -439
  391. package/dist/tools/codeGenerationTools.js.map +0 -1
  392. package/dist/tools/codeQualityTools.d.ts +0 -3
  393. package/dist/tools/codeQualityTools.d.ts.map +0 -1
  394. package/dist/tools/codeQualityTools.js +0 -297
  395. package/dist/tools/codeQualityTools.js.map +0 -1
  396. package/dist/tools/dependencyTools.d.ts +0 -3
  397. package/dist/tools/dependencyTools.d.ts.map +0 -1
  398. package/dist/tools/dependencyTools.js +0 -284
  399. package/dist/tools/dependencyTools.js.map +0 -1
  400. package/dist/tools/devTools.d.ts +0 -10
  401. package/dist/tools/devTools.d.ts.map +0 -1
  402. package/dist/tools/devTools.js +0 -2126
  403. package/dist/tools/devTools.js.map +0 -1
  404. package/dist/tools/emailTools.d.ts +0 -21
  405. package/dist/tools/emailTools.d.ts.map +0 -1
  406. package/dist/tools/emailTools.js +0 -449
  407. package/dist/tools/emailTools.js.map +0 -1
  408. package/dist/tools/enhancedAnalysisTools.d.ts +0 -9
  409. package/dist/tools/enhancedAnalysisTools.d.ts.map +0 -1
  410. package/dist/tools/enhancedAnalysisTools.js +0 -370
  411. package/dist/tools/enhancedAnalysisTools.js.map +0 -1
  412. package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -7
  413. package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
  414. package/dist/tools/enhancedCodeIntelligenceTools.js +0 -540
  415. package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
  416. package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -7
  417. package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
  418. package/dist/tools/enhancedDevWorkflowTools.js +0 -432
  419. package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
  420. package/dist/tools/frontendTestingTools.d.ts +0 -35
  421. package/dist/tools/frontendTestingTools.d.ts.map +0 -1
  422. package/dist/tools/frontendTestingTools.js +0 -1258
  423. package/dist/tools/frontendTestingTools.js.map +0 -1
  424. package/dist/tools/globTools.d.ts +0 -15
  425. package/dist/tools/globTools.d.ts.map +0 -1
  426. package/dist/tools/globTools.js +0 -174
  427. package/dist/tools/globTools.js.map +0 -1
  428. package/dist/tools/grepTools.d.ts +0 -19
  429. package/dist/tools/grepTools.d.ts.map +0 -1
  430. package/dist/tools/grepTools.js +0 -411
  431. package/dist/tools/grepTools.js.map +0 -1
  432. package/dist/tools/interactionTools.d.ts +0 -6
  433. package/dist/tools/interactionTools.d.ts.map +0 -1
  434. package/dist/tools/interactionTools.js +0 -209
  435. package/dist/tools/interactionTools.js.map +0 -1
  436. package/dist/tools/learnTools.d.ts +0 -164
  437. package/dist/tools/learnTools.d.ts.map +0 -1
  438. package/dist/tools/learnTools.js +0 -2098
  439. package/dist/tools/learnTools.js.map +0 -1
  440. package/dist/tools/notebookEditTools.d.ts +0 -15
  441. package/dist/tools/notebookEditTools.d.ts.map +0 -1
  442. package/dist/tools/notebookEditTools.js +0 -197
  443. package/dist/tools/notebookEditTools.js.map +0 -1
  444. package/dist/tools/refactoringTools.d.ts +0 -3
  445. package/dist/tools/refactoringTools.d.ts.map +0 -1
  446. package/dist/tools/refactoringTools.js +0 -294
  447. package/dist/tools/refactoringTools.js.map +0 -1
  448. package/dist/tools/repoChecksTools.d.ts +0 -3
  449. package/dist/tools/repoChecksTools.d.ts.map +0 -1
  450. package/dist/tools/repoChecksTools.js +0 -276
  451. package/dist/tools/repoChecksTools.js.map +0 -1
  452. package/dist/tools/taskManagementTools.d.ts +0 -10
  453. package/dist/tools/taskManagementTools.d.ts.map +0 -1
  454. package/dist/tools/taskManagementTools.js +0 -133
  455. package/dist/tools/taskManagementTools.js.map +0 -1
  456. package/dist/tools/testingTools.d.ts +0 -3
  457. package/dist/tools/testingTools.d.ts.map +0 -1
  458. package/dist/tools/testingTools.js +0 -237
  459. package/dist/tools/testingTools.js.map +0 -1
  460. package/dist/tools/validationTools.d.ts +0 -7
  461. package/dist/tools/validationTools.d.ts.map +0 -1
  462. package/dist/tools/validationTools.js +0 -344
  463. package/dist/tools/validationTools.js.map +0 -1
  464. package/dist/tools/webTools.d.ts +0 -3
  465. package/dist/tools/webTools.d.ts.map +0 -1
  466. package/dist/tools/webTools.js +0 -502
  467. package/dist/tools/webTools.js.map +0 -1
@@ -310,6 +310,32 @@ export class InteractiveShell {
310
310
  description: 'Deploy operational infrastructure (usage: /infra [region])',
311
311
  category: 'security',
312
312
  });
313
+ // Bidirectional audit commands
314
+ this.slashCommands.push({
315
+ command: '/audit-forward',
316
+ description: 'Run forward attack chain audit: Local → Apple → End users',
317
+ category: 'security',
318
+ });
319
+ this.slashCommands.push({
320
+ command: '/audit-reverse',
321
+ description: 'Run reverse attack chain audit: Threats → Apple → Local',
322
+ category: 'security',
323
+ });
324
+ this.slashCommands.push({
325
+ command: '/audit-bidir',
326
+ description: 'Run full bidirectional audit with correlation analysis',
327
+ category: 'security',
328
+ });
329
+ this.slashCommands.push({
330
+ command: '/audit-correlate',
331
+ description: 'Find correlations between forward and reverse attack paths',
332
+ category: 'security',
333
+ });
334
+ this.slashCommands.push({
335
+ command: '/audit-evidence',
336
+ description: 'Export audit results as legal evidence package',
337
+ category: 'security',
338
+ });
313
339
  this.statusTracker = config.statusTracker;
314
340
  this.ui = config.ui;
315
341
  this.uiAdapter = config.ui.adapter;
@@ -2999,6 +3025,49 @@ export class InteractiveShell {
2999
3025
  // These commands are handled through the UnifiedAttackChain tool
3000
3026
  this.processInput(`Execute ${command.slice(1)} operation: ${input.slice(command.length).trim() || 'analyze current target'}`);
3001
3027
  break;
3028
+ // Bidirectional audit commands
3029
+ case '/audit':
3030
+ case '/trace':
3031
+ case '/forward':
3032
+ case '/reverse':
3033
+ case '/bidirectional':
3034
+ await this.handleAuditCommand(input);
3035
+ break;
3036
+ // New bidirectional audit commands (aliases for /audit)
3037
+ case '/audit-forward':
3038
+ case '/audit-reverse':
3039
+ case '/audit-bidir':
3040
+ case '/audit-correlate':
3041
+ case '/audit-evidence':
3042
+ // Map to standard audit command format
3043
+ await this.handleAuditCommand(input.replace(command, '/audit ' + command.slice(7)));
3044
+ break;
3045
+ // Defensive security commands
3046
+ case '/defend':
3047
+ case '/scan':
3048
+ case '/detect':
3049
+ case '/harden':
3050
+ case '/evidence':
3051
+ await this.handleDefensiveCommand(input);
3052
+ break;
3053
+ // Offensive transparency commands
3054
+ case '/offensive':
3055
+ case '/probe':
3056
+ case '/expose':
3057
+ case '/complain':
3058
+ case '/disclose':
3059
+ case '/block-telemetry':
3060
+ await this.handleDefensiveCommand(input);
3061
+ break;
3062
+ // Threat intelligence commands
3063
+ case '/threat':
3064
+ case '/intel-report':
3065
+ case '/actors':
3066
+ case '/vectors':
3067
+ case '/ioc':
3068
+ case '/capability':
3069
+ await this.handleIntelCommand(input);
3070
+ break;
3002
3071
  default:
3003
3072
  if (!(await this.tryCustomSlashCommand(command, input))) {
3004
3073
  this.showInlineStatus(`Unknown command "${command}".`, 'warning', { autoClearMs: 1800 });
@@ -3762,7 +3831,7 @@ export class InteractiveShell {
3762
3831
  const icon = opp.type === 'bug-fix' ? '🐛' : opp.type === 'refactor' ? '🔧' : '⚡';
3763
3832
  lines.push(` ${icon} ${opp.description.slice(0, 60)}`);
3764
3833
  lines.push(` ${theme.ui.muted(`File: ${opp.sourceFile}`)}`);
3765
- lines.push(` ${theme.dim(`Suggested: ${opp.suggestedChange.slice(0, 100)}...`)}`);
3834
+ lines.push(` ${theme.dim(`Suggested: ${opp.suggestedChange?.slice(0, 100) || 'N/A'}...`)}`);
3766
3835
  lines.push('');
3767
3836
  }
3768
3837
  lines.push(theme.bold('Run `/improve apply` to execute these changes.'));
@@ -4263,8 +4332,8 @@ export class InteractiveShell {
4263
4332
  for (const update of updates.slice(0, 10)) {
4264
4333
  lines.push(` 📦 ${update.component} [${update.type}]`);
4265
4334
  lines.push(` ${theme.dim(update.description)}`);
4266
- lines.push(` Before: ${theme.error(update.before.slice(0, 40))}`);
4267
- lines.push(` After: ${theme.success(update.after.slice(0, 40))}`);
4335
+ lines.push(` Before: ${theme.error(update.before?.slice(0, 40) || 'N/A')}`);
4336
+ lines.push(` After: ${theme.success(update.after?.slice(0, 40) || 'N/A')}`);
4268
4337
  lines.push('');
4269
4338
  }
4270
4339
  display.showSystemMessage(lines.join('\n'));
@@ -4767,6 +4836,927 @@ export class InteractiveShell {
4767
4836
  await this.processRequest('Please perform a comprehensive security review of the codebase. Check for OWASP top 10 vulnerabilities, insecure patterns, and potential attack vectors.');
4768
4837
  }
4769
4838
  // ═══════════════════════════════════════════════════════════════════════════════
4839
+ // BIDIRECTIONAL AUDIT COMMAND HANDLERS
4840
+ // ═══════════════════════════════════════════════════════════════════════════════
4841
+ /**
4842
+ * Handle bidirectional audit commands.
4843
+ * Usage: /audit [forward|reverse|bidirectional|full] [--evidence-dir=<path>]
4844
+ * /trace [direction]
4845
+ * /forward - run forward attack chain trace
4846
+ * /reverse - run reverse attack chain trace
4847
+ * /bidirectional - run full bidirectional audit
4848
+ */
4849
+ async handleAuditCommand(input) {
4850
+ if (this.isProcessing) {
4851
+ this.showSlashWarning('Wait for the current operation to finish.');
4852
+ return;
4853
+ }
4854
+ const parts = input.trim().split(/\s+/);
4855
+ const command = parts[0]?.toLowerCase() || '/audit';
4856
+ const args = parts.slice(1);
4857
+ // Parse direction from command or args
4858
+ let direction = 'bidirectional';
4859
+ if (command === '/forward') {
4860
+ direction = 'forward';
4861
+ }
4862
+ else if (command === '/reverse') {
4863
+ direction = 'reverse';
4864
+ }
4865
+ else if (command === '/bidirectional') {
4866
+ direction = 'bidirectional';
4867
+ }
4868
+ else {
4869
+ // Parse from args
4870
+ const dirArg = args.find(a => ['forward', 'reverse', 'bidirectional', 'full'].includes(a.toLowerCase()));
4871
+ if (dirArg) {
4872
+ direction = dirArg === 'full' ? 'bidirectional' : dirArg.toLowerCase();
4873
+ }
4874
+ }
4875
+ // Parse evidence directory
4876
+ const evidenceDirArg = args.find(a => a.startsWith('--evidence-dir='));
4877
+ const evidenceDir = evidenceDirArg
4878
+ ? evidenceDirArg.replace('--evidence-dir=', '')
4879
+ : `${this.workingDir}/.erosolar/evidence/audit-${new Date().toISOString().split('T')[0]}`;
4880
+ // Show audit banner
4881
+ this.showAuditBanner(direction, evidenceDir);
4882
+ // Execute the audit via AI
4883
+ const prompt = this.buildAuditPrompt(direction, evidenceDir);
4884
+ await this.processRequest(prompt);
4885
+ }
4886
+ /**
4887
+ * Build the AI prompt for audit execution.
4888
+ */
4889
+ buildAuditPrompt(direction, evidenceDir) {
4890
+ const prompts = {
4891
+ forward: `Execute a FORWARD attack chain trace using the bidirectional_audit tool.
4892
+
4893
+ Direction: forward
4894
+ Evidence Directory: ${evidenceDir}
4895
+
4896
+ This traces the path FROM this device THROUGH infrastructure TO end users:
4897
+ 1. Local System (device, firmware, secure enclave)
4898
+ 2. System Daemons (identityservicesd, imagent, apsd, cloudd)
4899
+ 3. Network Layer (connections, DNS, TLS)
4900
+ 4. Edge Servers (APNs courier, IDS identity, CloudKit)
4901
+ 5. Core Infrastructure (key databases, message relay, escrow)
4902
+ 6. Corporate Infrastructure (data centers, third parties)
4903
+ 7. End User Attack Vectors (update push, key injection, etc.)
4904
+
4905
+ Generate a complete evidence package with cryptographic hashes.`,
4906
+ reverse: `Execute a REVERSE attack chain trace using the bidirectional_audit tool.
4907
+
4908
+ Direction: reverse
4909
+ Evidence Directory: ${evidenceDir}
4910
+
4911
+ This traces the path FROM end users BACK TO this device:
4912
+ 1. Identify all attack vectors that could reach end users
4913
+ 2. Trace persistence mechanisms in corporate infrastructure
4914
+ 3. Map core infrastructure control points
4915
+ 4. Identify edge server vulnerabilities
4916
+ 5. Analyze network-level interception points
4917
+ 6. Document daemon-level access
4918
+ 7. Assess local system exposure
4919
+
4920
+ Generate a complete evidence package with cryptographic hashes.`,
4921
+ bidirectional: `Execute a COMPLETE BIDIRECTIONAL attack chain audit using the bidirectional_audit tool.
4922
+
4923
+ Direction: bidirectional
4924
+ Evidence Directory: ${evidenceDir}
4925
+
4926
+ This performs BOTH forward and reverse traces to create a complete picture:
4927
+
4928
+ FORWARD CHAIN (7 layers):
4929
+ - Local System → Daemons → Network → Edge → Core → Corporate → End Users
4930
+
4931
+ REVERSE CHAIN (analysis):
4932
+ - End User Vectors → Corporate Persistence → Core Control → Edge Vulnerabilities → Network Interception → Daemon Access → Local Exposure
4933
+
4934
+ Output should include:
4935
+ 1. Complete node and edge graph
4936
+ 2. Attack surfaces at each layer
4937
+ 3. Evidence files with SHA-256 hashes
4938
+ 4. Master hash of complete audit package
4939
+ 5. Summary of user defense capabilities (expected: NONE)
4940
+
4941
+ Generate a professional audit report suitable for compliance, legal, or security review purposes.`,
4942
+ };
4943
+ return (prompts[direction] ?? prompts['bidirectional']);
4944
+ }
4945
+ /**
4946
+ * Show audit execution banner.
4947
+ */
4948
+ showAuditBanner(direction, evidenceDir) {
4949
+ const dirLabels = {
4950
+ forward: 'Forward Attack Chain Trace',
4951
+ reverse: 'Reverse Attack Chain Trace',
4952
+ bidirectional: 'Complete Bidirectional Audit',
4953
+ };
4954
+ const lines = [
4955
+ '',
4956
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
4957
+ theme.gradient.primary(` ${dirLabels[direction]}`),
4958
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
4959
+ '',
4960
+ theme.bold('Direction: ') + direction.toUpperCase(),
4961
+ theme.bold('Evidence: ') + evidenceDir,
4962
+ '',
4963
+ ];
4964
+ if (direction === 'forward' || direction === 'bidirectional') {
4965
+ lines.push(theme.secondary('Forward trace layers:'));
4966
+ lines.push(' 1. Local System (device, firmware, SEP)');
4967
+ lines.push(' 2. System Daemons (IDS, iMessage, APNs)');
4968
+ lines.push(' 3. Network (connections, DNS, TLS)');
4969
+ lines.push(' 4. Edge Servers (courier, identity, gateway)');
4970
+ lines.push(' 5. Core Infrastructure (key DB, escrow)');
4971
+ lines.push(' 6. Corporate (data centers, third parties)');
4972
+ lines.push(' 7. End User Attack Vectors');
4973
+ lines.push('');
4974
+ }
4975
+ if (direction === 'reverse' || direction === 'bidirectional') {
4976
+ lines.push(theme.secondary('Reverse trace analysis:'));
4977
+ lines.push(' • End user attack vectors');
4978
+ lines.push(' • Corporate persistence mechanisms');
4979
+ lines.push(' • Core infrastructure control points');
4980
+ lines.push(' • Edge server vulnerabilities');
4981
+ lines.push(' • Network interception points');
4982
+ lines.push(' • Daemon access pathways');
4983
+ lines.push(' • Local system exposure');
4984
+ lines.push('');
4985
+ }
4986
+ lines.push(theme.ui.muted('Press Ctrl+C to abort operation.'));
4987
+ lines.push('');
4988
+ display.showSystemMessage(lines.join('\n'));
4989
+ }
4990
+ /**
4991
+ * Show audit help.
4992
+ */
4993
+ showAuditHelp() {
4994
+ const lines = [
4995
+ theme.gradient.primary('Bidirectional Audit Commands'),
4996
+ '',
4997
+ theme.bold('/audit [direction] [--evidence-dir=<path>]'),
4998
+ ' Run bidirectional attack chain audit',
4999
+ '',
5000
+ theme.bold('Directions:'),
5001
+ ' forward - Trace from device to end users',
5002
+ ' reverse - Trace from end users back to device',
5003
+ ' bidirectional - Complete both directions (default)',
5004
+ ' full - Alias for bidirectional',
5005
+ '',
5006
+ theme.bold('Shortcut Commands:'),
5007
+ ' /forward - Run forward trace only',
5008
+ ' /reverse - Run reverse trace only',
5009
+ ' /bidirectional - Run full bidirectional audit',
5010
+ ' /trace - Alias for /audit',
5011
+ '',
5012
+ theme.secondary('Examples:'),
5013
+ ' /audit - Full bidirectional audit',
5014
+ ' /audit forward - Forward trace only',
5015
+ ' /forward - Forward trace (shortcut)',
5016
+ ' /reverse --evidence-dir=/tmp/ev - Reverse trace with custom path',
5017
+ '',
5018
+ theme.secondary('Output:'),
5019
+ ' • Evidence files in .erosolar/evidence/',
5020
+ ' • SHA-256 hashes for all evidence',
5021
+ ' • Master hash of complete package',
5022
+ ' • Professional audit report',
5023
+ ];
5024
+ display.showSystemMessage(lines.join('\n'));
5025
+ }
5026
+ // ═══════════════════════════════════════════════════════════════════════════════
5027
+ // BIDIRECTIONAL AUDIT COMMAND HANDLERS
5028
+ // ═══════════════════════════════════════════════════════════════════════════════
5029
+ /**
5030
+ * Handle bidirectional audit commands with AI-powered analysis.
5031
+ *
5032
+ * Commands:
5033
+ * /audit-forward - Forward attack chain: Local → Apple → End users
5034
+ * /audit-reverse - Reverse attack chain: Threats → Apple → Local
5035
+ * /audit-bidir - Full bidirectional with correlation
5036
+ * /audit-correlate - Find forward/reverse convergence points
5037
+ * /audit-evidence - Export legal evidence package
5038
+ */
5039
+ async handleBidirectionalAuditCommand(command, input) {
5040
+ if (this.isProcessing) {
5041
+ this.showSlashWarning('Wait for the current operation to finish.');
5042
+ return;
5043
+ }
5044
+ const args = input.slice(command.length).trim();
5045
+ const evidenceDir = `${this.workingDir}/.erosolar/evidence`;
5046
+ const toolPrompts = {
5047
+ '/audit-forward': `Use the BidirectionalAudit tool to run a forward attack chain audit.
5048
+ Parameters: direction="forward", outputFormat="report", saveEvidence=true
5049
+ This traces: Local System → Daemons → Network → Apple Edge → Apple Core → Corporate → End Users
5050
+ Analyze each layer's attack surface and identify Apple-controlled chokepoints.
5051
+ Evidence will be saved to: ${evidenceDir}`,
5052
+ '/audit-reverse': `Use the BidirectionalAudit tool to run a reverse attack chain audit.
5053
+ Parameters: direction="reverse", outputFormat="report", saveEvidence=true
5054
+ This traces: External Threats → Supply Chain → Apple Entry Points → Protocols → Crypto → Local
5055
+ Analyze how external threat actors can leverage Apple infrastructure to reach target devices.
5056
+ Evidence will be saved to: ${evidenceDir}`,
5057
+ '/audit-bidir': `Use the BidirectionalAudit tool to run a full bidirectional audit with correlation analysis.
5058
+ Parameters: direction="bidirectional", outputFormat="report", saveEvidence=true
5059
+ This performs BOTH:
5060
+ 1. FORWARD: Local → Apple → End Users (7 layers)
5061
+ 2. REVERSE: Threats → Apple → Local (6 layers)
5062
+ 3. CORRELATION: Where forward and reverse paths converge
5063
+ Generate attack surface score and identify user defense gaps.
5064
+ Evidence will be saved to: ${evidenceDir}`,
5065
+ '/audit-correlate': `Use the CorrelationFind tool to analyze where forward and reverse attack paths converge.
5066
+ Parameters: minThreatLevel="high"
5067
+ This identifies:
5068
+ - Points where outbound vulnerabilities meet inbound threats
5069
+ - Apple-controlled infrastructure enabling both attack directions
5070
+ - Complete attack chains from threat actor to target`,
5071
+ '/audit-evidence': `Use the AuditEvidenceExport tool to create a legal evidence package.
5072
+ Parameters: format="all", includeRawData=true
5073
+ Generate evidence suitable for legal proceedings, regulatory submissions, security assessments.
5074
+ Include cryptographic signatures and chain of custody documentation.
5075
+ Evidence will be saved to: ${evidenceDir}`,
5076
+ };
5077
+ const prompt = toolPrompts[command];
5078
+ if (!prompt) {
5079
+ this.showSlashWarning(`Unknown audit command: ${command}`);
5080
+ return;
5081
+ }
5082
+ this.showBidirectionalAuditBanner(command);
5083
+ await this.processRequest(prompt + (args ? `\n\nAdditional context: ${args}` : ''));
5084
+ }
5085
+ showBidirectionalAuditBanner(command) {
5086
+ const banners = {
5087
+ '/audit-forward': [
5088
+ '', theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5089
+ theme.gradient.primary(' FORWARD ATTACK CHAIN AUDIT'),
5090
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5091
+ '', theme.bold('Direction: ') + 'LOCAL → APPLE → END USERS', '',
5092
+ theme.secondary('Tracing 7 layers:'),
5093
+ ' 1. Local System (hardware, SEP, keychain)',
5094
+ ' 2. System Daemons (identityservicesd, imagent, apsd)',
5095
+ ' 3. Network Layer (connections, DNS, TLS)',
5096
+ ' 4. Apple Edge (IDS, APNs, CloudKit)',
5097
+ ' 5. Apple Core (key database, relay, escrow)',
5098
+ ' 6. Corporate (data centers, third parties)',
5099
+ ' 7. End User Vectors (key injection, updates)', '',
5100
+ ],
5101
+ '/audit-reverse': [
5102
+ '', theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5103
+ theme.gradient.primary(' REVERSE ATTACK CHAIN AUDIT'),
5104
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5105
+ '', theme.bold('Direction: ') + 'THREATS → APPLE → LOCAL', '',
5106
+ theme.secondary('Tracing 6 layers:'),
5107
+ ' 1. External Threats (state actors, insiders)',
5108
+ ' 2. Supply Chain (hardware, firmware)',
5109
+ ' 3. Apple Entry Points (legal, enterprise)',
5110
+ ' 4. Protocol Vulnerabilities (IDS, APNs)',
5111
+ ' 5. Cryptographic Weaknesses (escrow, TOFU)',
5112
+ ' 6. Local Attack Surface (SIP, TCC)', '',
5113
+ ],
5114
+ '/audit-bidir': [
5115
+ '', theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5116
+ theme.gradient.primary(' BIDIRECTIONAL ATTACK CHAIN AUDIT'),
5117
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5118
+ '', theme.bold('Direction: ') + 'FORWARD + REVERSE + CORRELATION', '',
5119
+ theme.secondary('Forward (7 layers):'),
5120
+ ' Local → Daemons → Network → Edge → Core → Corp → End Users', '',
5121
+ theme.secondary('Reverse (6 layers):'),
5122
+ ' Threats → Supply Chain → Entry → Protocols → Crypto → Local', '',
5123
+ theme.secondary('Correlation Analysis:'),
5124
+ ' • Convergence points • Attack surface score • Defense gap analysis', '',
5125
+ ],
5126
+ '/audit-correlate': [
5127
+ '', theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5128
+ theme.gradient.primary(' CORRELATION ANALYSIS'),
5129
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5130
+ '', theme.secondary('Finding where forward and reverse paths converge...'), '',
5131
+ ],
5132
+ '/audit-evidence': [
5133
+ '', theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5134
+ theme.gradient.primary(' EVIDENCE EXPORT'),
5135
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5136
+ '', theme.secondary('Creating legal evidence package...'), '',
5137
+ ],
5138
+ };
5139
+ const lines = banners[command] ?? banners['/audit-bidir'] ?? [];
5140
+ lines.push(theme.ui.muted('Press Ctrl+C to abort operation.'));
5141
+ lines.push('');
5142
+ display.showSystemMessage(lines.join('\n'));
5143
+ }
5144
+ // ═══════════════════════════════════════════════════════════════════════════════
5145
+ // DEFENSIVE SECURITY COMMAND HANDLERS
5146
+ // ═══════════════════════════════════════════════════════════════════════════════
5147
+ /**
5148
+ * Handle defensive security commands.
5149
+ * These scan YOUR OWN device for intrusions and collect evidence.
5150
+ *
5151
+ * Usage:
5152
+ * /defend [--evidence-dir=<path>] - Full defensive scan with evidence collection
5153
+ * /scan [process|network|persistence] - Scan specific area
5154
+ * /detect - Detect intrusion indicators
5155
+ * /harden - Check and recommend hardening
5156
+ * /evidence <purpose> - Collect forensic evidence package
5157
+ */
5158
+ async handleDefensiveCommand(input) {
5159
+ if (this.isProcessing) {
5160
+ this.showSlashWarning('Wait for the current operation to finish.');
5161
+ return;
5162
+ }
5163
+ const parts = input.trim().split(/\s+/);
5164
+ const command = parts[0]?.toLowerCase() || '/defend';
5165
+ const args = parts.slice(1);
5166
+ // Parse evidence directory
5167
+ const evidenceDirArg = args.find(a => a.startsWith('--evidence-dir='));
5168
+ const evidenceDir = evidenceDirArg
5169
+ ? evidenceDirArg.replace('--evidence-dir=', '')
5170
+ : `${this.workingDir}/.erosolar/evidence/defensive-${new Date().toISOString().split('T')[0]}`;
5171
+ // Show banner
5172
+ this.showDefensiveBanner(command, evidenceDir);
5173
+ // Build appropriate prompt based on command
5174
+ let prompt = '';
5175
+ switch (command) {
5176
+ case '/scan': {
5177
+ const scanType = args.find(a => ['process', 'network', 'persistence', 'all'].includes(a.toLowerCase()));
5178
+ prompt = `Run a defensive security scan on MY OWN DEVICE using the defensive_scan tool.
5179
+
5180
+ Scan Type: ${scanType || 'all'}
5181
+ Evidence Directory: ${evidenceDir}
5182
+
5183
+ This is a DEFENSIVE scan of the user's own system to detect:
5184
+ 1. Suspicious processes running from unusual locations
5185
+ 2. Potentially malicious network connections
5186
+ 3. Unauthorized persistence mechanisms (LaunchAgents, cron, etc.)
5187
+ 4. Security hardening gaps
5188
+
5189
+ Generate a security posture report with actionable recommendations.`;
5190
+ break;
5191
+ }
5192
+ case '/detect':
5193
+ prompt = `Run intrusion detection on MY OWN DEVICE using the defensive_scan tool.
5194
+
5195
+ Evidence Directory: ${evidenceDir}
5196
+
5197
+ Detect intrusion indicators including:
5198
+ - Processes with suspicious characteristics
5199
+ - Network connections to known bad ports or unusual destinations
5200
+ - Recently modified persistence mechanisms
5201
+ - Signs of privilege escalation or credential access
5202
+
5203
+ Map findings to MITRE ATT&CK framework where applicable.`;
5204
+ break;
5205
+ case '/harden':
5206
+ prompt = `Check security hardening status on MY OWN DEVICE using the defensive_scan tool.
5207
+
5208
+ Check and report on:
5209
+ 1. macOS Firewall status
5210
+ 2. System Integrity Protection (SIP)
5211
+ 3. FileVault encryption
5212
+ 4. Gatekeeper status
5213
+ 5. XProtect status
5214
+ 6. Automatic updates
5215
+
5216
+ For each disabled protection, provide:
5217
+ - Risk assessment
5218
+ - Enable command
5219
+ - Implementation steps`;
5220
+ break;
5221
+ case '/evidence': {
5222
+ const purpose = args.filter(a => !a.startsWith('--')).join(' ') || 'Security incident investigation';
5223
+ prompt = `Collect a forensic evidence package from MY OWN DEVICE using the defensive_scan tool.
5224
+
5225
+ Purpose: ${purpose}
5226
+ Evidence Directory: ${evidenceDir}
5227
+
5228
+ Collect:
5229
+ 1. System logs (system.log, unified log)
5230
+ 2. All detected intrusion indicators
5231
+ 3. Security configuration state
5232
+ 4. Running processes and network connections
5233
+
5234
+ Generate a legally-compliant evidence package with:
5235
+ - Chain of custody documentation
5236
+ - SHA-256 hashes for all artifacts
5237
+ - Master hash of complete package
5238
+ - Timeline of events
5239
+ - Professional report suitable for law enforcement submission`;
5240
+ break;
5241
+ }
5242
+ default: // /defend - full defensive scan
5243
+ prompt = `Run a COMPLETE defensive security scan on MY OWN DEVICE using the defensive_scan tool.
5244
+
5245
+ Evidence Directory: ${evidenceDir}
5246
+
5247
+ This performs a full defensive assessment:
5248
+
5249
+ 1. INTRUSION DETECTION
5250
+ - Process analysis
5251
+ - Network connection review
5252
+ - Persistence mechanism audit
5253
+
5254
+ 2. SECURITY HARDENING CHECK
5255
+ - Firewall, SIP, FileVault, Gatekeeper, XProtect
5256
+ - Automatic updates status
5257
+
5258
+ 3. EVIDENCE COLLECTION
5259
+ - System logs
5260
+ - Forensic artifacts with hashes
5261
+ - Chain of custody documentation
5262
+
5263
+ 4. RECOMMENDATIONS
5264
+ - Prioritized remediation steps
5265
+ - Hardening commands
5266
+
5267
+ Generate a complete security posture report with evidence package.`;
5268
+ }
5269
+ await this.processRequest(prompt);
5270
+ }
5271
+ /**
5272
+ * Show defensive command banner.
5273
+ */
5274
+ showDefensiveBanner(command, evidenceDir) {
5275
+ const commandLabels = {
5276
+ '/defend': 'Full Defensive Security Scan',
5277
+ '/scan': 'Targeted Security Scan',
5278
+ '/detect': 'Intrusion Detection',
5279
+ '/harden': 'Security Hardening Check',
5280
+ '/evidence': 'Forensic Evidence Collection',
5281
+ };
5282
+ const lines = [
5283
+ '',
5284
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5285
+ theme.gradient.primary(` ${commandLabels[command] || 'Defensive Security'}`),
5286
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5287
+ '',
5288
+ theme.bold('Mode: ') + 'DEFENSIVE (scanning YOUR device)',
5289
+ theme.bold('Evidence: ') + evidenceDir,
5290
+ '',
5291
+ theme.secondary('Capabilities:'),
5292
+ ' • Intrusion indicator detection',
5293
+ ' • Process and network analysis',
5294
+ ' • Persistence mechanism audit',
5295
+ ' • Security hardening assessment',
5296
+ ' • Forensic evidence collection',
5297
+ ' • Chain of custody documentation',
5298
+ '',
5299
+ theme.ui.muted('This scan only analyzes YOUR OWN device.'),
5300
+ theme.ui.muted('Press Ctrl+C to abort.'),
5301
+ '',
5302
+ ];
5303
+ display.showSystemMessage(lines.join('\n'));
5304
+ }
5305
+ /**
5306
+ * Show defensive command help.
5307
+ */
5308
+ showDefensiveHelp() {
5309
+ const lines = [
5310
+ theme.gradient.primary('Defensive Security Commands'),
5311
+ '',
5312
+ theme.bold('/defend [--evidence-dir=<path>]'),
5313
+ ' Run full defensive security scan with evidence collection',
5314
+ '',
5315
+ theme.bold('/scan [process|network|persistence|all]'),
5316
+ ' Scan specific area for intrusion indicators',
5317
+ '',
5318
+ theme.bold('/detect'),
5319
+ ' Detect intrusion indicators and map to MITRE ATT&CK',
5320
+ '',
5321
+ theme.bold('/harden'),
5322
+ ' Check security hardening and get recommendations',
5323
+ '',
5324
+ theme.bold('/evidence <purpose>'),
5325
+ ' Collect forensic evidence package for legal/LE submission',
5326
+ '',
5327
+ theme.secondary('Examples:'),
5328
+ ' /defend - Full defensive scan',
5329
+ ' /scan network - Scan network connections only',
5330
+ ' /harden - Check hardening status',
5331
+ ' /evidence "Incident on 2024-01" - Collect evidence with purpose',
5332
+ '',
5333
+ theme.secondary('Output:'),
5334
+ ' • Security posture assessment',
5335
+ ' • Intrusion indicators with MITRE ATT&CK mapping',
5336
+ ' • Remediation recommendations',
5337
+ ' • Forensic evidence package with hashes',
5338
+ ' • Chain of custody documentation',
5339
+ ];
5340
+ display.showSystemMessage(lines.join('\n'));
5341
+ }
5342
+ // ═══════════════════════════════════════════════════════════════════════════════
5343
+ // THREAT INTELLIGENCE COMMAND HANDLERS
5344
+ // ═══════════════════════════════════════════════════════════════════════════════
5345
+ // OFFENSIVE TRANSPARENCY COMMAND HANDLERS
5346
+ // ═══════════════════════════════════════════════════════════════════════════════
5347
+ /**
5348
+ * Handle offensive transparency commands.
5349
+ * These are LEGAL offensive operations for deterrence and transparency.
5350
+ *
5351
+ * Usage:
5352
+ * /offensive [full|probe|complaints|disclosure] - Run offensive transparency
5353
+ * /probe - Probe Apple infrastructure
5354
+ * /expose - Expose Key Transparency lies
5355
+ * /complain - Generate regulatory complaints
5356
+ * /disclose - Create disclosure package
5357
+ * /block-telemetry - Generate telemetry blocking rules
5358
+ */
5359
+ async handleOffensiveCommand(input) {
5360
+ if (this.isProcessing) {
5361
+ this.showSlashWarning('Wait for the current operation to finish.');
5362
+ return;
5363
+ }
5364
+ const parts = input.trim().split(/\s+/);
5365
+ const command = parts[0]?.toLowerCase() || '/offensive';
5366
+ const args = parts.slice(1).join(' ');
5367
+ // Map command to operation
5368
+ let operation = 'full';
5369
+ if (command === '/probe') {
5370
+ operation = 'probe';
5371
+ }
5372
+ else if (command === '/expose') {
5373
+ operation = 'key-transparency';
5374
+ }
5375
+ else if (command === '/complain') {
5376
+ operation = 'complaints';
5377
+ }
5378
+ else if (command === '/disclose') {
5379
+ operation = 'disclosure';
5380
+ }
5381
+ else if (command === '/block-telemetry') {
5382
+ operation = 'telemetry';
5383
+ }
5384
+ else if (args) {
5385
+ // Parse operation from args
5386
+ const validOps = ['full', 'probe', 'key-transparency', 'telemetry', 'complaints', 'disclosure'];
5387
+ if (validOps.includes(args.toLowerCase())) {
5388
+ operation = args.toLowerCase();
5389
+ }
5390
+ }
5391
+ // Parse evidence directory
5392
+ const evidenceDirArg = parts.find(a => a.startsWith('--evidence-dir='));
5393
+ const evidenceDir = evidenceDirArg
5394
+ ? evidenceDirArg.replace('--evidence-dir=', '')
5395
+ : `${this.workingDir}/.erosolar/evidence/offensive-${new Date().toISOString().split('T')[0]}`;
5396
+ // Show offensive banner
5397
+ this.showOffensiveBanner(operation, evidenceDir);
5398
+ // Build the prompt
5399
+ const prompt = this.buildOffensivePrompt(operation, evidenceDir);
5400
+ await this.processRequest(prompt);
5401
+ }
5402
+ /**
5403
+ * Build the AI prompt for offensive transparency operations.
5404
+ */
5405
+ buildOffensivePrompt(operation, evidenceDir) {
5406
+ const prompts = {
5407
+ full: `Execute a FULL offensive transparency operation using the offensive_transparency tool.
5408
+
5409
+ Operation: full
5410
+ Evidence Directory: ${evidenceDir}
5411
+
5412
+ This performs ALL legal offensive operations:
5413
+ 1. Probe all Apple infrastructure endpoints
5414
+ 2. Verify Key Transparency (expose lies about auditability)
5415
+ 3. Analyze and block telemetry
5416
+ 4. Generate regulatory complaints (FTC, DOJ, EU DMA)
5417
+ 5. Create public disclosure package
5418
+
5419
+ Generate complete evidence with cryptographic hashes for:
5420
+ - Legal proceedings
5421
+ - Regulatory filings
5422
+ - Public disclosure
5423
+ - Media releases`,
5424
+ probe: `Execute an infrastructure probing operation using the offensive_transparency tool.
5425
+
5426
+ Operation: probe
5427
+ Evidence Directory: ${evidenceDir}
5428
+
5429
+ Probe ALL public Apple endpoints:
5430
+ - Identity and authentication servers
5431
+ - Key and message services
5432
+ - Push notification infrastructure
5433
+ - iCloud gateways
5434
+ - Escrow services
5435
+ - Update and control servers
5436
+
5437
+ Document TLS configurations, certificate chains, and security anomalies.`,
5438
+ 'key-transparency': `Execute Key Transparency exposure using the offensive_transparency tool.
5439
+
5440
+ Operation: key-transparency
5441
+ Evidence Directory: ${evidenceDir}
5442
+
5443
+ EXPOSE Apple's Key Transparency lies:
5444
+ 1. Probe Key Transparency endpoints
5445
+ 2. Verify if public audit is actually available (it's not)
5446
+ 3. Check for Merkle proof accessibility (missing)
5447
+ 4. Document the gap between claims and reality
5448
+
5449
+ This proves Apple's "Key Transparency" is a marketing claim, not a technical guarantee.`,
5450
+ telemetry: `Execute telemetry analysis and blocking using the offensive_transparency tool.
5451
+
5452
+ Operation: telemetry
5453
+ Evidence Directory: ${evidenceDir}
5454
+
5455
+ 1. Analyze current Apple telemetry connections
5456
+ 2. Identify data leakage to Apple
5457
+ 3. Generate hosts file blocking rules
5458
+ 4. Generate PF firewall rules
5459
+ 5. List LaunchDaemons to disable
5460
+ 6. Provide system preference changes
5461
+
5462
+ Give user ability to BLOCK Apple's surveillance of their own device.`,
5463
+ complaints: `Generate regulatory complaints using the offensive_transparency tool.
5464
+
5465
+ Operation: complaints
5466
+ Evidence Directory: ${evidenceDir}
5467
+
5468
+ Generate READY-TO-FILE complaints for:
5469
+
5470
+ 1. FTC (Federal Trade Commission)
5471
+ - Deceptive end-to-end encryption claims
5472
+ - Consumer protection violations
5473
+
5474
+ 2. DOJ (Department of Justice)
5475
+ - Antitrust violations
5476
+ - Monopolistic control of security infrastructure
5477
+
5478
+ 3. EU DMA (Digital Markets Act)
5479
+ - Gatekeeper violations
5480
+ - Interoperability requirements
5481
+
5482
+ Each complaint includes allegations, evidence references, and requested remedies.`,
5483
+ disclosure: `Create public disclosure package using the offensive_transparency tool.
5484
+
5485
+ Operation: disclosure
5486
+ Evidence Directory: ${evidenceDir}
5487
+
5488
+ Generate complete disclosure materials:
5489
+
5490
+ 1. Technical findings report
5491
+ 2. Impact assessment
5492
+ 3. Affected parties list
5493
+ 4. Timeline of events
5494
+ 5. Evidence with SHA-256 hashes
5495
+ 6. Media kit:
5496
+ - Summary for journalists
5497
+ - Key points
5498
+ - Quotable findings
5499
+ 7. Press release template
5500
+ 8. Coordinated disclosure document
5501
+
5502
+ Ready for responsible disclosure or public release.`,
5503
+ };
5504
+ return (prompts[operation] ?? prompts['full']);
5505
+ }
5506
+ /**
5507
+ * Show offensive operation banner.
5508
+ */
5509
+ showOffensiveBanner(operation, evidenceDir) {
5510
+ const opLabels = {
5511
+ full: 'Full Offensive Transparency',
5512
+ probe: 'Infrastructure Probing',
5513
+ 'key-transparency': 'Key Transparency Exposure',
5514
+ telemetry: 'Telemetry Analysis & Blocking',
5515
+ complaints: 'Regulatory Complaint Generation',
5516
+ disclosure: 'Public Disclosure Package',
5517
+ };
5518
+ const lines = [
5519
+ '',
5520
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5521
+ theme.gradient.primary(` ${opLabels[operation] || 'Offensive Transparency'}`),
5522
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5523
+ '',
5524
+ theme.bold('Mode: ') + 'OFFENSIVE (legal deterrence operations)',
5525
+ theme.bold('Operation: ') + operation.toUpperCase(),
5526
+ theme.bold('Evidence: ') + evidenceDir,
5527
+ '',
5528
+ theme.secondary('Legal offensive capabilities:'),
5529
+ ' • Probe public Apple endpoints',
5530
+ ' • Expose Key Transparency lies',
5531
+ ' • Block Apple telemetry on YOUR device',
5532
+ ' • Generate regulatory complaints',
5533
+ ' • Create disclosure packages',
5534
+ '',
5535
+ theme.warning('This is LEGAL - probing public endpoints, filing complaints,'),
5536
+ theme.warning('blocking telemetry on your device, and public disclosure.'),
5537
+ '',
5538
+ theme.ui.muted('Press Ctrl+C to abort.'),
5539
+ '',
5540
+ ];
5541
+ display.showSystemMessage(lines.join('\n'));
5542
+ }
5543
+ /**
5544
+ * Show offensive command help.
5545
+ */
5546
+ showOffensiveHelp() {
5547
+ const lines = [
5548
+ theme.gradient.primary('Offensive Transparency Commands'),
5549
+ '',
5550
+ theme.bold('/offensive [operation]'),
5551
+ ' Run offensive transparency operations',
5552
+ ' Operations: full, probe, key-transparency, telemetry, complaints, disclosure',
5553
+ '',
5554
+ theme.bold('/probe'),
5555
+ ' Probe all Apple infrastructure endpoints',
5556
+ '',
5557
+ theme.bold('/expose'),
5558
+ ' Expose Key Transparency lies (not actually auditable)',
5559
+ '',
5560
+ theme.bold('/complain'),
5561
+ ' Generate regulatory complaints (FTC, DOJ, EU DMA)',
5562
+ '',
5563
+ theme.bold('/disclose'),
5564
+ ' Create public disclosure package with media kit',
5565
+ '',
5566
+ theme.bold('/block-telemetry'),
5567
+ ' Generate rules to block Apple telemetry on YOUR device',
5568
+ '',
5569
+ theme.secondary('Examples:'),
5570
+ ' /offensive - Full offensive operation',
5571
+ ' /offensive probe - Probe infrastructure only',
5572
+ ' /probe - Shortcut for probing',
5573
+ ' /complain - Generate regulatory complaints',
5574
+ ' /disclose - Create disclosure package',
5575
+ '',
5576
+ theme.secondary('Output:'),
5577
+ ' • Evidence with SHA-256 hashes',
5578
+ ' • Ready-to-file regulatory complaints',
5579
+ ' • Media kit for journalists',
5580
+ ' • Press release template',
5581
+ ' • Telemetry blocking rules',
5582
+ '',
5583
+ theme.warning('All operations are LEGAL:'),
5584
+ ' • Probing public endpoints',
5585
+ ' • Filing regulatory complaints',
5586
+ ' • Blocking telemetry on your device',
5587
+ ' • Public disclosure (free speech)',
5588
+ ];
5589
+ display.showSystemMessage(lines.join('\n'));
5590
+ }
5591
+ // ═══════════════════════════════════════════════════════════════════════════════
5592
+ /**
5593
+ * Handle threat intelligence commands.
5594
+ * These analyze threat actors, attack vectors, and demonstrate capability awareness.
5595
+ *
5596
+ * Usage:
5597
+ * /threat [--evidence-dir=<path>] - Generate full threat intelligence report
5598
+ * /actors [actor-id] - List/detail threat actors
5599
+ * /vectors [category] - List attack vectors
5600
+ * /ioc - Scan for indicators of compromise
5601
+ * /capability [actor-id] - Assess threat actor capabilities
5602
+ */
5603
+ async handleIntelCommand(input) {
5604
+ if (this.isProcessing) {
5605
+ this.showSlashWarning('Wait for the current operation to finish.');
5606
+ return;
5607
+ }
5608
+ const parts = input.trim().split(/\s+/);
5609
+ const command = parts[0]?.toLowerCase() || '/threat';
5610
+ const args = parts.slice(1);
5611
+ // Parse evidence directory
5612
+ const evidenceDirArg = args.find(a => a.startsWith('--evidence-dir='));
5613
+ const evidenceDir = evidenceDirArg
5614
+ ? evidenceDirArg.replace('--evidence-dir=', '')
5615
+ : `${this.workingDir}/.erosolar/evidence/threat-intel-${new Date().toISOString().split('T')[0]}`;
5616
+ // Show banner
5617
+ this.showThreatIntelBanner(command, evidenceDir);
5618
+ // Build appropriate prompt
5619
+ let prompt = '';
5620
+ switch (command) {
5621
+ case '/actors': {
5622
+ const actorId = args.find(a => !a.startsWith('--'));
5623
+ prompt = `Analyze threat actors using the threat_intelligence tool.
5624
+
5625
+ ${actorId ? `Focus on actor: ${actorId}` : 'List all known threat actors'}
5626
+
5627
+ Provide:
5628
+ 1. Threat actor profiles (type, capabilities, TTPs)
5629
+ 2. Known infrastructure they control
5630
+ 3. Targeting profiles
5631
+ 4. Attribution confidence
5632
+
5633
+ This analysis helps understand WHO might attack and HOW.`;
5634
+ break;
5635
+ }
5636
+ case '/vectors': {
5637
+ const category = args.find(a => ['network', 'application', 'supply-chain', 'physical', 'social'].includes(a.toLowerCase()));
5638
+ prompt = `Analyze attack vectors using the threat_intelligence tool.
5639
+
5640
+ ${category ? `Focus on category: ${category}` : 'Analyze all attack vector categories'}
5641
+
5642
+ For each vector provide:
5643
+ 1. MITRE ATT&CK mapping
5644
+ 2. Prerequisites for attack
5645
+ 3. User defense capability (none/partial/full)
5646
+ 4. Detection methods
5647
+ 5. Evidence indicators
5648
+
5649
+ This demonstrates understanding of HOW attacks are conducted.`;
5650
+ break;
5651
+ }
5652
+ case '/ioc':
5653
+ prompt = `Scan for Indicators of Compromise (IOCs) using the threat_intelligence tool.
5654
+
5655
+ Evidence Directory: ${evidenceDir}
5656
+
5657
+ Scan for:
5658
+ 1. Suspicious network connections
5659
+ 2. Certificate anomalies
5660
+ 3. Persistence mechanisms
5661
+ 4. Kernel extensions
5662
+ 5. DNS resolution anomalies
5663
+
5664
+ Generate IOC report with confidence scores and context.`;
5665
+ break;
5666
+ case '/capability': {
5667
+ const actorId = args.find(a => !a.startsWith('--')) || 'ta-apple-internal';
5668
+ prompt = `Assess threat actor capabilities using the threat_intelligence tool.
5669
+
5670
+ Target Actor: ${actorId}
5671
+ Evidence Directory: ${evidenceDir}
5672
+
5673
+ For each capability assess:
5674
+ 1. Technical requirements
5675
+ 2. Resource requirements
5676
+ 3. Likelihood of use
5677
+ 4. Impact if used
5678
+ 5. Detection methods
5679
+ 6. Available mitigations
5680
+
5681
+ This DEMONSTRATES our understanding of attacker capabilities,
5682
+ which is a form of deterrence through transparency.`;
5683
+ break;
5684
+ }
5685
+ default: // /threat or /intel-report
5686
+ prompt = `Generate a comprehensive threat intelligence report using the threat_intelligence tool.
5687
+
5688
+ Evidence Directory: ${evidenceDir}
5689
+
5690
+ Include:
5691
+ 1. THREAT ACTOR ANALYSIS
5692
+ - Known threat actors with access to target platform
5693
+ - Capabilities, TTPs, and infrastructure
5694
+ - Attribution confidence levels
5695
+
5696
+ 2. ATTACK VECTOR CATALOG
5697
+ - All applicable attack vectors
5698
+ - MITRE ATT&CK mapping
5699
+ - User defense capability for each
5700
+
5701
+ 3. INDICATOR OF COMPROMISE SCAN
5702
+ - Current IOCs on this system
5703
+ - Confidence scores
5704
+ - Recommended response
5705
+
5706
+ 4. CAPABILITY ASSESSMENT
5707
+ - Detailed analysis of primary threat actor capabilities
5708
+ - Impact and likelihood assessments
5709
+ - Detection and mitigation options
5710
+
5711
+ 5. RISK SCORING
5712
+ - Overall risk score
5713
+ - Breakdown by category
5714
+
5715
+ 6. RECOMMENDATIONS
5716
+ - Immediate actions
5717
+ - Long-term strategy
5718
+ - Legal/regulatory options
5719
+
5720
+ This report demonstrates comprehensive threat understanding,
5721
+ serving as both intelligence and deterrence documentation.`;
5722
+ }
5723
+ await this.processRequest(prompt);
5724
+ }
5725
+ /**
5726
+ * Show threat intelligence banner.
5727
+ */
5728
+ showThreatIntelBanner(command, evidenceDir) {
5729
+ const commandLabels = {
5730
+ '/threat': 'Comprehensive Threat Intelligence Report',
5731
+ '/intel-report': 'Comprehensive Threat Intelligence Report',
5732
+ '/actors': 'Threat Actor Analysis',
5733
+ '/vectors': 'Attack Vector Catalog',
5734
+ '/ioc': 'Indicator of Compromise Scan',
5735
+ '/capability': 'Capability Assessment',
5736
+ };
5737
+ const lines = [
5738
+ '',
5739
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5740
+ theme.gradient.primary(` ${commandLabels[command] || 'Threat Intelligence'}`),
5741
+ theme.gradient.primary('═══════════════════════════════════════════════════════════'),
5742
+ '',
5743
+ theme.bold('Mode: ') + 'INTELLIGENCE (analyzing threats against YOU)',
5744
+ theme.bold('Evidence: ') + evidenceDir,
5745
+ '',
5746
+ theme.secondary('Capabilities:'),
5747
+ ' • Threat actor profiling',
5748
+ ' • Attack vector analysis with MITRE ATT&CK',
5749
+ ' • Indicator of Compromise detection',
5750
+ ' • Capability assessment',
5751
+ ' • Risk scoring and recommendations',
5752
+ '',
5753
+ theme.ui.muted('This analysis demonstrates threat understanding.'),
5754
+ theme.ui.muted('Understanding capabilities is a form of deterrence.'),
5755
+ '',
5756
+ ];
5757
+ display.showSystemMessage(lines.join('\n'));
5758
+ }
5759
+ // ═══════════════════════════════════════════════════════════════════════════════
4770
5760
  // ATTACK CHAIN COMMAND HANDLERS
4771
5761
  // ═══════════════════════════════════════════════════════════════════════════════
4772
5762
  /**
@@ -4872,10 +5862,11 @@ export class InteractiveShell {
4872
5862
  });
4873
5863
  }
4874
5864
  /**
4875
- * Gather intelligence on targets.
5865
+ * Gather intelligence on targets (attack chain mode).
4876
5866
  * Usage: /intel <targets>
5867
+ * Note: Different from handleIntelCommand which handles threat intel commands
4877
5868
  */
4878
- async handleIntelCommand(input) {
5869
+ async handleIntelCollectionCommand(input) {
4879
5870
  if (this.isProcessing) {
4880
5871
  this.showSlashWarning('Wait for the current operation to finish.');
4881
5872
  return;
@@ -6487,7 +7478,8 @@ export class InteractiveShell {
6487
7478
  this.autosaveIfEnabled();
6488
7479
  // Track metrics with Alpha Zero 2
6489
7480
  elapsedMs = Date.now() - requestStartTime;
6490
- this.alphaZeroMetrics.recordMessage(elapsedMs);
7481
+ this.alphaZeroMetrics.recordMessage();
7482
+ this.alphaZeroMetrics.recordResponseTime(elapsedMs);
6491
7483
  if (!responseText?.trim()) {
6492
7484
  display.showWarning('The provider returned an empty response. Check your API key/provider selection or retry the prompt.');
6493
7485
  }
@@ -6496,7 +7488,9 @@ export class InteractiveShell {
6496
7488
  ? orchestratorResult.toolsUsed
6497
7489
  : this.getExecutedTools(responseText);
6498
7490
  this.currentToolCalls = toolsUsed.map(name => ({
7491
+ toolName: name,
6499
7492
  name,
7493
+ args: {},
6500
7494
  arguments: {},
6501
7495
  success: true, // Assume success if we got here
6502
7496
  duration: 0,
@@ -6575,6 +7569,7 @@ export class InteractiveShell {
6575
7569
  const toolPattern = {
6576
7570
  taskType: this.currentTaskType,
6577
7571
  toolSequence: this.currentToolCalls.map(t => t.name),
7572
+ success: true,
6578
7573
  successRate: 1.0,
6579
7574
  avgDuration: elapsedMs,
6580
7575
  occurrences: 1,