erosolar-cli 1.5.2 → 1.5.4

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 (346) hide show
  1. package/config/security-deployment.json +54 -0
  2. package/dist/bin/adapters/node/index.js +33 -0
  3. package/dist/bin/adapters/types.js +1 -0
  4. package/dist/bin/alpha-zero/agentWrapper.js +165 -0
  5. package/dist/bin/alpha-zero/codeEvaluator.js +272 -0
  6. package/dist/bin/alpha-zero/competitiveRunner.js +219 -0
  7. package/dist/bin/alpha-zero/index.js +98 -0
  8. package/dist/bin/alpha-zero/introspection.js +298 -0
  9. package/dist/bin/alpha-zero/metricsTracker.js +207 -0
  10. package/dist/bin/alpha-zero/security/core.js +269 -0
  11. package/dist/bin/alpha-zero/security/google.js +308 -0
  12. package/dist/bin/alpha-zero/security/googleLoader.js +40 -0
  13. package/dist/bin/alpha-zero/security/index.js +31 -0
  14. package/dist/bin/alpha-zero/security/simulation.js +274 -0
  15. package/dist/bin/alpha-zero/selfModification.js +231 -0
  16. package/dist/bin/alpha-zero/types.js +30 -0
  17. package/dist/bin/bin/erosolar-optimized.js +205 -0
  18. package/dist/bin/capabilities/agentSpawningCapability.js +116 -0
  19. package/dist/bin/capabilities/bashCapability.js +22 -0
  20. package/dist/bin/capabilities/cloudCapability.js +36 -0
  21. package/dist/bin/capabilities/codeAnalysisCapability.js +22 -0
  22. package/dist/bin/capabilities/codeQualityCapability.js +23 -0
  23. package/dist/bin/capabilities/dependencySecurityCapability.js +22 -0
  24. package/dist/bin/capabilities/devCapability.js +22 -0
  25. package/dist/bin/capabilities/editCapability.js +28 -0
  26. package/dist/bin/capabilities/emailCapability.js +20 -0
  27. package/dist/bin/capabilities/enhancedGitCapability.js +221 -0
  28. package/dist/bin/capabilities/filesystemCapability.js +22 -0
  29. package/dist/bin/capabilities/globCapability.js +28 -0
  30. package/dist/bin/capabilities/interactionCapability.js +20 -0
  31. package/dist/bin/capabilities/learnCapability.js +22 -0
  32. package/dist/bin/capabilities/mcpCapability.js +20 -0
  33. package/dist/bin/capabilities/notebookCapability.js +28 -0
  34. package/dist/bin/capabilities/planningCapability.js +27 -0
  35. package/dist/bin/capabilities/refactoringCapability.js +23 -0
  36. package/dist/bin/capabilities/repoChecksCapability.js +22 -0
  37. package/dist/bin/capabilities/searchCapability.js +22 -0
  38. package/dist/bin/capabilities/skillCapability.js +76 -0
  39. package/dist/bin/capabilities/taskManagementCapability.js +20 -0
  40. package/dist/bin/capabilities/testingCapability.js +23 -0
  41. package/dist/bin/capabilities/toolManifest.js +159 -0
  42. package/dist/bin/capabilities/toolRegistry.js +114 -0
  43. package/dist/bin/capabilities/webCapability.js +20 -0
  44. package/dist/bin/config.js +139 -0
  45. package/dist/bin/contracts/v1/agent.js +7 -0
  46. package/dist/bin/contracts/v1/agentProfileManifest.js +8 -0
  47. package/dist/bin/contracts/v1/agentRules.js +9 -0
  48. package/dist/bin/contracts/v1/toolAccess.js +8 -0
  49. package/dist/bin/core/agent.js +362 -0
  50. package/dist/bin/core/agentProfileManifest.js +187 -0
  51. package/dist/bin/core/agentProfiles.js +34 -0
  52. package/dist/bin/core/agentRulebook.js +135 -0
  53. package/dist/bin/core/agentSchemaLoader.js +233 -0
  54. package/dist/bin/core/contextManager.js +412 -0
  55. package/dist/bin/core/contextWindow.js +122 -0
  56. package/dist/bin/core/customCommands.js +80 -0
  57. package/dist/bin/core/errors/apiKeyErrors.js +114 -0
  58. package/dist/bin/core/errors/errorTypes.js +340 -0
  59. package/dist/bin/core/errors/safetyValidator.js +304 -0
  60. package/dist/bin/core/errors.js +32 -0
  61. package/dist/bin/core/modelDiscovery.js +755 -0
  62. package/dist/bin/core/preferences.js +224 -0
  63. package/dist/bin/core/schemaValidator.js +92 -0
  64. package/dist/bin/core/secretStore.js +199 -0
  65. package/dist/bin/core/sessionStore.js +187 -0
  66. package/dist/bin/core/toolRuntime.js +290 -0
  67. package/dist/bin/core/types.js +1 -0
  68. package/dist/bin/erosolar-optimized.d.ts +12 -0
  69. package/dist/bin/erosolar-optimized.d.ts.map +1 -0
  70. package/dist/bin/erosolar-optimized.js +239 -0
  71. package/dist/bin/erosolar-optimized.js.map +1 -0
  72. package/dist/bin/erosolar.js +14 -0
  73. package/dist/bin/erosolar.js.map +1 -1
  74. package/dist/bin/headless/headlessApp.js +172 -0
  75. package/dist/bin/mcp/config.js +202 -0
  76. package/dist/bin/mcp/stdioClient.js +172 -0
  77. package/dist/bin/mcp/toolBridge.js +104 -0
  78. package/dist/bin/mcp/types.js +1 -0
  79. package/dist/bin/plugins/index.js +113 -0
  80. package/dist/bin/plugins/providers/anthropic/index.js +25 -0
  81. package/dist/bin/plugins/providers/deepseek/index.js +24 -0
  82. package/dist/bin/plugins/providers/google/index.js +26 -0
  83. package/dist/bin/plugins/providers/index.js +19 -0
  84. package/dist/bin/plugins/providers/ollama/index.js +59 -0
  85. package/dist/bin/plugins/providers/openai/index.js +26 -0
  86. package/dist/bin/plugins/providers/xai/index.js +24 -0
  87. package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +8 -0
  88. package/dist/bin/plugins/tools/bash/localBashPlugin.js +13 -0
  89. package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +13 -0
  90. package/dist/bin/plugins/tools/cloud/cloudPlugin.js +13 -0
  91. package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +13 -0
  92. package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +13 -0
  93. package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +11 -0
  94. package/dist/bin/plugins/tools/development/devPlugin.js +13 -0
  95. package/dist/bin/plugins/tools/edit/editPlugin.js +14 -0
  96. package/dist/bin/plugins/tools/email/emailPlugin.js +11 -0
  97. package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +8 -0
  98. package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +13 -0
  99. package/dist/bin/plugins/tools/glob/globPlugin.js +14 -0
  100. package/dist/bin/plugins/tools/index.js +2 -0
  101. package/dist/bin/plugins/tools/interaction/interactionPlugin.js +11 -0
  102. package/dist/bin/plugins/tools/learn/learnPlugin.js +13 -0
  103. package/dist/bin/plugins/tools/mcp/mcpPlugin.js +8 -0
  104. package/dist/bin/plugins/tools/nodeDefaults.js +56 -0
  105. package/dist/bin/plugins/tools/notebook/notebookPlugin.js +14 -0
  106. package/dist/bin/plugins/tools/planning/planningPlugin.js +14 -0
  107. package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +11 -0
  108. package/dist/bin/plugins/tools/registry.js +57 -0
  109. package/dist/bin/plugins/tools/search/localSearchPlugin.js +13 -0
  110. package/dist/bin/plugins/tools/skills/skillPlugin.js +8 -0
  111. package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +11 -0
  112. package/dist/bin/plugins/tools/testing/testingPlugin.js +11 -0
  113. package/dist/bin/plugins/tools/web/webPlugin.js +11 -0
  114. package/dist/bin/providers/anthropicProvider.js +329 -0
  115. package/dist/bin/providers/googleProvider.js +203 -0
  116. package/dist/bin/providers/openaiChatCompletionsProvider.js +208 -0
  117. package/dist/bin/providers/openaiResponsesProvider.js +249 -0
  118. package/dist/bin/providers/providerFactory.js +24 -0
  119. package/dist/bin/runtime/agentController.js +321 -0
  120. package/dist/bin/runtime/agentHost.js +153 -0
  121. package/dist/bin/runtime/agentSession.js +195 -0
  122. package/dist/bin/runtime/node.js +10 -0
  123. package/dist/bin/runtime/universal.js +28 -0
  124. package/dist/bin/shell/bracketedPasteManager.js +350 -0
  125. package/dist/bin/shell/fileChangeTracker.js +65 -0
  126. package/dist/bin/shell/interactiveShell.js +2908 -0
  127. package/dist/bin/shell/liveStatus.js +78 -0
  128. package/dist/bin/shell/shellApp.js +290 -0
  129. package/dist/bin/shell/systemPrompt.js +60 -0
  130. package/dist/bin/shell/updateManager.js +108 -0
  131. package/dist/bin/skills/skillRepository.js +236 -0
  132. package/dist/bin/skills/types.js +1 -0
  133. package/dist/bin/subagents/taskRunner.js +269 -0
  134. package/dist/bin/tools/backgroundBashTools.js +211 -0
  135. package/dist/bin/tools/bashTools.js +159 -0
  136. package/dist/bin/tools/cloudTools.js +864 -0
  137. package/dist/bin/tools/codeAnalysisTools.js +641 -0
  138. package/dist/bin/tools/codeQualityTools.js +294 -0
  139. package/dist/bin/tools/dependencyTools.js +282 -0
  140. package/dist/bin/tools/devTools.js +238 -0
  141. package/dist/bin/tools/diffUtils.js +137 -0
  142. package/dist/bin/tools/editTools.js +134 -0
  143. package/dist/bin/tools/emailTools.js +448 -0
  144. package/dist/bin/tools/fileTools.js +282 -0
  145. package/dist/bin/tools/globTools.js +173 -0
  146. package/dist/bin/tools/grepTools.js +332 -0
  147. package/dist/bin/tools/interactionTools.js +170 -0
  148. package/dist/bin/tools/learnTools.js +1818 -0
  149. package/dist/bin/tools/notebookEditTools.js +196 -0
  150. package/dist/bin/tools/planningTools.js +46 -0
  151. package/dist/bin/tools/refactoringTools.js +293 -0
  152. package/dist/bin/tools/repoChecksTools.js +160 -0
  153. package/dist/bin/tools/searchTools.js +206 -0
  154. package/dist/bin/tools/skillTools.js +177 -0
  155. package/dist/bin/tools/taskManagementTools.js +156 -0
  156. package/dist/bin/tools/testingTools.js +232 -0
  157. package/dist/bin/tools/webTools.js +480 -0
  158. package/dist/bin/ui/ShellUIAdapter.js +459 -0
  159. package/dist/bin/ui/UnifiedUIController.js +183 -0
  160. package/dist/bin/ui/animation/AnimationScheduler.js +430 -0
  161. package/dist/bin/ui/codeHighlighter.js +854 -0
  162. package/dist/bin/ui/designSystem.js +121 -0
  163. package/dist/bin/ui/display.js +1222 -0
  164. package/dist/bin/ui/interrupts/InterruptManager.js +437 -0
  165. package/dist/bin/ui/layout.js +139 -0
  166. package/dist/bin/ui/orchestration/StatusOrchestrator.js +403 -0
  167. package/dist/bin/ui/outputMode.js +38 -0
  168. package/dist/bin/ui/persistentPrompt.js +183 -0
  169. package/dist/bin/ui/richText.js +338 -0
  170. package/dist/bin/ui/shortcutsHelp.js +87 -0
  171. package/dist/bin/ui/telemetry/UITelemetry.js +443 -0
  172. package/dist/bin/ui/textHighlighter.js +210 -0
  173. package/dist/bin/ui/theme.js +116 -0
  174. package/dist/bin/ui/toolDisplay.js +423 -0
  175. package/dist/bin/ui/toolDisplayAdapter.js +357 -0
  176. package/dist/bin/workspace.js +106 -0
  177. package/dist/bin/workspace.validator.js +213 -0
  178. package/dist/capabilities/cloudCapability.d.ts +13 -0
  179. package/dist/capabilities/cloudCapability.d.ts.map +1 -0
  180. package/dist/capabilities/cloudCapability.js +38 -0
  181. package/dist/capabilities/cloudCapability.js.map +1 -0
  182. package/dist/capabilities/index.d.ts +1 -0
  183. package/dist/capabilities/index.d.ts.map +1 -1
  184. package/dist/capabilities/index.js +1 -0
  185. package/dist/capabilities/index.js.map +1 -1
  186. package/dist/capabilities/offensiveSecurityCapability.d.ts +26 -0
  187. package/dist/capabilities/offensiveSecurityCapability.d.ts.map +1 -0
  188. package/dist/capabilities/offensiveSecurityCapability.js +58 -0
  189. package/dist/capabilities/offensiveSecurityCapability.js.map +1 -0
  190. package/dist/capabilities/realSecurityCapability.d.ts +26 -0
  191. package/dist/capabilities/realSecurityCapability.d.ts.map +1 -0
  192. package/dist/capabilities/realSecurityCapability.js +53 -0
  193. package/dist/capabilities/realSecurityCapability.js.map +1 -0
  194. package/dist/capabilities/securityCapability.d.ts +32 -0
  195. package/dist/capabilities/securityCapability.d.ts.map +1 -0
  196. package/dist/capabilities/securityCapability.js +57 -0
  197. package/dist/capabilities/securityCapability.js.map +1 -0
  198. package/dist/capabilities/ultimateSecurityCapability.d.ts +42 -0
  199. package/dist/capabilities/ultimateSecurityCapability.d.ts.map +1 -0
  200. package/dist/capabilities/ultimateSecurityCapability.js +96 -0
  201. package/dist/capabilities/ultimateSecurityCapability.js.map +1 -0
  202. package/dist/core/LazyLoader.d.ts +129 -0
  203. package/dist/core/LazyLoader.d.ts.map +1 -0
  204. package/dist/core/LazyLoader.js +240 -0
  205. package/dist/core/LazyLoader.js.map +1 -0
  206. package/dist/core/intelligenceTools.d.ts +19 -0
  207. package/dist/core/intelligenceTools.d.ts.map +1 -0
  208. package/dist/core/intelligenceTools.js +453 -0
  209. package/dist/core/intelligenceTools.js.map +1 -0
  210. package/dist/core/operationalTools.d.ts +19 -0
  211. package/dist/core/operationalTools.d.ts.map +1 -0
  212. package/dist/core/operationalTools.js +467 -0
  213. package/dist/core/operationalTools.js.map +1 -0
  214. package/dist/offensive/core/offensive-engine.d.ts +171 -0
  215. package/dist/offensive/core/offensive-engine.d.ts.map +1 -0
  216. package/dist/offensive/core/offensive-engine.js +345 -0
  217. package/dist/offensive/core/offensive-engine.js.map +1 -0
  218. package/dist/offensive/core/offensive-integration.d.ts +129 -0
  219. package/dist/offensive/core/offensive-integration.d.ts.map +1 -0
  220. package/dist/offensive/core/offensive-integration.js +364 -0
  221. package/dist/offensive/core/offensive-integration.js.map +1 -0
  222. package/dist/offensive/core/offensive-tools.d.ts +55 -0
  223. package/dist/offensive/core/offensive-tools.d.ts.map +1 -0
  224. package/dist/offensive/core/offensive-tools.js +438 -0
  225. package/dist/offensive/core/offensive-tools.js.map +1 -0
  226. package/dist/offensive/offensive-cli.d.ts +48 -0
  227. package/dist/offensive/offensive-cli.d.ts.map +1 -0
  228. package/dist/offensive/offensive-cli.js +233 -0
  229. package/dist/offensive/offensive-cli.js.map +1 -0
  230. package/dist/plugins/index.d.ts +1 -1
  231. package/dist/plugins/index.d.ts.map +1 -1
  232. package/dist/plugins/index.js +2 -0
  233. package/dist/plugins/index.js.map +1 -1
  234. package/dist/plugins/tools/cloud/cloudPlugin.d.ts +3 -0
  235. package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +1 -0
  236. package/dist/plugins/tools/cloud/cloudPlugin.js +14 -0
  237. package/dist/plugins/tools/cloud/cloudPlugin.js.map +1 -0
  238. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  239. package/dist/plugins/tools/nodeDefaults.js +2 -0
  240. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  241. package/dist/security/advanced-persistence-research.d.ts +92 -0
  242. package/dist/security/advanced-persistence-research.d.ts.map +1 -0
  243. package/dist/security/advanced-persistence-research.js +195 -0
  244. package/dist/security/advanced-persistence-research.js.map +1 -0
  245. package/dist/security/apt-simulation-cli.d.ts +57 -0
  246. package/dist/security/apt-simulation-cli.d.ts.map +1 -0
  247. package/dist/security/apt-simulation-cli.js +278 -0
  248. package/dist/security/apt-simulation-cli.js.map +1 -0
  249. package/dist/security/apt-simulation-engine-complete.d.ts +97 -0
  250. package/dist/security/apt-simulation-engine-complete.d.ts.map +1 -0
  251. package/dist/security/apt-simulation-engine-complete.js +441 -0
  252. package/dist/security/apt-simulation-engine-complete.js.map +1 -0
  253. package/dist/security/apt-simulation-engine.d.ts +97 -0
  254. package/dist/security/apt-simulation-engine.d.ts.map +1 -0
  255. package/dist/security/apt-simulation-engine.js +441 -0
  256. package/dist/security/apt-simulation-engine.js.map +1 -0
  257. package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
  258. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
  259. package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
  260. package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
  261. package/dist/security/authorization/securityAuthorization.d.ts +88 -0
  262. package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
  263. package/dist/security/authorization/securityAuthorization.js +172 -0
  264. package/dist/security/authorization/securityAuthorization.js.map +1 -0
  265. package/dist/security/authorization.d.ts +45 -0
  266. package/dist/security/authorization.d.ts.map +1 -0
  267. package/dist/security/authorization.js +128 -0
  268. package/dist/security/authorization.js.map +1 -0
  269. package/dist/security/comprehensive-security-research.d.ts +84 -0
  270. package/dist/security/comprehensive-security-research.d.ts.map +1 -0
  271. package/dist/security/comprehensive-security-research.js +211 -0
  272. package/dist/security/comprehensive-security-research.js.map +1 -0
  273. package/dist/security/offensive/exploitationEngine.d.ts +54 -0
  274. package/dist/security/offensive/exploitationEngine.d.ts.map +1 -0
  275. package/dist/security/offensive/exploitationEngine.js +263 -0
  276. package/dist/security/offensive/exploitationEngine.js.map +1 -0
  277. package/dist/security/persistence-analyzer.d.ts +56 -0
  278. package/dist/security/persistence-analyzer.d.ts.map +1 -0
  279. package/dist/security/persistence-analyzer.js +187 -0
  280. package/dist/security/persistence-analyzer.js.map +1 -0
  281. package/dist/security/persistence-cli.d.ts +36 -0
  282. package/dist/security/persistence-cli.d.ts.map +1 -0
  283. package/dist/security/persistence-cli.js +160 -0
  284. package/dist/security/persistence-cli.js.map +1 -0
  285. package/dist/security/persistence-research.d.ts +100 -0
  286. package/dist/security/persistence-research.d.ts.map +1 -0
  287. package/dist/security/persistence-research.js +372 -0
  288. package/dist/security/persistence-research.js.map +1 -0
  289. package/dist/security/real/networkExploitation.d.ts +92 -0
  290. package/dist/security/real/networkExploitation.d.ts.map +1 -0
  291. package/dist/security/real/networkExploitation.js +316 -0
  292. package/dist/security/real/networkExploitation.js.map +1 -0
  293. package/dist/security/real/persistenceImplementation.d.ts +62 -0
  294. package/dist/security/real/persistenceImplementation.d.ts.map +1 -0
  295. package/dist/security/real/persistenceImplementation.js +323 -0
  296. package/dist/security/real/persistenceImplementation.js.map +1 -0
  297. package/dist/security/real/vulnerabilityScanner.d.ts +73 -0
  298. package/dist/security/real/vulnerabilityScanner.d.ts.map +1 -0
  299. package/dist/security/real/vulnerabilityScanner.js +341 -0
  300. package/dist/security/real/vulnerabilityScanner.js.map +1 -0
  301. package/dist/security/research/persistenceResearch.d.ts +97 -0
  302. package/dist/security/research/persistenceResearch.d.ts.map +1 -0
  303. package/dist/security/research/persistenceResearch.js +282 -0
  304. package/dist/security/research/persistenceResearch.js.map +1 -0
  305. package/dist/security/security-testing-framework.d.ts +120 -0
  306. package/dist/security/security-testing-framework.d.ts.map +1 -0
  307. package/dist/security/security-testing-framework.js +372 -0
  308. package/dist/security/security-testing-framework.js.map +1 -0
  309. package/dist/security/simulation/attackSimulation.d.ts +93 -0
  310. package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
  311. package/dist/security/simulation/attackSimulation.js +341 -0
  312. package/dist/security/simulation/attackSimulation.js.map +1 -0
  313. package/dist/shell/bracketedPasteManager.d.ts +76 -0
  314. package/dist/shell/bracketedPasteManager.d.ts.map +1 -1
  315. package/dist/shell/bracketedPasteManager.js +267 -9
  316. package/dist/shell/bracketedPasteManager.js.map +1 -1
  317. package/dist/shell/interactiveShell.d.ts +34 -1
  318. package/dist/shell/interactiveShell.d.ts.map +1 -1
  319. package/dist/shell/interactiveShell.js +304 -24
  320. package/dist/shell/interactiveShell.js.map +1 -1
  321. package/dist/shell/taskCompletionDetector.d.ts +101 -0
  322. package/dist/shell/taskCompletionDetector.d.ts.map +1 -0
  323. package/dist/shell/taskCompletionDetector.js +343 -0
  324. package/dist/shell/taskCompletionDetector.js.map +1 -0
  325. package/dist/tools/cloudTools.d.ts +57 -0
  326. package/dist/tools/cloudTools.d.ts.map +1 -0
  327. package/dist/tools/cloudTools.js +865 -0
  328. package/dist/tools/cloudTools.js.map +1 -0
  329. package/dist/tools/enhancedSecurityTools.d.ts +19 -0
  330. package/dist/tools/enhancedSecurityTools.d.ts.map +1 -0
  331. package/dist/tools/enhancedSecurityTools.js +215 -0
  332. package/dist/tools/enhancedSecurityTools.js.map +1 -0
  333. package/dist/tools/offensiveSecurityTools.d.ts +16 -0
  334. package/dist/tools/offensiveSecurityTools.d.ts.map +1 -0
  335. package/dist/tools/offensiveSecurityTools.js +285 -0
  336. package/dist/tools/offensiveSecurityTools.js.map +1 -0
  337. package/dist/tools/realSecurityTools.d.ts +18 -0
  338. package/dist/tools/realSecurityTools.d.ts.map +1 -0
  339. package/dist/tools/realSecurityTools.js +468 -0
  340. package/dist/tools/realSecurityTools.js.map +1 -0
  341. package/dist/tools/securityTools.d.ts +20 -0
  342. package/dist/tools/securityTools.d.ts.map +1 -0
  343. package/dist/tools/securityTools.js +449 -0
  344. package/dist/tools/securityTools.js.map +1 -0
  345. package/package.json +27 -12
  346. package/scripts/deploy-security-capabilities.js +178 -0
@@ -0,0 +1,343 @@
1
+ /**
2
+ * Intelligent Task Completion Detector
3
+ *
4
+ * This module provides robust detection of whether a continuous task is truly complete,
5
+ * rather than just pattern-matching keywords like "done" in responses.
6
+ *
7
+ * Key features:
8
+ * - Multi-signal analysis (tool usage, response content, state changes)
9
+ * - AI verification round before final completion
10
+ * - Confidence scoring
11
+ * - Work-in-progress detection
12
+ *
13
+ * @license MIT
14
+ * @author Bo Shang
15
+ */
16
+ // Keywords that strongly indicate task completion
17
+ const STRONG_COMPLETION_PATTERNS = [
18
+ /^(all\s+)?tasks?\s+(are\s+)?(now\s+)?(complete|done|finished)/im,
19
+ /^(i('ve|'m|\s+have|\s+am)\s+)?(successfully\s+)?(completed?|finished|done)\s+(all|the|with|everything)/im,
20
+ /^everything\s+(is\s+)?(now\s+)?(complete|done|finished)/im,
21
+ /^the\s+requested?\s+(task|work|changes?)\s+(is|are|has been)\s+(complete|done|finished)/im,
22
+ /^i\s+have\s+(now\s+)?(successfully\s+)?(completed?|finished|done)\s+(all|the|everything)/im,
23
+ /no\s+(more|further)\s+(tasks?|work|actions?|changes?)\s+(are\s+)?(needed|required|necessary)/im,
24
+ ];
25
+ // Keywords that indicate work is still in progress
26
+ const INCOMPLETE_WORK_PATTERNS = [
27
+ /\b(next|then|now\s+I('ll|\s+will)|let\s+me|I('ll|\s+will)|going\s+to|about\s+to)\b/i,
28
+ /\b(continue|continuing|proceed|proceeding|working\s+on)\b/i,
29
+ /\b(TODO|FIXME|WIP|in\s+progress)\b/i,
30
+ /\b(still\s+need|remaining|left\s+to\s+do|more\s+to\s+do)\b/i,
31
+ /\b(step\s+\d+|phase\s+\d+|iteration\s+\d+)\b/i,
32
+ /\b(haven'?t\s+(yet|finished)|not\s+yet\s+(done|complete|finished))\b/i,
33
+ ];
34
+ // Keywords that indicate pending actions
35
+ const PENDING_ACTION_PATTERNS = [
36
+ /\b(need\s+to|should|must|have\s+to|requires?)\b/i,
37
+ /\b(waiting|pending|queued)\b/i,
38
+ /\b(before\s+I\s+can|after\s+that|once\s+that)\b/i,
39
+ /\b(running|executing|processing)\b/i,
40
+ ];
41
+ // Keywords that indicate errors or issues
42
+ const ERROR_PATTERNS = [
43
+ /\b(error|failed|failure|exception|issue|problem|bug)\b/i,
44
+ /\b(can'?t|cannot|couldn'?t|unable\s+to)\b/i,
45
+ /\b(fix|fixing|resolve|resolving|debug|debugging)\b/i,
46
+ ];
47
+ // Keywords that indicate follow-up questions
48
+ const FOLLOWUP_QUESTION_PATTERNS = [
49
+ /\b(would\s+you\s+like|do\s+you\s+want|shall\s+I|should\s+I)\b/i,
50
+ /\b(let\s+me\s+know|please\s+(confirm|tell|let))\b/i,
51
+ /\?$/m,
52
+ ];
53
+ // Keywords that indicate future work
54
+ const FUTURE_WORK_PATTERNS = [
55
+ /\b(could\s+also|might\s+want\s+to|consider|recommend)\b/i,
56
+ /\b(future|later|eventually|when\s+you\s+have\s+time)\b/i,
57
+ /\b(improvement|enhancement|optimization)\b/i,
58
+ ];
59
+ // Read-only tool names
60
+ const READ_ONLY_TOOLS = new Set([
61
+ 'read_file',
62
+ 'Read',
63
+ 'list_dir',
64
+ 'list_files',
65
+ 'search_text',
66
+ 'grep',
67
+ 'Grep',
68
+ 'glob',
69
+ 'Glob',
70
+ 'git_status',
71
+ 'git_log',
72
+ 'git_diff',
73
+ ]);
74
+ // Write/action tool names - exported for use in completion detection
75
+ export const WRITE_TOOLS = new Set([
76
+ 'write_file',
77
+ 'Write',
78
+ 'edit_file',
79
+ 'Edit',
80
+ 'bash',
81
+ 'Bash',
82
+ 'execute_command',
83
+ 'git_commit',
84
+ 'git_push',
85
+ 'NotebookEdit',
86
+ ]);
87
+ export class TaskCompletionDetector {
88
+ toolHistory = [];
89
+ responseHistory = [];
90
+ lastToolNames = [];
91
+ consecutiveNoTools = 0;
92
+ todoStats = { pending: 0, completed: 0 };
93
+ constructor() {
94
+ this.reset();
95
+ }
96
+ /**
97
+ * Reset the detector state for a new task
98
+ */
99
+ reset() {
100
+ this.toolHistory = [];
101
+ this.responseHistory = [];
102
+ this.lastToolNames = [];
103
+ this.consecutiveNoTools = 0;
104
+ this.todoStats = { pending: 0, completed: 0 };
105
+ }
106
+ /**
107
+ * Record a tool call
108
+ */
109
+ recordToolCall(toolName, success, hasOutput) {
110
+ this.toolHistory.push({
111
+ toolName,
112
+ timestamp: Date.now(),
113
+ success,
114
+ hasOutput,
115
+ });
116
+ this.lastToolNames.push(toolName);
117
+ // Keep only recent history
118
+ if (this.toolHistory.length > 100) {
119
+ this.toolHistory = this.toolHistory.slice(-100);
120
+ }
121
+ if (this.lastToolNames.length > 20) {
122
+ this.lastToolNames = this.lastToolNames.slice(-20);
123
+ }
124
+ }
125
+ /**
126
+ * Record a response (call after each AI response)
127
+ */
128
+ recordResponse(response, toolsUsed) {
129
+ this.responseHistory.push(response);
130
+ if (toolsUsed.length === 0) {
131
+ this.consecutiveNoTools++;
132
+ }
133
+ else {
134
+ this.consecutiveNoTools = 0;
135
+ this.lastToolNames = toolsUsed;
136
+ }
137
+ // Keep only recent history
138
+ if (this.responseHistory.length > 20) {
139
+ this.responseHistory = this.responseHistory.slice(-20);
140
+ }
141
+ }
142
+ /**
143
+ * Update todo statistics
144
+ */
145
+ updateTodoStats(pending, completed) {
146
+ this.todoStats = { pending, completed };
147
+ }
148
+ /**
149
+ * Analyze the current state and determine if the task is complete
150
+ */
151
+ analyzeCompletion(currentResponse, toolsUsedThisRound) {
152
+ this.recordResponse(currentResponse, toolsUsedThisRound);
153
+ const signals = this.gatherSignals(currentResponse, toolsUsedThisRound);
154
+ const confidence = this.calculateConfidence(signals);
155
+ signals.completionConfidence = confidence;
156
+ // Determine completion status
157
+ let isComplete = false;
158
+ let reason = '';
159
+ let shouldVerify = false;
160
+ let verificationPrompt;
161
+ // High confidence completion
162
+ if (confidence >= 0.85 && signals.hasExplicitCompletionStatement && !signals.hasIncompleteWorkIndicators) {
163
+ isComplete = true;
164
+ reason = 'High confidence explicit completion statement with no incomplete work indicators';
165
+ }
166
+ // Medium confidence - needs verification
167
+ else if (confidence >= 0.6 && signals.hasExplicitCompletionStatement) {
168
+ shouldVerify = true;
169
+ reason = 'Medium confidence completion - AI verification recommended';
170
+ verificationPrompt = this.generateVerificationPrompt(signals);
171
+ }
172
+ // Low confidence - likely not complete
173
+ else if (confidence < 0.4) {
174
+ isComplete = false;
175
+ reason = this.getLowConfidenceReason(signals);
176
+ }
177
+ // Ambiguous case - check for stagnation
178
+ else if (this.consecutiveNoTools >= 3 && !signals.hasIncompleteWorkIndicators) {
179
+ shouldVerify = true;
180
+ reason = 'No tool activity for multiple rounds - verification needed';
181
+ verificationPrompt = this.generateStagnationVerificationPrompt();
182
+ }
183
+ // Default: not complete
184
+ else {
185
+ isComplete = false;
186
+ reason = 'Active work indicators detected or low completion confidence';
187
+ }
188
+ return {
189
+ isComplete,
190
+ confidence,
191
+ signals,
192
+ reason,
193
+ shouldVerify,
194
+ verificationPrompt,
195
+ };
196
+ }
197
+ /**
198
+ * Gather all completion signals from the current state
199
+ */
200
+ gatherSignals(response, toolsUsed) {
201
+ const hasExplicitCompletionStatement = STRONG_COMPLETION_PATTERNS.some((p) => p.test(response));
202
+ const hasIncompleteWorkIndicators = INCOMPLETE_WORK_PATTERNS.some((p) => p.test(response));
203
+ const hasPendingActionIndicators = PENDING_ACTION_PATTERNS.some((p) => p.test(response));
204
+ const hasErrorIndicators = ERROR_PATTERNS.some((p) => p.test(response));
205
+ const hasFollowUpQuestions = FOLLOWUP_QUESTION_PATTERNS.some((p) => p.test(response));
206
+ const mentionsFutureWork = FUTURE_WORK_PATTERNS.some((p) => p.test(response));
207
+ const lastToolWasReadOnly = toolsUsed.length > 0 && toolsUsed.every((t) => READ_ONLY_TOOLS.has(t));
208
+ const recentTools = this.toolHistory.filter((t) => Date.now() - t.timestamp < 60000);
209
+ const hasRecentFileWrites = recentTools.some((t) => t.toolName === 'write_file' || t.toolName === 'Write' || t.toolName === 'edit_file' || t.toolName === 'Edit');
210
+ const hasRecentCommits = recentTools.some((t) => t.toolName === 'bash' || t.toolName === 'Bash') && this.responseHistory.some((r) => r.includes('git commit') || r.includes('committed'));
211
+ return {
212
+ hasExplicitCompletionStatement,
213
+ hasIncompleteWorkIndicators,
214
+ hasPendingActionIndicators,
215
+ hasErrorIndicators,
216
+ hasFollowUpQuestions,
217
+ toolsUsedInLastResponse: toolsUsed.length,
218
+ lastToolWasReadOnly,
219
+ consecutiveResponsesWithoutTools: this.consecutiveNoTools,
220
+ hasRecentFileWrites,
221
+ hasRecentCommits,
222
+ todoItemsPending: this.todoStats.pending,
223
+ todoItemsCompleted: this.todoStats.completed,
224
+ mentionsFutureWork,
225
+ completionConfidence: 0, // Will be calculated
226
+ };
227
+ }
228
+ /**
229
+ * Calculate confidence score for task completion
230
+ */
231
+ calculateConfidence(signals) {
232
+ let score = 0.5; // Start at neutral
233
+ // Strong positive signals
234
+ if (signals.hasExplicitCompletionStatement)
235
+ score += 0.25;
236
+ if (signals.hasRecentCommits)
237
+ score += 0.1;
238
+ if (signals.todoItemsPending === 0 && signals.todoItemsCompleted > 0)
239
+ score += 0.15;
240
+ // Strong negative signals
241
+ if (signals.hasIncompleteWorkIndicators)
242
+ score -= 0.3;
243
+ if (signals.hasPendingActionIndicators)
244
+ score -= 0.2;
245
+ if (signals.hasErrorIndicators)
246
+ score -= 0.25;
247
+ if (signals.todoItemsPending > 0)
248
+ score -= 0.15;
249
+ // Moderate signals
250
+ if (signals.toolsUsedInLastResponse > 0 && !signals.lastToolWasReadOnly)
251
+ score -= 0.1;
252
+ if (signals.consecutiveResponsesWithoutTools >= 2)
253
+ score += 0.1;
254
+ if (signals.hasFollowUpQuestions)
255
+ score -= 0.1;
256
+ if (signals.mentionsFutureWork && signals.hasExplicitCompletionStatement)
257
+ score += 0.05;
258
+ // Clamp to 0-1 range
259
+ return Math.max(0, Math.min(1, score));
260
+ }
261
+ /**
262
+ * Generate a verification prompt to ask the AI if the task is truly complete
263
+ */
264
+ generateVerificationPrompt(signals) {
265
+ const concerns = [];
266
+ if (signals.todoItemsPending > 0) {
267
+ concerns.push(`there are ${signals.todoItemsPending} todo items still pending`);
268
+ }
269
+ if (signals.hasFollowUpQuestions) {
270
+ concerns.push('you asked follow-up questions');
271
+ }
272
+ if (signals.mentionsFutureWork) {
273
+ concerns.push('you mentioned potential future improvements');
274
+ }
275
+ const concernsText = concerns.length > 0 ? `However, ${concerns.join(' and ')}. ` : '';
276
+ return `You indicated the task might be complete. ${concernsText}Please confirm:
277
+
278
+ 1. Have ALL the originally requested changes been implemented?
279
+ 2. Are there any remaining errors or issues that need to be fixed?
280
+ 3. Is there anything else you need to do to fully complete this task?
281
+
282
+ If everything is truly done, respond with exactly: "TASK_FULLY_COMPLETE"
283
+ If there's more work to do, describe what remains.`;
284
+ }
285
+ /**
286
+ * Generate a verification prompt for stagnation cases
287
+ */
288
+ generateStagnationVerificationPrompt() {
289
+ return `I notice you haven't used any tools for several responses. Let me check:
290
+
291
+ 1. Is the task complete? If so, summarize what was accomplished.
292
+ 2. Are you blocked on something? If so, what do you need?
293
+ 3. Is there more work to do? If so, please continue.
294
+
295
+ If everything is done, respond with exactly: "TASK_FULLY_COMPLETE"
296
+ Otherwise, please continue with the next action.`;
297
+ }
298
+ /**
299
+ * Get a human-readable reason for low confidence
300
+ */
301
+ getLowConfidenceReason(signals) {
302
+ const reasons = [];
303
+ if (signals.hasIncompleteWorkIndicators) {
304
+ reasons.push('incomplete work indicators detected');
305
+ }
306
+ if (signals.hasPendingActionIndicators) {
307
+ reasons.push('pending action indicators found');
308
+ }
309
+ if (signals.hasErrorIndicators) {
310
+ reasons.push('error indicators present');
311
+ }
312
+ if (signals.toolsUsedInLastResponse > 0 && !signals.lastToolWasReadOnly) {
313
+ reasons.push('write operations performed');
314
+ }
315
+ if (signals.todoItemsPending > 0) {
316
+ reasons.push(`${signals.todoItemsPending} todo items still pending`);
317
+ }
318
+ return reasons.length > 0 ? reasons.join(', ') : 'no clear completion signals';
319
+ }
320
+ /**
321
+ * Check if a verification response confirms completion
322
+ */
323
+ isVerificationConfirmed(verificationResponse) {
324
+ return (verificationResponse.includes('TASK_FULLY_COMPLETE') ||
325
+ /^(yes|confirmed?|all\s+done|everything\s+(is\s+)?complete)/im.test(verificationResponse.trim()));
326
+ }
327
+ }
328
+ /**
329
+ * Create a singleton instance for the shell to use
330
+ */
331
+ let detectorInstance = null;
332
+ export function getTaskCompletionDetector() {
333
+ if (!detectorInstance) {
334
+ detectorInstance = new TaskCompletionDetector();
335
+ }
336
+ return detectorInstance;
337
+ }
338
+ export function resetTaskCompletionDetector() {
339
+ if (detectorInstance) {
340
+ detectorInstance.reset();
341
+ }
342
+ }
343
+ //# sourceMappingURL=taskCompletionDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskCompletionDetector.js","sourceRoot":"","sources":["../../src/shell/taskCompletionDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA0CH,kDAAkD;AAClD,MAAM,0BAA0B,GAAG;IACjC,iEAAiE;IACjE,0GAA0G;IAC1G,2DAA2D;IAC3D,2FAA2F;IAC3F,4FAA4F;IAC5F,gGAAgG;CACjG,CAAC;AAEF,mDAAmD;AACnD,MAAM,wBAAwB,GAAG;IAC/B,qFAAqF;IACrF,4DAA4D;IAC5D,qCAAqC;IACrC,6DAA6D;IAC7D,+CAA+C;IAC/C,uEAAuE;CACxE,CAAC;AAEF,yCAAyC;AACzC,MAAM,uBAAuB,GAAG;IAC9B,kDAAkD;IAClD,+BAA+B;IAC/B,kDAAkD;IAClD,qCAAqC;CACtC,CAAC;AAEF,0CAA0C;AAC1C,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,4CAA4C;IAC5C,qDAAqD;CACtD,CAAC;AAEF,6CAA6C;AAC7C,MAAM,0BAA0B,GAAG;IACjC,gEAAgE;IAChE,oDAAoD;IACpD,MAAM;CACP,CAAC;AAEF,qCAAqC;AACrC,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uBAAuB,CAAC,oBAA4B;QAClD,OAAO,CACL,oBAAoB,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YACpD,8DAA8D,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC,CACjG,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,IAAI,gBAAgB,GAAkC,IAAI,CAAC;AAE3D,MAAM,UAAU,yBAAyB;IACvC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,IAAI,gBAAgB,EAAE,CAAC;QACrB,gBAAgB,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Cloud Deployment Tools - Unified cloud CLI capabilities with auto-detection and auto-fix
3
+ *
4
+ * Supports:
5
+ * - Firebase (Hosting, Functions, Firestore, Storage, Auth)
6
+ * - Aliyun/Alibaba Cloud (OSS, FC, ACR, etc.)
7
+ * - AWS (S3, Lambda, CloudFront, etc.)
8
+ * - GCP (Cloud Run, Storage, Functions)
9
+ * - Azure (Static Web Apps, Functions, Blob Storage)
10
+ * - Vercel, Netlify, Cloudflare Pages
11
+ *
12
+ * Features:
13
+ * - Automatic CLI detection and installation checking
14
+ * - Authentication status verification
15
+ * - Auto-fix for common issues
16
+ * - AI-driven error resolution
17
+ *
18
+ * @license MIT
19
+ * @author Bo Shang
20
+ *
21
+ * DISCLAIMER: This software is provided for both defensive and offensive security
22
+ * purposes and is open source (available via npm and GitHub) to anyone globally.
23
+ * The creator, Bo Shang, does not solicit or endorse unauthorized attacks.
24
+ * This tool is released with the belief that providing technological freedom
25
+ * globally is the right thing to do. Users are solely responsible for ensuring
26
+ * their use complies with applicable laws and regulations in their jurisdiction.
27
+ * Use responsibly and ethically.
28
+ */
29
+ import type { ToolDefinition } from '../core/toolRuntime.js';
30
+ interface CloudProvider {
31
+ id: string;
32
+ name: string;
33
+ cliCommand: string;
34
+ versionFlag: string;
35
+ installCommand: string;
36
+ installUrl: string;
37
+ loginCommand: string;
38
+ checkAuthCommand: string;
39
+ configFile?: string;
40
+ envVars?: string[];
41
+ }
42
+ declare const CLOUD_PROVIDERS: Record<string, CloudProvider>;
43
+ interface CLIStatus {
44
+ installed: boolean;
45
+ version?: string;
46
+ authenticated: boolean;
47
+ authDetails?: string;
48
+ configExists: boolean;
49
+ errors: string[];
50
+ suggestions: string[];
51
+ }
52
+ declare function getFullCLIStatus(providerId: string, workingDir: string): Promise<CLIStatus>;
53
+ declare function autoFixIssues(providerId: string, workingDir: string): Promise<string[]>;
54
+ export declare function createCloudTools(workingDir?: string): ToolDefinition[];
55
+ export type { CLIStatus, CloudProvider };
56
+ export { CLOUD_PROVIDERS, getFullCLIStatus, autoFixIssues };
57
+ //# sourceMappingURL=cloudTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudTools.d.ts","sourceRoot":"","sources":["../../src/tools/cloudTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CA+HlD,CAAC;AAEF,UAAU,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