@deepseekdev/coder 1.0.74

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 (711) hide show
  1. package/LICENSE +21 -0
  2. package/agents/agi-code.rules.json +159 -0
  3. package/agents/general.rules.json +181 -0
  4. package/dist/bin/cliMode.d.ts +8 -0
  5. package/dist/bin/cliMode.d.ts.map +1 -0
  6. package/dist/bin/cliMode.js +20 -0
  7. package/dist/bin/cliMode.js.map +1 -0
  8. package/dist/bin/deepseek.d.ts +3 -0
  9. package/dist/bin/deepseek.d.ts.map +1 -0
  10. package/dist/bin/deepseek.js +137 -0
  11. package/dist/bin/deepseek.js.map +1 -0
  12. package/dist/bin/erosolar.d.ts +7 -0
  13. package/dist/bin/erosolar.d.ts.map +1 -0
  14. package/dist/bin/erosolar.js +7 -0
  15. package/dist/bin/erosolar.js.map +1 -0
  16. package/dist/bin/lean.d.ts +9 -0
  17. package/dist/bin/lean.d.ts.map +1 -0
  18. package/dist/bin/lean.js +333 -0
  19. package/dist/bin/lean.js.map +1 -0
  20. package/dist/bin/selfTest.d.ts +14 -0
  21. package/dist/bin/selfTest.d.ts.map +1 -0
  22. package/dist/bin/selfTest.js +298 -0
  23. package/dist/bin/selfTest.js.map +1 -0
  24. package/dist/capabilities/baseCapability.d.ts +72 -0
  25. package/dist/capabilities/baseCapability.d.ts.map +1 -0
  26. package/dist/capabilities/baseCapability.js +183 -0
  27. package/dist/capabilities/baseCapability.js.map +1 -0
  28. package/dist/capabilities/bashCapability.d.ts +13 -0
  29. package/dist/capabilities/bashCapability.d.ts.map +1 -0
  30. package/dist/capabilities/bashCapability.js +24 -0
  31. package/dist/capabilities/bashCapability.js.map +1 -0
  32. package/dist/capabilities/editCapability.d.ts +17 -0
  33. package/dist/capabilities/editCapability.d.ts.map +1 -0
  34. package/dist/capabilities/editCapability.js +27 -0
  35. package/dist/capabilities/editCapability.js.map +1 -0
  36. package/dist/capabilities/enhancedGitCapability.d.ts +7 -0
  37. package/dist/capabilities/enhancedGitCapability.d.ts.map +1 -0
  38. package/dist/capabilities/enhancedGitCapability.js +220 -0
  39. package/dist/capabilities/enhancedGitCapability.js.map +1 -0
  40. package/dist/capabilities/filesystemCapability.d.ts +13 -0
  41. package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
  42. package/dist/capabilities/filesystemCapability.js +24 -0
  43. package/dist/capabilities/filesystemCapability.js.map +1 -0
  44. package/dist/capabilities/gitHistoryCapability.d.ts +6 -0
  45. package/dist/capabilities/gitHistoryCapability.d.ts.map +1 -0
  46. package/dist/capabilities/gitHistoryCapability.js +160 -0
  47. package/dist/capabilities/gitHistoryCapability.js.map +1 -0
  48. package/dist/capabilities/hitlCapability.d.ts +18 -0
  49. package/dist/capabilities/hitlCapability.d.ts.map +1 -0
  50. package/dist/capabilities/hitlCapability.js +29 -0
  51. package/dist/capabilities/hitlCapability.js.map +1 -0
  52. package/dist/capabilities/index.d.ts +11 -0
  53. package/dist/capabilities/index.d.ts.map +1 -0
  54. package/dist/capabilities/index.js +13 -0
  55. package/dist/capabilities/index.js.map +1 -0
  56. package/dist/capabilities/searchCapability.d.ts +19 -0
  57. package/dist/capabilities/searchCapability.d.ts.map +1 -0
  58. package/dist/capabilities/searchCapability.js +29 -0
  59. package/dist/capabilities/searchCapability.js.map +1 -0
  60. package/dist/capabilities/toolManifest.d.ts +3 -0
  61. package/dist/capabilities/toolManifest.d.ts.map +1 -0
  62. package/dist/capabilities/toolManifest.js +163 -0
  63. package/dist/capabilities/toolManifest.js.map +1 -0
  64. package/dist/capabilities/toolRegistry.d.ts +25 -0
  65. package/dist/capabilities/toolRegistry.d.ts.map +1 -0
  66. package/dist/capabilities/toolRegistry.js +150 -0
  67. package/dist/capabilities/toolRegistry.js.map +1 -0
  68. package/dist/capabilities/unifiedCodingCapability.d.ts +48 -0
  69. package/dist/capabilities/unifiedCodingCapability.d.ts.map +1 -0
  70. package/dist/capabilities/unifiedCodingCapability.js +631 -0
  71. package/dist/capabilities/unifiedCodingCapability.js.map +1 -0
  72. package/dist/capabilities/webCapability.d.ts +23 -0
  73. package/dist/capabilities/webCapability.d.ts.map +1 -0
  74. package/dist/capabilities/webCapability.js +33 -0
  75. package/dist/capabilities/webCapability.js.map +1 -0
  76. package/dist/config.d.ts +25 -0
  77. package/dist/config.d.ts.map +1 -0
  78. package/dist/config.js +155 -0
  79. package/dist/config.js.map +1 -0
  80. package/dist/contracts/agent-profiles.schema.json +43 -0
  81. package/dist/contracts/agent-schemas.json +480 -0
  82. package/dist/contracts/models.schema.json +9 -0
  83. package/dist/contracts/module-schema.json +430 -0
  84. package/dist/contracts/schemas/agent-profile.schema.json +157 -0
  85. package/dist/contracts/schemas/agent-rules.schema.json +238 -0
  86. package/dist/contracts/schemas/agent-schemas.schema.json +528 -0
  87. package/dist/contracts/schemas/agent.schema.json +90 -0
  88. package/dist/contracts/schemas/tool-selection.schema.json +174 -0
  89. package/dist/contracts/tools.schema.json +82 -0
  90. package/dist/contracts/unified-schema.json +757 -0
  91. package/dist/contracts/v1/agent.d.ts +187 -0
  92. package/dist/contracts/v1/agent.d.ts.map +1 -0
  93. package/dist/contracts/v1/agent.js +8 -0
  94. package/dist/contracts/v1/agent.js.map +1 -0
  95. package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
  96. package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
  97. package/dist/contracts/v1/agentProfileManifest.js +9 -0
  98. package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
  99. package/dist/contracts/v1/agentRules.d.ts +60 -0
  100. package/dist/contracts/v1/agentRules.d.ts.map +1 -0
  101. package/dist/contracts/v1/agentRules.js +10 -0
  102. package/dist/contracts/v1/agentRules.js.map +1 -0
  103. package/dist/contracts/v1/provider.d.ts +149 -0
  104. package/dist/contracts/v1/provider.d.ts.map +1 -0
  105. package/dist/contracts/v1/provider.js +7 -0
  106. package/dist/contracts/v1/provider.js.map +1 -0
  107. package/dist/contracts/v1/tool.d.ts +136 -0
  108. package/dist/contracts/v1/tool.d.ts.map +1 -0
  109. package/dist/contracts/v1/tool.js +7 -0
  110. package/dist/contracts/v1/tool.js.map +1 -0
  111. package/dist/contracts/v1/toolAccess.d.ts +43 -0
  112. package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
  113. package/dist/contracts/v1/toolAccess.js +9 -0
  114. package/dist/contracts/v1/toolAccess.js.map +1 -0
  115. package/dist/core/agent.d.ts +320 -0
  116. package/dist/core/agent.d.ts.map +1 -0
  117. package/dist/core/agent.js +1627 -0
  118. package/dist/core/agent.js.map +1 -0
  119. package/dist/core/agentProfileManifest.d.ts +3 -0
  120. package/dist/core/agentProfileManifest.d.ts.map +1 -0
  121. package/dist/core/agentProfileManifest.js +188 -0
  122. package/dist/core/agentProfileManifest.js.map +1 -0
  123. package/dist/core/agentProfiles.d.ts +22 -0
  124. package/dist/core/agentProfiles.d.ts.map +1 -0
  125. package/dist/core/agentProfiles.js +35 -0
  126. package/dist/core/agentProfiles.js.map +1 -0
  127. package/dist/core/agentRulebook.d.ts +11 -0
  128. package/dist/core/agentRulebook.d.ts.map +1 -0
  129. package/dist/core/agentRulebook.js +136 -0
  130. package/dist/core/agentRulebook.js.map +1 -0
  131. package/dist/core/agentSchemaLoader.d.ts +131 -0
  132. package/dist/core/agentSchemaLoader.d.ts.map +1 -0
  133. package/dist/core/agentSchemaLoader.js +235 -0
  134. package/dist/core/agentSchemaLoader.js.map +1 -0
  135. package/dist/core/agiCore.d.ts +312 -0
  136. package/dist/core/agiCore.d.ts.map +1 -0
  137. package/dist/core/agiCore.js +1585 -0
  138. package/dist/core/agiCore.js.map +1 -0
  139. package/dist/core/aiErrorFixer.d.ts +57 -0
  140. package/dist/core/aiErrorFixer.d.ts.map +1 -0
  141. package/dist/core/aiErrorFixer.js +214 -0
  142. package/dist/core/aiErrorFixer.js.map +1 -0
  143. package/dist/core/bashCommandGuidance.d.ts +16 -0
  144. package/dist/core/bashCommandGuidance.d.ts.map +1 -0
  145. package/dist/core/bashCommandGuidance.js +40 -0
  146. package/dist/core/bashCommandGuidance.js.map +1 -0
  147. package/dist/core/constants.d.ts +31 -0
  148. package/dist/core/constants.d.ts.map +1 -0
  149. package/dist/core/constants.js +62 -0
  150. package/dist/core/constants.js.map +1 -0
  151. package/dist/core/contextManager.d.ts +271 -0
  152. package/dist/core/contextManager.d.ts.map +1 -0
  153. package/dist/core/contextManager.js +1073 -0
  154. package/dist/core/contextManager.js.map +1 -0
  155. package/dist/core/contextWindow.d.ts +42 -0
  156. package/dist/core/contextWindow.d.ts.map +1 -0
  157. package/dist/core/contextWindow.js +123 -0
  158. package/dist/core/contextWindow.js.map +1 -0
  159. package/dist/core/customCommands.d.ts +19 -0
  160. package/dist/core/customCommands.d.ts.map +1 -0
  161. package/dist/core/customCommands.js +85 -0
  162. package/dist/core/customCommands.js.map +1 -0
  163. package/dist/core/deepBugAnalyzer.d.ts +25 -0
  164. package/dist/core/deepBugAnalyzer.d.ts.map +1 -0
  165. package/dist/core/deepBugAnalyzer.js +44 -0
  166. package/dist/core/deepBugAnalyzer.js.map +1 -0
  167. package/dist/core/dynamicGuardrails.d.ts +207 -0
  168. package/dist/core/dynamicGuardrails.d.ts.map +1 -0
  169. package/dist/core/dynamicGuardrails.js +455 -0
  170. package/dist/core/dynamicGuardrails.js.map +1 -0
  171. package/dist/core/embeddingProviders.d.ts +80 -0
  172. package/dist/core/embeddingProviders.d.ts.map +1 -0
  173. package/dist/core/embeddingProviders.js +241 -0
  174. package/dist/core/embeddingProviders.js.map +1 -0
  175. package/dist/core/episodicMemory.d.ts +259 -0
  176. package/dist/core/episodicMemory.d.ts.map +1 -0
  177. package/dist/core/episodicMemory.js +834 -0
  178. package/dist/core/episodicMemory.js.map +1 -0
  179. package/dist/core/errors/apiKeyErrors.d.ts +11 -0
  180. package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
  181. package/dist/core/errors/apiKeyErrors.js +159 -0
  182. package/dist/core/errors/apiKeyErrors.js.map +1 -0
  183. package/dist/core/errors/errorTypes.d.ts +111 -0
  184. package/dist/core/errors/errorTypes.d.ts.map +1 -0
  185. package/dist/core/errors/errorTypes.js +345 -0
  186. package/dist/core/errors/errorTypes.js.map +1 -0
  187. package/dist/core/errors/index.d.ts +50 -0
  188. package/dist/core/errors/index.d.ts.map +1 -0
  189. package/dist/core/errors/index.js +156 -0
  190. package/dist/core/errors/index.js.map +1 -0
  191. package/dist/core/errors/networkErrors.d.ts +14 -0
  192. package/dist/core/errors/networkErrors.d.ts.map +1 -0
  193. package/dist/core/errors/networkErrors.js +53 -0
  194. package/dist/core/errors/networkErrors.js.map +1 -0
  195. package/dist/core/errors/safetyValidator.d.ts +109 -0
  196. package/dist/core/errors/safetyValidator.d.ts.map +1 -0
  197. package/dist/core/errors/safetyValidator.js +271 -0
  198. package/dist/core/errors/safetyValidator.js.map +1 -0
  199. package/dist/core/errors.d.ts +4 -0
  200. package/dist/core/errors.d.ts.map +1 -0
  201. package/dist/core/errors.js +33 -0
  202. package/dist/core/errors.js.map +1 -0
  203. package/dist/core/finalResponseFormatter.d.ts +10 -0
  204. package/dist/core/finalResponseFormatter.d.ts.map +1 -0
  205. package/dist/core/finalResponseFormatter.js +14 -0
  206. package/dist/core/finalResponseFormatter.js.map +1 -0
  207. package/dist/core/flowProtection.d.ts +154 -0
  208. package/dist/core/flowProtection.d.ts.map +1 -0
  209. package/dist/core/flowProtection.js +439 -0
  210. package/dist/core/flowProtection.js.map +1 -0
  211. package/dist/core/gitWorktreeManager.d.ts +126 -0
  212. package/dist/core/gitWorktreeManager.d.ts.map +1 -0
  213. package/dist/core/gitWorktreeManager.js +403 -0
  214. package/dist/core/gitWorktreeManager.js.map +1 -0
  215. package/dist/core/global-macbook-access.d.ts +59 -0
  216. package/dist/core/global-macbook-access.d.ts.map +1 -0
  217. package/dist/core/global-macbook-access.js +101 -0
  218. package/dist/core/global-macbook-access.js.map +1 -0
  219. package/dist/core/guardrails.d.ts +146 -0
  220. package/dist/core/guardrails.d.ts.map +1 -0
  221. package/dist/core/guardrails.js +361 -0
  222. package/dist/core/guardrails.js.map +1 -0
  223. package/dist/core/hallucinationGuard.d.ts +57 -0
  224. package/dist/core/hallucinationGuard.d.ts.map +1 -0
  225. package/dist/core/hallucinationGuard.js +237 -0
  226. package/dist/core/hallucinationGuard.js.map +1 -0
  227. package/dist/core/hitl.d.ts +109 -0
  228. package/dist/core/hitl.d.ts.map +1 -0
  229. package/dist/core/hitl.js +371 -0
  230. package/dist/core/hitl.js.map +1 -0
  231. package/dist/core/hooks.d.ts +113 -0
  232. package/dist/core/hooks.d.ts.map +1 -0
  233. package/dist/core/hooks.js +364 -0
  234. package/dist/core/hooks.js.map +1 -0
  235. package/dist/core/hotReload.d.ts +154 -0
  236. package/dist/core/hotReload.d.ts.map +1 -0
  237. package/dist/core/hotReload.js +451 -0
  238. package/dist/core/hotReload.js.map +1 -0
  239. package/dist/core/hypothesisEngine.d.ts +27 -0
  240. package/dist/core/hypothesisEngine.d.ts.map +1 -0
  241. package/dist/core/hypothesisEngine.js +58 -0
  242. package/dist/core/hypothesisEngine.js.map +1 -0
  243. package/dist/core/index.d.ts +18 -0
  244. package/dist/core/index.d.ts.map +1 -0
  245. package/dist/core/index.js +40 -0
  246. package/dist/core/index.js.map +1 -0
  247. package/dist/core/initialExplorer.d.ts +53 -0
  248. package/dist/core/initialExplorer.d.ts.map +1 -0
  249. package/dist/core/initialExplorer.js +423 -0
  250. package/dist/core/initialExplorer.js.map +1 -0
  251. package/dist/core/inputProtection.d.ts +122 -0
  252. package/dist/core/inputProtection.d.ts.map +1 -0
  253. package/dist/core/inputProtection.js +422 -0
  254. package/dist/core/inputProtection.js.map +1 -0
  255. package/dist/core/liveGCPVerification.d.ts +41 -0
  256. package/dist/core/liveGCPVerification.d.ts.map +1 -0
  257. package/dist/core/liveGCPVerification.js +745 -0
  258. package/dist/core/liveGCPVerification.js.map +1 -0
  259. package/dist/core/modelDiscovery.d.ts +105 -0
  260. package/dist/core/modelDiscovery.d.ts.map +1 -0
  261. package/dist/core/modelDiscovery.js +768 -0
  262. package/dist/core/modelDiscovery.js.map +1 -0
  263. package/dist/core/multilinePasteHandler.d.ts +35 -0
  264. package/dist/core/multilinePasteHandler.d.ts.map +1 -0
  265. package/dist/core/multilinePasteHandler.js +81 -0
  266. package/dist/core/multilinePasteHandler.js.map +1 -0
  267. package/dist/core/parallelExecutor.d.ts +215 -0
  268. package/dist/core/parallelExecutor.d.ts.map +1 -0
  269. package/dist/core/parallelExecutor.js +584 -0
  270. package/dist/core/parallelExecutor.js.map +1 -0
  271. package/dist/core/preferences.d.ts +71 -0
  272. package/dist/core/preferences.d.ts.map +1 -0
  273. package/dist/core/preferences.js +341 -0
  274. package/dist/core/preferences.js.map +1 -0
  275. package/dist/core/productTestHarness.d.ts +46 -0
  276. package/dist/core/productTestHarness.d.ts.map +1 -0
  277. package/dist/core/productTestHarness.js +128 -0
  278. package/dist/core/productTestHarness.js.map +1 -0
  279. package/dist/core/providerKeys.d.ts +20 -0
  280. package/dist/core/providerKeys.d.ts.map +1 -0
  281. package/dist/core/providerKeys.js +40 -0
  282. package/dist/core/providerKeys.js.map +1 -0
  283. package/dist/core/resultVerification.d.ts +47 -0
  284. package/dist/core/resultVerification.d.ts.map +1 -0
  285. package/dist/core/resultVerification.js +126 -0
  286. package/dist/core/resultVerification.js.map +1 -0
  287. package/dist/core/revenueEnvValidator.d.ts +30 -0
  288. package/dist/core/revenueEnvValidator.d.ts.map +1 -0
  289. package/dist/core/revenueEnvValidator.js +244 -0
  290. package/dist/core/revenueEnvValidator.js.map +1 -0
  291. package/dist/core/schemaValidator.d.ts +49 -0
  292. package/dist/core/schemaValidator.d.ts.map +1 -0
  293. package/dist/core/schemaValidator.js +234 -0
  294. package/dist/core/schemaValidator.js.map +1 -0
  295. package/dist/core/secretStore.d.ts +48 -0
  296. package/dist/core/secretStore.d.ts.map +1 -0
  297. package/dist/core/secretStore.js +295 -0
  298. package/dist/core/secretStore.js.map +1 -0
  299. package/dist/core/selfUpgrade.d.ts +79 -0
  300. package/dist/core/selfUpgrade.d.ts.map +1 -0
  301. package/dist/core/selfUpgrade.js +92 -0
  302. package/dist/core/selfUpgrade.js.map +1 -0
  303. package/dist/core/sessionStorage.d.ts +10 -0
  304. package/dist/core/sessionStorage.d.ts.map +1 -0
  305. package/dist/core/sessionStorage.js +46 -0
  306. package/dist/core/sessionStorage.js.map +1 -0
  307. package/dist/core/sessionStore.d.ts +35 -0
  308. package/dist/core/sessionStore.d.ts.map +1 -0
  309. package/dist/core/sessionStore.js +191 -0
  310. package/dist/core/sessionStore.js.map +1 -0
  311. package/dist/core/shutdown.d.ts +34 -0
  312. package/dist/core/shutdown.d.ts.map +1 -0
  313. package/dist/core/shutdown.js +173 -0
  314. package/dist/core/shutdown.js.map +1 -0
  315. package/dist/core/sudoPasswordManager.d.ts +52 -0
  316. package/dist/core/sudoPasswordManager.d.ts.map +1 -0
  317. package/dist/core/sudoPasswordManager.js +115 -0
  318. package/dist/core/sudoPasswordManager.js.map +1 -0
  319. package/dist/core/taskCompletionDetector.d.ts +112 -0
  320. package/dist/core/taskCompletionDetector.d.ts.map +1 -0
  321. package/dist/core/taskCompletionDetector.js +469 -0
  322. package/dist/core/taskCompletionDetector.js.map +1 -0
  323. package/dist/core/testFailureMonitor.d.ts +67 -0
  324. package/dist/core/testFailureMonitor.d.ts.map +1 -0
  325. package/dist/core/testFailureMonitor.js +262 -0
  326. package/dist/core/testFailureMonitor.js.map +1 -0
  327. package/dist/core/toolPreconditions.d.ts +34 -0
  328. package/dist/core/toolPreconditions.d.ts.map +1 -0
  329. package/dist/core/toolPreconditions.js +242 -0
  330. package/dist/core/toolPreconditions.js.map +1 -0
  331. package/dist/core/toolRuntime.d.ts +185 -0
  332. package/dist/core/toolRuntime.d.ts.map +1 -0
  333. package/dist/core/toolRuntime.js +412 -0
  334. package/dist/core/toolRuntime.js.map +1 -0
  335. package/dist/core/types/utilityTypes.d.ts +183 -0
  336. package/dist/core/types/utilityTypes.d.ts.map +1 -0
  337. package/dist/core/types/utilityTypes.js +273 -0
  338. package/dist/core/types/utilityTypes.js.map +1 -0
  339. package/dist/core/types.d.ts +334 -0
  340. package/dist/core/types.d.ts.map +1 -0
  341. package/dist/core/types.js +76 -0
  342. package/dist/core/types.js.map +1 -0
  343. package/dist/core/unifiedOrchestrator.d.ts +47 -0
  344. package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
  345. package/dist/core/unifiedOrchestrator.js +103 -0
  346. package/dist/core/unifiedOrchestrator.js.map +1 -0
  347. package/dist/core/unrestricted-mode.d.ts +42 -0
  348. package/dist/core/unrestricted-mode.d.ts.map +1 -0
  349. package/dist/core/unrestricted-mode.js +88 -0
  350. package/dist/core/unrestricted-mode.js.map +1 -0
  351. package/dist/core/updateChecker.d.ts +148 -0
  352. package/dist/core/updateChecker.d.ts.map +1 -0
  353. package/dist/core/updateChecker.js +593 -0
  354. package/dist/core/updateChecker.js.map +1 -0
  355. package/dist/headless/interactiveShell.d.ts +22 -0
  356. package/dist/headless/interactiveShell.d.ts.map +1 -0
  357. package/dist/headless/interactiveShell.js +4045 -0
  358. package/dist/headless/interactiveShell.js.map +1 -0
  359. package/dist/headless/quickMode.d.ts +26 -0
  360. package/dist/headless/quickMode.d.ts.map +1 -0
  361. package/dist/headless/quickMode.js +236 -0
  362. package/dist/headless/quickMode.js.map +1 -0
  363. package/dist/leanAgent.d.ts +73 -0
  364. package/dist/leanAgent.d.ts.map +1 -0
  365. package/dist/leanAgent.js +175 -0
  366. package/dist/leanAgent.js.map +1 -0
  367. package/dist/orchestration/index.d.ts +14 -0
  368. package/dist/orchestration/index.d.ts.map +1 -0
  369. package/dist/orchestration/index.js +12 -0
  370. package/dist/orchestration/index.js.map +1 -0
  371. package/dist/plugins/index.d.ts +49 -0
  372. package/dist/plugins/index.d.ts.map +1 -0
  373. package/dist/plugins/index.js +104 -0
  374. package/dist/plugins/index.js.map +1 -0
  375. package/dist/plugins/providers/anthropic/index.d.ts +9 -0
  376. package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
  377. package/dist/plugins/providers/anthropic/index.js +48 -0
  378. package/dist/plugins/providers/anthropic/index.js.map +1 -0
  379. package/dist/plugins/providers/deepseek/index.d.ts +11 -0
  380. package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
  381. package/dist/plugins/providers/deepseek/index.js +54 -0
  382. package/dist/plugins/providers/deepseek/index.js.map +1 -0
  383. package/dist/plugins/providers/index.d.ts +2 -0
  384. package/dist/plugins/providers/index.d.ts.map +1 -0
  385. package/dist/plugins/providers/index.js +17 -0
  386. package/dist/plugins/providers/index.js.map +1 -0
  387. package/dist/plugins/providers/openai/index.d.ts +10 -0
  388. package/dist/plugins/providers/openai/index.d.ts.map +1 -0
  389. package/dist/plugins/providers/openai/index.js +47 -0
  390. package/dist/plugins/providers/openai/index.js.map +1 -0
  391. package/dist/plugins/providers/xai/index.d.ts +10 -0
  392. package/dist/plugins/providers/xai/index.d.ts.map +1 -0
  393. package/dist/plugins/providers/xai/index.js +47 -0
  394. package/dist/plugins/providers/xai/index.js.map +1 -0
  395. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +10 -0
  396. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +1 -0
  397. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +110 -0
  398. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +1 -0
  399. package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
  400. package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
  401. package/dist/plugins/tools/bash/localBashPlugin.js +14 -0
  402. package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
  403. package/dist/plugins/tools/edit/editPlugin.d.ts +9 -0
  404. package/dist/plugins/tools/edit/editPlugin.d.ts.map +1 -0
  405. package/dist/plugins/tools/edit/editPlugin.js +15 -0
  406. package/dist/plugins/tools/edit/editPlugin.js.map +1 -0
  407. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +3 -0
  408. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +1 -0
  409. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +9 -0
  410. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +1 -0
  411. package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
  412. package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
  413. package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +14 -0
  414. package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
  415. package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts +3 -0
  416. package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts.map +1 -0
  417. package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js +9 -0
  418. package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js.map +1 -0
  419. package/dist/plugins/tools/index.d.ts +3 -0
  420. package/dist/plugins/tools/index.d.ts.map +1 -0
  421. package/dist/plugins/tools/index.js +3 -0
  422. package/dist/plugins/tools/index.js.map +1 -0
  423. package/dist/plugins/tools/integrity/integrityPlugin.d.ts +3 -0
  424. package/dist/plugins/tools/integrity/integrityPlugin.d.ts.map +1 -0
  425. package/dist/plugins/tools/integrity/integrityPlugin.js +31 -0
  426. package/dist/plugins/tools/integrity/integrityPlugin.js.map +1 -0
  427. package/dist/plugins/tools/mcp/mcpPlugin.d.ts +3 -0
  428. package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +1 -0
  429. package/dist/plugins/tools/mcp/mcpPlugin.js +27 -0
  430. package/dist/plugins/tools/mcp/mcpPlugin.js.map +1 -0
  431. package/dist/plugins/tools/nodeDefaults.d.ts +13 -0
  432. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
  433. package/dist/plugins/tools/nodeDefaults.js +31 -0
  434. package/dist/plugins/tools/nodeDefaults.js.map +1 -0
  435. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +3 -0
  436. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
  437. package/dist/plugins/tools/orchestration/orchestrationPlugin.js +340 -0
  438. package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
  439. package/dist/plugins/tools/registry.d.ts +22 -0
  440. package/dist/plugins/tools/registry.d.ts.map +1 -0
  441. package/dist/plugins/tools/registry.js +58 -0
  442. package/dist/plugins/tools/registry.js.map +1 -0
  443. package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
  444. package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
  445. package/dist/plugins/tools/search/localSearchPlugin.js +14 -0
  446. package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
  447. package/dist/plugins/tools/skills/skillPlugin.d.ts +3 -0
  448. package/dist/plugins/tools/skills/skillPlugin.d.ts.map +1 -0
  449. package/dist/plugins/tools/skills/skillPlugin.js +27 -0
  450. package/dist/plugins/tools/skills/skillPlugin.js.map +1 -0
  451. package/dist/providers/baseProvider.d.ts +148 -0
  452. package/dist/providers/baseProvider.d.ts.map +1 -0
  453. package/dist/providers/baseProvider.js +284 -0
  454. package/dist/providers/baseProvider.js.map +1 -0
  455. package/dist/providers/openaiChatCompletionsProvider.d.ts +64 -0
  456. package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
  457. package/dist/providers/openaiChatCompletionsProvider.js +1003 -0
  458. package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
  459. package/dist/providers/providerFactory.d.ts +22 -0
  460. package/dist/providers/providerFactory.d.ts.map +1 -0
  461. package/dist/providers/providerFactory.js +25 -0
  462. package/dist/providers/providerFactory.js.map +1 -0
  463. package/dist/providers/resilientProvider.d.ts +103 -0
  464. package/dist/providers/resilientProvider.d.ts.map +1 -0
  465. package/dist/providers/resilientProvider.js +462 -0
  466. package/dist/providers/resilientProvider.js.map +1 -0
  467. package/dist/runtime/agentController.d.ts +114 -0
  468. package/dist/runtime/agentController.d.ts.map +1 -0
  469. package/dist/runtime/agentController.js +707 -0
  470. package/dist/runtime/agentController.js.map +1 -0
  471. package/dist/runtime/agentHost.d.ts +61 -0
  472. package/dist/runtime/agentHost.d.ts.map +1 -0
  473. package/dist/runtime/agentHost.js +157 -0
  474. package/dist/runtime/agentHost.js.map +1 -0
  475. package/dist/runtime/agentSession.d.ts +45 -0
  476. package/dist/runtime/agentSession.d.ts.map +1 -0
  477. package/dist/runtime/agentSession.js +210 -0
  478. package/dist/runtime/agentSession.js.map +1 -0
  479. package/dist/runtime/agentWorkerPool.d.ts +167 -0
  480. package/dist/runtime/agentWorkerPool.d.ts.map +1 -0
  481. package/dist/runtime/agentWorkerPool.js +435 -0
  482. package/dist/runtime/agentWorkerPool.js.map +1 -0
  483. package/dist/runtime/node.d.ts +7 -0
  484. package/dist/runtime/node.d.ts.map +1 -0
  485. package/dist/runtime/node.js +25 -0
  486. package/dist/runtime/node.js.map +1 -0
  487. package/dist/runtime/universal.d.ts +18 -0
  488. package/dist/runtime/universal.d.ts.map +1 -0
  489. package/dist/runtime/universal.js +21 -0
  490. package/dist/runtime/universal.js.map +1 -0
  491. package/dist/shell/autoExecutor.d.ts +70 -0
  492. package/dist/shell/autoExecutor.d.ts.map +1 -0
  493. package/dist/shell/autoExecutor.js +320 -0
  494. package/dist/shell/autoExecutor.js.map +1 -0
  495. package/dist/shell/commandRegistry.d.ts +122 -0
  496. package/dist/shell/commandRegistry.d.ts.map +1 -0
  497. package/dist/shell/commandRegistry.js +398 -0
  498. package/dist/shell/commandRegistry.js.map +1 -0
  499. package/dist/shell/composableMessage.d.ts +178 -0
  500. package/dist/shell/composableMessage.d.ts.map +1 -0
  501. package/dist/shell/composableMessage.js +384 -0
  502. package/dist/shell/composableMessage.js.map +1 -0
  503. package/dist/shell/liveStatus.d.ts +27 -0
  504. package/dist/shell/liveStatus.d.ts.map +1 -0
  505. package/dist/shell/liveStatus.js +53 -0
  506. package/dist/shell/liveStatus.js.map +1 -0
  507. package/dist/shell/systemPrompt.d.ts +12 -0
  508. package/dist/shell/systemPrompt.d.ts.map +1 -0
  509. package/dist/shell/systemPrompt.js +16 -0
  510. package/dist/shell/systemPrompt.js.map +1 -0
  511. package/dist/shell/vimMode.d.ts +66 -0
  512. package/dist/shell/vimMode.d.ts.map +1 -0
  513. package/dist/shell/vimMode.js +435 -0
  514. package/dist/shell/vimMode.js.map +1 -0
  515. package/dist/tools/bashTools.d.ts +7 -0
  516. package/dist/tools/bashTools.d.ts.map +1 -0
  517. package/dist/tools/bashTools.js +773 -0
  518. package/dist/tools/bashTools.js.map +1 -0
  519. package/dist/tools/diffUtils.d.ts +43 -0
  520. package/dist/tools/diffUtils.d.ts.map +1 -0
  521. package/dist/tools/diffUtils.js +607 -0
  522. package/dist/tools/diffUtils.js.map +1 -0
  523. package/dist/tools/editTools.d.ts +29 -0
  524. package/dist/tools/editTools.d.ts.map +1 -0
  525. package/dist/tools/editTools.js +673 -0
  526. package/dist/tools/editTools.js.map +1 -0
  527. package/dist/tools/emailTools.d.ts +140 -0
  528. package/dist/tools/emailTools.d.ts.map +1 -0
  529. package/dist/tools/emailTools.js +793 -0
  530. package/dist/tools/emailTools.js.map +1 -0
  531. package/dist/tools/fileChangeTracker.d.ts +47 -0
  532. package/dist/tools/fileChangeTracker.d.ts.map +1 -0
  533. package/dist/tools/fileChangeTracker.js +154 -0
  534. package/dist/tools/fileChangeTracker.js.map +1 -0
  535. package/dist/tools/fileReadTracker.d.ts +69 -0
  536. package/dist/tools/fileReadTracker.d.ts.map +1 -0
  537. package/dist/tools/fileReadTracker.js +213 -0
  538. package/dist/tools/fileReadTracker.js.map +1 -0
  539. package/dist/tools/fileTools.d.ts +3 -0
  540. package/dist/tools/fileTools.d.ts.map +1 -0
  541. package/dist/tools/fileTools.js +333 -0
  542. package/dist/tools/fileTools.js.map +1 -0
  543. package/dist/tools/grepTools.d.ts +3 -0
  544. package/dist/tools/grepTools.d.ts.map +1 -0
  545. package/dist/tools/grepTools.js +128 -0
  546. package/dist/tools/grepTools.js.map +1 -0
  547. package/dist/tools/hitlTools.d.ts +7 -0
  548. package/dist/tools/hitlTools.d.ts.map +1 -0
  549. package/dist/tools/hitlTools.js +189 -0
  550. package/dist/tools/hitlTools.js.map +1 -0
  551. package/dist/tools/humanOpsTools.d.ts +3 -0
  552. package/dist/tools/humanOpsTools.d.ts.map +1 -0
  553. package/dist/tools/humanOpsTools.js +86 -0
  554. package/dist/tools/humanOpsTools.js.map +1 -0
  555. package/dist/tools/localExplore.d.ts +38 -0
  556. package/dist/tools/localExplore.d.ts.map +1 -0
  557. package/dist/tools/localExplore.js +30 -0
  558. package/dist/tools/localExplore.js.map +1 -0
  559. package/dist/tools/metaTools.d.ts +3 -0
  560. package/dist/tools/metaTools.d.ts.map +1 -0
  561. package/dist/tools/metaTools.js +148 -0
  562. package/dist/tools/metaTools.js.map +1 -0
  563. package/dist/tools/planningTools.d.ts +81 -0
  564. package/dist/tools/planningTools.d.ts.map +1 -0
  565. package/dist/tools/planningTools.js +370 -0
  566. package/dist/tools/planningTools.js.map +1 -0
  567. package/dist/tools/searchTools.d.ts +12 -0
  568. package/dist/tools/searchTools.d.ts.map +1 -0
  569. package/dist/tools/searchTools.js +363 -0
  570. package/dist/tools/searchTools.js.map +1 -0
  571. package/dist/tools/telemetryTools.d.ts +10 -0
  572. package/dist/tools/telemetryTools.d.ts.map +1 -0
  573. package/dist/tools/telemetryTools.js +9 -0
  574. package/dist/tools/telemetryTools.js.map +1 -0
  575. package/dist/tools/unifiedOps.d.ts +3 -0
  576. package/dist/tools/unifiedOps.d.ts.map +1 -0
  577. package/dist/tools/unifiedOps.js +57 -0
  578. package/dist/tools/unifiedOps.js.map +1 -0
  579. package/dist/tools/webTools.d.ts +26 -0
  580. package/dist/tools/webTools.d.ts.map +1 -0
  581. package/dist/tools/webTools.js +227 -0
  582. package/dist/tools/webTools.js.map +1 -0
  583. package/dist/ui/PromptController.d.ts +193 -0
  584. package/dist/ui/PromptController.d.ts.map +1 -0
  585. package/dist/ui/PromptController.js +394 -0
  586. package/dist/ui/PromptController.js.map +1 -0
  587. package/dist/ui/UnifiedUIRenderer.d.ts +843 -0
  588. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
  589. package/dist/ui/UnifiedUIRenderer.js +5711 -0
  590. package/dist/ui/UnifiedUIRenderer.js.map +1 -0
  591. package/dist/ui/animatedStatus.d.ts +140 -0
  592. package/dist/ui/animatedStatus.d.ts.map +1 -0
  593. package/dist/ui/animatedStatus.js +480 -0
  594. package/dist/ui/animatedStatus.js.map +1 -0
  595. package/dist/ui/animation/AnimationScheduler.d.ts +197 -0
  596. package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
  597. package/dist/ui/animation/AnimationScheduler.js +440 -0
  598. package/dist/ui/animation/AnimationScheduler.js.map +1 -0
  599. package/dist/ui/codeHighlighter.d.ts +6 -0
  600. package/dist/ui/codeHighlighter.d.ts.map +1 -0
  601. package/dist/ui/codeHighlighter.js +855 -0
  602. package/dist/ui/codeHighlighter.js.map +1 -0
  603. package/dist/ui/designSystem.d.ts +26 -0
  604. package/dist/ui/designSystem.d.ts.map +1 -0
  605. package/dist/ui/designSystem.js +114 -0
  606. package/dist/ui/designSystem.js.map +1 -0
  607. package/dist/ui/errorFormatter.d.ts +64 -0
  608. package/dist/ui/errorFormatter.d.ts.map +1 -0
  609. package/dist/ui/errorFormatter.js +316 -0
  610. package/dist/ui/errorFormatter.js.map +1 -0
  611. package/dist/ui/globalWriteLock.d.ts +63 -0
  612. package/dist/ui/globalWriteLock.d.ts.map +1 -0
  613. package/dist/ui/globalWriteLock.js +173 -0
  614. package/dist/ui/globalWriteLock.js.map +1 -0
  615. package/dist/ui/index.d.ts +32 -0
  616. package/dist/ui/index.d.ts.map +1 -0
  617. package/dist/ui/index.js +54 -0
  618. package/dist/ui/index.js.map +1 -0
  619. package/dist/ui/interrupts/InterruptManager.d.ts +157 -0
  620. package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
  621. package/dist/ui/interrupts/InterruptManager.js +501 -0
  622. package/dist/ui/interrupts/InterruptManager.js.map +1 -0
  623. package/dist/ui/layout.d.ts +27 -0
  624. package/dist/ui/layout.d.ts.map +1 -0
  625. package/dist/ui/layout.js +184 -0
  626. package/dist/ui/layout.js.map +1 -0
  627. package/dist/ui/outputMode.d.ts +44 -0
  628. package/dist/ui/outputMode.d.ts.map +1 -0
  629. package/dist/ui/outputMode.js +123 -0
  630. package/dist/ui/outputMode.js.map +1 -0
  631. package/dist/ui/overlay/OverlayManager.d.ts +105 -0
  632. package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
  633. package/dist/ui/overlay/OverlayManager.js +304 -0
  634. package/dist/ui/overlay/OverlayManager.js.map +1 -0
  635. package/dist/ui/premiumComponents.d.ts +54 -0
  636. package/dist/ui/premiumComponents.d.ts.map +1 -0
  637. package/dist/ui/premiumComponents.js +241 -0
  638. package/dist/ui/premiumComponents.js.map +1 -0
  639. package/dist/ui/richText.d.ts +13 -0
  640. package/dist/ui/richText.d.ts.map +1 -0
  641. package/dist/ui/richText.js +444 -0
  642. package/dist/ui/richText.js.map +1 -0
  643. package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
  644. package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
  645. package/dist/ui/telemetry/ResponseTracker.js +60 -0
  646. package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
  647. package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
  648. package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
  649. package/dist/ui/telemetry/UITelemetry.js +446 -0
  650. package/dist/ui/telemetry/UITelemetry.js.map +1 -0
  651. package/dist/ui/textHighlighter.d.ts +83 -0
  652. package/dist/ui/textHighlighter.d.ts.map +1 -0
  653. package/dist/ui/textHighlighter.js +267 -0
  654. package/dist/ui/textHighlighter.js.map +1 -0
  655. package/dist/ui/theme.d.ts +364 -0
  656. package/dist/ui/theme.d.ts.map +1 -0
  657. package/dist/ui/theme.js +471 -0
  658. package/dist/ui/theme.js.map +1 -0
  659. package/dist/ui/toolDisplay.d.ts +221 -0
  660. package/dist/ui/toolDisplay.d.ts.map +1 -0
  661. package/dist/ui/toolDisplay.js +1654 -0
  662. package/dist/ui/toolDisplay.js.map +1 -0
  663. package/dist/ui/uiConstants.d.ts +288 -0
  664. package/dist/ui/uiConstants.d.ts.map +1 -0
  665. package/dist/ui/uiConstants.js +472 -0
  666. package/dist/ui/uiConstants.js.map +1 -0
  667. package/dist/utils/askUserPrompt.d.ts +21 -0
  668. package/dist/utils/askUserPrompt.d.ts.map +1 -0
  669. package/dist/utils/askUserPrompt.js +87 -0
  670. package/dist/utils/askUserPrompt.js.map +1 -0
  671. package/dist/utils/asyncUtils.d.ts +95 -0
  672. package/dist/utils/asyncUtils.d.ts.map +1 -0
  673. package/dist/utils/asyncUtils.js +286 -0
  674. package/dist/utils/asyncUtils.js.map +1 -0
  675. package/dist/utils/debugLogger.d.ts +6 -0
  676. package/dist/utils/debugLogger.d.ts.map +1 -0
  677. package/dist/utils/debugLogger.js +39 -0
  678. package/dist/utils/debugLogger.js.map +1 -0
  679. package/dist/utils/errorUtils.d.ts +12 -0
  680. package/dist/utils/errorUtils.d.ts.map +1 -0
  681. package/dist/utils/errorUtils.js +83 -0
  682. package/dist/utils/errorUtils.js.map +1 -0
  683. package/dist/utils/frontmatter.d.ts +10 -0
  684. package/dist/utils/frontmatter.d.ts.map +1 -0
  685. package/dist/utils/frontmatter.js +78 -0
  686. package/dist/utils/frontmatter.js.map +1 -0
  687. package/dist/utils/packageInfo.d.ts +14 -0
  688. package/dist/utils/packageInfo.d.ts.map +1 -0
  689. package/dist/utils/packageInfo.js +45 -0
  690. package/dist/utils/packageInfo.js.map +1 -0
  691. package/dist/utils/planFormatter.d.ts +34 -0
  692. package/dist/utils/planFormatter.d.ts.map +1 -0
  693. package/dist/utils/planFormatter.js +141 -0
  694. package/dist/utils/planFormatter.js.map +1 -0
  695. package/dist/utils/securityUtils.d.ts +132 -0
  696. package/dist/utils/securityUtils.d.ts.map +1 -0
  697. package/dist/utils/securityUtils.js +324 -0
  698. package/dist/utils/securityUtils.js.map +1 -0
  699. package/dist/utils/statusReporter.d.ts +6 -0
  700. package/dist/utils/statusReporter.d.ts.map +1 -0
  701. package/dist/utils/statusReporter.js +26 -0
  702. package/dist/utils/statusReporter.js.map +1 -0
  703. package/dist/workspace.d.ts +8 -0
  704. package/dist/workspace.d.ts.map +1 -0
  705. package/dist/workspace.js +135 -0
  706. package/dist/workspace.js.map +1 -0
  707. package/dist/workspace.validator.d.ts +49 -0
  708. package/dist/workspace.validator.d.ts.map +1 -0
  709. package/dist/workspace.validator.js +215 -0
  710. package/dist/workspace.validator.js.map +1 -0
  711. package/package.json +121 -0
@@ -0,0 +1,631 @@
1
+ /**
2
+ * UNIFIED CODING CAPABILITY
3
+ *
4
+ * A lean, consolidated capability module that provides all essential
5
+ * tools for an AI coding assistant in a single, coherent interface.
6
+ *
7
+ * Consolidates: Filesystem, Edit, Bash, Search, Git, Web
8
+ */
9
+ import * as fs from 'fs';
10
+ import * as path from 'path';
11
+ import { execSync } from 'child_process';
12
+ import { buildDiffWithContext, formatDiffClaudeStyle } from '../tools/diffUtils.js';
13
+ import { recordFileChange } from '../tools/fileChangeTracker.js';
14
+ // ============================================================================
15
+ // SCHEMA HELPERS
16
+ // ============================================================================
17
+ function stringProp(description, enumValues) {
18
+ const prop = {
19
+ type: 'string',
20
+ description,
21
+ };
22
+ if (enumValues) {
23
+ return { ...prop, enum: enumValues };
24
+ }
25
+ return prop;
26
+ }
27
+ function objectSchema(properties, required) {
28
+ return {
29
+ type: 'object',
30
+ properties,
31
+ required,
32
+ };
33
+ }
34
+ export class UnifiedCodingCapabilityModule {
35
+ id = 'unified-coding';
36
+ options;
37
+ constructor(options = {}) {
38
+ this.options = {
39
+ workingDir: options.workingDir ?? process.cwd(),
40
+ enableGit: options.enableGit ?? true,
41
+ enableWeb: options.enableWeb ?? true,
42
+ enableBash: options.enableBash ?? true,
43
+ maxFileSize: options.maxFileSize ?? 10 * 1024 * 1024, // 10MB
44
+ timeout: options.timeout ?? 30000, // 30s
45
+ provider: options.provider,
46
+ providerId: options.providerId,
47
+ modelId: options.modelId,
48
+ };
49
+ }
50
+ async create(_context) {
51
+ return {
52
+ id: this.id,
53
+ description: 'Unified coding assistant tools',
54
+ toolSuite: this.buildToolSuite(),
55
+ };
56
+ }
57
+ buildToolSuite() {
58
+ const tools = [];
59
+ // === FILESYSTEM TOOLS ===
60
+ tools.push(this.createReadFileTool());
61
+ tools.push(this.createWriteFileTool());
62
+ tools.push(this.createListFilesTool());
63
+ tools.push(this.createFileExistsTool());
64
+ // === EDIT TOOLS ===
65
+ tools.push(this.createEditFileTool());
66
+ tools.push(this.createSearchReplaceTool());
67
+ // === SEARCH TOOLS ===
68
+ tools.push(this.createGrepTool());
69
+ tools.push(this.createGlobTool());
70
+ // === BASH TOOLS ===
71
+ if (this.options.enableBash) {
72
+ tools.push(this.createBashTool());
73
+ }
74
+ // === GIT TOOLS ===
75
+ if (this.options.enableGit) {
76
+ tools.push(this.createGitTool());
77
+ }
78
+ // === WEB TOOLS ===
79
+ if (this.options.enableWeb) {
80
+ tools.push(this.createWebFetchTool());
81
+ }
82
+ // === PARALLEL AGENTS TOOL ===
83
+ if (this.options.provider) {
84
+ tools.push(this.createParallelAgentsTool());
85
+ }
86
+ return {
87
+ id: 'unified-coding-tools',
88
+ description: 'Unified coding assistant tools for file operations, editing, search, and execution',
89
+ tools,
90
+ };
91
+ }
92
+ // ============================================================================
93
+ // FILESYSTEM TOOLS
94
+ // ============================================================================
95
+ createReadFileTool() {
96
+ return {
97
+ name: 'read_file',
98
+ description: 'Read the contents of a file. Returns the file content as a string.',
99
+ parameters: objectSchema({
100
+ path: stringProp('Absolute or relative path to the file'),
101
+ encoding: stringProp('File encoding (default: utf-8)'),
102
+ }, ['path']),
103
+ handler: async (args) => {
104
+ try {
105
+ const filePath = this.resolvePath(args.path);
106
+ const stat = fs.statSync(filePath);
107
+ if (stat.size > this.options.maxFileSize) {
108
+ return `Error: File too large (${stat.size} bytes). Max: ${this.options.maxFileSize} bytes`;
109
+ }
110
+ const content = fs.readFileSync(filePath, { encoding: args.encoding ?? 'utf-8' });
111
+ return content;
112
+ }
113
+ catch (error) {
114
+ return `Error reading file: ${error.message}`;
115
+ }
116
+ },
117
+ };
118
+ }
119
+ createWriteFileTool() {
120
+ return {
121
+ name: 'write_file',
122
+ description: 'Write content to a file. Creates the file if it does not exist.',
123
+ parameters: objectSchema({
124
+ path: stringProp('Absolute or relative path to the file'),
125
+ content: stringProp('Content to write to the file'),
126
+ createDirs: stringProp('Create parent directories if they do not exist (default: true)'),
127
+ }, ['path', 'content']),
128
+ handler: async (args) => {
129
+ try {
130
+ const filePath = this.resolvePath(args.path);
131
+ // Read old content if file exists (for diff)
132
+ let oldContent = '';
133
+ const fileExists = fs.existsSync(filePath);
134
+ if (fileExists) {
135
+ oldContent = fs.readFileSync(filePath, 'utf-8');
136
+ }
137
+ if (args.createDirs !== 'false') {
138
+ const dir = path.dirname(filePath);
139
+ if (!fs.existsSync(dir)) {
140
+ fs.mkdirSync(dir, { recursive: true });
141
+ }
142
+ }
143
+ // Record for revert before writing
144
+ recordFileChange(filePath);
145
+ fs.writeFileSync(filePath, args.content, 'utf-8');
146
+ // Generate diff output
147
+ const relativePath = path.relative(this.options.workingDir, filePath);
148
+ const displayPath = relativePath && !relativePath.startsWith('..') ? relativePath : filePath;
149
+ const diffResult = buildDiffWithContext(oldContent, args.content, 2);
150
+ const { additions, removals } = diffResult;
151
+ // Format diff with colors (limit to 10 lines)
152
+ const MAX_DIFF_LINES = 10;
153
+ const truncatedSegments = diffResult.segments.slice(0, MAX_DIFF_LINES);
154
+ const diffLines = formatDiffClaudeStyle(truncatedSegments, true);
155
+ const remainingChanges = diffResult.segments.length - MAX_DIFF_LINES;
156
+ if (remainingChanges > 0) {
157
+ diffLines.push(` ... +${remainingChanges} more changes`);
158
+ }
159
+ const diffBlock = diffLines.length > 0 ? diffLines.join('\n') : ' (No visual diff)';
160
+ // Build summary
161
+ const action = fileExists ? 'Update' : 'Create';
162
+ const additionText = additions === 1 ? '1 addition' : `${additions} additions`;
163
+ const removalText = removals === 1 ? '1 removal' : `${removals} removals`;
164
+ const summaryParts = [];
165
+ if (additions > 0)
166
+ summaryParts.push(additionText);
167
+ if (removals > 0)
168
+ summaryParts.push(removalText);
169
+ const summaryText = summaryParts.length > 0 ? summaryParts.join(' and ') : 'no changes';
170
+ return [
171
+ `⏺ ${action}(${displayPath})`,
172
+ ` ⎿ ${action}d ${displayPath} with ${summaryText}`,
173
+ diffBlock,
174
+ ].join('\n');
175
+ }
176
+ catch (error) {
177
+ return `Error writing file: ${error.message}`;
178
+ }
179
+ },
180
+ };
181
+ }
182
+ createListFilesTool() {
183
+ return {
184
+ name: 'list_files',
185
+ description: 'List files in a directory. Optionally filter by pattern and recurse into subdirectories.',
186
+ parameters: objectSchema({
187
+ path: stringProp('Directory path to list'),
188
+ recursive: stringProp('Recurse into subdirectories (default: false)'),
189
+ pattern: stringProp('Glob pattern to filter files (e.g., "*.ts")'),
190
+ }, ['path']),
191
+ handler: async (args) => {
192
+ try {
193
+ const dirPath = this.resolvePath(args.path);
194
+ const files = this.listDirectory(dirPath, args.recursive === 'true', args.pattern);
195
+ return files.join('\n');
196
+ }
197
+ catch (error) {
198
+ return `Error listing files: ${error.message}`;
199
+ }
200
+ },
201
+ };
202
+ }
203
+ createFileExistsTool() {
204
+ return {
205
+ name: 'file_exists',
206
+ description: 'Check if a file or directory exists.',
207
+ parameters: objectSchema({
208
+ path: stringProp('Path to check'),
209
+ }, ['path']),
210
+ handler: async (args) => {
211
+ const filePath = this.resolvePath(args.path);
212
+ const exists = fs.existsSync(filePath);
213
+ if (exists) {
214
+ const stat = fs.statSync(filePath);
215
+ return `Exists: ${stat.isDirectory() ? 'directory' : 'file'}`;
216
+ }
217
+ return 'Does not exist';
218
+ },
219
+ };
220
+ }
221
+ // ============================================================================
222
+ // EDIT TOOLS
223
+ // ============================================================================
224
+ createEditFileTool() {
225
+ return {
226
+ name: 'edit_file',
227
+ description: 'Edit a file by replacing specific text. The oldText must match exactly.',
228
+ parameters: objectSchema({
229
+ path: stringProp('Path to the file to edit'),
230
+ oldText: stringProp('Exact text to find and replace'),
231
+ newText: stringProp('Text to replace with'),
232
+ }, ['path', 'oldText', 'newText']),
233
+ handler: async (args) => {
234
+ try {
235
+ const filePath = this.resolvePath(args.path);
236
+ const content = fs.readFileSync(filePath, 'utf-8');
237
+ if (!content.includes(args.oldText)) {
238
+ return `Error: Could not find the specified text in ${filePath}`;
239
+ }
240
+ const newContent = content.replace(args.oldText, args.newText);
241
+ fs.writeFileSync(filePath, newContent, 'utf-8');
242
+ return `Successfully edited ${filePath}`;
243
+ }
244
+ catch (error) {
245
+ return `Error editing file: ${error.message}`;
246
+ }
247
+ },
248
+ };
249
+ }
250
+ createSearchReplaceTool() {
251
+ return {
252
+ name: 'search_replace',
253
+ description: 'Search and replace text in a file. Supports regex patterns.',
254
+ parameters: objectSchema({
255
+ path: stringProp('Path to the file'),
256
+ search: stringProp('Text or regex pattern to search for'),
257
+ replace: stringProp('Replacement text'),
258
+ regex: stringProp('Treat search as regex (default: false)'),
259
+ global: stringProp('Replace all occurrences (default: true)'),
260
+ }, ['path', 'search', 'replace']),
261
+ handler: async (args) => {
262
+ try {
263
+ const filePath = this.resolvePath(args.path);
264
+ const content = fs.readFileSync(filePath, 'utf-8');
265
+ let pattern;
266
+ if (args.regex === 'true') {
267
+ const flags = args.global !== 'false' ? 'g' : '';
268
+ pattern = new RegExp(args.search, flags);
269
+ }
270
+ else {
271
+ pattern = args.global !== 'false'
272
+ ? new RegExp(this.escapeRegex(args.search), 'g')
273
+ : args.search;
274
+ }
275
+ const newContent = content.replace(pattern, args.replace);
276
+ const matchCount = (content.match(pattern instanceof RegExp ? pattern : new RegExp(this.escapeRegex(args.search), 'g')) || []).length;
277
+ fs.writeFileSync(filePath, newContent, 'utf-8');
278
+ return `Replaced ${matchCount} occurrence(s) in ${filePath}`;
279
+ }
280
+ catch (error) {
281
+ return `Error in search/replace: ${error.message}`;
282
+ }
283
+ },
284
+ };
285
+ }
286
+ // ============================================================================
287
+ // SEARCH TOOLS
288
+ // ============================================================================
289
+ createGrepTool() {
290
+ return {
291
+ name: 'grep',
292
+ description: 'Search for a pattern in files. Returns matching lines with file names and line numbers.',
293
+ parameters: objectSchema({
294
+ pattern: stringProp('Regex pattern to search for'),
295
+ path: stringProp('Directory or file to search in (default: working directory)'),
296
+ filePattern: stringProp('Filter files by glob pattern (e.g., "*.ts")'),
297
+ contextLines: stringProp('Number of context lines around matches (default: 0)'),
298
+ }, ['pattern']),
299
+ handler: async (args) => {
300
+ try {
301
+ const searchPath = this.resolvePath(args.path ?? '.');
302
+ const results = [];
303
+ const files = fs.statSync(searchPath).isDirectory()
304
+ ? this.listDirectory(searchPath, true, args.filePattern)
305
+ : [searchPath];
306
+ // Use regex without 'g' flag for test() to avoid lastIndex issues
307
+ const regex = new RegExp(args.pattern, 'i');
308
+ const contextLines = parseInt(args.contextLines ?? '0', 10) || 0;
309
+ const matchedLineSet = new Set(); // Prevent duplicate context lines
310
+ for (const file of files.slice(0, 100)) { // Limit to 100 files
311
+ try {
312
+ // Skip binary files by checking for null bytes
313
+ const buffer = fs.readFileSync(file);
314
+ if (buffer.includes(0))
315
+ continue; // Binary file
316
+ const content = buffer.toString('utf-8');
317
+ // Skip very large files
318
+ if (content.length > 1024 * 1024)
319
+ continue; // > 1MB
320
+ const lines = content.split('\n');
321
+ const fileMatches = [];
322
+ // First pass: find all matching line numbers
323
+ for (let i = 0; i < lines.length; i++) {
324
+ if (regex.test(lines[i])) {
325
+ fileMatches.push(i);
326
+ }
327
+ }
328
+ // Second pass: output with context, avoiding duplicates
329
+ for (const matchIdx of fileMatches) {
330
+ const start = Math.max(0, matchIdx - contextLines);
331
+ const end = Math.min(lines.length - 1, matchIdx + contextLines);
332
+ for (let j = start; j <= end; j++) {
333
+ const lineKey = `${file}:${j}`;
334
+ if (!matchedLineSet.has(lineKey)) {
335
+ matchedLineSet.add(lineKey);
336
+ const prefix = j === matchIdx ? '>' : ' ';
337
+ results.push(`${file}:${j + 1}:${prefix} ${lines[j]}`);
338
+ }
339
+ }
340
+ if (contextLines > 0 && matchIdx < fileMatches[fileMatches.length - 1]) {
341
+ results.push('--');
342
+ }
343
+ }
344
+ }
345
+ catch {
346
+ // Skip unreadable files
347
+ }
348
+ // Stop if we have enough results
349
+ if (results.length > 500)
350
+ break;
351
+ }
352
+ return results.length > 0
353
+ ? results.slice(0, 500).join('\n')
354
+ : 'No matches found';
355
+ }
356
+ catch (error) {
357
+ return `Error in grep: ${error.message}`;
358
+ }
359
+ },
360
+ };
361
+ }
362
+ createGlobTool() {
363
+ return {
364
+ name: 'glob',
365
+ description: 'Find files matching a glob pattern.',
366
+ parameters: objectSchema({
367
+ pattern: stringProp('Glob pattern (e.g., "**/*.ts", "src/**/*.js")'),
368
+ path: stringProp('Base directory (default: working directory)'),
369
+ }, ['pattern']),
370
+ handler: async (args) => {
371
+ try {
372
+ const basePath = this.resolvePath(args.path ?? '.');
373
+ const files = this.listDirectory(basePath, true, args.pattern);
374
+ return files.length > 0
375
+ ? files.slice(0, 200).join('\n')
376
+ : 'No files found matching pattern';
377
+ }
378
+ catch (error) {
379
+ return `Error in glob: ${error.message}`;
380
+ }
381
+ },
382
+ };
383
+ }
384
+ // ============================================================================
385
+ // BASH TOOL
386
+ // ============================================================================
387
+ createBashTool() {
388
+ return {
389
+ name: 'bash',
390
+ description: 'Execute a bash command and return the output. Use for running builds, tests, git commands, etc.',
391
+ parameters: objectSchema({
392
+ command: stringProp('The command to execute'),
393
+ timeout: stringProp('Timeout in milliseconds (default: 30000)'),
394
+ cwd: stringProp('Working directory for the command'),
395
+ }, ['command']),
396
+ handler: async (args) => {
397
+ return new Promise((resolve) => {
398
+ try {
399
+ const timeout = parseInt(args.timeout ?? String(this.options.timeout), 10);
400
+ const cwd = args.cwd ? this.resolvePath(args.cwd) : this.options.workingDir;
401
+ const result = execSync(args.command, {
402
+ cwd,
403
+ timeout,
404
+ encoding: 'utf-8',
405
+ maxBuffer: 10 * 1024 * 1024,
406
+ stdio: ['pipe', 'pipe', 'pipe'],
407
+ });
408
+ resolve(result.trim() || '(no output)');
409
+ }
410
+ catch (error) {
411
+ const execError = error;
412
+ const stdout = execError.stdout ?? '';
413
+ const stderr = execError.stderr ?? '';
414
+ resolve(`Error: ${execError.message}\nStdout: ${stdout}\nStderr: ${stderr}`);
415
+ }
416
+ });
417
+ },
418
+ };
419
+ }
420
+ // ============================================================================
421
+ // GIT TOOL
422
+ // ============================================================================
423
+ createGitTool() {
424
+ return {
425
+ name: 'git',
426
+ description: 'Execute git operations. Supports: status, diff, log, add, commit, push, pull, branch, checkout, merge, stash',
427
+ parameters: objectSchema({
428
+ operation: stringProp('Git operation', ['status', 'diff', 'log', 'add', 'commit', 'push', 'pull', 'branch', 'checkout', 'merge', 'stash', 'reset', 'fetch']),
429
+ args: stringProp('Additional arguments for the git command'),
430
+ }, ['operation']),
431
+ handler: async (args) => {
432
+ try {
433
+ const command = `git ${args.operation}${args.args ? ' ' + args.args : ''}`;
434
+ const result = execSync(command, {
435
+ cwd: this.options.workingDir,
436
+ encoding: 'utf-8',
437
+ timeout: this.options.timeout,
438
+ });
439
+ return result.trim() || '(no output)';
440
+ }
441
+ catch (error) {
442
+ const execError = error;
443
+ return `Git error: ${execError.stderr || execError.message}`;
444
+ }
445
+ },
446
+ };
447
+ }
448
+ // ============================================================================
449
+ // WEB TOOL
450
+ // ============================================================================
451
+ createWebFetchTool() {
452
+ return {
453
+ name: 'web_fetch',
454
+ description: 'Fetch content from a URL. Useful for downloading documentation or API responses.',
455
+ parameters: objectSchema({
456
+ url: stringProp('URL to fetch'),
457
+ method: stringProp('HTTP method (default: GET)'),
458
+ headers: stringProp('JSON string of headers'),
459
+ }, ['url']),
460
+ handler: async (args) => {
461
+ try {
462
+ const headers = args.headers ? JSON.parse(args.headers) : {};
463
+ const response = await fetch(args.url, {
464
+ method: args.method ?? 'GET',
465
+ headers,
466
+ });
467
+ if (!response.ok) {
468
+ return `HTTP ${response.status}: ${response.statusText}`;
469
+ }
470
+ const contentType = response.headers.get('content-type') ?? '';
471
+ if (contentType.includes('application/json')) {
472
+ const json = await response.json();
473
+ return JSON.stringify(json, null, 2);
474
+ }
475
+ const text = await response.text();
476
+ return text.slice(0, 50000); // Limit response size
477
+ }
478
+ catch (error) {
479
+ return `Fetch error: ${error.message}`;
480
+ }
481
+ },
482
+ };
483
+ }
484
+ // ============================================================================
485
+ // PARALLEL AGENTS TOOL
486
+ // ============================================================================
487
+ createParallelAgentsTool() {
488
+ const MAX_CONCURRENCY = 5;
489
+ const opts = {
490
+ provider: this.options.provider,
491
+ workingDir: this.options.workingDir,
492
+ providerId: this.options.providerId,
493
+ modelId: this.options.modelId,
494
+ };
495
+ // Dynamic import to avoid circular dependency at module level
496
+ const LeanAgentModule = import('../leanAgent.js');
497
+ return {
498
+ name: 'parallel_agents',
499
+ description: 'Execute multiple independent tasks in parallel using sub-agents. ' +
500
+ 'Each sub-agent gets its own tool suite (filesystem, edit, bash, search, git, web) and works independently. ' +
501
+ 'Use this when you need to perform several independent operations simultaneously ' +
502
+ '(e.g., creating multiple files, searching in different places, running independent edits). ' +
503
+ 'Do NOT use for tasks that depend on each other or for single small tasks.\n\n' +
504
+ 'Parameter `tasks`: A JSON string encoding an array of objects, each with:\n' +
505
+ ' - id: unique string identifier for the task\n' +
506
+ ' - description: short label (3-5 words)\n' +
507
+ ' - prompt: full instructions for the sub-agent',
508
+ parameters: objectSchema({
509
+ tasks: stringProp('JSON array of task objects: [{"id":"string","description":"short label","prompt":"full instructions"}]'),
510
+ }, ['tasks']),
511
+ handler: async (args) => {
512
+ let taskSpecs;
513
+ try {
514
+ taskSpecs = JSON.parse(args.tasks);
515
+ }
516
+ catch {
517
+ return 'Error: Could not parse tasks JSON. Provide a valid JSON array of {id, description, prompt} objects.';
518
+ }
519
+ if (!Array.isArray(taskSpecs) || taskSpecs.length === 0) {
520
+ return 'Error: tasks must be a non-empty JSON array.';
521
+ }
522
+ if (taskSpecs.length > MAX_CONCURRENCY) {
523
+ return `Error: Maximum ${MAX_CONCURRENCY} parallel tasks allowed. Got ${taskSpecs.length}.`;
524
+ }
525
+ // Validate each task
526
+ for (const t of taskSpecs) {
527
+ if (!t.id || !t.prompt) {
528
+ return `Error: Each task must have "id" and "prompt" fields. Invalid task: ${JSON.stringify(t)}`;
529
+ }
530
+ }
531
+ // Import LeanAgent dynamically to avoid circular dependency
532
+ const { LeanAgent } = await LeanAgentModule;
533
+ // Execute tasks in parallel
534
+ const results = await Promise.all(taskSpecs.map(async (task) => {
535
+ try {
536
+ const subAgent = new LeanAgent({
537
+ provider: opts.provider,
538
+ workingDir: opts.workingDir ?? process.cwd(),
539
+ providerId: opts.providerId,
540
+ modelId: opts.modelId,
541
+ systemPrompt: 'You are a focused sub-agent executing a specific task. ' +
542
+ 'Complete the task efficiently and report what you did. ' +
543
+ `Working directory: ${opts.workingDir ?? process.cwd()}`,
544
+ });
545
+ const response = await subAgent.chat(task.prompt, false);
546
+ return {
547
+ id: task.id,
548
+ description: task.description || task.id,
549
+ success: true,
550
+ output: response.content,
551
+ };
552
+ }
553
+ catch (error) {
554
+ return {
555
+ id: task.id,
556
+ description: task.description || task.id,
557
+ success: false,
558
+ output: `Error: ${error.message}`,
559
+ };
560
+ }
561
+ }));
562
+ // Format results
563
+ const lines = [`Parallel execution complete: ${results.length} tasks`];
564
+ for (const r of results) {
565
+ const status = r.success ? 'OK' : 'FAILED';
566
+ lines.push(`\n--- [${status}] ${r.id}: ${r.description} ---`);
567
+ lines.push(r.output);
568
+ }
569
+ return lines.join('\n');
570
+ },
571
+ };
572
+ }
573
+ // ============================================================================
574
+ // UTILITY METHODS
575
+ // ============================================================================
576
+ resolvePath(inputPath) {
577
+ if (path.isAbsolute(inputPath)) {
578
+ return inputPath;
579
+ }
580
+ return path.resolve(this.options.workingDir, inputPath);
581
+ }
582
+ listDirectory(dir, recursive, pattern) {
583
+ const results = [];
584
+ const regex = pattern ? this.globToRegex(pattern) : null;
585
+ const walk = (currentDir) => {
586
+ try {
587
+ const entries = fs.readdirSync(currentDir, { withFileTypes: true });
588
+ for (const entry of entries) {
589
+ const fullPath = path.join(currentDir, entry.name);
590
+ // Skip hidden files and common ignore patterns
591
+ if (entry.name.startsWith('.') || entry.name === 'node_modules') {
592
+ continue;
593
+ }
594
+ if (entry.isDirectory()) {
595
+ if (recursive) {
596
+ walk(fullPath);
597
+ }
598
+ }
599
+ else {
600
+ if (!regex || regex.test(entry.name) || regex.test(fullPath)) {
601
+ results.push(fullPath);
602
+ }
603
+ }
604
+ }
605
+ }
606
+ catch {
607
+ // Skip unreadable directories
608
+ }
609
+ };
610
+ walk(dir);
611
+ return results;
612
+ }
613
+ globToRegex(pattern) {
614
+ const escaped = pattern
615
+ .replace(/[.+^${}()|[\]\\]/g, '\\$&')
616
+ .replace(/\*/g, '.*')
617
+ .replace(/\?/g, '.');
618
+ return new RegExp(escaped, 'i');
619
+ }
620
+ escapeRegex(str) {
621
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
622
+ }
623
+ }
624
+ // ============================================================================
625
+ // FACTORY & CONVENIENCE EXPORTS
626
+ // ============================================================================
627
+ export function createUnifiedCodingCapability(options) {
628
+ return new UnifiedCodingCapabilityModule(options);
629
+ }
630
+ export default UnifiedCodingCapabilityModule;
631
+ //# sourceMappingURL=unifiedCodingCapability.js.map