rhachet 1.12.1 → 1.12.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 (295) hide show
  1. package/dist/contract/cli/invoke.js +1 -1
  2. package/dist/contract/cli/invoke.js.map +1 -1
  3. package/dist/contract/cli/invokeAsk.d.ts +3 -3
  4. package/dist/contract/cli/invokeBriefs.d.ts +2 -2
  5. package/dist/contract/cli/invokeBriefsBoot.d.ts +1 -1
  6. package/dist/contract/cli/invokeBriefsBoot.js +2 -2
  7. package/dist/contract/cli/invokeBriefsBoot.js.map +1 -1
  8. package/dist/contract/cli/invokeBriefsLink.d.ts +2 -2
  9. package/dist/contract/cli/invokeBriefsLink.js +1 -1
  10. package/dist/contract/cli/invokeBriefsLink.js.map +1 -1
  11. package/dist/contract/cli/invokeChoose.d.ts +1 -1
  12. package/dist/contract/cli/invokeInit.d.ts +1 -1
  13. package/dist/contract/cli/invokeInit.js +1 -1
  14. package/dist/contract/cli/invokeInit.js.map +1 -1
  15. package/dist/contract/cli/invokeList.d.ts +2 -2
  16. package/dist/contract/cli/invokeReadme.d.ts +2 -2
  17. package/dist/contract/cli/invokeRoles.d.ts +2 -2
  18. package/dist/contract/cli/invokeRolesBoot.d.ts +1 -1
  19. package/dist/contract/cli/invokeRolesBoot.js +2 -2
  20. package/dist/contract/cli/invokeRolesBoot.js.map +1 -1
  21. package/dist/contract/cli/invokeRolesLink.d.ts +2 -2
  22. package/dist/contract/cli/invokeRolesLink.js +1 -1
  23. package/dist/contract/cli/invokeRolesLink.js.map +1 -1
  24. package/dist/contract/sdk.d.ts +13 -13
  25. package/dist/contract/sdk.js +25 -25
  26. package/dist/contract/sdk.js.map +1 -1
  27. package/dist/domain/constants.d.ts +3 -0
  28. package/dist/domain/constants.js +5 -0
  29. package/dist/domain/constants.js.map +1 -0
  30. package/dist/domain/objects/InvokeHooks.d.ts +1 -1
  31. package/dist/domain/objects/InvokeOpts.d.ts +1 -1
  32. package/dist/domain/objects/Role.d.ts +2 -2
  33. package/dist/domain/objects/RoleContext.d.ts +1 -1
  34. package/dist/domain/objects/RoleSkill.d.ts +2 -2
  35. package/dist/domain/objects/RoleSkillArgGetter.d.ts +3 -3
  36. package/dist/domain/objects/RoleTrait.d.ts +2 -2
  37. package/dist/domain/objects/Stitch.d.ts +4 -4
  38. package/dist/domain/objects/Stitch.js.map +1 -1
  39. package/dist/domain/objects/StitchChoice.d.ts +2 -2
  40. package/dist/domain/objects/StitchChoice.js.map +1 -1
  41. package/dist/domain/objects/StitchCycle.d.ts +4 -4
  42. package/dist/domain/objects/StitchCycle.js.map +1 -1
  43. package/dist/domain/objects/StitchFanout.d.ts +4 -4
  44. package/dist/domain/objects/StitchFanout.js.map +1 -1
  45. package/dist/domain/objects/StitchRoute.d.ts +1 -1
  46. package/dist/domain/objects/StitchRoute.js.map +1 -1
  47. package/dist/domain/objects/StitchSetEvent.d.ts +3 -3
  48. package/dist/domain/objects/StitchStep.d.ts +3 -3
  49. package/dist/domain/objects/Stitcher.d.ts +9 -9
  50. package/dist/domain/objects/Stitcher.js.map +1 -1
  51. package/dist/domain/objects/Template.d.ts +2 -2
  52. package/dist/domain/objects/Template.js.map +1 -1
  53. package/dist/domain/objects/Thread.d.ts +2 -2
  54. package/dist/domain/objects/Threads.d.ts +2 -2
  55. package/dist/domain/objects/Threads.js.map +1 -1
  56. package/dist/domain/objects/index.d.ts +2 -2
  57. package/dist/domain/objects/index.js +2 -2
  58. package/dist/domain/objects/index.js.map +1 -1
  59. package/dist/logic/context/genContextStitchTrail.d.ts +1 -1
  60. package/dist/logic/context/genContextStitchTrail.js.map +1 -1
  61. package/dist/logic/invoke/assureFindRole.d.ts +2 -2
  62. package/dist/logic/invoke/assureUniqueRoles.d.ts +1 -1
  63. package/dist/logic/invoke/getInvokeHooksByOpts.d.ts +2 -2
  64. package/dist/logic/invoke/getRegistriesByOpts.d.ts +2 -2
  65. package/dist/logic/invoke/getSkillContext.d.ts +3 -3
  66. package/dist/logic/invoke/getSkillThreads.d.ts +4 -4
  67. package/dist/logic/invoke/hooks/onInvokeAskInput.d.ts +2 -2
  68. package/dist/logic/invoke/performInCurrentThread.d.ts +2 -2
  69. package/dist/logic/invoke/performInIsolatedThread.execute.d.ts +1 -1
  70. package/dist/logic/invoke/performInIsolatedThread.invoke.d.ts +2 -2
  71. package/dist/logic/invoke/performInIsolatedThread.invoke.js +3 -3
  72. package/dist/logic/invoke/performInIsolatedThread.invoke.js.map +1 -1
  73. package/dist/logic/invoke/performInIsolatedThreads.d.ts +1 -1
  74. package/dist/logic/role/addRoleTraits.d.ts +5 -5
  75. package/dist/logic/role/enrollThread.d.ts +4 -4
  76. package/dist/logic/role/genRoleSkill.d.ts +1 -1
  77. package/dist/logic/stitch/adapters/imagineViaOpenAI.d.ts +1 -1
  78. package/dist/logic/stitch/enstitch.d.ts +3 -3
  79. package/dist/logic/stitch/enstitch.js +1 -1
  80. package/dist/logic/stitch/enstitch.js.map +1 -1
  81. package/dist/logic/stitch/invokeImagineStitcher.d.ts +3 -3
  82. package/dist/logic/stitch/withStitchTrail.d.ts +4 -4
  83. package/dist/logic/stitch/withStitchTrail.js +1 -1
  84. package/dist/logic/stitch/withStitchTrail.js.map +1 -1
  85. package/dist/logic/template/genStepImagineViaTemplate.d.ts +2 -2
  86. package/dist/logic/template/genStepImagineViaTemplate.js.map +1 -1
  87. package/dist/logic/template/genTemplate.d.ts +3 -3
  88. package/dist/logic/template/getTemplatePathByCallerPath.d.ts +1 -1
  89. package/dist/logic/template/getTemplatePathByCallerPath.js +2 -2
  90. package/dist/logic/template/getTemplatePathByCallerPath.js.map +1 -1
  91. package/dist/logic/template/getTemplateValFromArtifacts.d.ts +2 -2
  92. package/dist/logic/template/getTemplateValFromArtifacts.js.map +1 -1
  93. package/dist/logic/template/getTemplateVarsFromInheritance.d.ts +1 -1
  94. package/dist/logic/template/useTemplate.d.ts +2 -2
  95. package/dist/logic/thread/getStitch.d.ts +1 -1
  96. package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.d.ts +3 -3
  97. package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.d.ts +4 -4
  98. package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.d.ts +6 -6
  99. package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.d.ts +4 -4
  100. package/dist/logic/weave/compose/ProcedureContextMerged.generic.d.ts +1 -1
  101. package/dist/logic/weave/compose/ThreadsMerged.generic.d.ts +4 -4
  102. package/dist/logic/weave/compose/asStitcher.d.ts +3 -3
  103. package/dist/logic/weave/compose/asStitcherFlat.d.ts +2 -2
  104. package/dist/logic/weave/compose/genStitchChoice.d.ts +3 -3
  105. package/dist/logic/weave/compose/genStitchCycle.d.ts +5 -5
  106. package/dist/logic/weave/compose/genStitchFanout.d.ts +5 -5
  107. package/dist/logic/weave/compose/genStitchFanout.js.map +1 -1
  108. package/dist/logic/weave/compose/genStitchRoute.d.ts +3 -3
  109. package/dist/logic/weave/compose/genStitchRoute.js.map +1 -1
  110. package/dist/logic/weave/enweaveOneChoice.d.ts +2 -2
  111. package/dist/logic/weave/enweaveOneChoice.js.map +1 -1
  112. package/dist/logic/weave/enweaveOneCycle.d.ts +2 -2
  113. package/dist/logic/weave/enweaveOneCycle.js.map +1 -1
  114. package/dist/logic/weave/enweaveOneFanout.d.ts +2 -2
  115. package/dist/logic/weave/enweaveOneFanout.js.map +1 -1
  116. package/dist/logic/weave/enweaveOneRoute.d.ts +2 -2
  117. package/dist/logic/weave/enweaveOneRoute.js.map +1 -1
  118. package/dist/logic/weave/enweaveOneStitcher.d.ts +2 -2
  119. package/dist/logic/weave/enweaveOneStitcher.js.map +1 -1
  120. package/license.md +21 -0
  121. package/package.json +36 -36
  122. package/dist/.test/directory.d.ts +0 -2
  123. package/dist/.test/directory.js +0 -6
  124. package/dist/.test/directory.js.map +0 -1
  125. package/dist/.test/example.use.repo/example.echoRegistry.d.ts +0 -2
  126. package/dist/.test/example.use.repo/example.echoRegistry.js +0 -108
  127. package/dist/.test/example.use.repo/example.echoRegistry.js.map +0 -1
  128. package/dist/.test/genContextLogTrail.d.ts +0 -2
  129. package/dist/.test/genContextLogTrail.js +0 -12
  130. package/dist/.test/genContextLogTrail.js.map +0 -1
  131. package/dist/.test/getContextOpenAI.d.ts +0 -2
  132. package/dist/.test/getContextOpenAI.js +0 -18
  133. package/dist/.test/getContextOpenAI.js.map +0 -1
  134. package/dist/.test/stitchers/genStitcherCodeFileRead.d.ts +0 -14
  135. package/dist/.test/stitchers/genStitcherCodeFileRead.js +0 -23
  136. package/dist/.test/stitchers/genStitcherCodeFileRead.js.map +0 -1
  137. package/dist/.test/stitchers/genStitcherCodeFileWrite.d.ts +0 -16
  138. package/dist/.test/stitchers/genStitcherCodeFileWrite.js +0 -29
  139. package/dist/.test/stitchers/genStitcherCodeFileWrite.js.map +0 -1
  140. package/dist/.test/stitchers/genStitcherCodeReviewImagine.d.ts +0 -15
  141. package/dist/.test/stitchers/genStitcherCodeReviewImagine.js +0 -97
  142. package/dist/.test/stitchers/genStitcherCodeReviewImagine.js.map +0 -1
  143. package/dist/.test/stitchers/stitcherCodeDiffImagine.d.ts +0 -13
  144. package/dist/.test/stitchers/stitcherCodeDiffImagine.js +0 -33
  145. package/dist/.test/stitchers/stitcherCodeDiffImagine.js.map +0 -1
  146. package/dist/.test/stitchers/stitcherFanoutRandomSum.d.ts +0 -13
  147. package/dist/.test/stitchers/stitcherFanoutRandomSum.js +0 -45
  148. package/dist/.test/stitchers/stitcherFanoutRandomSum.js.map +0 -1
  149. package/dist/.test/stitchers/stitcherFanoutSubroutes.d.ts +0 -35
  150. package/dist/.test/stitchers/stitcherFanoutSubroutes.js +0 -76
  151. package/dist/.test/stitchers/stitcherFanoutSubroutes.js.map +0 -1
  152. package/dist/.test/threads/codeArtist.d.ts +0 -6
  153. package/dist/.test/threads/codeArtist.js +0 -26
  154. package/dist/.test/threads/codeArtist.js.map +0 -1
  155. package/dist/.test/threads/codeCritic.d.ts +0 -6
  156. package/dist/.test/threads/codeCritic.js +0 -21
  157. package/dist/.test/threads/codeCritic.js.map +0 -1
  158. package/dist/.test/threads/director.d.ts +0 -6
  159. package/dist/.test/threads/director.js +0 -14
  160. package/dist/.test/threads/director.js.map +0 -1
  161. package/dist/contract/cli/invoke.integration.test.d.ts +0 -1
  162. package/dist/contract/cli/invoke.integration.test.js +0 -39
  163. package/dist/contract/cli/invoke.integration.test.js.map +0 -1
  164. package/dist/contract/cli/invokeAsk.integration.test.d.ts +0 -1
  165. package/dist/contract/cli/invokeAsk.integration.test.js +0 -69
  166. package/dist/contract/cli/invokeAsk.integration.test.js.map +0 -1
  167. package/dist/contract/cli/invokeBriefsBoot.integration.test.d.ts +0 -1
  168. package/dist/contract/cli/invokeBriefsBoot.integration.test.js +0 -159
  169. package/dist/contract/cli/invokeBriefsBoot.integration.test.js.map +0 -1
  170. package/dist/contract/cli/invokeBriefsLink.integration.test.d.ts +0 -1
  171. package/dist/contract/cli/invokeBriefsLink.integration.test.js +0 -100
  172. package/dist/contract/cli/invokeBriefsLink.integration.test.js.map +0 -1
  173. package/dist/contract/cli/invokeChoose.integration.test.d.ts +0 -1
  174. package/dist/contract/cli/invokeChoose.integration.test.js +0 -111
  175. package/dist/contract/cli/invokeChoose.integration.test.js.map +0 -1
  176. package/dist/contract/cli/invokeInit.integration.test.d.ts +0 -1
  177. package/dist/contract/cli/invokeInit.integration.test.js +0 -123
  178. package/dist/contract/cli/invokeInit.integration.test.js.map +0 -1
  179. package/dist/contract/cli/invokeReadme.integration.test.d.ts +0 -1
  180. package/dist/contract/cli/invokeReadme.integration.test.js +0 -62
  181. package/dist/contract/cli/invokeReadme.integration.test.js.map +0 -1
  182. package/dist/contract/cli/invokeRolesBoot.integration.test.d.ts +0 -1
  183. package/dist/contract/cli/invokeRolesBoot.integration.test.js +0 -152
  184. package/dist/contract/cli/invokeRolesBoot.integration.test.js.map +0 -1
  185. package/dist/contract/cli/invokeRolesLink.integration.test.d.ts +0 -1
  186. package/dist/contract/cli/invokeRolesLink.integration.test.js +0 -117
  187. package/dist/contract/cli/invokeRolesLink.integration.test.js.map +0 -1
  188. package/dist/domain/objects/InvokeOpts.test.d.ts +0 -1
  189. package/dist/domain/objects/InvokeOpts.test.js +0 -41
  190. package/dist/domain/objects/InvokeOpts.test.js.map +0 -1
  191. package/dist/domain/objects/Stitcher.test.d.ts +0 -1
  192. package/dist/domain/objects/Stitcher.test.js +0 -78
  193. package/dist/domain/objects/Stitcher.test.js.map +0 -1
  194. package/dist/domain/objects/Template.test.d.ts +0 -1
  195. package/dist/domain/objects/Template.test.js +0 -48
  196. package/dist/domain/objects/Template.test.js.map +0 -1
  197. package/dist/logic/init/generateRhachetConfig.test.d.ts +0 -1
  198. package/dist/logic/init/generateRhachetConfig.test.js +0 -35
  199. package/dist/logic/init/generateRhachetConfig.test.js.map +0 -1
  200. package/dist/logic/invoke/addAttemptQualifierToOutputPath.test.d.ts +0 -1
  201. package/dist/logic/invoke/addAttemptQualifierToOutputPath.test.js +0 -130
  202. package/dist/logic/invoke/addAttemptQualifierToOutputPath.test.js.map +0 -1
  203. package/dist/logic/invoke/getPeerQualifiersOfOutputChoice.test.d.ts +0 -1
  204. package/dist/logic/invoke/getPeerQualifiersOfOutputChoice.test.js +0 -77
  205. package/dist/logic/invoke/getPeerQualifiersOfOutputChoice.test.js.map +0 -1
  206. package/dist/logic/invoke/getSkillContext.test.d.ts +0 -1
  207. package/dist/logic/invoke/getSkillContext.test.js +0 -85
  208. package/dist/logic/invoke/getSkillContext.test.js.map +0 -1
  209. package/dist/logic/invoke/getSkillThread.test.d.ts +0 -1
  210. package/dist/logic/invoke/getSkillThread.test.js +0 -115
  211. package/dist/logic/invoke/getSkillThread.test.js.map +0 -1
  212. package/dist/logic/invoke/performInIsolatedThread.invoke.integration.test.d.ts +0 -1
  213. package/dist/logic/invoke/performInIsolatedThread.invoke.integration.test.js +0 -74
  214. package/dist/logic/invoke/performInIsolatedThread.invoke.integration.test.js.map +0 -1
  215. package/dist/logic/invoke/performInIsolatedThreads.integration.test.d.ts +0 -1
  216. package/dist/logic/invoke/performInIsolatedThreads.integration.test.js +0 -75
  217. package/dist/logic/invoke/performInIsolatedThreads.integration.test.js.map +0 -1
  218. package/dist/logic/role/addRoleTraits.test.d.ts +0 -1
  219. package/dist/logic/role/addRoleTraits.test.js +0 -93
  220. package/dist/logic/role/addRoleTraits.test.js.map +0 -1
  221. package/dist/logic/role/enrollThread.integration.test.d.ts +0 -1
  222. package/dist/logic/role/enrollThread.integration.test.js +0 -79
  223. package/dist/logic/role/enrollThread.integration.test.js.map +0 -1
  224. package/dist/logic/role/genRoleSkill.test.d.ts +0 -1
  225. package/dist/logic/role/genRoleSkill.test.js +0 -79
  226. package/dist/logic/role/genRoleSkill.test.js.map +0 -1
  227. package/dist/logic/stitch/enstitch.test.d.ts +0 -1
  228. package/dist/logic/stitch/enstitch.test.js +0 -112
  229. package/dist/logic/stitch/enstitch.test.js.map +0 -1
  230. package/dist/logic/stitch/invokeImagineStitcher.integration.test.d.ts +0 -1
  231. package/dist/logic/stitch/invokeImagineStitcher.integration.test.js +0 -195
  232. package/dist/logic/stitch/invokeImagineStitcher.integration.test.js.map +0 -1
  233. package/dist/logic/template/genStepImagineViaTemplate.test.d.ts +0 -1
  234. package/dist/logic/template/genStepImagineViaTemplate.test.js +0 -126
  235. package/dist/logic/template/genStepImagineViaTemplate.test.js.map +0 -1
  236. package/dist/logic/template/genTemplate.test.d.ts +0 -1
  237. package/dist/logic/template/genTemplate.test.js +0 -118
  238. package/dist/logic/template/genTemplate.test.js.map +0 -1
  239. package/dist/logic/template/useTemplate.integration.test.d.ts +0 -1
  240. package/dist/logic/template/useTemplate.integration.test.js +0 -28
  241. package/dist/logic/template/useTemplate.integration.test.js.map +0 -1
  242. package/dist/logic/thread/getStitch.test.d.ts +0 -1
  243. package/dist/logic/thread/getStitch.test.js +0 -73
  244. package/dist/logic/thread/getStitch.test.js.map +0 -1
  245. package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.d.ts +0 -1
  246. package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js +0 -67
  247. package/dist/logic/weave/compose/GStitcherInferredFromChoice.generic.test.js.map +0 -1
  248. package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.d.ts +0 -1
  249. package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js +0 -132
  250. package/dist/logic/weave/compose/GStitcherInferredFromCycle.generic.test.js.map +0 -1
  251. package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.d.ts +0 -1
  252. package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js +0 -74
  253. package/dist/logic/weave/compose/GStitcherInferredFromFanout.generic.test.js.map +0 -1
  254. package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.d.ts +0 -1
  255. package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js +0 -190
  256. package/dist/logic/weave/compose/GStitcherInferredFromRoute.generic.test.js.map +0 -1
  257. package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.d.ts +0 -1
  258. package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.js +0 -29
  259. package/dist/logic/weave/compose/ProcedureContextMerged.generic.test.js.map +0 -1
  260. package/dist/logic/weave/compose/ThreadsMerged.generic.test.d.ts +0 -1
  261. package/dist/logic/weave/compose/ThreadsMerged.generic.test.js +0 -420
  262. package/dist/logic/weave/compose/ThreadsMerged.generic.test.js.map +0 -1
  263. package/dist/logic/weave/compose/asStitcher.test.d.ts +0 -1
  264. package/dist/logic/weave/compose/asStitcher.test.js +0 -95
  265. package/dist/logic/weave/compose/asStitcher.test.js.map +0 -1
  266. package/dist/logic/weave/compose/asStitcherFlat.test.d.ts +0 -1
  267. package/dist/logic/weave/compose/asStitcherFlat.test.js +0 -96
  268. package/dist/logic/weave/compose/asStitcherFlat.test.js.map +0 -1
  269. package/dist/logic/weave/compose/genStitchChoice.test.d.ts +0 -1
  270. package/dist/logic/weave/compose/genStitchChoice.test.js +0 -200
  271. package/dist/logic/weave/compose/genStitchChoice.test.js.map +0 -1
  272. package/dist/logic/weave/compose/genStitchCycle.test.d.ts +0 -1
  273. package/dist/logic/weave/compose/genStitchCycle.test.js +0 -267
  274. package/dist/logic/weave/compose/genStitchCycle.test.js.map +0 -1
  275. package/dist/logic/weave/compose/genStitchFanout.test.d.ts +0 -1
  276. package/dist/logic/weave/compose/genStitchFanout.test.js +0 -79
  277. package/dist/logic/weave/compose/genStitchFanout.test.js.map +0 -1
  278. package/dist/logic/weave/compose/genStitchRoute.test.d.ts +0 -1
  279. package/dist/logic/weave/compose/genStitchRoute.test.js +0 -120
  280. package/dist/logic/weave/compose/genStitchRoute.test.js.map +0 -1
  281. package/dist/logic/weave/enweaveOneChoice.test.d.ts +0 -1
  282. package/dist/logic/weave/enweaveOneChoice.test.js +0 -181
  283. package/dist/logic/weave/enweaveOneChoice.test.js.map +0 -1
  284. package/dist/logic/weave/enweaveOneCycle.test.d.ts +0 -1
  285. package/dist/logic/weave/enweaveOneCycle.test.js +0 -180
  286. package/dist/logic/weave/enweaveOneCycle.test.js.map +0 -1
  287. package/dist/logic/weave/enweaveOneFanout.integration.test.d.ts +0 -1
  288. package/dist/logic/weave/enweaveOneFanout.integration.test.js +0 -166
  289. package/dist/logic/weave/enweaveOneFanout.integration.test.js.map +0 -1
  290. package/dist/logic/weave/enweaveOneRoute.integration.test.d.ts +0 -1
  291. package/dist/logic/weave/enweaveOneRoute.integration.test.js +0 -159
  292. package/dist/logic/weave/enweaveOneRoute.integration.test.js.map +0 -1
  293. package/dist/logic/weave/enweaveOneStitcher.integration.test.d.ts +0 -2
  294. package/dist/logic/weave/enweaveOneStitcher.integration.test.js +0 -258
  295. package/dist/logic/weave/enweaveOneStitcher.integration.test.js.map +0 -1
@@ -1,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const test_fns_1 = require("test-fns");
4
- const addAttemptQualifierToOutputPath_1 = require("./addAttemptQualifierToOutputPath");
5
- describe('addAttemptQualifierToOutputPath', () => {
6
- describe('with replacement variable', () => {
7
- (0, test_fns_1.given)('a path containing {{attempt}} once', () => {
8
- const input = { path: 'dist/out.{{attempt}}.json', attempt: 3 };
9
- (0, test_fns_1.when)('qualifying the path', () => {
10
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
11
- (0, test_fns_1.then)('it replaces the placeholder with i{attempt}', () => {
12
- expect(result).toBe('dist/out.i3.json');
13
- });
14
- });
15
- });
16
- (0, test_fns_1.given)('a path containing {{attempt}} multiple times', () => {
17
- const input = { path: 'a.{{attempt}}.b.{{attempt}}.c', attempt: 9 };
18
- (0, test_fns_1.when)('qualifying the path', () => {
19
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
20
- (0, test_fns_1.then)('it replaces each occurrence', () => {
21
- expect(result).toBe('a.i9.b.i9.c');
22
- });
23
- });
24
- });
25
- (0, test_fns_1.given)('a path with {{attempt}} and dotted directories', () => {
26
- const input = { path: 'build.v2/out.{{attempt}}.log', attempt: 11 };
27
- (0, test_fns_1.when)('qualifying the path', () => {
28
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
29
- (0, test_fns_1.then)('it replaces the placeholder in the filename and preserves directories', () => {
30
- expect(result).toBe('build.v2/out.i11.log');
31
- });
32
- });
33
- });
34
- });
35
- describe('wout replacement variable', () => {
36
- describe('with extension', () => {
37
- (0, test_fns_1.given)('a simple file with one extension', () => {
38
- const input = { path: 'out.json', attempt: 2 };
39
- (0, test_fns_1.when)('qualifying the path', () => {
40
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
41
- (0, test_fns_1.then)('it inserts .i{attempt} before the final extension', () => {
42
- expect(result).toBe('out.i2.json');
43
- });
44
- });
45
- });
46
- (0, test_fns_1.given)('a multi-dot basename but a single final extension', () => {
47
- const input = { path: 'foo.bar.baz.json', attempt: 7 };
48
- (0, test_fns_1.when)('qualifying the path', () => {
49
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
50
- (0, test_fns_1.then)('it inserts only before the final extension', () => {
51
- expect(result).toBe('foo.bar.baz.i7.json');
52
- });
53
- });
54
- });
55
- (0, test_fns_1.given)('a hidden file with an extension (e.g., .env.local)', () => {
56
- const input = { path: '.env.local', attempt: 4 };
57
- (0, test_fns_1.when)('qualifying the path', () => {
58
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
59
- (0, test_fns_1.then)('it preserves the leading dot and inserts before the final extension', () => {
60
- expect(result).toBe('.env.i4.local'); // if folks dont want this outcome, they can use {{attempt}} replacement var instead
61
- });
62
- });
63
- });
64
- (0, test_fns_1.given)('a dotted directory with a simple filename', () => {
65
- const input = { path: 'build.v1/output.json', attempt: 5 };
66
- (0, test_fns_1.when)('qualifying the path', () => {
67
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
68
- (0, test_fns_1.then)('it preserves directory dots and inserts before the final extension', () => {
69
- expect(result).toBe('build.v1/output.i5.json');
70
- });
71
- });
72
- });
73
- (0, test_fns_1.given)('attempt number zero (edge numeric case)', () => {
74
- const input = { path: 'file.txt', attempt: 0 };
75
- (0, test_fns_1.when)('qualifying the path', () => {
76
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
77
- (0, test_fns_1.then)('it renders i0 in the qualified path', () => {
78
- expect(result).toBe('file.i0.txt');
79
- });
80
- });
81
- });
82
- });
83
- // explicitly not supported today
84
- // todo: should we ever support this? folks can simply use template var replacement if needed. otherwise, seems like an infinite list of extensions to allowlist
85
- describe.skip('double extension', () => {
86
- (0, test_fns_1.given)('a nested path with .tar.gz', () => {
87
- const input = { path: 'build/artifacts/output.tar.gz', attempt: 5 };
88
- (0, test_fns_1.when)('qualifying the path', () => {
89
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
90
- (0, test_fns_1.then)('it inserts before the last extension only', () => {
91
- expect(result).toBe('build/artifacts/output.i5.tar.gz');
92
- });
93
- });
94
- });
95
- (0, test_fns_1.given)('multiple dotted directories and a multi-dot filename', () => {
96
- const input = {
97
- path: 'releases/2025.09.09/artifact.v2.tar.gz',
98
- attempt: 8,
99
- };
100
- (0, test_fns_1.when)('qualifying the path', () => {
101
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
102
- (0, test_fns_1.then)('it qualifies before the final extension and keeps directory dots intact', () => {
103
- expect(result).toBe('releases/2025.09.09/artifact.v2.i8.tar.gz');
104
- });
105
- });
106
- });
107
- });
108
- describe('no extension', () => {
109
- (0, test_fns_1.given)('a regular file with no extension (e.g., README)', () => {
110
- const input = { path: 'README', attempt: 1 };
111
- (0, test_fns_1.when)('qualifying the path', () => {
112
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
113
- (0, test_fns_1.then)('it suffixes i{attempt}. after the basename', () => {
114
- expect(result).toBe('README.i1');
115
- });
116
- });
117
- });
118
- (0, test_fns_1.given)('a dotfile with no extension (e.g., .env)', () => {
119
- const input = { path: '.env', attempt: 7 };
120
- (0, test_fns_1.when)('qualifying the path', () => {
121
- const result = (0, addAttemptQualifierToOutputPath_1.addAttemptQualifierToOutputPath)(input);
122
- (0, test_fns_1.then)('it suffixes i{attempt} after the basename while keeping the dotfile root', () => {
123
- expect(result).toBe('.env.i7');
124
- });
125
- });
126
- });
127
- });
128
- });
129
- });
130
- //# sourceMappingURL=addAttemptQualifierToOutputPath.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addAttemptQualifierToOutputPath.test.js","sourceRoot":"","sources":["../../../src/logic/invoke/addAttemptQualifierToOutputPath.test.ts"],"names":[],"mappings":";;AAAA,uCAA6C;AAE7C,uFAAoF;AAEpF,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,QAAQ,CAAC,2BAA2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AAQ,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;gBAE7C,IAAA,eAAI,EAAC,qBAAqB,EAAE,GAAG,EAAE;oBAC/B,MAAM,MAAM,GAAG,IAAA,iEAA+B,EAAC,KAAK,CAAC,CAAC;oBAEtD,IAAA,eAAI,EAAC,4CAA4C,EAAE,GAAG,EAAE;wBACtD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBACnC,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAA,gBAAK,EAAC,0CAA0C,EAAE,GAAG,EAAE;gBACrD,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;gBAE3C,IAAA,eAAI,EAAC,qBAAqB,EAAE,GAAG,EAAE;oBAC/B,MAAM,MAAM,GAAG,IAAA,iEAA+B,EAAC,KAAK,CAAC,CAAC;oBAEtD,IAAA,eAAI,EACF,0EAA0E,EAC1E,GAAG,EAAE;wBACH,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACjC,CAAC,CACF,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const helpful_errors_1 = require("helpful-errors");
4
- const getPeerQualifiersOfOutputChoice_1 = require("./getPeerQualifiersOfOutputChoice");
5
- const validCases = [
6
- {
7
- peers: [
8
- 'provider.scene_6.loyalty_build.v1i2.[stories]._.md',
9
- 'provider.scene_6.loyalty_build.v1i2.[stories].v1._.md',
10
- 'provider.scene_6.loyalty_build.v1i2.[stories].v1.md',
11
- 'provider.scene_6.loyalty_build.v1i2.[stories].v1.i1.md',
12
- 'provider.scene_6.loyalty_build.v1i2.[stories].v1.i2.md',
13
- 'provider.scene_6.loyalty_build.v1i2.[stories].v1.i3.md',
14
- 'provider.scene_6.loyalty_build.v1i2.[stories].choice.v1.i3.md',
15
- 'provider.scene_6.loyalty_build.v1i2.[stories].choice.i5.md',
16
- ],
17
- output: {
18
- prefix: 'provider.scene_6.loyalty_build.v1i2.[stories]',
19
- extension: 'md',
20
- },
21
- },
22
- {
23
- peers: [
24
- 'provider.scene_6.loyalty_build.v1i2.[stories].src',
25
- 'provider.scene_6.loyalty_build.v1i2.[stories].v1.src',
26
- ],
27
- output: {
28
- prefix: 'provider.scene_6.loyalty_build.v1i2.[stories]',
29
- extension: 'src',
30
- },
31
- },
32
- {
33
- peers: [
34
- 'provider.scene_6.loyalty_build.v2i5.[notes].i1.txt',
35
- 'provider.scene_6.loyalty_build.v2i5.[notes].i2.txt',
36
- ],
37
- output: {
38
- prefix: 'provider.scene_6.loyalty_build.v2i5.[notes]',
39
- extension: 'txt',
40
- },
41
- },
42
- {
43
- peers: [
44
- 'provider.scene_6.loyalty_build.v1i0.[draft]._.md',
45
- 'provider.scene_6.loyalty_build.v1i0.[draft].i1.md',
46
- ],
47
- output: {
48
- prefix: 'provider.scene_6.loyalty_build.v1i0.[draft]',
49
- extension: 'md',
50
- },
51
- },
52
- ];
53
- describe('getPeerQualifiersOfOutputChoice', () => {
54
- validCases.forEach(({ peers, output }) => {
55
- describe(`peers ${output.prefix}`, () => {
56
- peers.forEach((choice) => {
57
- test(`returns correct prefix and extension for choice "${choice}"`, () => {
58
- expect((0, getPeerQualifiersOfOutputChoice_1.getPeerQualifiersOfOutputChoice)(choice)).toEqual(output);
59
- });
60
- });
61
- });
62
- });
63
- const invalidCases = [
64
- // 'provider.scene_6.loyalty_build.v1i2.[stories]', // no extension
65
- // 'provider.scene_6.loyalty_build.v1i2.[stories]', // no extension
66
- // 'just_something_random', // completely malformed
67
- // 'file.without.any.structure', // another malformed
68
- ];
69
- describe('invalid input cases', () => {
70
- invalidCases.forEach((input) => {
71
- test(`throws BadRequestError for "${input}"`, () => {
72
- expect(() => (0, getPeerQualifiersOfOutputChoice_1.getPeerQualifiersOfOutputChoice)(input)).toThrow(helpful_errors_1.BadRequestError);
73
- });
74
- });
75
- });
76
- });
77
- //# sourceMappingURL=getPeerQualifiersOfOutputChoice.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPeerQualifiersOfOutputChoice.test.js","sourceRoot":"","sources":["../../../src/logic/invoke/getPeerQualifiersOfOutputChoice.test.ts"],"names":[],"mappings":";;AAAA,mDAAiD;AAEjD,uFAAoF;AAEpF,MAAM,UAAU,GAGV;IACJ;QACE,KAAK,EAAE;YACL,oDAAoD;YACpD,uDAAuD;YACvD,qDAAqD;YACrD,wDAAwD;YACxD,wDAAwD;YACxD,wDAAwD;YACxD,+DAA+D;YAC/D,4DAA4D;SAC7D;QACD,MAAM,EAAE;YACN,MAAM,EAAE,+CAA+C;YACvD,SAAS,EAAE,IAAI;SAChB;KACF;IACD;QACE,KAAK,EAAE;YACL,mDAAmD;YACnD,sDAAsD;SACvD;QACD,MAAM,EAAE;YACN,MAAM,EAAE,+CAA+C;YACvD,SAAS,EAAE,KAAK;SACjB;KACF;IACD;QACE,KAAK,EAAE;YACL,oDAAoD;YACpD,oDAAoD;SACrD;QACD,MAAM,EAAE;YACN,MAAM,EAAE,6CAA6C;YACrD,SAAS,EAAE,KAAK;SACjB;KACF;IACD;QACE,KAAK,EAAE;YACL,kDAAkD;YAClD,mDAAmD;SACpD;QACD,MAAM,EAAE;YACN,MAAM,EAAE,6CAA6C;YACrD,SAAS,EAAE,IAAI;SAChB;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACvC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE;YACtC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACvB,IAAI,CAAC,oDAAoD,MAAM,GAAG,EAAE,GAAG,EAAE;oBACvE,MAAM,CAAC,IAAA,iEAA+B,EAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClE,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAa;IAC7B,mEAAmE;IACnE,mEAAmE;IACnE,mDAAmD;IACnD,qDAAqD;KACtD,CAAC;IAEF,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7B,IAAI,CAAC,+BAA+B,KAAK,GAAG,EAAE,GAAG,EAAE;gBACjD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,iEAA+B,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAC1D,gCAAe,CAChB,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const helpful_errors_1 = require("helpful-errors");
4
- const test_fns_1 = require("test-fns");
5
- const objects_1 = require("../../domain/objects");
6
- const getSkillContext_1 = require("./getSkillContext");
7
- const getterExample = objects_1.RoleSkillContextGetter.build({
8
- lookup: {
9
- openaiApiKey: {
10
- source: 'process.env',
11
- desc: 'your OpenAI key',
12
- envar: 'OPENAI_API_KEY',
13
- type: 'string',
14
- },
15
- },
16
- assess: (input) => typeof input?.openaiApiKey === 'string',
17
- instantiate: (input) => ({
18
- key: input.openaiApiKey,
19
- }),
20
- });
21
- describe('getSkillContext', () => {
22
- (0, test_fns_1.given)('a valid context getter requiring OPENAI_API_KEY', () => {
23
- const getter = getterExample.clone();
24
- (0, test_fns_1.when)('called with passin: { openaiApiKey: "sk-abc" }', () => {
25
- (0, test_fns_1.then)('it should return the expected context', async () => {
26
- const result = await (0, getSkillContext_1.getSkillContext)({
27
- getter,
28
- from: { passin: { openaiApiKey: 'sk-abc' } },
29
- });
30
- expect(result).toEqual({ key: 'sk-abc' });
31
- });
32
- });
33
- (0, test_fns_1.when)('called with passin: { wrongKey: "oops" }', () => {
34
- (0, test_fns_1.then)('it should throw BadRequestError', async () => {
35
- const error = await (0, test_fns_1.getError)(async () => (0, getSkillContext_1.getSkillContext)({
36
- getter,
37
- from: { passin: { wrongKey: 'oops' } },
38
- }));
39
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
40
- });
41
- });
42
- (0, test_fns_1.when)('called with env: { OPENAI_API_KEY: "sk-env" }', () => {
43
- (0, test_fns_1.then)('it should return the expected context', async () => {
44
- const result = await (0, getSkillContext_1.getSkillContext)({
45
- getter,
46
- from: { lookup: { env: { OPENAI_API_KEY: 'sk-env' } } },
47
- });
48
- expect(result).toEqual({ key: 'sk-env' });
49
- });
50
- });
51
- (0, test_fns_1.when)('called with env: {} (missing key)', () => {
52
- (0, test_fns_1.then)('it should throw BadRequestError', async () => {
53
- const error = await (0, test_fns_1.getError)(async () => (0, getSkillContext_1.getSkillContext)({
54
- getter,
55
- from: { lookup: { env: {} } },
56
- }));
57
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
58
- });
59
- });
60
- });
61
- (0, test_fns_1.given)('a rejecting getter that fails all assess checks', () => {
62
- const getter = getterExample.clone({
63
- assess: (() => false),
64
- });
65
- (0, test_fns_1.when)('called with env: { OPENAI_API_KEY: "sk-reject" }', () => {
66
- (0, test_fns_1.then)('it should throw UnexpectedCodePathError', async () => {
67
- const error = await (0, test_fns_1.getError)(async () => (0, getSkillContext_1.getSkillContext)({
68
- getter,
69
- from: { lookup: { env: { OPENAI_API_KEY: 'sk-reject' } } },
70
- }));
71
- expect(error).toBeInstanceOf(helpful_errors_1.UnexpectedCodePathError);
72
- });
73
- });
74
- (0, test_fns_1.when)('called with passin: { openaiApiKey: "sk-reject" }', () => {
75
- (0, test_fns_1.then)('it should throw BadRequestError', async () => {
76
- const error = await (0, test_fns_1.getError)(async () => (0, getSkillContext_1.getSkillContext)({
77
- getter,
78
- from: { passin: { openaiApiKey: 'sk-reject' } },
79
- }));
80
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
81
- });
82
- });
83
- });
84
- });
85
- //# sourceMappingURL=getSkillContext.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSkillContext.test.js","sourceRoot":"","sources":["../../../src/logic/invoke/getSkillContext.test.ts"],"names":[],"mappings":";;AAAA,mDAA0E;AAC1E,uCAAuD;AAEvD,kDAAyE;AACzE,uDAAoD;AAEpD,MAAM,aAAa,GAAG,gCAAsB,CAAC,KAAK,CAKhD;IACA,MAAM,EAAE;QACN,YAAY,EAAE;YACZ,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,MAAM,EAAE,CAAC,KAAU,EAAqC,EAAE,CACxD,OAAO,KAAK,EAAE,YAAY,KAAK,QAAQ;IACzC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CACrB,CAAC;QACC,GAAG,EAAE,KAAK,CAAC,YAAY;KAChB,CAAA;CACZ,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAA,gBAAK,EAAC,iDAAiD,EAAE,GAAG,EAAE;QAC5D,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,CAAC;QAErC,IAAA,eAAI,EAAC,gDAAgD,EAAE,GAAG,EAAE;YAC1D,IAAA,eAAI,EAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;gBACvD,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAe,EA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EAAE,EAAE;iBAChD,CAAC,CACH,CAAC;gBAEF,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,gCAAe,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const helpful_errors_1 = require("helpful-errors");
4
- const test_fns_1 = require("test-fns");
5
- const RoleSkillArgGetter_1 = require("../../domain/objects/RoleSkillArgGetter");
6
- const genThread_1 = require("../thread/genThread");
7
- const getSkillThreads_1 = require("./getSkillThreads");
8
- const getterExample = RoleSkillArgGetter_1.RoleSkillThreadsGetter.build({
9
- lookup: {
10
- target: {
11
- source: 'process.argv',
12
- desc: 'target file or dir',
13
- char: 't',
14
- type: 'string',
15
- },
16
- },
17
- assess: (input) => typeof input?.target === 'string' && typeof input?.ask === 'string',
18
- instantiate: (input) => ({
19
- caller: (0, genThread_1.genThread)({ role: 'caller', target: input.target }),
20
- }),
21
- });
22
- describe('getSkillThreads', () => {
23
- (0, test_fns_1.given)('a valid threads getter for { target, ask }', () => {
24
- const getter = getterExample.clone();
25
- (0, test_fns_1.when)('called with passin: { target: "src/index.ts", ask: "describe" }', () => {
26
- (0, test_fns_1.then)('it should return the expected caller thread', async () => {
27
- const result = await (0, getSkillThreads_1.getSkillThreads)({
28
- getter,
29
- from: { passin: { target: 'src/index.ts', ask: 'describe' } },
30
- });
31
- expect(result).toEqual({
32
- caller: (0, genThread_1.genThread)({ role: 'caller', target: 'src/index.ts' }),
33
- });
34
- });
35
- });
36
- (0, test_fns_1.when)('called with passin: { bad: true }', () => {
37
- (0, test_fns_1.then)('it should throw BadRequestError', async () => {
38
- const error = await (0, test_fns_1.getError)(() => (0, getSkillThreads_1.getSkillThreads)({
39
- getter,
40
- from: { passin: { bad: true } },
41
- }));
42
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
43
- });
44
- });
45
- (0, test_fns_1.when)('called with argv: { target: "src/main.ts", ask: "go now" }', () => {
46
- (0, test_fns_1.then)('it should return the expected caller thread', async () => {
47
- const result = await (0, getSkillThreads_1.getSkillThreads)({
48
- getter,
49
- from: { lookup: { argv: { target: 'src/main.ts', ask: 'go now' } } },
50
- });
51
- expect(result).toEqual({
52
- caller: (0, genThread_1.genThread)({ role: 'caller', target: 'src/main.ts' }),
53
- });
54
- });
55
- });
56
- (0, test_fns_1.when)('called with argv: { t: "src/main.ts", ask: "run this" }', () => {
57
- (0, test_fns_1.then)('it should return the expected caller thread', async () => {
58
- const result = await (0, getSkillThreads_1.getSkillThreads)({
59
- getter,
60
- from: { lookup: { argv: { t: 'src/main.ts', ask: 'run this' } } },
61
- });
62
- expect(result).toEqual({
63
- caller: (0, genThread_1.genThread)({ role: 'caller', target: 'src/main.ts' }),
64
- });
65
- });
66
- });
67
- (0, test_fns_1.when)('called with argv: { ask: "missing target" }', () => {
68
- (0, test_fns_1.then)('it should throw BadRequestError for missing target', async () => {
69
- const error = await (0, test_fns_1.getError)(() => (0, getSkillThreads_1.getSkillThreads)({
70
- getter,
71
- from: { lookup: { argv: { ask: 'missing target' } } },
72
- }));
73
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
74
- });
75
- });
76
- (0, test_fns_1.when)('called with argv: { target: "src/x.ts" } (missing ask)', () => {
77
- (0, test_fns_1.then)('it should throw BadRequestError for missing ask', async () => {
78
- const error = await (0, test_fns_1.getError)(() => (0, getSkillThreads_1.getSkillThreads)({
79
- getter,
80
- from: { lookup: { argv: { target: 'src/x.ts' } } },
81
- }));
82
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
83
- expect(error.message).toMatch(/missing.*ask/i);
84
- });
85
- });
86
- });
87
- (0, test_fns_1.given)('a rejecting getter that fails all assess checks', () => {
88
- const getter = getterExample.clone({
89
- assess: (() => false),
90
- });
91
- (0, test_fns_1.when)('called with argv: { target: "src/any.ts", ask: "still fails" }', () => {
92
- (0, test_fns_1.then)('it should throw UnexpectedCodePathError', async () => {
93
- const error = await (0, test_fns_1.getError)(() => (0, getSkillThreads_1.getSkillThreads)({
94
- getter,
95
- from: {
96
- lookup: {
97
- argv: { target: 'src/any.ts', ask: 'still fails' },
98
- },
99
- },
100
- }));
101
- expect(error).toBeInstanceOf(helpful_errors_1.UnexpectedCodePathError);
102
- });
103
- });
104
- (0, test_fns_1.when)('called with passin: { target: "src/any.ts", ask: "bad input" }', () => {
105
- (0, test_fns_1.then)('it should throw BadRequestError', async () => {
106
- const error = await (0, test_fns_1.getError)(() => (0, getSkillThreads_1.getSkillThreads)({
107
- getter,
108
- from: { passin: { target: 'src/any.ts', ask: 'bad input' } },
109
- }));
110
- expect(error).toBeInstanceOf(helpful_errors_1.BadRequestError);
111
- });
112
- });
113
- });
114
- });
115
- //# sourceMappingURL=getSkillThread.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSkillThread.test.js","sourceRoot":"","sources":["../../../src/logic/invoke/getSkillThread.test.ts"],"names":[],"mappings":";;AAAA,mDAA0E;AAC1E,uCAAuD;AAGvD,gFAAiF;AACjF,mDAAgD;AAChD,uDAAoD;AAEpD,MAAM,aAAa,GAAG,2CAAsB,CAAC,KAAK,CAKhD;IACA,MAAM,EAAE;QACN,MAAM,EAAE;YACN,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,oBAAoB;YAC1B,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,QAAQ;SACf;KACF;IACD,MAAM,EAAE,CAAC,KAAU,EAA4C,EAAE,CAC/D,OAAO,KAAK,EAAE,MAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE,GAAG,KAAK,QAAQ;IACrE,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,MAAM,EAAE,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK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AC;gBACF,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,wCAAuB,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;QACL,CAAC,CACF,CAAC;QAEF,IAAA,eAAI,EACF,gEAAgE,EAChE,GAAG,EAAE;YACH,IAAA,eAAI,EAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;gBACjD,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAChC,IAAA,iCAAe,EAAC;oBACd,MAAM;oBACN,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE;iBAC7D,CAAC,CACH,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,gCAAe,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,74 +0,0 @@
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
- const node_path_1 = __importDefault(require("node:path"));
7
- const test_fns_1 = require("test-fns");
8
- const directory_1 = require("../../.test/directory");
9
- const performInIsolatedThread_invoke_1 = require("./performInIsolatedThread.invoke");
10
- describe('performInIsolatedThread', () => {
11
- // observe stdout
12
- let stdoutObserved = '';
13
- const originalWrite = process.stdout.write;
14
- beforeAll(() => {
15
- process.stdout.write = (chunk, ...args) => {
16
- stdoutObserved += chunk.toString();
17
- return originalWrite.call(process.stdout, chunk, ...args);
18
- };
19
- });
20
- afterAll(() => {
21
- process.stdout.write = originalWrite;
22
- });
23
- (0, test_fns_1.given)('a simple demo config', () => {
24
- // declare the demo config via path
25
- const configPath = node_path_1.default.resolve(directory_1.TEST_FIXTURE_DIRECTORY, './example.use.repo/example.rhachet.use.ts');
26
- (0, test_fns_1.when)('asked to perform a skill registered in the config', () => {
27
- const opts = {
28
- config: configPath,
29
- skill: 'echo',
30
- role: 'echoer',
31
- attempt: 1,
32
- ask: 'do it',
33
- };
34
- (0, test_fns_1.then)('it should successfully execute it', async () => {
35
- await (0, performInIsolatedThread_invoke_1.performInIsolatedThread)({ opts, peer: { attempts: 3 } });
36
- });
37
- (0, test_fns_1.then)('it should have logged with observable prefixes', async () => {
38
- expect(stdoutObserved).toContain('○ i1 ›');
39
- expect(stdoutObserved).toContain(`🫡 on it!`);
40
- });
41
- });
42
- (0, test_fns_1.when)('asked to perform a skill registered in the config with 100 peer attempts', () => {
43
- const opts = {
44
- config: configPath,
45
- skill: 'echo',
46
- role: 'echoer',
47
- attempt: 1,
48
- ask: 'do it',
49
- };
50
- (0, test_fns_1.then)('it should successfully execute it', async () => {
51
- await (0, performInIsolatedThread_invoke_1.performInIsolatedThread)({ opts, peer: { attempts: 100 } });
52
- });
53
- (0, test_fns_1.then)('it should have logged with padded observable prefixes', async () => {
54
- expect(stdoutObserved).toContain('○ i001 ›');
55
- });
56
- });
57
- (0, test_fns_1.when)('asked to perform a skill registered in the config on attempt number 3', () => {
58
- const opts = {
59
- config: configPath,
60
- skill: 'echo',
61
- role: 'echoer',
62
- attempt: 3,
63
- ask: 'do it',
64
- };
65
- (0, test_fns_1.then)('it should successfully execute it', async () => {
66
- await (0, performInIsolatedThread_invoke_1.performInIsolatedThread)({ opts, peer: { attempts: 3 } });
67
- });
68
- (0, test_fns_1.then)('it should have logged with padded observable prefixes', async () => {
69
- expect(stdoutObserved).toContain('○ i3 ›');
70
- });
71
- });
72
- });
73
- });
74
- //# sourceMappingURL=performInIsolatedThread.invoke.integration.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"performInIsolatedThread.invoke.integration.test.js","sourceRoot":"","sources":["../../../src/logic/invoke/performInIsolatedThread.invoke.integration.test.ts"],"names":[],"mappings":";;;;;AAAA,0DAA6B;AAC7B,uCAA6C;AAE7C,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Q,CAAC,CAAC;YAC7C,CAAC,CACF,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,75 +0,0 @@
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
- const node_path_1 = __importDefault(require("node:path"));
7
- const rhachet_artifact_git_1 = require("rhachet-artifact-git");
8
- const test_fns_1 = require("test-fns");
9
- const directory_1 = require("../../.test/directory");
10
- const performInIsolatedThreads_1 = require("./performInIsolatedThreads");
11
- describe('performInIsolatedThreads', () => {
12
- // observe stdout
13
- let stdoutObserved = '';
14
- const originalWrite = process.stdout.write;
15
- beforeAll(() => {
16
- process.stdout.write = (chunk, ...args) => {
17
- stdoutObserved += chunk.toString();
18
- return originalWrite.call(process.stdout, chunk, ...args);
19
- };
20
- });
21
- afterAll(() => {
22
- process.stdout.write = originalWrite;
23
- });
24
- (0, test_fns_1.given)('a simple echo demo', () => {
25
- // declare the demo config via path
26
- const configPath = node_path_1.default.resolve(directory_1.TEST_FIXTURE_DIRECTORY, './example.use.repo/example.rhachet.use.ts');
27
- (0, test_fns_1.when)('asked to perform a skill registered in the config 3 times', () => {
28
- const opts = {
29
- config: configPath,
30
- role: 'echoer',
31
- skill: 'echo',
32
- attempts: 3,
33
- ask: 'do it',
34
- };
35
- (0, test_fns_1.then)('it should successfully execute do so', async () => {
36
- await (0, performInIsolatedThreads_1.performInIsolatedThreads)({ opts });
37
- });
38
- (0, test_fns_1.then)('it should have logged with observable prefixes', async () => {
39
- expect(stdoutObserved).toContain('○ i1 ›');
40
- expect(stdoutObserved).toContain(`🫡 on it!`);
41
- });
42
- });
43
- });
44
- (0, test_fns_1.given)('a simple file write', () => {
45
- // declare the demo config via path
46
- const configPath = node_path_1.default.resolve(directory_1.TEST_FIXTURE_DIRECTORY, './example.use.repo/example.rhachet.use.ts');
47
- (0, test_fns_1.when)('asked to perform a skill registered in the config 3 times', () => {
48
- const opts = {
49
- config: configPath,
50
- output: directory_1.TEST_FIXTURE_DIRECTORY +
51
- `/example.use.repo/.tmp/performInIsolatedThreads/${Date.now()}.demo.md`,
52
- role: 'echoer',
53
- skill: 'write',
54
- attempts: 3,
55
- ask: 'do it',
56
- };
57
- (0, test_fns_1.then)('it should successfully execute do so', async () => {
58
- await (0, performInIsolatedThreads_1.performInIsolatedThreads)({ opts });
59
- });
60
- (0, test_fns_1.then)('it should have logged with observable prefixes', async () => {
61
- expect(stdoutObserved).toContain('○ i1 ›');
62
- expect(stdoutObserved).toContain(`🫡 on it!`);
63
- });
64
- (0, test_fns_1.then)('it should written files to the expected paths', async () => {
65
- const artifactsExpected = [
66
- (0, rhachet_artifact_git_1.genArtifactGitFile)({ uri: opts.output.replace(/\.md$/, '.i1.md') }),
67
- (0, rhachet_artifact_git_1.genArtifactGitFile)({ uri: opts.output.replace(/\.md$/, '.i2.md') }),
68
- (0, rhachet_artifact_git_1.genArtifactGitFile)({ uri: opts.output.replace(/\.md$/, '.i3.md') }),
69
- ];
70
- await Promise.all(artifactsExpected.map(async (art) => expect((await art.get())?.content).toEqual(opts.ask)));
71
- });
72
- });
73
- });
74
- });
75
- //# sourceMappingURL=performInIsolatedThreads.integration.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"performInIsolatedThreads.integration.test.js","sourceRoot":"","sources":["../../../src/logic/invoke/performInIsolatedThreads.integration.test.ts"],"names":[],"mappings":";;;;;AAAA,0DAA6B;AAC7B,+DAA0D;AAC1D,uCAA6C;AAE7C,qDAA+D;AAC/D,yEAAsE;AAEtE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,iBAAiB;IACjB,IAAI,cAAc,GAAG,EAAE,CAAC;IACxB,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3C,SAAS,CAAC,GAAG,EAAE;QACZ,OAAO,CA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