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,36 @@
1
+ import { z } from 'zod';
2
+ import type { BrainArch1Context } from '../../../../../domain.objects/BrainArch1/BrainArch1Context';
3
+ import { BrainArch1ToolDefinition } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition';
4
+ import { BrainArch1ToolResult } from '../../../../../domain.objects/BrainArch1/BrainArch1ToolResult';
5
+ /**
6
+ * .what = zod schema for websearch tool input
7
+ * .why = enables type-safe validation and json schema generation
8
+ */
9
+ export declare const schemaWebsearchInput: z.ZodObject<{
10
+ query: z.ZodString;
11
+ num_results: z.ZodOptional<z.ZodNumber>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ query: string;
14
+ num_results?: number | undefined;
15
+ }, {
16
+ query: string;
17
+ num_results?: number | undefined;
18
+ }>;
19
+ /**
20
+ * .what = tool definition for web search
21
+ * .why = enables the brain to search the web for information
22
+ */
23
+ export declare const toolDefinitionSearch: BrainArch1ToolDefinition;
24
+ /**
25
+ * .what = executes web search using Tavily API
26
+ * .why = provides reliable web search with proper API authentication
27
+ *
28
+ * .note = requires TAVILY_API_KEY in context.creds.tavily
29
+ */
30
+ export declare const executeToolSearch: (input: {
31
+ callId: string;
32
+ args: {
33
+ query: string;
34
+ num_results?: number;
35
+ };
36
+ }, context: BrainArch1Context) => Promise<BrainArch1ToolResult>;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeToolSearch = exports.toolDefinitionSearch = exports.schemaWebsearchInput = void 0;
4
+ const zod_1 = require("zod");
5
+ const BrainArch1ToolDefinition_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolDefinition");
6
+ const BrainArch1ToolResult_1 = require("../../../../../domain.objects/BrainArch1/BrainArch1ToolResult");
7
+ /**
8
+ * .what = zod schema for websearch tool input
9
+ * .why = enables type-safe validation and json schema generation
10
+ */
11
+ exports.schemaWebsearchInput = zod_1.z.object({
12
+ query: zod_1.z.string().describe('The search query to look up'),
13
+ num_results: zod_1.z
14
+ .number()
15
+ .optional()
16
+ .describe('Number of results to return (default: 10, max: 20)'),
17
+ });
18
+ /**
19
+ * .what = tool definition for web search
20
+ * .why = enables the brain to search the web for information
21
+ */
22
+ exports.toolDefinitionSearch = new BrainArch1ToolDefinition_1.BrainArch1ToolDefinition({
23
+ name: 'websearch',
24
+ description: 'Search the web for information. Returns search results with titles, URLs, and snippets. Use this to find current information, research topics, and gather sources for citations.',
25
+ schema: {
26
+ input: (0, BrainArch1ToolDefinition_1.toJsonSchema)(exports.schemaWebsearchInput),
27
+ },
28
+ strict: false,
29
+ });
30
+ /**
31
+ * .what = executes web search using Tavily API
32
+ * .why = provides reliable web search with proper API authentication
33
+ *
34
+ * .note = requires TAVILY_API_KEY in context.creds.tavily
35
+ */
36
+ const executeToolSearch = async (input, context) => {
37
+ const { callId, args } = input;
38
+ const numResults = Math.min(args.num_results ?? 10, 20);
39
+ // check for api key
40
+ if (!context.creds.tavily.apiKey) {
41
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
42
+ callId,
43
+ success: false,
44
+ output: '',
45
+ error: 'TAVILY_API_KEY not configured',
46
+ });
47
+ }
48
+ try {
49
+ // call Tavily search API
50
+ const response = await fetch('https://api.tavily.com/search', {
51
+ method: 'POST',
52
+ headers: { 'Content-Type': 'application/json' },
53
+ body: JSON.stringify({
54
+ api_key: context.creds.tavily.apiKey,
55
+ query: args.query,
56
+ max_results: numResults,
57
+ search_depth: 'basic',
58
+ include_answer: false,
59
+ include_raw_content: false,
60
+ }),
61
+ });
62
+ if (!response.ok) {
63
+ const errorText = await response.text();
64
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
65
+ callId,
66
+ success: false,
67
+ output: '',
68
+ error: `tavily search failed: ${response.status} ${response.statusText} - ${errorText}`,
69
+ });
70
+ }
71
+ const data = (await response.json());
72
+ if (!data.results || data.results.length === 0) {
73
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
74
+ callId,
75
+ success: true,
76
+ output: `No results found for query: "${args.query}"`,
77
+ error: null,
78
+ });
79
+ }
80
+ // format results for the brain
81
+ const formattedResults = data.results
82
+ .map((r, i) => `[${i + 1}] ${r.title}\n URL: ${r.url}\n ${r.content}`)
83
+ .join('\n\n');
84
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
85
+ callId,
86
+ success: true,
87
+ output: `Found ${data.results.length} results for "${args.query}":\n\n${formattedResults}`,
88
+ error: null,
89
+ });
90
+ }
91
+ catch (error) {
92
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
93
+ callId,
94
+ success: false,
95
+ output: '',
96
+ error: `search failed: ${error instanceof Error ? error.message : String(error)}`,
97
+ });
98
+ }
99
+ };
100
+ exports.executeToolSearch = executeToolSearch;
101
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../src/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import type { BrainArch1Context } from '../../../domain.objects/BrainArch1/BrainArch1Context';
2
+ import type { BrainArch1PermissionGuard } from '../../../domain.objects/BrainArch1/BrainArch1PermissionGuard';
3
+ import type { BrainArch1Toolbox } from '../../../domain.objects/BrainArch1/BrainArch1Toolbox';
4
+ import type { BrainArch1ToolCall } from '../../../domain.objects/BrainArch1/BrainArch1ToolCall';
5
+ import { BrainArch1ToolResult } from '../../../domain.objects/BrainArch1/BrainArch1ToolResult';
6
+ /**
7
+ * .what = executes a tool call against the merged toolboxes
8
+ * .why = provides unified tool execution with permission checking
9
+ */
10
+ export declare const executeBrainArch1ToolCall: (input: {
11
+ call: BrainArch1ToolCall;
12
+ toolboxByToolName: Map<string, BrainArch1Toolbox>;
13
+ permissionGuard: BrainArch1PermissionGuard;
14
+ }, context: BrainArch1Context) => Promise<BrainArch1ToolResult>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeBrainArch1ToolCall = void 0;
4
+ const BrainArch1ToolResult_1 = require("../../../domain.objects/BrainArch1/BrainArch1ToolResult");
5
+ /**
6
+ * .what = executes a tool call against the merged toolboxes
7
+ * .why = provides unified tool execution with permission checking
8
+ */
9
+ const executeBrainArch1ToolCall = async (input, context) => {
10
+ // find the toolbox for this tool
11
+ const toolbox = input.toolboxByToolName.get(input.call.name);
12
+ if (!toolbox) {
13
+ const availableTools = Array.from(input.toolboxByToolName.keys());
14
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
15
+ callId: input.call.id,
16
+ success: false,
17
+ output: `tool "${input.call.name}" not found. available tools: ${availableTools.join(', ')}`,
18
+ error: `tool not found: ${input.call.name}`,
19
+ });
20
+ }
21
+ // check permission guard
22
+ const decision = await input.permissionGuard.check({ call: input.call }, context);
23
+ if (decision.verdict === 'deny') {
24
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
25
+ callId: input.call.id,
26
+ success: false,
27
+ output: `permission denied: ${decision.reason ?? 'no reason provided'}`,
28
+ error: 'permission denied',
29
+ });
30
+ }
31
+ // handle prompt verdict (for now, treat as deny with explanation)
32
+ if (decision.verdict === 'prompt') {
33
+ return new BrainArch1ToolResult_1.BrainArch1ToolResult({
34
+ callId: input.call.id,
35
+ success: false,
36
+ output: `permission requires user approval: ${decision.reason ?? 'no reason provided'}`,
37
+ error: 'user approval required',
38
+ });
39
+ }
40
+ // execute the tool via its toolbox
41
+ const result = await toolbox.execute({ call: input.call }, context);
42
+ return result;
43
+ };
44
+ exports.executeBrainArch1ToolCall = executeBrainArch1ToolCall;
45
+ //# sourceMappingURL=executeBrainArch1ToolCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeBrainArch1ToolCall.js","sourceRoot":"","sources":["../../../../src/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.ts"],"names":[],"mappings":";;;AAIA,8FAA2F;AAE3F;;;GAGG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAC5C,KAIC,EACD,OAA0B,EACK,EAAE;IACjC,iCAAiC;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC;QAClE,OAAO,IAAI,2CAAoB,CAAC;YAC9B,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,iCAAiC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC5F,KAAK,EAAE,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB;IACzB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,eAAe,CAAC,KAAK,CAChD,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EACpB,OAAO,CACR,CAAC;IACF,IAAI,QAAQ,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAChC,OAAO,IAAI,2CAAoB,CAAC;YAC9B,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,sBAAsB,QAAQ,CAAC,MAAM,IAAI,oBAAoB,EAAE;YACvE,KAAK,EAAE,mBAAmB;SAC3B,CAAC,CAAC;IACL,CAAC;IAED,kEAAkE;IAClE,IAAI,QAAQ,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,IAAI,2CAAoB,CAAC;YAC9B,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,sCAAsC,QAAQ,CAAC,MAAM,IAAI,oBAAoB,EAAE;YACvF,KAAK,EAAE,wBAAwB;SAChC,CAAC,CAAC;IACL,CAAC;IAED,mCAAmC;IACnC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAEpE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAhDW,QAAA,yBAAyB,6BAgDpC"}
@@ -0,0 +1,19 @@
1
+ import type { BrainArch1Toolbox } from '../../../domain.objects/BrainArch1/BrainArch1Toolbox';
2
+ import type { BrainArch1ToolDefinition } from '../../../domain.objects/BrainArch1/BrainArch1ToolDefinition';
3
+ /**
4
+ * .what = result of merging multiple tool boxes
5
+ * .why = provides both definitions for llm and lookup for execution
6
+ */
7
+ export interface MergedBrainArch1Toolboxes {
8
+ definitions: BrainArch1ToolDefinition[];
9
+ toolboxByToolName: Map<string, BrainArch1Toolbox>;
10
+ }
11
+ /**
12
+ * .what = merges multiple tool boxes into a unified collection
13
+ * .why = enables brain to use tools from multiple sources with single interface
14
+ *
15
+ * .note = throws if duplicate tool names detected
16
+ */
17
+ export declare const mergeBrainArch1Toolboxes: (input: {
18
+ toolboxes: BrainArch1Toolbox[];
19
+ }) => MergedBrainArch1Toolboxes;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeBrainArch1Toolboxes = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = merges multiple tool boxes into a unified collection
7
+ * .why = enables brain to use tools from multiple sources with single interface
8
+ *
9
+ * .note = throws if duplicate tool names detected
10
+ */
11
+ const mergeBrainArch1Toolboxes = (input) => {
12
+ const definitions = [];
13
+ const toolboxByToolName = new Map();
14
+ const seenToolNames = new Set();
15
+ // iterate through each toolbox
16
+ for (const toolbox of input.toolboxes) {
17
+ // iterate through each tool definition in the box
18
+ for (const definition of toolbox.definitions) {
19
+ // check for duplicate tool names
20
+ if (seenToolNames.has(definition.name)) {
21
+ throw new helpful_errors_1.BadRequestError('duplicate tool name across toolboxes', {
22
+ toolName: definition.name,
23
+ toolboxName: toolbox.name,
24
+ });
25
+ }
26
+ // register the tool
27
+ seenToolNames.add(definition.name);
28
+ definitions.push(definition);
29
+ toolboxByToolName.set(definition.name, toolbox);
30
+ }
31
+ }
32
+ return { definitions, toolboxByToolName };
33
+ };
34
+ exports.mergeBrainArch1Toolboxes = mergeBrainArch1Toolboxes;
35
+ //# sourceMappingURL=mergeBrainArch1Toolboxes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeBrainArch1Toolboxes.js","sourceRoot":"","sources":["../../../../src/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAcjD;;;;;GAKG;AACI,MAAM,wBAAwB,GAAG,CAAC,KAExC,EAA6B,EAAE;IAC9B,MAAM,WAAW,GAA+B,EAAE,CAAC;IACnD,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA6B,CAAC;IAC/D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IAExC,+BAA+B;IAC/B,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACtC,kDAAkD;QAClD,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YAC7C,iCAAiC;YACjC,IAAI,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvC,MAAM,IAAI,gCAAe,CAAC,sCAAsC,EAAE;oBAChE,QAAQ,EAAE,UAAU,CAAC,IAAI;oBACzB,WAAW,EAAE,OAAO,CAAC,IAAI;iBAC1B,CAAC,CAAC;YACL,CAAC;YAED,oBAAoB;YACpB,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACnC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC7B,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC5C,CAAC,CAAC;AA3BW,QAAA,wBAAwB,4BA2BnC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * .what = constructs github url for a file in a git repository
3
+ * .why = enables permanent citations with provenance track
4
+ */
5
+ export declare const genGitHubFileUrl: (input: {
6
+ filePath: string;
7
+ cwd: string;
8
+ ref?: string;
9
+ }) => string;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.genGitHubFileUrl = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const getGitRemoteUrl_1 = require("./getGitRemoteUrl");
6
+ /**
7
+ * .what = constructs github url for a file in a git repository
8
+ * .why = enables permanent citations with provenance track
9
+ */
10
+ const genGitHubFileUrl = (input) => {
11
+ // get remote url and parse to github format
12
+ const remoteUrl = (0, getGitRemoteUrl_1.getGitRemoteUrl)({ cwd: input.cwd });
13
+ const githubBase = parseRemoteToGitHubUrl(remoteUrl);
14
+ // get current branch or commit if ref not specified
15
+ const ref = input.ref ??
16
+ (0, child_process_1.execSync)('git rev-parse HEAD', {
17
+ cwd: input.cwd,
18
+ encoding: 'utf-8',
19
+ stdio: 'pipe',
20
+ }).trim();
21
+ // encode file path for url (handle special characters like brackets)
22
+ const encodedPath = encodeFilePath(input.filePath);
23
+ return `${githubBase}/blob/${ref}/${encodedPath}`;
24
+ };
25
+ exports.genGitHubFileUrl = genGitHubFileUrl;
26
+ /**
27
+ * .what = parses git remote url to github https url
28
+ * .why = handles both ssh and https remote formats
29
+ */
30
+ const parseRemoteToGitHubUrl = (remoteUrl) => {
31
+ // ssh format: git@github.com:org/repo.git
32
+ const sshMatch = remoteUrl.match(/git@github\.com:(.+?)(?:\.git)?$/);
33
+ if (sshMatch) {
34
+ return `https://github.com/${sshMatch[1]}`;
35
+ }
36
+ // https format: https://github.com/org/repo.git
37
+ const httpsMatch = remoteUrl.match(/https:\/\/github\.com\/(.+?)(?:\.git)?$/);
38
+ if (httpsMatch) {
39
+ return `https://github.com/${httpsMatch[1]}`;
40
+ }
41
+ // fallback: strip .git suffix if present
42
+ return remoteUrl.replace(/\.git$/, '');
43
+ };
44
+ /**
45
+ * .what = encodes file path for github url
46
+ * .why = handles special characters like brackets in filenames
47
+ */
48
+ const encodeFilePath = (filePath) => {
49
+ // encode special characters that github expects encoded
50
+ return filePath
51
+ .split('/')
52
+ .map((segment) => segment.replace(/\[/g, '%5B').replace(/\]/g, '%5D').replace(/ /g, '%20'))
53
+ .join('/');
54
+ };
55
+ //# sourceMappingURL=genGitHubFileUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genGitHubFileUrl.js","sourceRoot":"","sources":["../../../src/domain.operations/git/genGitHubFileUrl.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAEzC,uDAAoD;AAEpD;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,KAIhC,EAAU,EAAE;IACX,4CAA4C;IAC5C,MAAM,SAAS,GAAG,IAAA,iCAAe,EAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAErD,oDAAoD;IACpD,MAAM,GAAG,GACP,KAAK,CAAC,GAAG;QACT,IAAA,wBAAQ,EAAC,oBAAoB,EAAE;YAC7B,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,MAAM;SACd,CAAC,CAAC,IAAI,EAAE,CAAC;IAEZ,qEAAqE;IACrE,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEnD,OAAO,GAAG,UAAU,SAAS,GAAG,IAAI,WAAW,EAAE,CAAC;AACpD,CAAC,CAAC;AAtBW,QAAA,gBAAgB,oBAsB3B;AAEF;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAU,EAAE;IAC3D,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACrE,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,sBAAsB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7C,CAAC;IAED,gDAAgD;IAChD,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC9E,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,sBAAsB,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,CAAC;IAED,yCAAyC;IACzC,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAU,EAAE;IAClD,wDAAwD;IACxD,OAAO,QAAQ;SACZ,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACf,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CACzE;SACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * .what = extracts git remote origin url from repository
3
+ * .why = enables construction of github urls for citations
4
+ */
5
+ export declare const getGitRemoteUrl: (input: {
6
+ cwd: string;
7
+ }) => string;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGitRemoteUrl = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const helpful_errors_1 = require("helpful-errors");
6
+ /**
7
+ * .what = extracts git remote origin url from repository
8
+ * .why = enables construction of github urls for citations
9
+ */
10
+ const getGitRemoteUrl = (input) => {
11
+ // verify this is a git repository
12
+ try {
13
+ (0, child_process_1.execSync)('git rev-parse --git-dir', {
14
+ cwd: input.cwd,
15
+ stdio: 'pipe',
16
+ });
17
+ }
18
+ catch {
19
+ throw new helpful_errors_1.BadRequestError('directory is not a git repository', {
20
+ cwd: input.cwd,
21
+ });
22
+ }
23
+ // get remote origin url
24
+ try {
25
+ const result = (0, child_process_1.execSync)('git remote get-url origin', {
26
+ cwd: input.cwd,
27
+ encoding: 'utf-8',
28
+ stdio: 'pipe',
29
+ });
30
+ return result.trim();
31
+ }
32
+ catch {
33
+ throw new helpful_errors_1.BadRequestError('git repository has no remote origin configured', {
34
+ cwd: input.cwd,
35
+ hint: 'run: git remote add origin <url>',
36
+ });
37
+ }
38
+ };
39
+ exports.getGitRemoteUrl = getGitRemoteUrl;
40
+ //# sourceMappingURL=getGitRemoteUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGitRemoteUrl.js","sourceRoot":"","sources":["../../../src/domain.operations/git/getGitRemoteUrl.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,mDAAiD;AAEjD;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,KAAsB,EAAU,EAAE;IAChE,kCAAkC;IAClC,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,yBAAyB,EAAE;YAClC,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,gCAAe,CAAC,mCAAmC,EAAE;YAC7D,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC,CAAC;IACL,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,2BAA2B,EAAE;YACnD,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,gCAAe,CACvB,gDAAgD,EAChD;YACE,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,IAAI,EAAE,kCAAkC;SACzC,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInvokeHooks = void 0;
4
- const execTranslateDocOutputPath_1 = require("./execTranslateDocOutputPath");
4
+ const execTranslateDocOutputPath_1 = require("../../domain.operations/hooks/execTranslateDocOutputPath");
5
5
  const getInvokeHooks = () => ({
6
6
  onInvokeAskInput: [
7
7
  (input) => {
@@ -1 +1 @@
1
- {"version":3,"file":"getInvokeHooks.js","sourceRoot":"","sources":["../../../src/domain.operations/hooks/getInvokeHooks.ts"],"names":[],"mappings":";;;AAEA,6EAA0E;AAEnE,MAAM,cAAc,GAAG,GAAgB,EAAE,CAAC,CAAC;IAChD,gBAAgB,EAAE;QAChB,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC5B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,uDAA0B,EAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,4BAA4B;KAC3F;CACF,CAAC,CAAC;AARU,QAAA,cAAc,kBAQxB"}
1
+ {"version":3,"file":"getInvokeHooks.js","sourceRoot":"","sources":["../../../src/domain.operations/hooks/getInvokeHooks.ts"],"names":[],"mappings":";;;AAEA,wGAAqG;AAE9F,MAAM,cAAc,GAAG,GAAgB,EAAE,CAAC,CAAC;IAChD,gBAAgB,EAAE;QAChB,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC5B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,uDAA0B,EAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,4BAA4B;KAC3F;CACF,CAAC,CAAC;AARU,QAAA,cAAc,kBAQxB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * .what = creates draft directory structure for reflect output
3
+ * .why = organizes pure proposals, manifest, and blended sync output
4
+ */
5
+ export declare const createDraftDirectory: (input: {
6
+ targetDir: string;
7
+ }) => Promise<{
8
+ draftDir: string;
9
+ pureDir: string;
10
+ syncDir: string;
11
+ }>;
@@ -0,0 +1,46 @@
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.createDraftDirectory = void 0;
27
+ const fs = __importStar(require("fs/promises"));
28
+ const path = __importStar(require("path"));
29
+ /**
30
+ * .what = creates draft directory structure for reflect output
31
+ * .why = organizes pure proposals, manifest, and blended sync output
32
+ */
33
+ const createDraftDirectory = async (input) => {
34
+ // generate timestamp for unique draft directory
35
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
36
+ // create draft directory paths
37
+ const draftDir = path.join(input.targetDir, '.draft', `v${timestamp}`);
38
+ const pureDir = path.join(draftDir, 'pure');
39
+ const syncDir = path.join(draftDir, 'sync');
40
+ // create directories
41
+ await fs.mkdir(pureDir, { recursive: true });
42
+ await fs.mkdir(syncDir, { recursive: true });
43
+ return { draftDir, pureDir, syncDir };
44
+ };
45
+ exports.createDraftDirectory = createDraftDirectory;
46
+ //# sourceMappingURL=createDraftDirectory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDraftDirectory.js","sourceRoot":"","sources":["../../../src/domain.operations/reflect/createDraftDirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,2CAA6B;AAE7B;;;GAGG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAE1C,EAIE,EAAE;IACH,gDAAgD;IAChD,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAEjE,+BAA+B;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE5C,qBAAqB;IACrB,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACxC,CAAC,CAAC;AApBW,QAAA,oBAAoB,wBAoB/B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * .what = enumerates feedback files matching [feedback].*.[given]* pattern
3
+ * .why = identifies all feedback to reflect upon in source directory
4
+ */
5
+ export declare const enumFeedbackFiles: (input: {
6
+ directory: string;
7
+ }) => Promise<string[]>;
@@ -0,0 +1,69 @@
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.enumFeedbackFiles = void 0;
27
+ const fs = __importStar(require("fs/promises"));
28
+ const path = __importStar(require("path"));
29
+ /**
30
+ * .what = enumerates feedback files matching [feedback].*.[given]* pattern
31
+ * .why = identifies all feedback to reflect upon in source directory
32
+ */
33
+ const enumFeedbackFiles = async (input) => {
34
+ const feedbackFiles = [];
35
+ // recursive walk function
36
+ const walkDirectory = async (dir) => {
37
+ const entries = await fs.readdir(dir, { withFileTypes: true });
38
+ for (const entry of entries) {
39
+ const fullPath = path.join(dir, entry.name);
40
+ if (entry.isDirectory()) {
41
+ // recurse into subdirectories
42
+ await walkDirectory(fullPath);
43
+ }
44
+ else if (entry.isFile()) {
45
+ // check if file matches feedback pattern
46
+ if (isFeedbackFile(entry.name)) {
47
+ // return relative path from input directory
48
+ feedbackFiles.push(path.relative(input.directory, fullPath));
49
+ }
50
+ }
51
+ }
52
+ };
53
+ await walkDirectory(input.directory);
54
+ // sort for deterministic output
55
+ return feedbackFiles.sort();
56
+ };
57
+ exports.enumFeedbackFiles = enumFeedbackFiles;
58
+ /**
59
+ * .what = checks if filename matches [feedback].*.[given]* pattern
60
+ * .why = identifies feedback files by naming convention
61
+ */
62
+ const isFeedbackFile = (filename) => {
63
+ // pattern: [feedback].*.[given]*
64
+ // e.g., [feedback].v1.[given].by_human.md
65
+ // e.g., execution.md.[feedback].v2.[given].by_human.md
66
+ const pattern = /\[feedback\]\..*\.\[given\]/i;
67
+ return pattern.test(filename);
68
+ };
69
+ //# sourceMappingURL=enumFeedbackFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enumFeedbackFiles.js","sourceRoot":"","sources":["../../../src/domain.operations/reflect/enumFeedbackFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,2CAA6B;AAE7B;;;GAGG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAEvC,EAAqB,EAAE;IACtB,MAAM,aAAa,GAAa,EAAE,CAAC;IAEnC,0BAA0B;IAC1B,MAAM,aAAa,GAAG,KAAK,EAAE,GAAW,EAAiB,EAAE;QACzD,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAE/D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAE5C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,8BAA8B;gBAC9B,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,yCAAyC;gBACzC,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC/B,4CAA4C;oBAC5C,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAErC,gCAAgC;IAChC,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;AAC9B,CAAC,CAAC;AA7BW,QAAA,iBAAiB,qBA6B5B;AAEF;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAW,EAAE;IACnD,iCAAiC;IACjC,0CAA0C;IAC1C,uDAAuD;IACvD,MAAM,OAAO,GAAG,8BAA8B,CAAC;IAC/C,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * .what = extracts JSON content from model response text
3
+ * .why = model may wrap JSON in markdown code blocks or inline backticks
4
+ */
5
+ export declare const extractJsonFromResultText: (input: {
6
+ resultText: string;
7
+ }) => string;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractJsonFromResultText = void 0;
4
+ /**
5
+ * .what = extracts JSON content from model response text
6
+ * .why = model may wrap JSON in markdown code blocks or inline backticks
7
+ */
8
+ const extractJsonFromResultText = (input) => {
9
+ // try to extract from markdown code block first
10
+ const codeBlockMatch = input.resultText.match(/```(?:json)?\s*([\s\S]*?)```/);
11
+ if (codeBlockMatch) {
12
+ return codeBlockMatch[1].trim();
13
+ }
14
+ // strip inline backticks if present (model sometimes wraps JSON in single backticks)
15
+ const stripped = input.resultText.trim().replace(/^`|`$/g, '');
16
+ return stripped.trim();
17
+ };
18
+ exports.extractJsonFromResultText = extractJsonFromResultText;
19
+ //# sourceMappingURL=extractJsonFromResultText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractJsonFromResultText.js","sourceRoot":"","sources":["../../../src/domain.operations/reflect/extractJsonFromResultText.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,yBAAyB,GAAG,CAAC,KAEzC,EAAU,EAAE;IACX,gDAAgD;IAChD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC9E,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,qFAAqF;IACrF,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAE/D,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC,CAAC;AAbW,QAAA,yBAAyB,6BAapC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * .what = usage metrics from claude invocation
3
+ * .why = enables cost tracking and optimization
4
+ */
5
+ export interface ReflectClaudeUsage {
6
+ input: number;
7
+ cacheWrite: number;
8
+ cacheRead: number;
9
+ output: number;
10
+ }
11
+ /**
12
+ * .what = result from step 1 claude invocation
13
+ * .why = contains proposed rules as structured JSON
14
+ */
15
+ export interface ReflectStep1Response {
16
+ rules: Array<{
17
+ name: string;
18
+ content: string;
19
+ }>;
20
+ }
21
+ /**
22
+ * .what = result from step 2 claude invocation
23
+ * .why = contains manifest operations as JSON
24
+ */
25
+ export interface ReflectStep2Response {
26
+ timestamp: string;
27
+ pureRules: Array<{
28
+ path: string;
29
+ operation: string;
30
+ syncPath?: string;
31
+ existingPath?: string;
32
+ reason?: string;
33
+ }>;
34
+ }
35
+ /**
36
+ * .what = invokes claude-code cli for reflect step
37
+ * .why = executes brain invocation via claude-code print mode
38
+ */
39
+ export declare const invokeClaudeCodeForReflect: <T>(input: {
40
+ prompt: string;
41
+ cwd?: string;
42
+ rapid?: boolean;
43
+ }) => Promise<{
44
+ response: T;
45
+ usage: ReflectClaudeUsage;
46
+ }>;