erosolar-cli 1.7.340 → 1.7.342

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 (327) hide show
  1. package/README.md +24 -148
  2. package/dist/bin/erosolar.js +5 -21
  3. package/dist/bin/erosolar.js.map +1 -1
  4. package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
  5. package/dist/capabilities/agentSpawningCapability.js +56 -31
  6. package/dist/capabilities/agentSpawningCapability.js.map +1 -1
  7. package/dist/contracts/agent-schemas.json +0 -15
  8. package/dist/contracts/tools.schema.json +0 -9
  9. package/dist/core/agent.d.ts +2 -2
  10. package/dist/core/agent.d.ts.map +1 -1
  11. package/dist/core/agent.js.map +1 -1
  12. package/dist/core/customCommands.d.ts +1 -0
  13. package/dist/core/customCommands.d.ts.map +1 -1
  14. package/dist/core/customCommands.js +3 -0
  15. package/dist/core/customCommands.js.map +1 -1
  16. package/dist/core/hooks.d.ts +113 -0
  17. package/dist/core/hooks.d.ts.map +1 -0
  18. package/dist/core/hooks.js +267 -0
  19. package/dist/core/hooks.js.map +1 -0
  20. package/dist/core/metricsTracker.d.ts +122 -0
  21. package/dist/core/metricsTracker.d.ts.map +1 -0
  22. package/dist/{alpha-zero → core}/metricsTracker.js +2 -5
  23. package/dist/core/metricsTracker.js.map +1 -0
  24. package/dist/core/securityAssessment.d.ts +91 -0
  25. package/dist/core/securityAssessment.d.ts.map +1 -0
  26. package/dist/core/securityAssessment.js +580 -0
  27. package/dist/core/securityAssessment.js.map +1 -0
  28. package/dist/core/sessionStore.d.ts +2 -0
  29. package/dist/core/sessionStore.d.ts.map +1 -1
  30. package/dist/core/sessionStore.js +1 -0
  31. package/dist/core/sessionStore.js.map +1 -1
  32. package/dist/core/toolPreconditions.d.ts.map +1 -1
  33. package/dist/core/toolPreconditions.js +0 -14
  34. package/dist/core/toolPreconditions.js.map +1 -1
  35. package/dist/core/toolRuntime.d.ts +22 -1
  36. package/dist/core/toolRuntime.d.ts.map +1 -1
  37. package/dist/core/toolRuntime.js +0 -5
  38. package/dist/core/toolRuntime.js.map +1 -1
  39. package/dist/core/toolValidation.d.ts.map +1 -1
  40. package/dist/core/toolValidation.js +14 -3
  41. package/dist/core/toolValidation.js.map +1 -1
  42. package/dist/core/validationRunner.d.ts +1 -3
  43. package/dist/core/validationRunner.d.ts.map +1 -1
  44. package/dist/core/validationRunner.js.map +1 -1
  45. package/dist/core/verification.d.ts +137 -0
  46. package/dist/core/verification.d.ts.map +1 -0
  47. package/dist/core/verification.js +323 -0
  48. package/dist/core/verification.js.map +1 -0
  49. package/dist/headless/headlessApp.d.ts.map +1 -1
  50. package/dist/headless/headlessApp.js +21 -0
  51. package/dist/headless/headlessApp.js.map +1 -1
  52. package/dist/mcp/sseClient.d.ts.map +1 -1
  53. package/dist/mcp/sseClient.js +9 -18
  54. package/dist/mcp/sseClient.js.map +1 -1
  55. package/dist/plugins/tools/build/buildPlugin.d.ts +0 -6
  56. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  57. package/dist/plugins/tools/build/buildPlugin.js +4 -10
  58. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  59. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  60. package/dist/plugins/tools/nodeDefaults.js +0 -2
  61. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  62. package/dist/runtime/agentSession.d.ts +2 -2
  63. package/dist/runtime/agentSession.d.ts.map +1 -1
  64. package/dist/runtime/agentSession.js +2 -2
  65. package/dist/runtime/agentSession.js.map +1 -1
  66. package/dist/shell/interactiveShell.d.ts +19 -7
  67. package/dist/shell/interactiveShell.d.ts.map +1 -1
  68. package/dist/shell/interactiveShell.js +271 -166
  69. package/dist/shell/interactiveShell.js.map +1 -1
  70. package/dist/shell/shellApp.d.ts +2 -0
  71. package/dist/shell/shellApp.d.ts.map +1 -1
  72. package/dist/shell/shellApp.js +82 -9
  73. package/dist/shell/shellApp.js.map +1 -1
  74. package/dist/shell/systemPrompt.d.ts.map +1 -1
  75. package/dist/shell/systemPrompt.js +1 -4
  76. package/dist/shell/systemPrompt.js.map +1 -1
  77. package/dist/shell/terminalInput.d.ts +215 -120
  78. package/dist/shell/terminalInput.d.ts.map +1 -1
  79. package/dist/shell/terminalInput.js +926 -537
  80. package/dist/shell/terminalInput.js.map +1 -1
  81. package/dist/shell/terminalInputAdapter.d.ts +99 -21
  82. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  83. package/dist/shell/terminalInputAdapter.js +131 -30
  84. package/dist/shell/terminalInputAdapter.js.map +1 -1
  85. package/dist/subagents/agentConfig.d.ts +27 -0
  86. package/dist/subagents/agentConfig.d.ts.map +1 -0
  87. package/dist/subagents/agentConfig.js +89 -0
  88. package/dist/subagents/agentConfig.js.map +1 -0
  89. package/dist/subagents/agentRegistry.d.ts +33 -0
  90. package/dist/subagents/agentRegistry.d.ts.map +1 -0
  91. package/dist/subagents/agentRegistry.js +162 -0
  92. package/dist/subagents/agentRegistry.js.map +1 -0
  93. package/dist/subagents/taskRunner.d.ts +7 -1
  94. package/dist/subagents/taskRunner.d.ts.map +1 -1
  95. package/dist/subagents/taskRunner.js +180 -47
  96. package/dist/subagents/taskRunner.js.map +1 -1
  97. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  98. package/dist/ui/ShellUIAdapter.js +13 -12
  99. package/dist/ui/ShellUIAdapter.js.map +1 -1
  100. package/dist/ui/display.d.ts +24 -45
  101. package/dist/ui/display.d.ts.map +1 -1
  102. package/dist/ui/display.js +140 -259
  103. package/dist/ui/display.js.map +1 -1
  104. package/dist/ui/theme.d.ts.map +1 -1
  105. package/dist/ui/theme.js +6 -8
  106. package/dist/ui/theme.js.map +1 -1
  107. package/dist/ui/toolDisplay.d.ts +0 -158
  108. package/dist/ui/toolDisplay.d.ts.map +1 -1
  109. package/dist/ui/toolDisplay.js +0 -348
  110. package/dist/ui/toolDisplay.js.map +1 -1
  111. package/dist/ui/unified/layout.d.ts +1 -0
  112. package/dist/ui/unified/layout.d.ts.map +1 -1
  113. package/dist/ui/unified/layout.js +15 -25
  114. package/dist/ui/unified/layout.js.map +1 -1
  115. package/dist/utils/frontmatter.d.ts +10 -0
  116. package/dist/utils/frontmatter.d.ts.map +1 -0
  117. package/dist/utils/frontmatter.js +78 -0
  118. package/dist/utils/frontmatter.js.map +1 -0
  119. package/package.json +4 -4
  120. package/dist/alpha-zero/agentWrapper.d.ts +0 -84
  121. package/dist/alpha-zero/agentWrapper.d.ts.map +0 -1
  122. package/dist/alpha-zero/agentWrapper.js +0 -171
  123. package/dist/alpha-zero/agentWrapper.js.map +0 -1
  124. package/dist/alpha-zero/codeEvaluator.d.ts +0 -25
  125. package/dist/alpha-zero/codeEvaluator.d.ts.map +0 -1
  126. package/dist/alpha-zero/codeEvaluator.js +0 -273
  127. package/dist/alpha-zero/codeEvaluator.js.map +0 -1
  128. package/dist/alpha-zero/competitiveRunner.d.ts +0 -66
  129. package/dist/alpha-zero/competitiveRunner.d.ts.map +0 -1
  130. package/dist/alpha-zero/competitiveRunner.js +0 -224
  131. package/dist/alpha-zero/competitiveRunner.js.map +0 -1
  132. package/dist/alpha-zero/index.d.ts +0 -67
  133. package/dist/alpha-zero/index.d.ts.map +0 -1
  134. package/dist/alpha-zero/index.js +0 -99
  135. package/dist/alpha-zero/index.js.map +0 -1
  136. package/dist/alpha-zero/introspection.d.ts +0 -128
  137. package/dist/alpha-zero/introspection.d.ts.map +0 -1
  138. package/dist/alpha-zero/introspection.js +0 -300
  139. package/dist/alpha-zero/introspection.js.map +0 -1
  140. package/dist/alpha-zero/metricsTracker.d.ts +0 -71
  141. package/dist/alpha-zero/metricsTracker.d.ts.map +0 -1
  142. package/dist/alpha-zero/metricsTracker.js.map +0 -1
  143. package/dist/alpha-zero/security/core.d.ts +0 -125
  144. package/dist/alpha-zero/security/core.d.ts.map +0 -1
  145. package/dist/alpha-zero/security/core.js +0 -271
  146. package/dist/alpha-zero/security/core.js.map +0 -1
  147. package/dist/alpha-zero/security/google.d.ts +0 -125
  148. package/dist/alpha-zero/security/google.d.ts.map +0 -1
  149. package/dist/alpha-zero/security/google.js +0 -311
  150. package/dist/alpha-zero/security/google.js.map +0 -1
  151. package/dist/alpha-zero/security/googleLoader.d.ts +0 -17
  152. package/dist/alpha-zero/security/googleLoader.d.ts.map +0 -1
  153. package/dist/alpha-zero/security/googleLoader.js +0 -41
  154. package/dist/alpha-zero/security/googleLoader.js.map +0 -1
  155. package/dist/alpha-zero/security/index.d.ts +0 -29
  156. package/dist/alpha-zero/security/index.d.ts.map +0 -1
  157. package/dist/alpha-zero/security/index.js +0 -32
  158. package/dist/alpha-zero/security/index.js.map +0 -1
  159. package/dist/alpha-zero/security/simulation.d.ts +0 -124
  160. package/dist/alpha-zero/security/simulation.d.ts.map +0 -1
  161. package/dist/alpha-zero/security/simulation.js +0 -277
  162. package/dist/alpha-zero/security/simulation.js.map +0 -1
  163. package/dist/alpha-zero/selfModification.d.ts +0 -109
  164. package/dist/alpha-zero/selfModification.d.ts.map +0 -1
  165. package/dist/alpha-zero/selfModification.js +0 -233
  166. package/dist/alpha-zero/selfModification.js.map +0 -1
  167. package/dist/alpha-zero/types.d.ts +0 -170
  168. package/dist/alpha-zero/types.d.ts.map +0 -1
  169. package/dist/alpha-zero/types.js +0 -31
  170. package/dist/alpha-zero/types.js.map +0 -1
  171. package/dist/capabilities/securityTestingCapability.d.ts +0 -13
  172. package/dist/capabilities/securityTestingCapability.d.ts.map +0 -1
  173. package/dist/capabilities/securityTestingCapability.js +0 -25
  174. package/dist/capabilities/securityTestingCapability.js.map +0 -1
  175. package/dist/core/aiFlowOptimizer.d.ts +0 -26
  176. package/dist/core/aiFlowOptimizer.d.ts.map +0 -1
  177. package/dist/core/aiFlowOptimizer.js +0 -31
  178. package/dist/core/aiFlowOptimizer.js.map +0 -1
  179. package/dist/core/aiOptimizationEngine.d.ts +0 -158
  180. package/dist/core/aiOptimizationEngine.d.ts.map +0 -1
  181. package/dist/core/aiOptimizationEngine.js +0 -428
  182. package/dist/core/aiOptimizationEngine.js.map +0 -1
  183. package/dist/core/aiOptimizationIntegration.d.ts +0 -93
  184. package/dist/core/aiOptimizationIntegration.d.ts.map +0 -1
  185. package/dist/core/aiOptimizationIntegration.js +0 -250
  186. package/dist/core/aiOptimizationIntegration.js.map +0 -1
  187. package/dist/core/enhancedErrorRecovery.d.ts +0 -100
  188. package/dist/core/enhancedErrorRecovery.d.ts.map +0 -1
  189. package/dist/core/enhancedErrorRecovery.js +0 -345
  190. package/dist/core/enhancedErrorRecovery.js.map +0 -1
  191. package/dist/core/hooksSystem.d.ts +0 -65
  192. package/dist/core/hooksSystem.d.ts.map +0 -1
  193. package/dist/core/hooksSystem.js +0 -273
  194. package/dist/core/hooksSystem.js.map +0 -1
  195. package/dist/core/memorySystem.d.ts +0 -48
  196. package/dist/core/memorySystem.d.ts.map +0 -1
  197. package/dist/core/memorySystem.js +0 -271
  198. package/dist/core/memorySystem.js.map +0 -1
  199. package/dist/core/unified/errors.d.ts +0 -189
  200. package/dist/core/unified/errors.d.ts.map +0 -1
  201. package/dist/core/unified/errors.js +0 -497
  202. package/dist/core/unified/errors.js.map +0 -1
  203. package/dist/core/unified/index.d.ts +0 -19
  204. package/dist/core/unified/index.d.ts.map +0 -1
  205. package/dist/core/unified/index.js +0 -68
  206. package/dist/core/unified/index.js.map +0 -1
  207. package/dist/core/unified/schema.d.ts +0 -101
  208. package/dist/core/unified/schema.d.ts.map +0 -1
  209. package/dist/core/unified/schema.js +0 -350
  210. package/dist/core/unified/schema.js.map +0 -1
  211. package/dist/core/unified/toolRuntime.d.ts +0 -179
  212. package/dist/core/unified/toolRuntime.d.ts.map +0 -1
  213. package/dist/core/unified/toolRuntime.js +0 -517
  214. package/dist/core/unified/toolRuntime.js.map +0 -1
  215. package/dist/core/unified/tools.d.ts +0 -127
  216. package/dist/core/unified/tools.d.ts.map +0 -1
  217. package/dist/core/unified/tools.js +0 -1333
  218. package/dist/core/unified/tools.js.map +0 -1
  219. package/dist/core/unified/types.d.ts +0 -352
  220. package/dist/core/unified/types.d.ts.map +0 -1
  221. package/dist/core/unified/types.js +0 -12
  222. package/dist/core/unified/types.js.map +0 -1
  223. package/dist/core/unified/version.d.ts +0 -209
  224. package/dist/core/unified/version.d.ts.map +0 -1
  225. package/dist/core/unified/version.js +0 -454
  226. package/dist/core/unified/version.js.map +0 -1
  227. package/dist/plugins/tools/security/securityPlugin.d.ts +0 -3
  228. package/dist/plugins/tools/security/securityPlugin.d.ts.map +0 -1
  229. package/dist/plugins/tools/security/securityPlugin.js +0 -12
  230. package/dist/plugins/tools/security/securityPlugin.js.map +0 -1
  231. package/dist/security/active-stack-security.d.ts +0 -112
  232. package/dist/security/active-stack-security.d.ts.map +0 -1
  233. package/dist/security/active-stack-security.js +0 -296
  234. package/dist/security/active-stack-security.js.map +0 -1
  235. package/dist/security/advanced-persistence-research.d.ts +0 -92
  236. package/dist/security/advanced-persistence-research.d.ts.map +0 -1
  237. package/dist/security/advanced-persistence-research.js +0 -195
  238. package/dist/security/advanced-persistence-research.js.map +0 -1
  239. package/dist/security/advanced-targeting.d.ts +0 -119
  240. package/dist/security/advanced-targeting.d.ts.map +0 -1
  241. package/dist/security/advanced-targeting.js +0 -233
  242. package/dist/security/advanced-targeting.js.map +0 -1
  243. package/dist/security/assessment/vulnerabilityAssessment.d.ts +0 -104
  244. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +0 -1
  245. package/dist/security/assessment/vulnerabilityAssessment.js +0 -315
  246. package/dist/security/assessment/vulnerabilityAssessment.js.map +0 -1
  247. package/dist/security/authorization/securityAuthorization.d.ts +0 -88
  248. package/dist/security/authorization/securityAuthorization.d.ts.map +0 -1
  249. package/dist/security/authorization/securityAuthorization.js +0 -172
  250. package/dist/security/authorization/securityAuthorization.js.map +0 -1
  251. package/dist/security/comprehensive-targeting.d.ts +0 -85
  252. package/dist/security/comprehensive-targeting.d.ts.map +0 -1
  253. package/dist/security/comprehensive-targeting.js +0 -438
  254. package/dist/security/comprehensive-targeting.js.map +0 -1
  255. package/dist/security/global-security-integration.d.ts +0 -91
  256. package/dist/security/global-security-integration.d.ts.map +0 -1
  257. package/dist/security/global-security-integration.js +0 -218
  258. package/dist/security/global-security-integration.js.map +0 -1
  259. package/dist/security/index.d.ts +0 -38
  260. package/dist/security/index.d.ts.map +0 -1
  261. package/dist/security/index.js +0 -47
  262. package/dist/security/index.js.map +0 -1
  263. package/dist/security/persistence-analyzer.d.ts +0 -56
  264. package/dist/security/persistence-analyzer.d.ts.map +0 -1
  265. package/dist/security/persistence-analyzer.js +0 -187
  266. package/dist/security/persistence-analyzer.js.map +0 -1
  267. package/dist/security/persistence-cli.d.ts +0 -36
  268. package/dist/security/persistence-cli.d.ts.map +0 -1
  269. package/dist/security/persistence-cli.js +0 -160
  270. package/dist/security/persistence-cli.js.map +0 -1
  271. package/dist/security/persistence-research.d.ts +0 -92
  272. package/dist/security/persistence-research.d.ts.map +0 -1
  273. package/dist/security/persistence-research.js +0 -364
  274. package/dist/security/persistence-research.js.map +0 -1
  275. package/dist/security/research/persistenceResearch.d.ts +0 -97
  276. package/dist/security/research/persistenceResearch.d.ts.map +0 -1
  277. package/dist/security/research/persistenceResearch.js +0 -282
  278. package/dist/security/research/persistenceResearch.js.map +0 -1
  279. package/dist/security/security-integration.d.ts +0 -74
  280. package/dist/security/security-integration.d.ts.map +0 -1
  281. package/dist/security/security-integration.js +0 -137
  282. package/dist/security/security-integration.js.map +0 -1
  283. package/dist/security/security-testing-framework.d.ts +0 -112
  284. package/dist/security/security-testing-framework.d.ts.map +0 -1
  285. package/dist/security/security-testing-framework.js +0 -364
  286. package/dist/security/security-testing-framework.js.map +0 -1
  287. package/dist/security/simulation/attackSimulation.d.ts +0 -93
  288. package/dist/security/simulation/attackSimulation.d.ts.map +0 -1
  289. package/dist/security/simulation/attackSimulation.js +0 -341
  290. package/dist/security/simulation/attackSimulation.js.map +0 -1
  291. package/dist/security/strategic-operations.d.ts +0 -100
  292. package/dist/security/strategic-operations.d.ts.map +0 -1
  293. package/dist/security/strategic-operations.js +0 -276
  294. package/dist/security/strategic-operations.js.map +0 -1
  295. package/dist/security/tool-security-wrapper.d.ts +0 -58
  296. package/dist/security/tool-security-wrapper.d.ts.map +0 -1
  297. package/dist/security/tool-security-wrapper.js +0 -156
  298. package/dist/security/tool-security-wrapper.js.map +0 -1
  299. package/dist/shell/claudeCodeStreamHandler.d.ts +0 -145
  300. package/dist/shell/claudeCodeStreamHandler.d.ts.map +0 -1
  301. package/dist/shell/claudeCodeStreamHandler.js +0 -322
  302. package/dist/shell/claudeCodeStreamHandler.js.map +0 -1
  303. package/dist/shell/inputQueueManager.d.ts +0 -144
  304. package/dist/shell/inputQueueManager.d.ts.map +0 -1
  305. package/dist/shell/inputQueueManager.js +0 -290
  306. package/dist/shell/inputQueueManager.js.map +0 -1
  307. package/dist/shell/metricsTracker.d.ts +0 -60
  308. package/dist/shell/metricsTracker.d.ts.map +0 -1
  309. package/dist/shell/metricsTracker.js +0 -119
  310. package/dist/shell/metricsTracker.js.map +0 -1
  311. package/dist/shell/streamingOutputManager.d.ts +0 -115
  312. package/dist/shell/streamingOutputManager.d.ts.map +0 -1
  313. package/dist/shell/streamingOutputManager.js +0 -225
  314. package/dist/shell/streamingOutputManager.js.map +0 -1
  315. package/dist/tools/securityTools.d.ts +0 -22
  316. package/dist/tools/securityTools.d.ts.map +0 -1
  317. package/dist/tools/securityTools.js +0 -448
  318. package/dist/tools/securityTools.js.map +0 -1
  319. package/dist/ui/persistentPrompt.d.ts +0 -50
  320. package/dist/ui/persistentPrompt.d.ts.map +0 -1
  321. package/dist/ui/persistentPrompt.js +0 -92
  322. package/dist/ui/persistentPrompt.js.map +0 -1
  323. package/dist/ui/terminalUISchema.d.ts +0 -195
  324. package/dist/ui/terminalUISchema.d.ts.map +0 -1
  325. package/dist/ui/terminalUISchema.js +0 -113
  326. package/dist/ui/terminalUISchema.js.map +0 -1
  327. package/scripts/deploy-security-capabilities.js +0 -178
@@ -1,225 +0,0 @@
1
- /**
2
- * StreamingOutputManager - Buffered output for Claude Code style UI
3
- *
4
- * Key design principle:
5
- * - Buffer streaming output instead of writing directly to stdout
6
- * - This keeps the cursor at the prompt area (no cursor movement during streaming)
7
- * - Render complete response when streaming ends
8
- * - The UI (prompt) stays fixed at the bottom
9
- *
10
- * Two modes:
11
- * 1. Direct mode (bufferedMode=false): Write chunks directly to stdout (original behavior)
12
- * 2. Buffered mode (bufferedMode=true): Collect chunks, render when complete
13
- */
14
- import { EventEmitter } from 'node:events';
15
- import { writeLock } from '../ui/writeLock.js';
16
- /**
17
- * Manages streaming output with optional buffering.
18
- *
19
- * Buffered mode:
20
- * - Chunks are collected in a buffer
21
- * - Output is rendered all at once when streaming ends
22
- * - Cursor stays at prompt area (no jumping during streaming)
23
- *
24
- * Direct mode:
25
- * - Chunks written directly to stdout (original behavior)
26
- * - Cursor moves with output
27
- */
28
- export class StreamingOutputManager extends EventEmitter {
29
- state = {
30
- isStreaming: false,
31
- charsWritten: 0,
32
- linesWritten: 0,
33
- startTime: null,
34
- };
35
- writeStream;
36
- lastChunk = '';
37
- // Buffered mode support
38
- bufferedMode = false;
39
- outputBuffer = [];
40
- constructor(writeStream = process.stdout) {
41
- super();
42
- this.writeStream = writeStream;
43
- }
44
- /**
45
- * Enable or disable buffered mode
46
- * When buffered, chunks are collected and rendered at the end
47
- */
48
- setBufferedMode(enabled) {
49
- this.bufferedMode = enabled;
50
- }
51
- /**
52
- * Check if buffered mode is enabled
53
- */
54
- isBufferedMode() {
55
- return this.bufferedMode;
56
- }
57
- /**
58
- * Get the buffered content (for rendering)
59
- */
60
- getBuffer() {
61
- return this.outputBuffer.join('');
62
- }
63
- /**
64
- * Clear the buffer
65
- */
66
- clearBuffer() {
67
- this.outputBuffer = [];
68
- }
69
- /**
70
- * Check if currently streaming output
71
- */
72
- isStreaming() {
73
- return this.state.isStreaming;
74
- }
75
- /**
76
- * Begin a streaming session
77
- * Resets counters and marks streaming as active
78
- * In buffered mode, clears the buffer
79
- */
80
- startStream() {
81
- if (this.state.isStreaming) {
82
- return; // Already streaming
83
- }
84
- this.state = {
85
- isStreaming: true,
86
- charsWritten: 0,
87
- linesWritten: 0,
88
- startTime: Date.now(),
89
- };
90
- this.lastChunk = '';
91
- this.outputBuffer = [];
92
- this.emit('stream-start');
93
- }
94
- /**
95
- * Write a chunk of content
96
- *
97
- * In buffered mode: Collect in buffer (cursor stays at prompt)
98
- * In direct mode: Write to stdout immediately
99
- */
100
- writeChunk(chunk) {
101
- if (!chunk) {
102
- return;
103
- }
104
- // Track statistics
105
- this.state.charsWritten += chunk.length;
106
- this.state.linesWritten += this.countNewlines(chunk);
107
- this.lastChunk = chunk;
108
- if (this.bufferedMode) {
109
- // Buffered mode: collect chunks, don't write yet
110
- this.outputBuffer.push(chunk);
111
- }
112
- else {
113
- // Direct mode: write immediately
114
- this.writeLocked(chunk);
115
- }
116
- this.emit('stream-chunk', chunk);
117
- }
118
- /**
119
- * Write a complete line (adds newline)
120
- */
121
- writeLine(line = '') {
122
- this.writeChunk(`${line}\n`);
123
- }
124
- /**
125
- * End the streaming session
126
- * In buffered mode: Renders the complete buffered output
127
- * Returns statistics about what was streamed
128
- */
129
- endStream() {
130
- const stats = {
131
- duration: this.state.startTime ? Date.now() - this.state.startTime : 0,
132
- chars: this.state.charsWritten,
133
- lines: this.state.linesWritten,
134
- buffer: undefined,
135
- };
136
- if (this.bufferedMode) {
137
- // In buffered mode, render the collected output now
138
- const bufferedContent = this.outputBuffer.join('');
139
- stats.buffer = bufferedContent;
140
- if (bufferedContent) {
141
- this.writeLocked(bufferedContent);
142
- // Ensure we end with a newline
143
- if (!bufferedContent.endsWith('\n')) {
144
- this.writeLocked('\n');
145
- stats.lines += 1;
146
- }
147
- }
148
- this.outputBuffer = [];
149
- }
150
- else {
151
- // Direct mode: just ensure newline
152
- if (this.lastChunk && !this.lastChunk.endsWith('\n')) {
153
- this.writeLocked('\n');
154
- stats.lines += 1;
155
- }
156
- }
157
- this.state = {
158
- isStreaming: false,
159
- charsWritten: 0,
160
- linesWritten: 0,
161
- startTime: null,
162
- };
163
- this.lastChunk = '';
164
- this.emit('stream-end', stats);
165
- return stats;
166
- }
167
- /**
168
- * Get current streaming statistics
169
- */
170
- getStats() {
171
- return {
172
- chars: this.state.charsWritten,
173
- lines: this.state.linesWritten,
174
- elapsed: this.state.startTime ? Date.now() - this.state.startTime : 0,
175
- };
176
- }
177
- /**
178
- * Force a flush (for buffered output)
179
- */
180
- flush() {
181
- // Cork/uncork pattern for optimal buffering
182
- if (typeof this.writeStream.cork === 'function') {
183
- this.writeStream.cork();
184
- process.nextTick(() => {
185
- if (typeof this.writeStream.uncork === 'function') {
186
- this.writeStream.uncork();
187
- }
188
- });
189
- }
190
- }
191
- countNewlines(text) {
192
- let count = 0;
193
- for (const char of text) {
194
- if (char === '\n') {
195
- count += 1;
196
- }
197
- }
198
- return count;
199
- }
200
- writeLocked(chunk) {
201
- // If lock is already held, write directly - we're in a protected context
202
- // This prevents queuing issues where content gets delayed during streaming
203
- if (writeLock.isLocked()) {
204
- this.writeStream.write(chunk);
205
- return;
206
- }
207
- writeLock.withLock(() => {
208
- this.writeStream.write(chunk);
209
- }, 'streamingOutputManager.write');
210
- }
211
- }
212
- /**
213
- * Singleton instance for global use
214
- */
215
- let globalInstance = null;
216
- export function getStreamingOutputManager() {
217
- if (!globalInstance) {
218
- globalInstance = new StreamingOutputManager();
219
- }
220
- return globalInstance;
221
- }
222
- export function resetStreamingOutputManager() {
223
- globalInstance = null;
224
- }
225
- //# sourceMappingURL=streamingOutputManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"streamingOutputManager.js","sourceRoot":"","sources":["../../src/shell/streamingOutputManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAe/C;;;;;;;;;;;GAWG;AAC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
- * IMPORTANT: These tools are for AUTHORIZED security testing only:
5
- * - Your own systems and applications
6
- * - Systems you have explicit written permission to test
7
- * - Bug bounty programs where you're an authorized participant
8
- * - CTF competitions
9
- * - Security research and education
10
- *
11
- * DO NOT use these tools for:
12
- * - Unauthorized access to systems
13
- * - Denial of service attacks
14
- * - Mass scanning without permission
15
- * - Any illegal activities
16
- */
17
- import type { ToolDefinition } from '../core/toolRuntime.js';
18
- /**
19
- * Create security testing tools bound to a working directory
20
- */
21
- export declare function createSecurityTools(workingDir: string): ToolDefinition[];
22
- //# sourceMappingURL=securityTools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"securityTools.d.ts","sourceRoot":"","sources":["../../src/tools/securityTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AA+N7D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE,CAwQxE"}