rhachet-roles-bhrain 0.3.0 → 0.5.2

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 (247) hide show
  1. package/dist/access/sdk/sdkOpenAi.d.ts +25 -0
  2. package/dist/access/sdk/sdkOpenAi.js +122 -0
  3. package/dist/access/sdk/sdkOpenAi.js.map +1 -1
  4. package/dist/access/sdks/anthropic/sdkAnthropic.d.ts +31 -0
  5. package/dist/access/sdks/anthropic/sdkAnthropic.js +151 -0
  6. package/dist/access/sdks/anthropic/sdkAnthropic.js.map +1 -0
  7. package/dist/access/sdks/qwen/sdkQwen.d.ts +31 -0
  8. package/dist/access/sdks/qwen/sdkQwen.js +134 -0
  9. package/dist/access/sdks/qwen/sdkQwen.js.map +1 -0
  10. package/dist/domain.objects/BrainArch1/BrainArch1Actor.d.ts +67 -0
  11. package/dist/domain.objects/BrainArch1/BrainArch1Actor.js +12 -0
  12. package/dist/domain.objects/BrainArch1/BrainArch1Actor.js.map +1 -0
  13. package/dist/domain.objects/BrainArch1/BrainArch1Atom.d.ts +40 -0
  14. package/dist/domain.objects/BrainArch1/BrainArch1Atom.js +3 -0
  15. package/dist/domain.objects/BrainArch1/BrainArch1Atom.js.map +1 -0
  16. package/dist/domain.objects/BrainArch1/BrainArch1Context.d.ts +30 -0
  17. package/dist/domain.objects/BrainArch1/BrainArch1Context.js +3 -0
  18. package/dist/domain.objects/BrainArch1/BrainArch1Context.js.map +1 -0
  19. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.d.ts +34 -0
  20. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js +8 -0
  21. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js.map +1 -0
  22. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.d.ts +23 -0
  23. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js +9 -0
  24. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js.map +1 -0
  25. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.d.ts +49 -0
  26. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js +8 -0
  27. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js.map +1 -0
  28. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.d.ts +31 -0
  29. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js +9 -0
  30. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js.map +1 -0
  31. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.d.ts +27 -0
  32. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js +8 -0
  33. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js.map +1 -0
  34. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.d.ts +45 -0
  35. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js +3 -0
  36. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js.map +1 -0
  37. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.d.ts +29 -0
  38. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js +8 -0
  39. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js.map +1 -0
  40. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.d.ts +22 -0
  41. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js +8 -0
  42. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js.map +1 -0
  43. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.d.ts +30 -0
  44. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js +3 -0
  45. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js.map +1 -0
  46. package/dist/domain.objects/BrainArch1/BrainArch1Session.d.ts +47 -0
  47. package/dist/domain.objects/BrainArch1/BrainArch1Session.js +17 -0
  48. package/dist/domain.objects/BrainArch1/BrainArch1Session.js.map +1 -0
  49. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.d.ts +34 -0
  50. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js +12 -0
  51. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js.map +1 -0
  52. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.d.ts +21 -0
  53. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js +8 -0
  54. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js.map +1 -0
  55. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.d.ts +54 -0
  56. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js +20 -0
  57. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js.map +1 -0
  58. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.d.ts +36 -0
  59. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js +9 -0
  60. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js.map +1 -0
  61. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.d.ts +25 -0
  62. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js +8 -0
  63. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js.map +1 -0
  64. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.d.ts +31 -0
  65. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js +3 -0
  66. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js.map +1 -0
  67. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.d.ts +44 -0
  68. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js +8 -0
  69. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js.map +1 -0
  70. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.d.ts +30 -0
  71. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js +35 -0
  72. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js.map +1 -0
  73. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.d.ts +89 -0
  74. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js +8 -0
  75. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js.map +1 -0
  76. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.d.ts +43 -0
  77. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js +8 -0
  78. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js.map +1 -0
  79. package/dist/domain.operations/artifact/genLoopFeedback.js +1 -1
  80. package/dist/domain.operations/artifact/genLoopFeedback.js.map +1 -1
  81. package/dist/domain.operations/artifact/genStepGrabCallerFeedbackToArtifact.d.ts +1 -1
  82. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.d.ts +13 -0
  83. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js +106 -0
  84. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js.map +1 -0
  85. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.d.ts +18 -0
  86. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js +16 -0
  87. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js.map +1 -0
  88. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.d.ts +30 -0
  89. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js +71 -0
  90. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js.map +1 -0
  91. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.d.ts +20 -0
  92. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js +90 -0
  93. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js.map +1 -0
  94. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.d.ts +8 -0
  95. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js +31 -0
  96. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js.map +1 -0
  97. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.d.ts +3 -0
  98. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js +10 -0
  99. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js.map +1 -0
  100. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.d.ts +8 -0
  101. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js +31 -0
  102. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js.map +1 -0
  103. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.d.ts +8 -0
  104. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js +32 -0
  105. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js.map +1 -0
  106. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.d.ts +6 -0
  107. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js +80 -0
  108. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js.map +1 -0
  109. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.d.ts +6 -0
  110. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js +14 -0
  111. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js.map +1 -0
  112. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.d.ts +8 -0
  113. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js +52 -0
  114. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js.map +1 -0
  115. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.d.ts +8 -0
  116. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js +38 -0
  117. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js.map +1 -0
  118. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.d.ts +33 -0
  119. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js +100 -0
  120. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js.map +1 -0
  121. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.d.ts +6 -0
  122. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js +26 -0
  123. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js.map +1 -0
  124. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.d.ts +41 -0
  125. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js +107 -0
  126. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js.map +1 -0
  127. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.d.ts +33 -0
  128. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js +68 -0
  129. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js.map +1 -0
  130. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.d.ts +41 -0
  131. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js +97 -0
  132. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js.map +1 -0
  133. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.d.ts +6 -0
  134. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js +65 -0
  135. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js.map +1 -0
  136. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.d.ts +37 -0
  137. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js +96 -0
  138. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js.map +1 -0
  139. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.d.ts +33 -0
  140. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js +81 -0
  141. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js.map +1 -0
  142. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.d.ts +33 -0
  143. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js +113 -0
  144. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js.map +1 -0
  145. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.d.ts +6 -0
  146. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js +36 -0
  147. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js.map +1 -0
  148. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.d.ts +36 -0
  149. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js +101 -0
  150. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js.map +1 -0
  151. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.d.ts +14 -0
  152. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js +45 -0
  153. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js.map +1 -0
  154. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.d.ts +19 -0
  155. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js +35 -0
  156. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js.map +1 -0
  157. package/dist/domain.operations/git/genGitHubFileUrl.d.ts +9 -0
  158. package/dist/domain.operations/git/genGitHubFileUrl.js +55 -0
  159. package/dist/domain.operations/git/genGitHubFileUrl.js.map +1 -0
  160. package/dist/domain.operations/git/getGitRemoteUrl.d.ts +7 -0
  161. package/dist/domain.operations/git/getGitRemoteUrl.js +40 -0
  162. package/dist/domain.operations/git/getGitRemoteUrl.js.map +1 -0
  163. package/dist/domain.operations/hooks/getInvokeHooks.js +1 -1
  164. package/dist/domain.operations/hooks/getInvokeHooks.js.map +1 -1
  165. package/dist/domain.operations/reflect/createDraftDirectory.d.ts +11 -0
  166. package/dist/domain.operations/reflect/createDraftDirectory.js +46 -0
  167. package/dist/domain.operations/reflect/createDraftDirectory.js.map +1 -0
  168. package/dist/domain.operations/reflect/enumFeedbackFiles.d.ts +7 -0
  169. package/dist/domain.operations/reflect/enumFeedbackFiles.js +69 -0
  170. package/dist/domain.operations/reflect/enumFeedbackFiles.js.map +1 -0
  171. package/dist/domain.operations/reflect/extractJsonFromResultText.d.ts +7 -0
  172. package/dist/domain.operations/reflect/extractJsonFromResultText.js +19 -0
  173. package/dist/domain.operations/reflect/extractJsonFromResultText.js.map +1 -0
  174. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.d.ts +46 -0
  175. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js +120 -0
  176. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js.map +1 -0
  177. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.d.ts +12 -0
  178. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js +28 -0
  179. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js.map +1 -0
  180. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.d.ts +26 -0
  181. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js +66 -0
  182. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js.map +1 -0
  183. package/dist/domain.operations/reflect/metrics/writeLogArtifact.d.ts +17 -0
  184. package/dist/domain.operations/reflect/metrics/writeLogArtifact.js +93 -0
  185. package/dist/domain.operations/reflect/metrics/writeLogArtifact.js.map +1 -0
  186. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.d.ts +8 -0
  187. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js +28 -0
  188. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js.map +1 -0
  189. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.d.ts +14 -0
  190. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js +93 -0
  191. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js.map +1 -0
  192. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.d.ts +18 -0
  193. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js +208 -0
  194. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js.map +1 -0
  195. package/dist/domain.operations/reflect/step2/executeManifestOperations.d.ts +17 -0
  196. package/dist/domain.operations/reflect/step2/executeManifestOperations.js +189 -0
  197. package/dist/domain.operations/reflect/step2/executeManifestOperations.js.map +1 -0
  198. package/dist/domain.operations/reflect/step2/parseManifestOperations.d.ts +8 -0
  199. package/dist/domain.operations/reflect/step2/parseManifestOperations.js +73 -0
  200. package/dist/domain.operations/reflect/step2/parseManifestOperations.js.map +1 -0
  201. package/dist/domain.operations/reflect/validateSourceDirectory.d.ts +9 -0
  202. package/dist/domain.operations/reflect/validateSourceDirectory.js +63 -0
  203. package/dist/domain.operations/reflect/validateSourceDirectory.js.map +1 -0
  204. package/dist/domain.operations/reflect/validateTargetDirectory.d.ts +10 -0
  205. package/dist/domain.operations/reflect/validateTargetDirectory.js +59 -0
  206. package/dist/domain.operations/reflect/validateTargetDirectory.js.map +1 -0
  207. package/dist/domain.operations/review/compileReviewPrompt.js +16 -5
  208. package/dist/domain.operations/review/compileReviewPrompt.js.map +1 -1
  209. package/dist/domain.operations/review/formatReviewOutput.d.ts +15 -6
  210. package/dist/domain.operations/review/formatReviewOutput.js +15 -17
  211. package/dist/domain.operations/review/formatReviewOutput.js.map +1 -1
  212. package/dist/index.js.map +1 -1
  213. package/dist/roles/architect/getArchitectRole.d.ts +6 -0
  214. package/dist/roles/architect/getArchitectRole.js +31 -0
  215. package/dist/roles/architect/getArchitectRole.js.map +1 -0
  216. package/dist/roles/brain/getBrainRole.d.ts +6 -0
  217. package/dist/roles/brain/getBrainRole.js +28 -0
  218. package/dist/roles/brain/getBrainRole.js.map +1 -0
  219. package/dist/roles/brain/skills/act/skillAct.d.ts +5 -0
  220. package/dist/roles/brain/skills/act/skillAct.js +147 -0
  221. package/dist/roles/brain/skills/act/skillAct.js.map +1 -0
  222. package/dist/roles/brain/skills/act/skillAct.ts +186 -0
  223. package/dist/roles/brain/skills/act/stepAct.d.ts +27 -0
  224. package/dist/roles/brain/skills/act/stepAct.js +95 -0
  225. package/dist/roles/brain/skills/act/stepAct.js.map +1 -0
  226. package/dist/roles/brain/skills/act/stepAct.ts +123 -0
  227. package/dist/roles/getRoleRegistry.js +5 -4
  228. package/dist/roles/getRoleRegistry.js.map +1 -1
  229. package/dist/roles/reviewer/briefs/on.rules/rules101.[article].md +41 -0
  230. package/dist/roles/reviewer/briefs/on.rules/rules101.citations.[article].md +88 -0
  231. package/dist/roles/reviewer/briefs/on.rules/rules101.collocated.[article].md +97 -0
  232. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[article].md +228 -0
  233. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.failhide.md +87 -0
  234. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.gerunds.md +85 -0
  235. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].require.failfast.md +73 -0
  236. package/dist/roles/reviewer/briefs/on.rules/rules101.structure.[article].md +70 -0
  237. package/dist/roles/reviewer/skills/reflect/reflect.d.ts +30 -0
  238. package/dist/roles/reviewer/skills/reflect/reflect.js +305 -0
  239. package/dist/roles/reviewer/skills/reflect/reflect.js.map +1 -0
  240. package/dist/roles/reviewer/skills/reflect/reflect.sh +38 -0
  241. package/dist/roles/reviewer/skills/reflect/reflect.ts +356 -0
  242. package/dist/roles/reviewer/skills/review/review.js.map +1 -1
  243. package/dist/roles/reviewer/skills/review/review.ts +12 -3
  244. package/dist/roles/thinker/getThinkerBrief.d.ts +1 -1
  245. package/dist/roles/thinker/getThinkerRole.js +8 -8
  246. package/dist/roles/thinker/getThinkerRole.js.map +1 -1
  247. package/package.json +6 -4
@@ -0,0 +1,6 @@
1
+ import type { BrainArch1PermissionGuard } from '../../../../domain.objects/BrainArch1/BrainArch1PermissionGuard';
2
+ /**
3
+ * .what = permission guard that allows all tool calls
4
+ * .why = provides a default permissive policy for trusted environments
5
+ */
6
+ export declare const permissionGuardAllowAll: BrainArch1PermissionGuard;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.permissionGuardAllowAll = void 0;
4
+ const BrainArch1PermissionDecision_1 = require("../../../../domain.objects/BrainArch1/BrainArch1PermissionDecision");
5
+ /**
6
+ * .what = permission guard that allows all tool calls
7
+ * .why = provides a default permissive policy for trusted environments
8
+ */
9
+ exports.permissionGuardAllowAll = {
10
+ name: 'allowAll',
11
+ description: 'allows all tool operations without restriction',
12
+ check: async () => new BrainArch1PermissionDecision_1.BrainArch1PermissionDecision({ verdict: 'allow', reason: null }),
13
+ };
14
+ //# sourceMappingURL=allowAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowAll.js","sourceRoot":"","sources":["../../../../../src/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.ts"],"names":[],"mappings":";;;AAAA,8GAA2G;AAG3G;;;GAGG;AACU,QAAA,uBAAuB,GAA8B;IAChE,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE,KAAK,IAAI,EAAE,CAChB,IAAI,2DAA4B,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;CACvE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { BrainArch1PermissionGuard } from '../../../../domain.objects/BrainArch1/BrainArch1PermissionGuard';
2
+ /**
3
+ * .what = permission guard that prompts user for sensitive operations
4
+ * .why = balances automation with user control for potentially destructive actions
5
+ *
6
+ * .note = allows read-only operations, prompts for writes/executions
7
+ */
8
+ export declare const permissionGuardPromptUser: BrainArch1PermissionGuard;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.permissionGuardPromptUser = void 0;
4
+ const BrainArch1PermissionDecision_1 = require("../../../../domain.objects/BrainArch1/BrainArch1PermissionDecision");
5
+ /**
6
+ * .what = tools that require user approval before execution
7
+ * .why = provides sensible defaults for which operations need explicit consent
8
+ */
9
+ const PROMPT_REQUIRED_TOOLS = new Set([
10
+ 'bash_exec', // shell commands can be destructive
11
+ 'files_write', // file creation can overwrite
12
+ 'files_edit', // file modification can corrupt
13
+ ]);
14
+ /**
15
+ * .what = tools that are always safe to execute
16
+ * .why = read-only operations don't need approval
17
+ */
18
+ const ALWAYS_ALLOWED_TOOLS = new Set([
19
+ 'files_read', // reading files is safe
20
+ 'files_glob', // listing files is safe
21
+ 'files_grep', // searching files is safe
22
+ ]);
23
+ /**
24
+ * .what = permission guard that prompts user for sensitive operations
25
+ * .why = balances automation with user control for potentially destructive actions
26
+ *
27
+ * .note = allows read-only operations, prompts for writes/executions
28
+ */
29
+ exports.permissionGuardPromptUser = {
30
+ name: 'promptUser',
31
+ description: 'prompts for user approval on write/execute operations, allows read-only operations',
32
+ check: async ({ call }) => {
33
+ // allow read-only tools immediately
34
+ if (ALWAYS_ALLOWED_TOOLS.has(call.name))
35
+ return new BrainArch1PermissionDecision_1.BrainArch1PermissionDecision({
36
+ verdict: 'allow',
37
+ reason: null,
38
+ });
39
+ // prompt for known sensitive tools
40
+ if (PROMPT_REQUIRED_TOOLS.has(call.name))
41
+ return new BrainArch1PermissionDecision_1.BrainArch1PermissionDecision({
42
+ verdict: 'prompt',
43
+ reason: `tool '${call.name}' requires user approval`,
44
+ });
45
+ // default to prompting for unknown tools (fail-safe)
46
+ return new BrainArch1PermissionDecision_1.BrainArch1PermissionDecision({
47
+ verdict: 'prompt',
48
+ reason: `unknown tool '${call.name}' requires user approval`,
49
+ });
50
+ },
51
+ };
52
+ //# sourceMappingURL=promptUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptUser.js","sourceRoot":"","sources":["../../../../../src/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.ts"],"names":[],"mappings":";;;AAAA,8GAA2G;AAG3G;;;GAGG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,WAAW,EAAE,oCAAoC;IACjD,aAAa,EAAE,8BAA8B;IAC7C,YAAY,EAAE,gCAAgC;CAC/C,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IACnC,YAAY,EAAE,wBAAwB;IACtC,YAAY,EAAE,wBAAwB;IACtC,YAAY,EAAE,0BAA0B;CACzC,CAAC,CAAC;AAEH;;;;;GAKG;AACU,QAAA,yBAAyB,GAA8B;IAClE,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,oFAAoF;IAEtF,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACxB,oCAAoC;QACpC,IAAI,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YACrC,OAAO,IAAI,2DAA4B,CAAC;gBACtC,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,IAAI;aACb,CAAC,CAAC;QAEL,mCAAmC;QACnC,IAAI,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YACtC,OAAO,IAAI,2DAA4B,CAAC;gBACtC,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,SAAS,IAAI,CAAC,IAAI,0BAA0B;aACrD,CAAC,CAAC;QAEL,qDAAqD;QACrD,OAAO,IAAI,2DAA4B,CAAC;YACtC,OAAO,EAAE,QAAQ;YACjB,MAAM,EAAE,iBAAiB,IAAI,CAAC,IAAI,0BAA0B;SAC7D,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { BrainArch1PermissionGuard } from '../../../../domain.objects/BrainArch1/BrainArch1PermissionGuard';
2
+ /**
3
+ * .what = permission guard that allows read-only operations, prompts for all else
4
+ * .why = provides a safe default that enables exploration without risk of modification
5
+ *
6
+ * .note = this is the recommended default permission guard
7
+ */
8
+ export declare const permissionGuardReadOnly: BrainArch1PermissionGuard;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.permissionGuardReadOnly = void 0;
4
+ const BrainArch1PermissionDecision_1 = require("../../../../domain.objects/BrainArch1/BrainArch1PermissionDecision");
5
+ /**
6
+ * .what = tools that are safe to execute without prompting
7
+ * .why = read-only operations don't modify state and are always safe
8
+ */
9
+ const ALLOWED_TOOLS = new Set([
10
+ 'files_read', // reading files is safe
11
+ 'files_glob', // listing files is safe
12
+ 'files_grep', // searching files is safe
13
+ 'websearch', // searching the web is safe
14
+ ]);
15
+ /**
16
+ * .what = permission guard that allows read-only operations, prompts for all else
17
+ * .why = provides a safe default that enables exploration without risk of modification
18
+ *
19
+ * .note = this is the recommended default permission guard
20
+ */
21
+ exports.permissionGuardReadOnly = {
22
+ name: 'readOnly',
23
+ description: 'allows read-only operations (file reads, web searches), prompts for all else',
24
+ check: async ({ call }) => {
25
+ // allow read-only tools immediately
26
+ if (ALLOWED_TOOLS.has(call.name))
27
+ return new BrainArch1PermissionDecision_1.BrainArch1PermissionDecision({
28
+ verdict: 'allow',
29
+ reason: null,
30
+ });
31
+ // prompt for everything else
32
+ return new BrainArch1PermissionDecision_1.BrainArch1PermissionDecision({
33
+ verdict: 'prompt',
34
+ reason: `tool '${call.name}' requires user approval`,
35
+ });
36
+ },
37
+ };
38
+ //# sourceMappingURL=readOnly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../../../src/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.ts"],"names":[],"mappings":";;;AAAA,8GAA2G;AAG3G;;;GAGG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,YAAY,EAAE,wBAAwB;IACtC,YAAY,EAAE,wBAAwB;IACtC,YAAY,EAAE,0BAA0B;IACxC,WAAW,EAAE,4BAA4B;CAC1C,CAAC,CAAC;AAEH;;;;;GAKG;AACU,QAAA,uBAAuB,GAA8B;IAChE,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,8EAA8E;IAEhF,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACxB,oCAAoC;QACpC,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9B,OAAO,IAAI,2DAA4B,CAAC;gBACtC,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,IAAI;aACb,CAAC,CAAC;QAEL,6BAA6B;QAC7B,OAAO,IAAI,2DAA4B,CAAC;YACtC,OAAO,EAAE,QAAQ;YACjB,MAAM,EAAE,SAAS,IAAI,CAAC,IAAI,0BAA0B;SACrD,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import type { BrainArch1ToolCall } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolCall';
3
+ import { BrainArch1ToolDefinition } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition';
4
+ import { BrainArch1ToolResult } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolResult';
5
+ /**
6
+ * .what = zod schema for bash exec tool input
7
+ * .why = enables type-safe validation and json schema generation
8
+ */
9
+ export declare const schemaExecInput: z.ZodObject<{
10
+ command: z.ZodString;
11
+ cwd: z.ZodOptional<z.ZodString>;
12
+ timeout: z.ZodOptional<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ command: string;
15
+ cwd?: string | undefined;
16
+ timeout?: number | undefined;
17
+ }, {
18
+ command: string;
19
+ cwd?: string | undefined;
20
+ timeout?: number | undefined;
21
+ }>;
22
+ /**
23
+ * .what = tool definition for executing bash commands
24
+ * .why = enables agentic shell command execution
25
+ */
26
+ export declare const toolDefinitionExec: BrainArch1ToolDefinition;
27
+ /**
28
+ * .what = executes bash commands
29
+ * .why = enables shell operations for agentic workflows
30
+ */
31
+ export declare const executeExec: (input: {
32
+ call: BrainArch1ToolCall;
33
+ }) => Promise<BrainArch1ToolResult>;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeExec = exports.toolDefinitionExec = exports.schemaExecInput = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const util_1 = require("util");
6
+ const zod_1 = require("zod");
7
+ const BrainArch1ToolDefinition_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition");
8
+ const BrainArch1ToolResult_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolResult");
9
+ const execAsync = (0, util_1.promisify)(child_process_1.exec);
10
+ /**
11
+ * .what = zod schema for bash exec tool input
12
+ * .why = enables type-safe validation and json schema generation
13
+ */
14
+ exports.schemaExecInput = zod_1.z.object({
15
+ command: zod_1.z.string().describe('The bash command to execute'),
16
+ cwd: zod_1.z
17
+ .string()
18
+ .optional()
19
+ .describe('Working directory for the command. Defaults to current directory.'),
20
+ timeout: zod_1.z
21
+ .number()
22
+ .optional()
23
+ .describe('Timeout in milliseconds. Defaults to 30000 (30 seconds).'),
24
+ });
25
+ /**
26
+ * .what = tool definition for executing bash commands
27
+ * .why = enables agentic shell command execution
28
+ */
29
+ exports.toolDefinitionExec = new BrainArch1ToolDefinition_1.BrainArch1ToolDefinition({
30
+ name: 'bash_exec',
31
+ description: 'Executes a bash command and returns stdout/stderr. Use for git, npm, system commands, etc.',
32
+ schema: {
33
+ input: (0, BrainArch1ToolDefinition_1.toJsonSchema)(exports.schemaExecInput),
34
+ },
35
+ strict: false,
36
+ });
37
+ /**
38
+ * .what = executes bash commands
39
+ * .why = enables shell operations for agentic workflows
40
+ */
41
+ const executeExec = async (input) => {
42
+ const args = input.call.input;
43
+ // validate command is provided
44
+ if (!args.command || typeof args.command !== 'string') {
45
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
46
+ callId: input.call.id,
47
+ success: false,
48
+ output: '',
49
+ error: 'command is required and must be a string',
50
+ });
51
+ }
52
+ // execute the command
53
+ try {
54
+ const timeout = args.timeout ?? 30000;
55
+ const cwd = args.cwd ?? process.cwd();
56
+ const { stdout, stderr } = await execAsync(args.command, {
57
+ cwd,
58
+ timeout,
59
+ maxBuffer: 10 * 1024 * 1024, // 10MB buffer
60
+ });
61
+ // format output
62
+ const output = [
63
+ stdout ? `stdout:\n${stdout}` : null,
64
+ stderr ? `stderr:\n${stderr}` : null,
65
+ ]
66
+ .filter(Boolean)
67
+ .join('\n\n');
68
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
69
+ callId: input.call.id,
70
+ success: true,
71
+ output: output || '(no output)',
72
+ error: null,
73
+ });
74
+ }
75
+ catch (error) {
76
+ // handle exec errors (non-zero exit, timeout, etc)
77
+ const execError = error;
78
+ const output = [
79
+ execError.stdout ? `stdout:\n${execError.stdout}` : null,
80
+ execError.stderr ? `stderr:\n${execError.stderr}` : null,
81
+ ]
82
+ .filter(Boolean)
83
+ .join('\n\n');
84
+ const errorMsg = [
85
+ execError.message ?? String(error),
86
+ execError.code !== undefined ? `exit code: ${execError.code}` : null,
87
+ execError.killed ? 'process was killed (timeout or signal)' : null,
88
+ ]
89
+ .filter(Boolean)
90
+ .join('; ');
91
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
92
+ callId: input.call.id,
93
+ success: false,
94
+ output: output || '',
95
+ error: errorMsg,
96
+ });
97
+ }
98
+ };
99
+ exports.executeExec = executeExec;
100
+ //# sourceMappingURL=exec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../../../src/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ import type { BrainArch1Toolbox } from '../../../../../domain.objects/BrainArch1/BrainArch1Toolbox';
2
+ /**
3
+ * .what = toolbox for bash command execution
4
+ * .why = enables agentic shell operations
5
+ */
6
+ export declare const toolboxBash: BrainArch1Toolbox;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toolboxBash = void 0;
4
+ const BrainArch1ToolResult_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolResult");
5
+ const exec_1 = require("./exec");
6
+ /**
7
+ * .what = toolbox for bash command execution
8
+ * .why = enables agentic shell operations
9
+ */
10
+ exports.toolboxBash = {
11
+ name: 'bash',
12
+ definitions: [exec_1.toolDefinitionExec],
13
+ execute: async (input, _context) => {
14
+ // route to the correct executor
15
+ if (input.call.name === 'bash_exec')
16
+ return (0, exec_1.executeExec)(input);
17
+ // unknown tool
18
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
19
+ callId: input.call.id,
20
+ success: false,
21
+ output: '',
22
+ error: `unknown bash tool '${input.call.name}'`,
23
+ });
24
+ },
25
+ };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.ts"],"names":[],"mappings":";;;AAGA,8FAA2F;AAE3F,iCAAyD;AAEzD;;;GAGG;AACU,QAAA,WAAW,GAAsB;IAC5C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,CAAC,yBAAkB,CAAC;IACjC,OAAO,EAAE,KAAK,EACZ,KAAmC,EACnC,QAA2B,EAC3B,EAAE;QACF,gCAAgC;QAChC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW;YAAE,OAAO,IAAA,kBAAW,EAAC,KAAK,CAAC,CAAC;QAE/D,eAAe;QACf,OAAO,IAAI,2CAAoB,CAAC;YAC9B,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,sBAAsB,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG;SAChD,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import { BrainArch1ToolDefinition } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition';
3
+ import { BrainArch1ToolResult } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolResult';
4
+ /**
5
+ * .what = zod schema for edit tool input
6
+ * .why = enables type-safe validation and json schema generation
7
+ */
8
+ export declare const schemaEditInput: z.ZodObject<{
9
+ path: z.ZodString;
10
+ old_string: z.ZodString;
11
+ new_string: z.ZodString;
12
+ replace_all: z.ZodOptional<z.ZodBoolean>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ path: string;
15
+ old_string: string;
16
+ new_string: string;
17
+ replace_all?: boolean | undefined;
18
+ }, {
19
+ path: string;
20
+ old_string: string;
21
+ new_string: string;
22
+ replace_all?: boolean | undefined;
23
+ }>;
24
+ /**
25
+ * .what = tool definition for editing file contents via string replacement
26
+ * .why = enables the brain to make precise changes to existing files
27
+ */
28
+ export declare const toolDefinitionEdit: BrainArch1ToolDefinition;
29
+ /**
30
+ * .what = executes the edit tool
31
+ * .why = performs the actual file edit operation
32
+ */
33
+ export declare const executeToolEdit: (input: {
34
+ callId: string;
35
+ args: {
36
+ path: string;
37
+ old_string: string;
38
+ new_string: string;
39
+ replace_all?: boolean;
40
+ };
41
+ }) => Promise<BrainArch1ToolResult>;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.executeToolEdit = exports.toolDefinitionEdit = exports.schemaEditInput = void 0;
27
+ const fs = __importStar(require("fs/promises"));
28
+ const zod_1 = require("zod");
29
+ const BrainArch1ToolDefinition_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition");
30
+ const BrainArch1ToolResult_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolResult");
31
+ /**
32
+ * .what = zod schema for edit tool input
33
+ * .why = enables type-safe validation and json schema generation
34
+ */
35
+ exports.schemaEditInput = zod_1.z.object({
36
+ path: zod_1.z.string().describe('The absolute path to the file to edit'),
37
+ old_string: zod_1.z.string().describe('The exact string to find and replace'),
38
+ new_string: zod_1.z.string().describe('The string to replace it with'),
39
+ replace_all: zod_1.z
40
+ .boolean()
41
+ .optional()
42
+ .describe('If true, replace all occurrences. Otherwise, fail if multiple matches.'),
43
+ });
44
+ /**
45
+ * .what = tool definition for editing file contents via string replacement
46
+ * .why = enables the brain to make precise changes to existing files
47
+ */
48
+ exports.toolDefinitionEdit = new BrainArch1ToolDefinition_1.BrainArch1ToolDefinition({
49
+ name: 'edit',
50
+ description: 'Performs exact string replacement in a file. The old_string must be unique in the file unless replace_all is true.',
51
+ schema: {
52
+ input: (0, BrainArch1ToolDefinition_1.toJsonSchema)(exports.schemaEditInput),
53
+ },
54
+ strict: false,
55
+ });
56
+ /**
57
+ * .what = executes the edit tool
58
+ * .why = performs the actual file edit operation
59
+ */
60
+ const executeToolEdit = async (input) => {
61
+ try {
62
+ // read current content
63
+ const content = await fs.readFile(input.args.path, 'utf-8');
64
+ // count occurrences
65
+ const occurrences = content.split(input.args.old_string).length - 1;
66
+ // validate uniqueness
67
+ if (occurrences === 0) {
68
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
69
+ callId: input.callId,
70
+ success: false,
71
+ output: '',
72
+ error: 'old_string not found in file',
73
+ });
74
+ }
75
+ if (occurrences > 1 && !input.args.replace_all) {
76
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
77
+ callId: input.callId,
78
+ success: false,
79
+ output: '',
80
+ error: `old_string found ${occurrences} times. use replace_all=true or provide more context.`,
81
+ });
82
+ }
83
+ // perform replacement
84
+ const newContent = input.args.replace_all
85
+ ? content.split(input.args.old_string).join(input.args.new_string)
86
+ : content.replace(input.args.old_string, input.args.new_string);
87
+ // write updated content
88
+ await fs.writeFile(input.args.path, newContent, 'utf-8');
89
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
90
+ callId: input.callId,
91
+ success: true,
92
+ output: `replaced ${input.args.replace_all ? occurrences : 1} occurrence(s)`,
93
+ error: null,
94
+ });
95
+ }
96
+ catch (err) {
97
+ const error = err instanceof Error ? err.message : String(err);
98
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
99
+ callId: input.callId,
100
+ success: false,
101
+ output: '',
102
+ error: `failed to edit file: ${error}`,
103
+ });
104
+ }
105
+ };
106
+ exports.executeToolEdit = executeToolEdit;
107
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../../../../src/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { BrainArch1ToolDefinition } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition';
3
+ import { BrainArch1ToolResult } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolResult';
4
+ /**
5
+ * .what = zod schema for glob tool input
6
+ * .why = enables type-safe validation and json schema generation
7
+ */
8
+ export declare const schemaGlobInput: z.ZodObject<{
9
+ pattern: z.ZodString;
10
+ cwd: z.ZodOptional<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ pattern: string;
13
+ cwd?: string | undefined;
14
+ }, {
15
+ pattern: string;
16
+ cwd?: string | undefined;
17
+ }>;
18
+ /**
19
+ * .what = tool definition for finding files by glob pattern
20
+ * .why = enables the brain to discover files matching patterns
21
+ */
22
+ export declare const toolDefinitionGlob: BrainArch1ToolDefinition;
23
+ /**
24
+ * .what = executes the glob tool
25
+ * .why = performs the actual file pattern matching
26
+ */
27
+ export declare const executeToolGlob: (input: {
28
+ callId: string;
29
+ args: {
30
+ pattern: string;
31
+ cwd?: string;
32
+ };
33
+ }) => Promise<BrainArch1ToolResult>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.executeToolGlob = exports.toolDefinitionGlob = exports.schemaGlobInput = void 0;
7
+ const fast_glob_1 = __importDefault(require("fast-glob"));
8
+ const zod_1 = require("zod");
9
+ const BrainArch1ToolDefinition_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition");
10
+ const BrainArch1ToolResult_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolResult");
11
+ /**
12
+ * .what = zod schema for glob tool input
13
+ * .why = enables type-safe validation and json schema generation
14
+ */
15
+ exports.schemaGlobInput = zod_1.z.object({
16
+ pattern: zod_1.z
17
+ .string()
18
+ .describe('The glob pattern to match files (e.g., "**/*.ts")'),
19
+ cwd: zod_1.z
20
+ .string()
21
+ .optional()
22
+ .describe('Optional working directory to search from. Defaults to process.cwd().'),
23
+ });
24
+ /**
25
+ * .what = tool definition for finding files by glob pattern
26
+ * .why = enables the brain to discover files matching patterns
27
+ */
28
+ exports.toolDefinitionGlob = new BrainArch1ToolDefinition_1.BrainArch1ToolDefinition({
29
+ name: 'glob',
30
+ description: 'Finds files matching a glob pattern. Returns matching file paths.',
31
+ schema: {
32
+ input: (0, BrainArch1ToolDefinition_1.toJsonSchema)(exports.schemaGlobInput),
33
+ },
34
+ strict: false,
35
+ });
36
+ /**
37
+ * .what = executes the glob tool
38
+ * .why = performs the actual file pattern matching
39
+ */
40
+ const executeToolGlob = async (input) => {
41
+ try {
42
+ // find matching files
43
+ const matches = await (0, fast_glob_1.default)(input.args.pattern, {
44
+ cwd: input.args.cwd ?? process.cwd(),
45
+ absolute: true,
46
+ onlyFiles: true,
47
+ });
48
+ // format output
49
+ const output = matches.length > 0 ? matches.join('\n') : 'no files matched the pattern';
50
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
51
+ callId: input.callId,
52
+ success: true,
53
+ output,
54
+ error: null,
55
+ });
56
+ }
57
+ catch (err) {
58
+ const error = err instanceof Error ? err.message : String(err);
59
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
60
+ callId: input.callId,
61
+ success: false,
62
+ output: '',
63
+ error: `failed to glob: ${error}`,
64
+ });
65
+ }
66
+ };
67
+ exports.executeToolGlob = executeToolGlob;
68
+ //# sourceMappingURL=glob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glob.js","sourceRoot":"","sources":["../../../../../../src/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA2B;AAC3B,6BAAwB;AAExB,sGAGiE;AACjE,8FAA2F;AAE3F;;;GAGG;AACU,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,mDAAmD,CAAC;IAChE,GAAG,EAAE,OAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uEAAuE,CACxE;CACJ,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,kBAAkB,GAAG,IAAI,mDAAwB,CAAC;IAC7D,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,mEAAmE;IACrE,MAAM,EAAE;QACN,KAAK,EAAE,IAAA,uCAAY,EAAC,uBAAe,CAAC;KACrC;IACD,MAAM,EAAE,KAAK;CACd,CAAC,CAAC;AAEH;;;GAGG;AACI,MAAM,eAAe,GAAG,KAAK,EAAE,KAGrC,EAAiC,EAAE;IAClC,IAAI,CAAC;QACH,sBAAsB;QACtB,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAE,EAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE;YAC3C,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;YACpC,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,gBAAgB;QAChB,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC;QAE3E,OAAO,IAAI,2CAAoB,CAAC;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,IAAI;YACb,MAAM;YACN,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/D,OAAO,IAAI,2CAAoB,CAAC;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,mBAAmB,KAAK,EAAE;SAClC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AA/BW,QAAA,eAAe,mBA+B1B"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import { BrainArch1ToolDefinition } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition';
3
+ import { BrainArch1ToolResult } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolResult';
4
+ /**
5
+ * .what = zod schema for grep tool input
6
+ * .why = enables type-safe validation and json schema generation
7
+ */
8
+ export declare const schemaGrepInput: z.ZodObject<{
9
+ pattern: z.ZodString;
10
+ path: z.ZodOptional<z.ZodString>;
11
+ glob: z.ZodOptional<z.ZodString>;
12
+ case_insensitive: z.ZodOptional<z.ZodBoolean>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ pattern: string;
15
+ path?: string | undefined;
16
+ glob?: string | undefined;
17
+ case_insensitive?: boolean | undefined;
18
+ }, {
19
+ pattern: string;
20
+ path?: string | undefined;
21
+ glob?: string | undefined;
22
+ case_insensitive?: boolean | undefined;
23
+ }>;
24
+ /**
25
+ * .what = tool definition for searching file contents by pattern
26
+ * .why = enables the brain to search for text patterns in files
27
+ */
28
+ export declare const toolDefinitionGrep: BrainArch1ToolDefinition;
29
+ /**
30
+ * .what = executes the grep tool
31
+ * .why = performs the actual content search operation
32
+ */
33
+ export declare const executeToolGrep: (input: {
34
+ callId: string;
35
+ args: {
36
+ pattern: string;
37
+ path?: string;
38
+ glob?: string;
39
+ case_insensitive?: boolean;
40
+ };
41
+ }) => Promise<BrainArch1ToolResult>;