erosolar-cli 1.7.327 → 1.7.329

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 (323) hide show
  1. package/README.md +148 -24
  2. package/dist/alpha-zero/agentWrapper.d.ts +84 -0
  3. package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
  4. package/dist/alpha-zero/agentWrapper.js +171 -0
  5. package/dist/alpha-zero/agentWrapper.js.map +1 -0
  6. package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
  7. package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
  8. package/dist/alpha-zero/codeEvaluator.js +273 -0
  9. package/dist/alpha-zero/codeEvaluator.js.map +1 -0
  10. package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
  11. package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
  12. package/dist/alpha-zero/competitiveRunner.js +224 -0
  13. package/dist/alpha-zero/competitiveRunner.js.map +1 -0
  14. package/dist/alpha-zero/index.d.ts +67 -0
  15. package/dist/alpha-zero/index.d.ts.map +1 -0
  16. package/dist/alpha-zero/index.js +99 -0
  17. package/dist/alpha-zero/index.js.map +1 -0
  18. package/dist/alpha-zero/introspection.d.ts +128 -0
  19. package/dist/alpha-zero/introspection.d.ts.map +1 -0
  20. package/dist/alpha-zero/introspection.js +300 -0
  21. package/dist/alpha-zero/introspection.js.map +1 -0
  22. package/dist/alpha-zero/metricsTracker.d.ts +71 -0
  23. package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
  24. package/dist/{core → alpha-zero}/metricsTracker.js +5 -2
  25. package/dist/alpha-zero/metricsTracker.js.map +1 -0
  26. package/dist/alpha-zero/security/core.d.ts +125 -0
  27. package/dist/alpha-zero/security/core.d.ts.map +1 -0
  28. package/dist/alpha-zero/security/core.js +271 -0
  29. package/dist/alpha-zero/security/core.js.map +1 -0
  30. package/dist/alpha-zero/security/google.d.ts +125 -0
  31. package/dist/alpha-zero/security/google.d.ts.map +1 -0
  32. package/dist/alpha-zero/security/google.js +311 -0
  33. package/dist/alpha-zero/security/google.js.map +1 -0
  34. package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
  35. package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
  36. package/dist/alpha-zero/security/googleLoader.js +41 -0
  37. package/dist/alpha-zero/security/googleLoader.js.map +1 -0
  38. package/dist/alpha-zero/security/index.d.ts +29 -0
  39. package/dist/alpha-zero/security/index.d.ts.map +1 -0
  40. package/dist/alpha-zero/security/index.js +32 -0
  41. package/dist/alpha-zero/security/index.js.map +1 -0
  42. package/dist/alpha-zero/security/simulation.d.ts +124 -0
  43. package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
  44. package/dist/alpha-zero/security/simulation.js +277 -0
  45. package/dist/alpha-zero/security/simulation.js.map +1 -0
  46. package/dist/alpha-zero/selfModification.d.ts +109 -0
  47. package/dist/alpha-zero/selfModification.d.ts.map +1 -0
  48. package/dist/alpha-zero/selfModification.js +233 -0
  49. package/dist/alpha-zero/selfModification.js.map +1 -0
  50. package/dist/alpha-zero/types.d.ts +170 -0
  51. package/dist/alpha-zero/types.d.ts.map +1 -0
  52. package/dist/alpha-zero/types.js +31 -0
  53. package/dist/alpha-zero/types.js.map +1 -0
  54. package/dist/bin/erosolar.js +21 -5
  55. package/dist/bin/erosolar.js.map +1 -1
  56. package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
  57. package/dist/capabilities/agentSpawningCapability.js +31 -56
  58. package/dist/capabilities/agentSpawningCapability.js.map +1 -1
  59. package/dist/capabilities/securityTestingCapability.d.ts +13 -0
  60. package/dist/capabilities/securityTestingCapability.d.ts.map +1 -0
  61. package/dist/capabilities/securityTestingCapability.js +25 -0
  62. package/dist/capabilities/securityTestingCapability.js.map +1 -0
  63. package/dist/contracts/agent-schemas.json +15 -0
  64. package/dist/contracts/tools.schema.json +9 -0
  65. package/dist/core/agent.d.ts +2 -2
  66. package/dist/core/agent.d.ts.map +1 -1
  67. package/dist/core/agent.js.map +1 -1
  68. package/dist/core/aiFlowOptimizer.d.ts +26 -0
  69. package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
  70. package/dist/core/aiFlowOptimizer.js +31 -0
  71. package/dist/core/aiFlowOptimizer.js.map +1 -0
  72. package/dist/core/aiOptimizationEngine.d.ts +158 -0
  73. package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
  74. package/dist/core/aiOptimizationEngine.js +428 -0
  75. package/dist/core/aiOptimizationEngine.js.map +1 -0
  76. package/dist/core/aiOptimizationIntegration.d.ts +93 -0
  77. package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
  78. package/dist/core/aiOptimizationIntegration.js +250 -0
  79. package/dist/core/aiOptimizationIntegration.js.map +1 -0
  80. package/dist/core/customCommands.d.ts +0 -1
  81. package/dist/core/customCommands.d.ts.map +1 -1
  82. package/dist/core/customCommands.js +0 -3
  83. package/dist/core/customCommands.js.map +1 -1
  84. package/dist/core/enhancedErrorRecovery.d.ts +100 -0
  85. package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
  86. package/dist/core/enhancedErrorRecovery.js +345 -0
  87. package/dist/core/enhancedErrorRecovery.js.map +1 -0
  88. package/dist/core/hooksSystem.d.ts +65 -0
  89. package/dist/core/hooksSystem.d.ts.map +1 -0
  90. package/dist/core/hooksSystem.js +273 -0
  91. package/dist/core/hooksSystem.js.map +1 -0
  92. package/dist/core/memorySystem.d.ts +48 -0
  93. package/dist/core/memorySystem.d.ts.map +1 -0
  94. package/dist/core/memorySystem.js +271 -0
  95. package/dist/core/memorySystem.js.map +1 -0
  96. package/dist/core/toolPreconditions.d.ts.map +1 -1
  97. package/dist/core/toolPreconditions.js +14 -0
  98. package/dist/core/toolPreconditions.js.map +1 -1
  99. package/dist/core/toolRuntime.d.ts +1 -22
  100. package/dist/core/toolRuntime.d.ts.map +1 -1
  101. package/dist/core/toolRuntime.js +5 -0
  102. package/dist/core/toolRuntime.js.map +1 -1
  103. package/dist/core/toolValidation.d.ts.map +1 -1
  104. package/dist/core/toolValidation.js +3 -14
  105. package/dist/core/toolValidation.js.map +1 -1
  106. package/dist/core/unified/errors.d.ts +189 -0
  107. package/dist/core/unified/errors.d.ts.map +1 -0
  108. package/dist/core/unified/errors.js +497 -0
  109. package/dist/core/unified/errors.js.map +1 -0
  110. package/dist/core/unified/index.d.ts +19 -0
  111. package/dist/core/unified/index.d.ts.map +1 -0
  112. package/dist/core/unified/index.js +68 -0
  113. package/dist/core/unified/index.js.map +1 -0
  114. package/dist/core/unified/schema.d.ts +101 -0
  115. package/dist/core/unified/schema.d.ts.map +1 -0
  116. package/dist/core/unified/schema.js +350 -0
  117. package/dist/core/unified/schema.js.map +1 -0
  118. package/dist/core/unified/toolRuntime.d.ts +179 -0
  119. package/dist/core/unified/toolRuntime.d.ts.map +1 -0
  120. package/dist/core/unified/toolRuntime.js +517 -0
  121. package/dist/core/unified/toolRuntime.js.map +1 -0
  122. package/dist/core/unified/tools.d.ts +127 -0
  123. package/dist/core/unified/tools.d.ts.map +1 -0
  124. package/dist/core/unified/tools.js +1333 -0
  125. package/dist/core/unified/tools.js.map +1 -0
  126. package/dist/core/unified/types.d.ts +352 -0
  127. package/dist/core/unified/types.d.ts.map +1 -0
  128. package/dist/core/unified/types.js +12 -0
  129. package/dist/core/unified/types.js.map +1 -0
  130. package/dist/core/unified/version.d.ts +209 -0
  131. package/dist/core/unified/version.d.ts.map +1 -0
  132. package/dist/core/unified/version.js +454 -0
  133. package/dist/core/unified/version.js.map +1 -0
  134. package/dist/core/validationRunner.d.ts +3 -1
  135. package/dist/core/validationRunner.d.ts.map +1 -1
  136. package/dist/core/validationRunner.js.map +1 -1
  137. package/dist/headless/headlessApp.d.ts.map +1 -1
  138. package/dist/headless/headlessApp.js +0 -21
  139. package/dist/headless/headlessApp.js.map +1 -1
  140. package/dist/mcp/sseClient.d.ts.map +1 -1
  141. package/dist/mcp/sseClient.js +18 -9
  142. package/dist/mcp/sseClient.js.map +1 -1
  143. package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
  144. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  145. package/dist/plugins/tools/build/buildPlugin.js +10 -4
  146. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  147. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  148. package/dist/plugins/tools/nodeDefaults.js +2 -0
  149. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  150. package/dist/plugins/tools/security/securityPlugin.d.ts +3 -0
  151. package/dist/plugins/tools/security/securityPlugin.d.ts.map +1 -0
  152. package/dist/plugins/tools/security/securityPlugin.js +12 -0
  153. package/dist/plugins/tools/security/securityPlugin.js.map +1 -0
  154. package/dist/runtime/agentSession.d.ts +2 -2
  155. package/dist/runtime/agentSession.d.ts.map +1 -1
  156. package/dist/runtime/agentSession.js +2 -2
  157. package/dist/runtime/agentSession.js.map +1 -1
  158. package/dist/security/active-stack-security.d.ts +112 -0
  159. package/dist/security/active-stack-security.d.ts.map +1 -0
  160. package/dist/security/active-stack-security.js +296 -0
  161. package/dist/security/active-stack-security.js.map +1 -0
  162. package/dist/security/advanced-persistence-research.d.ts +92 -0
  163. package/dist/security/advanced-persistence-research.d.ts.map +1 -0
  164. package/dist/security/advanced-persistence-research.js +195 -0
  165. package/dist/security/advanced-persistence-research.js.map +1 -0
  166. package/dist/security/advanced-targeting.d.ts +119 -0
  167. package/dist/security/advanced-targeting.d.ts.map +1 -0
  168. package/dist/security/advanced-targeting.js +233 -0
  169. package/dist/security/advanced-targeting.js.map +1 -0
  170. package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
  171. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
  172. package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
  173. package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
  174. package/dist/security/authorization/securityAuthorization.d.ts +88 -0
  175. package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
  176. package/dist/security/authorization/securityAuthorization.js +172 -0
  177. package/dist/security/authorization/securityAuthorization.js.map +1 -0
  178. package/dist/security/comprehensive-targeting.d.ts +85 -0
  179. package/dist/security/comprehensive-targeting.d.ts.map +1 -0
  180. package/dist/security/comprehensive-targeting.js +438 -0
  181. package/dist/security/comprehensive-targeting.js.map +1 -0
  182. package/dist/security/global-security-integration.d.ts +91 -0
  183. package/dist/security/global-security-integration.d.ts.map +1 -0
  184. package/dist/security/global-security-integration.js +218 -0
  185. package/dist/security/global-security-integration.js.map +1 -0
  186. package/dist/security/index.d.ts +38 -0
  187. package/dist/security/index.d.ts.map +1 -0
  188. package/dist/security/index.js +47 -0
  189. package/dist/security/index.js.map +1 -0
  190. package/dist/security/persistence-analyzer.d.ts +56 -0
  191. package/dist/security/persistence-analyzer.d.ts.map +1 -0
  192. package/dist/security/persistence-analyzer.js +187 -0
  193. package/dist/security/persistence-analyzer.js.map +1 -0
  194. package/dist/security/persistence-cli.d.ts +36 -0
  195. package/dist/security/persistence-cli.d.ts.map +1 -0
  196. package/dist/security/persistence-cli.js +160 -0
  197. package/dist/security/persistence-cli.js.map +1 -0
  198. package/dist/security/persistence-research.d.ts +92 -0
  199. package/dist/security/persistence-research.d.ts.map +1 -0
  200. package/dist/security/persistence-research.js +364 -0
  201. package/dist/security/persistence-research.js.map +1 -0
  202. package/dist/security/research/persistenceResearch.d.ts +97 -0
  203. package/dist/security/research/persistenceResearch.d.ts.map +1 -0
  204. package/dist/security/research/persistenceResearch.js +282 -0
  205. package/dist/security/research/persistenceResearch.js.map +1 -0
  206. package/dist/security/security-integration.d.ts +74 -0
  207. package/dist/security/security-integration.d.ts.map +1 -0
  208. package/dist/security/security-integration.js +137 -0
  209. package/dist/security/security-integration.js.map +1 -0
  210. package/dist/security/security-testing-framework.d.ts +112 -0
  211. package/dist/security/security-testing-framework.d.ts.map +1 -0
  212. package/dist/security/security-testing-framework.js +364 -0
  213. package/dist/security/security-testing-framework.js.map +1 -0
  214. package/dist/security/simulation/attackSimulation.d.ts +93 -0
  215. package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
  216. package/dist/security/simulation/attackSimulation.js +341 -0
  217. package/dist/security/simulation/attackSimulation.js.map +1 -0
  218. package/dist/security/strategic-operations.d.ts +100 -0
  219. package/dist/security/strategic-operations.d.ts.map +1 -0
  220. package/dist/security/strategic-operations.js +276 -0
  221. package/dist/security/strategic-operations.js.map +1 -0
  222. package/dist/security/tool-security-wrapper.d.ts +58 -0
  223. package/dist/security/tool-security-wrapper.d.ts.map +1 -0
  224. package/dist/security/tool-security-wrapper.js +156 -0
  225. package/dist/security/tool-security-wrapper.js.map +1 -0
  226. package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
  227. package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
  228. package/dist/shell/claudeCodeStreamHandler.js +322 -0
  229. package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
  230. package/dist/shell/inputQueueManager.d.ts +144 -0
  231. package/dist/shell/inputQueueManager.d.ts.map +1 -0
  232. package/dist/shell/inputQueueManager.js +290 -0
  233. package/dist/shell/inputQueueManager.js.map +1 -0
  234. package/dist/shell/interactiveShell.d.ts +7 -16
  235. package/dist/shell/interactiveShell.d.ts.map +1 -1
  236. package/dist/shell/interactiveShell.js +164 -235
  237. package/dist/shell/interactiveShell.js.map +1 -1
  238. package/dist/shell/metricsTracker.d.ts +60 -0
  239. package/dist/shell/metricsTracker.d.ts.map +1 -0
  240. package/dist/shell/metricsTracker.js +119 -0
  241. package/dist/shell/metricsTracker.js.map +1 -0
  242. package/dist/shell/shellApp.d.ts +0 -2
  243. package/dist/shell/shellApp.d.ts.map +1 -1
  244. package/dist/shell/shellApp.js +9 -40
  245. package/dist/shell/shellApp.js.map +1 -1
  246. package/dist/shell/streamingOutputManager.d.ts +115 -0
  247. package/dist/shell/streamingOutputManager.d.ts.map +1 -0
  248. package/dist/shell/streamingOutputManager.js +225 -0
  249. package/dist/shell/streamingOutputManager.js.map +1 -0
  250. package/dist/shell/systemPrompt.d.ts.map +1 -1
  251. package/dist/shell/systemPrompt.js +4 -1
  252. package/dist/shell/systemPrompt.js.map +1 -1
  253. package/dist/shell/terminalInput.d.ts +117 -149
  254. package/dist/shell/terminalInput.d.ts.map +1 -1
  255. package/dist/shell/terminalInput.js +521 -639
  256. package/dist/shell/terminalInput.js.map +1 -1
  257. package/dist/shell/terminalInputAdapter.d.ts +20 -79
  258. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  259. package/dist/shell/terminalInputAdapter.js +30 -99
  260. package/dist/shell/terminalInputAdapter.js.map +1 -1
  261. package/dist/subagents/taskRunner.d.ts +1 -7
  262. package/dist/subagents/taskRunner.d.ts.map +1 -1
  263. package/dist/subagents/taskRunner.js +47 -180
  264. package/dist/subagents/taskRunner.js.map +1 -1
  265. package/dist/tools/securityTools.d.ts +22 -0
  266. package/dist/tools/securityTools.d.ts.map +1 -0
  267. package/dist/tools/securityTools.js +448 -0
  268. package/dist/tools/securityTools.js.map +1 -0
  269. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  270. package/dist/ui/ShellUIAdapter.js +12 -13
  271. package/dist/ui/ShellUIAdapter.js.map +1 -1
  272. package/dist/ui/display.d.ts +45 -24
  273. package/dist/ui/display.d.ts.map +1 -1
  274. package/dist/ui/display.js +259 -140
  275. package/dist/ui/display.js.map +1 -1
  276. package/dist/ui/persistentPrompt.d.ts +50 -0
  277. package/dist/ui/persistentPrompt.d.ts.map +1 -0
  278. package/dist/ui/persistentPrompt.js +92 -0
  279. package/dist/ui/persistentPrompt.js.map +1 -0
  280. package/dist/ui/terminalUISchema.d.ts +195 -0
  281. package/dist/ui/terminalUISchema.d.ts.map +1 -0
  282. package/dist/ui/terminalUISchema.js +113 -0
  283. package/dist/ui/terminalUISchema.js.map +1 -0
  284. package/dist/ui/theme.d.ts.map +1 -1
  285. package/dist/ui/theme.js +8 -6
  286. package/dist/ui/theme.js.map +1 -1
  287. package/dist/ui/toolDisplay.d.ts +158 -0
  288. package/dist/ui/toolDisplay.d.ts.map +1 -1
  289. package/dist/ui/toolDisplay.js +348 -0
  290. package/dist/ui/toolDisplay.js.map +1 -1
  291. package/dist/ui/unified/layout.d.ts +0 -1
  292. package/dist/ui/unified/layout.d.ts.map +1 -1
  293. package/dist/ui/unified/layout.js +25 -15
  294. package/dist/ui/unified/layout.js.map +1 -1
  295. package/package.json +4 -4
  296. package/scripts/deploy-security-capabilities.js +178 -0
  297. package/dist/core/hooks.d.ts +0 -113
  298. package/dist/core/hooks.d.ts.map +0 -1
  299. package/dist/core/hooks.js +0 -267
  300. package/dist/core/hooks.js.map +0 -1
  301. package/dist/core/metricsTracker.d.ts +0 -122
  302. package/dist/core/metricsTracker.d.ts.map +0 -1
  303. package/dist/core/metricsTracker.js.map +0 -1
  304. package/dist/core/securityAssessment.d.ts +0 -91
  305. package/dist/core/securityAssessment.d.ts.map +0 -1
  306. package/dist/core/securityAssessment.js +0 -580
  307. package/dist/core/securityAssessment.js.map +0 -1
  308. package/dist/core/verification.d.ts +0 -137
  309. package/dist/core/verification.d.ts.map +0 -1
  310. package/dist/core/verification.js +0 -323
  311. package/dist/core/verification.js.map +0 -1
  312. package/dist/subagents/agentConfig.d.ts +0 -27
  313. package/dist/subagents/agentConfig.d.ts.map +0 -1
  314. package/dist/subagents/agentConfig.js +0 -89
  315. package/dist/subagents/agentConfig.js.map +0 -1
  316. package/dist/subagents/agentRegistry.d.ts +0 -33
  317. package/dist/subagents/agentRegistry.d.ts.map +0 -1
  318. package/dist/subagents/agentRegistry.js +0 -162
  319. package/dist/subagents/agentRegistry.js.map +0 -1
  320. package/dist/utils/frontmatter.d.ts +0 -10
  321. package/dist/utils/frontmatter.d.ts.map +0 -1
  322. package/dist/utils/frontmatter.js +0 -78
  323. package/dist/utils/frontmatter.js.map +0 -1
@@ -0,0 +1,517 @@
1
+ /**
2
+ * Unified Tool Runtime
3
+ *
4
+ * Core tool execution engine with caching, validation, and lifecycle management.
5
+ * Combines the best features from both TypeScript and Python implementations.
6
+ *
7
+ * Principal Investigator: Bo Shang
8
+ * Framework: erosolar-cli
9
+ */
10
+ import { validateToolArguments, ToolArgumentValidationError } from './schema.js';
11
+ import { validateToolPreconditions } from '../toolPreconditions.js';
12
+ // ============================================================================
13
+ // Constants
14
+ // ============================================================================
15
+ /**
16
+ * Tools that can be safely cached based on their arguments
17
+ */
18
+ export const CACHEABLE_TOOLS = new Set([
19
+ 'Read',
20
+ 'read',
21
+ 'read_file',
22
+ 'Glob',
23
+ 'glob',
24
+ 'glob_search',
25
+ 'Grep',
26
+ 'grep',
27
+ 'grep_search',
28
+ 'WebSearch',
29
+ 'web_search',
30
+ 'WebFetch',
31
+ 'web_fetch',
32
+ 'find_definition',
33
+ 'analyze_code_quality',
34
+ 'analyze_complexity',
35
+ 'find_dependencies',
36
+ ]);
37
+ /**
38
+ * Default configuration
39
+ */
40
+ const DEFAULT_CONFIG = {
41
+ enableCache: true,
42
+ cacheTtlMs: 5 * 60 * 1000, // 5 minutes
43
+ maxCacheSize: 1000,
44
+ defaultTimeoutMs: 120_000, // 2 minutes
45
+ networkTimeoutMs: 30_000, // 30 seconds
46
+ maxOutputLength: 100_000, // 100k chars
47
+ verbose: false,
48
+ };
49
+ // ============================================================================
50
+ // Tool Runtime
51
+ // ============================================================================
52
+ /**
53
+ * Unified Tool Runtime
54
+ *
55
+ * Manages tool registration, execution, caching, and validation.
56
+ */
57
+ export class ToolRuntime {
58
+ registry = new Map();
59
+ cache = new Map();
60
+ config;
61
+ observers = [];
62
+ executionStats = {
63
+ totalCalls: 0,
64
+ cacheHits: 0,
65
+ errors: 0,
66
+ totalTimeMs: 0,
67
+ };
68
+ constructor(config = {}) {
69
+ this.config = { ...DEFAULT_CONFIG, ...config };
70
+ }
71
+ // ==========================================================================
72
+ // Registration
73
+ // ==========================================================================
74
+ /**
75
+ * Register a tool suite
76
+ */
77
+ registerSuite(suite) {
78
+ for (const tool of suite.tools) {
79
+ this.registerTool(tool, suite.name);
80
+ }
81
+ if (this.config.verbose) {
82
+ console.log(`[ToolRuntime] Registered suite: ${suite.name} (${suite.tools.length} tools)`);
83
+ }
84
+ }
85
+ /**
86
+ * Register a single tool
87
+ */
88
+ registerTool(tool, suiteName = 'default') {
89
+ const record = {
90
+ definition: tool,
91
+ suite: suiteName,
92
+ enabled: true,
93
+ executionCount: 0,
94
+ };
95
+ this.registry.set(tool.name, record);
96
+ // Also register lowercase version for case-insensitive lookup
97
+ if (tool.name !== tool.name.toLowerCase()) {
98
+ this.registry.set(tool.name.toLowerCase(), record);
99
+ }
100
+ }
101
+ /**
102
+ * Unregister a tool
103
+ */
104
+ unregisterTool(name) {
105
+ const record = this.registry.get(name);
106
+ if (!record)
107
+ return false;
108
+ this.registry.delete(name);
109
+ this.registry.delete(name.toLowerCase());
110
+ return true;
111
+ }
112
+ /**
113
+ * Get a tool by name
114
+ */
115
+ getTool(name) {
116
+ return this.registry.get(name) || this.registry.get(name.toLowerCase());
117
+ }
118
+ /**
119
+ * Check if a tool exists
120
+ */
121
+ hasTool(name) {
122
+ return this.registry.has(name) || this.registry.has(name.toLowerCase());
123
+ }
124
+ /**
125
+ * Enable or disable a tool
126
+ */
127
+ setToolEnabled(name, enabled) {
128
+ const record = this.getTool(name);
129
+ if (!record)
130
+ return false;
131
+ record.enabled = enabled;
132
+ return true;
133
+ }
134
+ // ==========================================================================
135
+ // Execution
136
+ // ==========================================================================
137
+ /**
138
+ * Execute a tool call
139
+ */
140
+ async execute(call) {
141
+ const startTime = Date.now();
142
+ this.executionStats.totalCalls++;
143
+ // Look up tool
144
+ const record = this.getTool(call.name);
145
+ if (!record) {
146
+ return this.createErrorResult(call, startTime, `Unknown tool: ${call.name}`);
147
+ }
148
+ if (!record.enabled) {
149
+ return this.createErrorResult(call, startTime, `Tool is disabled: ${call.name}`);
150
+ }
151
+ const tool = record.definition;
152
+ // Notify observers
153
+ this.notifyObservers('onToolStart', call);
154
+ // Check cache
155
+ if (this.config.enableCache && this.isCacheable(tool)) {
156
+ const cacheKey = this.getCacheKey(call);
157
+ const cached = this.cache.get(cacheKey);
158
+ if (cached && !this.isCacheExpired(cached)) {
159
+ cached.hitCount++;
160
+ this.executionStats.cacheHits++;
161
+ this.notifyObservers('onCacheHit', call, cached);
162
+ return {
163
+ toolCallId: call.id,
164
+ output: cached.output,
165
+ success: true,
166
+ cached: true,
167
+ durationMs: Date.now() - startTime,
168
+ };
169
+ }
170
+ this.notifyObservers('onCacheMiss', call);
171
+ }
172
+ // Validate arguments
173
+ try {
174
+ validateToolArguments(call.name, tool.parameters, call.arguments);
175
+ }
176
+ catch (error) {
177
+ if (error instanceof ToolArgumentValidationError) {
178
+ this.notifyObservers('onValidationError', call, error);
179
+ return this.createErrorResult(call, startTime, error.message);
180
+ }
181
+ throw error;
182
+ }
183
+ // Pre-flight AI flow validation - catch common tool usage failures
184
+ const preflightWarnings = validateToolPreconditions(call.name, call.arguments);
185
+ for (const warning of preflightWarnings) {
186
+ this.notifyObservers('onToolWarning', call, warning);
187
+ }
188
+ // Execute tool
189
+ try {
190
+ const output = await this.executeWithTimeout(tool, call.arguments);
191
+ const truncatedOutput = this.truncateOutput(output, call.name);
192
+ const durationMs = Date.now() - startTime;
193
+ // Update stats
194
+ record.executionCount++;
195
+ record.lastExecuted = Date.now();
196
+ this.executionStats.totalTimeMs += durationMs;
197
+ // Cache result if cacheable
198
+ if (this.config.enableCache && this.isCacheable(tool)) {
199
+ this.cacheResult(call, truncatedOutput);
200
+ }
201
+ const result = {
202
+ toolCallId: call.id,
203
+ output: truncatedOutput,
204
+ success: true,
205
+ cached: false,
206
+ durationMs,
207
+ };
208
+ this.notifyObservers('onToolResult', call, result);
209
+ return result;
210
+ }
211
+ catch (error) {
212
+ this.executionStats.errors++;
213
+ const errorMessage = error instanceof Error ? error.message : String(error);
214
+ this.notifyObservers('onToolError', call, error);
215
+ return this.createErrorResult(call, startTime, errorMessage);
216
+ }
217
+ }
218
+ /**
219
+ * Execute with timeout
220
+ */
221
+ async executeWithTimeout(tool, args) {
222
+ const timeoutMs = this.config.defaultTimeoutMs;
223
+ return new Promise((resolve, reject) => {
224
+ const timer = setTimeout(() => {
225
+ reject(new Error(`Tool execution timed out after ${timeoutMs}ms`));
226
+ }, timeoutMs);
227
+ tool
228
+ .execute(args)
229
+ .then((result) => {
230
+ clearTimeout(timer);
231
+ resolve(result);
232
+ })
233
+ .catch((error) => {
234
+ clearTimeout(timer);
235
+ reject(error);
236
+ });
237
+ });
238
+ }
239
+ /**
240
+ * Create an error result
241
+ */
242
+ createErrorResult(call, startTime, error) {
243
+ return {
244
+ toolCallId: call.id,
245
+ output: `Error: ${error}`,
246
+ success: false,
247
+ cached: false,
248
+ durationMs: Date.now() - startTime,
249
+ error,
250
+ };
251
+ }
252
+ // ==========================================================================
253
+ // Caching
254
+ // ==========================================================================
255
+ /**
256
+ * Check if a tool's results can be cached
257
+ */
258
+ isCacheable(tool) {
259
+ if (tool.cacheable !== undefined) {
260
+ return tool.cacheable;
261
+ }
262
+ return CACHEABLE_TOOLS.has(tool.name);
263
+ }
264
+ /**
265
+ * Generate cache key for a tool call
266
+ */
267
+ getCacheKey(call) {
268
+ const argsStr = JSON.stringify(call.arguments, Object.keys(call.arguments).sort());
269
+ return `${call.name}:${argsStr}`;
270
+ }
271
+ /**
272
+ * Check if a cache entry has expired
273
+ */
274
+ isCacheExpired(entry) {
275
+ return Date.now() - entry.timestamp > entry.ttl;
276
+ }
277
+ /**
278
+ * Cache a result
279
+ */
280
+ cacheResult(call, output) {
281
+ // Enforce max cache size
282
+ if (this.cache.size >= this.config.maxCacheSize) {
283
+ this.evictOldestCacheEntries(Math.floor(this.config.maxCacheSize * 0.2));
284
+ }
285
+ const cacheKey = this.getCacheKey(call);
286
+ this.cache.set(cacheKey, {
287
+ output,
288
+ timestamp: Date.now(),
289
+ ttl: this.config.cacheTtlMs,
290
+ hitCount: 0,
291
+ });
292
+ }
293
+ /**
294
+ * Evict oldest cache entries
295
+ */
296
+ evictOldestCacheEntries(count) {
297
+ const entries = Array.from(this.cache.entries());
298
+ entries.sort(([, a], [, b]) => a.timestamp - b.timestamp);
299
+ for (let i = 0; i < Math.min(count, entries.length); i++) {
300
+ const entry = entries[i];
301
+ if (entry) {
302
+ this.cache.delete(entry[0]);
303
+ }
304
+ }
305
+ }
306
+ /**
307
+ * Clear all cache entries
308
+ */
309
+ clearCache() {
310
+ this.cache.clear();
311
+ }
312
+ /**
313
+ * Clear expired cache entries
314
+ */
315
+ clearExpiredCache() {
316
+ let cleared = 0;
317
+ for (const [key, entry] of Array.from(this.cache.entries())) {
318
+ if (this.isCacheExpired(entry)) {
319
+ this.cache.delete(key);
320
+ cleared++;
321
+ }
322
+ }
323
+ return cleared;
324
+ }
325
+ // ==========================================================================
326
+ // Output Handling
327
+ // ==========================================================================
328
+ /**
329
+ * Truncate output if too long
330
+ *
331
+ * PERF: Uses efficient slicing - O(1) for length check, O(n) for truncation only when needed.
332
+ * Binary search not applicable here as we need character boundaries, not search.
333
+ */
334
+ truncateOutput(output, toolName) {
335
+ const maxLength = this.config.maxOutputLength;
336
+ const len = output.length;
337
+ // Fast path: no truncation needed
338
+ if (len <= maxLength) {
339
+ return output;
340
+ }
341
+ const truncatedCount = len - maxLength;
342
+ const toolLower = toolName.toLowerCase();
343
+ // For file reads, keep head and tail for better context
344
+ if (toolLower.includes('read') || toolLower === 'glob' || toolLower === 'grep') {
345
+ // Keep 70% head, 30% tail (minus notice overhead)
346
+ const noticeLen = 50;
347
+ const usableLen = maxLength - noticeLen;
348
+ const headSize = Math.floor(usableLen * 0.7);
349
+ const tailSize = usableLen - headSize;
350
+ return (output.slice(0, headSize) +
351
+ `\n\n... [truncated ${truncatedCount} characters] ...\n\n` +
352
+ output.slice(-tailSize));
353
+ }
354
+ // For bash/command output, keep more of the tail (errors usually at end)
355
+ if (toolLower.includes('bash') || toolLower === 'execute') {
356
+ const noticeLen = 50;
357
+ const usableLen = maxLength - noticeLen;
358
+ const tailSize = Math.floor(usableLen * 0.8);
359
+ const headSize = usableLen - tailSize;
360
+ return (output.slice(0, headSize) +
361
+ `\n\n... [truncated ${truncatedCount} characters] ...\n\n` +
362
+ output.slice(-tailSize));
363
+ }
364
+ // Default: keep head only (fastest)
365
+ return output.slice(0, maxLength - 50) + `\n... [truncated ${truncatedCount} characters]`;
366
+ }
367
+ // ==========================================================================
368
+ // Observers
369
+ // ==========================================================================
370
+ /**
371
+ * Add an observer
372
+ */
373
+ addObserver(observer) {
374
+ this.observers.push(observer);
375
+ }
376
+ /**
377
+ * Remove an observer
378
+ */
379
+ removeObserver(observer) {
380
+ const index = this.observers.indexOf(observer);
381
+ if (index === -1)
382
+ return false;
383
+ this.observers.splice(index, 1);
384
+ return true;
385
+ }
386
+ /**
387
+ * Notify observers of an event
388
+ */
389
+ notifyObservers(event, ...args) {
390
+ for (const observer of this.observers) {
391
+ const handler = observer[event];
392
+ if (handler) {
393
+ try {
394
+ handler.apply(observer, args);
395
+ }
396
+ catch (error) {
397
+ if (this.config.verbose) {
398
+ console.error(`[ToolRuntime] Observer error:`, error);
399
+ }
400
+ }
401
+ }
402
+ }
403
+ }
404
+ // ==========================================================================
405
+ // Provider Integration
406
+ // ==========================================================================
407
+ /**
408
+ * Get tools in provider format
409
+ */
410
+ listProviderTools() {
411
+ const tools = [];
412
+ const seen = new Set();
413
+ for (const [, record] of Array.from(this.registry.entries())) {
414
+ if (!record.enabled || seen.has(record.definition.name)) {
415
+ continue;
416
+ }
417
+ seen.add(record.definition.name);
418
+ const tool = record.definition;
419
+ tools.push({
420
+ type: 'function',
421
+ function: {
422
+ name: tool.name,
423
+ description: tool.description,
424
+ parameters: tool.parameters,
425
+ },
426
+ });
427
+ }
428
+ return tools;
429
+ }
430
+ /**
431
+ * Get tools for a specific category
432
+ */
433
+ getToolsByCategory(category) {
434
+ const tools = [];
435
+ const seen = new Set();
436
+ for (const record of Array.from(this.registry.values())) {
437
+ if (record.definition.category === category &&
438
+ record.enabled &&
439
+ !seen.has(record.definition.name)) {
440
+ seen.add(record.definition.name);
441
+ tools.push(record);
442
+ }
443
+ }
444
+ return tools;
445
+ }
446
+ // ==========================================================================
447
+ // Statistics
448
+ // ==========================================================================
449
+ /**
450
+ * Get execution statistics
451
+ */
452
+ getStats() {
453
+ const totalCalls = this.executionStats.totalCalls;
454
+ return {
455
+ totalCalls,
456
+ cacheHits: this.executionStats.cacheHits,
457
+ cacheHitRate: totalCalls > 0 ? this.executionStats.cacheHits / totalCalls : 0,
458
+ errors: this.executionStats.errors,
459
+ errorRate: totalCalls > 0 ? this.executionStats.errors / totalCalls : 0,
460
+ avgExecutionTimeMs: totalCalls > 0 ? this.executionStats.totalTimeMs / totalCalls : 0,
461
+ registeredTools: new Set(Array.from(this.registry.values()).map((r) => r.definition.name))
462
+ .size,
463
+ cacheSize: this.cache.size,
464
+ };
465
+ }
466
+ /**
467
+ * Reset statistics
468
+ */
469
+ resetStats() {
470
+ this.executionStats = {
471
+ totalCalls: 0,
472
+ cacheHits: 0,
473
+ errors: 0,
474
+ totalTimeMs: 0,
475
+ };
476
+ }
477
+ /**
478
+ * Get tool execution counts
479
+ */
480
+ getToolExecutionCounts() {
481
+ const counts = new Map();
482
+ const seen = new Set();
483
+ for (const record of Array.from(this.registry.values())) {
484
+ if (!seen.has(record.definition.name)) {
485
+ seen.add(record.definition.name);
486
+ counts.set(record.definition.name, record.executionCount);
487
+ }
488
+ }
489
+ return counts;
490
+ }
491
+ }
492
+ // ============================================================================
493
+ // Factory Functions
494
+ // ============================================================================
495
+ /**
496
+ * Create a tool runtime with default configuration
497
+ */
498
+ export function createToolRuntime(config) {
499
+ return new ToolRuntime(config);
500
+ }
501
+ /**
502
+ * Create a tool suite from definitions
503
+ */
504
+ export function createToolSuite(name, version, tools, description) {
505
+ return {
506
+ name,
507
+ version,
508
+ description,
509
+ tools,
510
+ };
511
+ }
512
+ // ============================================================================
513
+ // AI Flow Pre-Flight Validation
514
+ // ============================================================================
515
+ // Re-export shared preflight validation to maintain unified runtime parity.
516
+ export { validateToolPreconditions };
517
+ //# sourceMappingURL=toolRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolRuntime.js","sourceRoot":"","sources":["../../../src/core/unified/toolRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAyB,MAAM,yBAAyB,CAAC;AAE3F,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACrC,MAAM;IACN,MAAM;IACN,WAAW;IACX,MAAM;IACN,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;IACN,aAAa;IACb,WAAW;IACX,YAAY;IACZ,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,cAAc,GAAsB;IACxC,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,YAAY;IACvC,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,OAAO,EAAE,YAAY;IACvC,gBAAgB,EAAE,MAAM,EAAE,aAAa;IACvC,eAAe,EAAE,OAAO,EAAE,aAAa;IACvC,OAAO,EAAE,KAAK;CACf,CAAC;AAoCF,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACd,QAAQ,GAAG,IAAI,GAAG,EAAsB,CAAC;IACzC,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IACtC,MAAM,CAAoB;IAC1B,SAAS,GAA0B,EAAE,CAAC;IACtC,cAAc,GAAG;QACvB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,CAAC;KACf,CAAC;IAEF,YAAY,SAAqC,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AAU;QACR,IAAI,CAAC,cAAc,GAAG;YACpB,UAAU,EAAE,CAAC;YACb,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,CAAC;SACf,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QACzC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAE/B,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACjC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmC;IACnE,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,OAAe,EACf,KAAuB,EACvB,WAAoB;IAEpB,OAAO;QACL,IAAI;QACJ,OAAO;QACP,WAAW;QACX,KAAK;KACN,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,gCAAgC;AAChC,+EAA+E;AAC/E,4EAA4E;AAC5E,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Unified Tool Implementations
3
+ *
4
+ * Complete implementation of all tools defined in the unified schema.
5
+ * Single source of truth for tool executors in TypeScript.
6
+ *
7
+ * Principal Investigator: Bo Shang
8
+ * Framework: erosolar-cli
9
+ */
10
+ import type { ToolDefinition, ToolSuite } from './types.js';
11
+ /**
12
+ * Read tool - Read file contents
13
+ */
14
+ export declare function createReadTool(workingDir: string): ToolDefinition;
15
+ /**
16
+ * Write tool - Write content to a file
17
+ */
18
+ export declare function createWriteTool(workingDir: string): ToolDefinition;
19
+ /**
20
+ * Edit tool - Make surgical edits to a file
21
+ */
22
+ export declare function createEditTool(workingDir: string): ToolDefinition;
23
+ /**
24
+ * Bash tool - Execute shell commands
25
+ */
26
+ export declare function createBashTool(workingDir: string): ToolDefinition;
27
+ /**
28
+ * Glob tool - Find files matching a pattern
29
+ */
30
+ export declare function createGlobTool(workingDir: string): ToolDefinition;
31
+ /**
32
+ * Grep tool - Search file contents with regex
33
+ */
34
+ export declare function createGrepTool(workingDir: string): ToolDefinition;
35
+ /**
36
+ * WebSearch tool - Search the web
37
+ */
38
+ export declare function createWebSearchTool(): ToolDefinition;
39
+ /**
40
+ * WebFetch tool - Fetch and analyze web page content
41
+ */
42
+ export declare function createWebFetchTool(): ToolDefinition;
43
+ /**
44
+ * AnalyzeComplexity tool - Analyze code complexity
45
+ */
46
+ export declare function createAnalyzeComplexityTool(): ToolDefinition;
47
+ /**
48
+ * FindDependencies tool - Find imports and dependencies
49
+ */
50
+ export declare function createFindDependenciesTool(): ToolDefinition;
51
+ /**
52
+ * GenerateDocstring tool - Generate documentation for code
53
+ */
54
+ export declare function createGenerateDocstringTool(): ToolDefinition;
55
+ /**
56
+ * SuggestRefactorings tool - Suggest code refactoring improvements
57
+ */
58
+ export declare function createSuggestRefactoringsTool(): ToolDefinition;
59
+ /**
60
+ * GenerateTestStub tool - Generate test stubs
61
+ */
62
+ export declare function createGenerateTestStubTool(): ToolDefinition;
63
+ /**
64
+ * DependencyAudit tool - Audit dependencies for vulnerabilities
65
+ */
66
+ export declare function createDependencyAuditTool(workingDir: string): ToolDefinition;
67
+ /**
68
+ * CodeSecurityScan tool - Scan code for security vulnerabilities
69
+ */
70
+ export declare function createCodeSecurityScanTool(): ToolDefinition;
71
+ /**
72
+ * AnalyzeAttackSurface tool - Analyze code attack surface
73
+ */
74
+ export declare function createAnalyzeAttackSurfaceTool(): ToolDefinition;
75
+ /**
76
+ * AlphaZeroEvaluate tool - Evaluate code quality
77
+ */
78
+ export declare function createAlphaZeroEvaluateTool(): ToolDefinition;
79
+ /**
80
+ * AlphaZeroTournament tool - Run competitive tournament
81
+ */
82
+ export declare function createAlphaZeroTournamentTool(): ToolDefinition;
83
+ /**
84
+ * AlphaZeroIntrospect tool - Analyze agent performance
85
+ */
86
+ export declare function createAlphaZeroIntrospectTool(): ToolDefinition;
87
+ /**
88
+ * AlphaZeroHistory tool - Get historical competition data
89
+ */
90
+ export declare function createAlphaZeroHistoryTool(): ToolDefinition;
91
+ /**
92
+ * AlphaZeroMetrics tool - Get comprehensive metrics
93
+ */
94
+ export declare function createAlphaZeroMetricsTool(): ToolDefinition;
95
+ /**
96
+ * Intelligence Analyze - Run code analysis
97
+ */
98
+ export declare function createIntelligenceAnalyzeTool(workingDir: string): ToolDefinition;
99
+ /**
100
+ * Intelligence Refactor - Find and apply refactorings
101
+ */
102
+ export declare function createIntelligenceRefactorTool(workingDir: string): ToolDefinition;
103
+ /**
104
+ * Intelligence Document - Generate documentation
105
+ */
106
+ export declare function createIntelligenceDocumentTool(workingDir: string): ToolDefinition;
107
+ /**
108
+ * Intelligence Test - Generate test suites
109
+ */
110
+ export declare function createIntelligenceTestTool(workingDir: string): ToolDefinition;
111
+ /**
112
+ * Intelligence Full - Run complete intelligence suite
113
+ */
114
+ export declare function createIntelligenceFullTool(workingDir: string): ToolDefinition;
115
+ /**
116
+ * Create the complete unified tool suite
117
+ */
118
+ export declare function createUnifiedToolSuite(workingDir: string): ToolSuite;
119
+ /**
120
+ * Create individual tool suites by category
121
+ */
122
+ export declare function createCoreToolSuite(workingDir: string): ToolSuite;
123
+ export declare function createWebToolSuite(): ToolSuite;
124
+ export declare function createCodingToolSuite(): ToolSuite;
125
+ export declare function createSecurityToolSuite(workingDir: string): ToolSuite;
126
+ export declare function createAlphaZeroToolSuite(): ToolSuite;
127
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/core/unified/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5D;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAyCjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAoElE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAsBjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAkFjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAmDjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAkEjE;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,CAmBpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,CAqBnD;AAMD;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,cAAc,CAiC5D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,cAAc,CAoC3D;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,cAAc,CAyD5D;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,cAAc,CA+C9D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,cAAc,CAgE3D;AAMD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,G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