superacli 1.0.1 → 1.1.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 (389) hide show
  1. package/.beads/.br_history/issues.20260308_200823_636718328.jsonl +20 -0
  2. package/.beads/.br_history/issues.20260308_200823_636718328.jsonl.meta.json +1 -0
  3. package/.beads/.br_history/issues.20260308_200827_033159453.jsonl +21 -0
  4. package/.beads/.br_history/issues.20260308_200827_033159453.jsonl.meta.json +1 -0
  5. package/.beads/.br_history/issues.20260308_200829_595900053.jsonl +22 -0
  6. package/.beads/.br_history/issues.20260308_200829_595900053.jsonl.meta.json +1 -0
  7. package/.beads/.br_history/issues.20260308_200834_079930100.jsonl +23 -0
  8. package/.beads/.br_history/issues.20260308_200834_079930100.jsonl.meta.json +1 -0
  9. package/.beads/.br_history/issues.20260308_200858_370924996.jsonl +24 -0
  10. package/.beads/.br_history/issues.20260308_200858_370924996.jsonl.meta.json +1 -0
  11. package/.beads/.br_history/issues.20260308_201031_019730855.jsonl +24 -0
  12. package/.beads/.br_history/issues.20260308_201031_019730855.jsonl.meta.json +1 -0
  13. package/.beads/.br_history/issues.20260308_201031_578974884.jsonl +24 -0
  14. package/.beads/.br_history/issues.20260308_201031_578974884.jsonl.meta.json +1 -0
  15. package/.beads/.br_history/issues.20260308_201054_780345548.jsonl +24 -0
  16. package/.beads/.br_history/issues.20260308_201054_780345548.jsonl.meta.json +1 -0
  17. package/.beads/.br_history/issues.20260308_201054_896980019.jsonl +24 -0
  18. package/.beads/.br_history/issues.20260308_201054_896980019.jsonl.meta.json +1 -0
  19. package/.beads/.br_history/issues.20260308_201128_599819688.jsonl +24 -0
  20. package/.beads/.br_history/issues.20260308_201128_599819688.jsonl.meta.json +1 -0
  21. package/.beads/.br_history/issues.20260308_201128_710221699.jsonl +24 -0
  22. package/.beads/.br_history/issues.20260308_201128_710221699.jsonl.meta.json +1 -0
  23. package/.beads/.br_history/issues.20260308_201204_745649213.jsonl +24 -0
  24. package/.beads/.br_history/issues.20260308_201204_745649213.jsonl.meta.json +1 -0
  25. package/.beads/.br_history/issues.20260308_201338_908436144.jsonl +24 -0
  26. package/.beads/.br_history/issues.20260308_201338_908436144.jsonl.meta.json +1 -0
  27. package/.beads/.br_history/issues.20260308_201344_734860714.jsonl +25 -0
  28. package/.beads/.br_history/issues.20260308_201344_734860714.jsonl.meta.json +1 -0
  29. package/.beads/.br_history/issues.20260308_201630_819282295.jsonl +25 -0
  30. package/.beads/.br_history/issues.20260308_201630_819282295.jsonl.meta.json +1 -0
  31. package/.beads/.br_history/issues.20260308_203538_054279699.jsonl +25 -0
  32. package/.beads/.br_history/issues.20260308_203538_054279699.jsonl.meta.json +1 -0
  33. package/.beads/.br_history/issues.20260308_203547_597113070.jsonl +26 -0
  34. package/.beads/.br_history/issues.20260308_203547_597113070.jsonl.meta.json +1 -0
  35. package/.beads/.br_history/issues.20260308_203547_775139216.jsonl +27 -0
  36. package/.beads/.br_history/issues.20260308_203547_775139216.jsonl.meta.json +1 -0
  37. package/.beads/.br_history/issues.20260308_203547_950724773.jsonl +28 -0
  38. package/.beads/.br_history/issues.20260308_203547_950724773.jsonl.meta.json +1 -0
  39. package/.beads/.br_history/issues.20260308_203548_107684523.jsonl +29 -0
  40. package/.beads/.br_history/issues.20260308_203548_107684523.jsonl.meta.json +1 -0
  41. package/.beads/.br_history/issues.20260308_203548_310389993.jsonl +30 -0
  42. package/.beads/.br_history/issues.20260308_203548_310389993.jsonl.meta.json +1 -0
  43. package/.beads/.br_history/issues.20260308_203825_953337320.jsonl +31 -0
  44. package/.beads/.br_history/issues.20260308_203825_953337320.jsonl.meta.json +1 -0
  45. package/.beads/.br_history/issues.20260308_204056_071377736.jsonl +32 -0
  46. package/.beads/.br_history/issues.20260308_204056_071377736.jsonl.meta.json +1 -0
  47. package/.beads/.br_history/issues.20260308_205141_517616844.jsonl +32 -0
  48. package/.beads/.br_history/issues.20260308_205141_517616844.jsonl.meta.json +1 -0
  49. package/.beads/.br_history/issues.20260308_205141_648994024.jsonl +32 -0
  50. package/.beads/.br_history/issues.20260308_205141_648994024.jsonl.meta.json +1 -0
  51. package/.beads/.br_history/issues.20260308_205141_867598036.jsonl +32 -0
  52. package/.beads/.br_history/issues.20260308_205141_867598036.jsonl.meta.json +1 -0
  53. package/.beads/.br_history/issues.20260308_205142_094157355.jsonl +32 -0
  54. package/.beads/.br_history/issues.20260308_205142_094157355.jsonl.meta.json +1 -0
  55. package/.beads/.br_history/issues.20260308_205142_327315677.jsonl +32 -0
  56. package/.beads/.br_history/issues.20260308_205142_327315677.jsonl.meta.json +1 -0
  57. package/.beads/.br_history/issues.20260308_205142_545563822.jsonl +32 -0
  58. package/.beads/.br_history/issues.20260308_205142_545563822.jsonl.meta.json +1 -0
  59. package/.beads/.br_history/issues.20260308_205213_061989333.jsonl +32 -0
  60. package/.beads/.br_history/issues.20260308_205213_061989333.jsonl.meta.json +1 -0
  61. package/.beads/.br_history/issues.20260308_205213_181103364.jsonl +32 -0
  62. package/.beads/.br_history/issues.20260308_205213_181103364.jsonl.meta.json +1 -0
  63. package/.beads/.br_history/issues.20260308_205213_408872234.jsonl +32 -0
  64. package/.beads/.br_history/issues.20260308_205213_408872234.jsonl.meta.json +1 -0
  65. package/.beads/.br_history/issues.20260308_205213_616681652.jsonl +32 -0
  66. package/.beads/.br_history/issues.20260308_205213_616681652.jsonl.meta.json +1 -0
  67. package/.beads/.br_history/issues.20260308_205213_821507069.jsonl +32 -0
  68. package/.beads/.br_history/issues.20260308_205213_821507069.jsonl.meta.json +1 -0
  69. package/.beads/.br_history/issues.20260308_205214_026661112.jsonl +32 -0
  70. package/.beads/.br_history/issues.20260308_205214_026661112.jsonl.meta.json +1 -0
  71. package/.beads/.br_history/issues.20260308_205454_955250554.jsonl +32 -0
  72. package/.beads/.br_history/issues.20260308_205454_955250554.jsonl.meta.json +1 -0
  73. package/.beads/.br_history/issues.20260308_205556_337800392.jsonl +33 -0
  74. package/.beads/.br_history/issues.20260308_205556_337800392.jsonl.meta.json +1 -0
  75. package/.beads/.br_history/issues.20260308_205824_274686694.jsonl +33 -0
  76. package/.beads/.br_history/issues.20260308_205824_274686694.jsonl.meta.json +1 -0
  77. package/.beads/.br_history/issues.20260308_210240_583768328.jsonl +34 -0
  78. package/.beads/.br_history/issues.20260308_210240_583768328.jsonl.meta.json +1 -0
  79. package/.beads/.br_history/issues.20260308_212223_641541494.jsonl +34 -0
  80. package/.beads/.br_history/issues.20260308_212223_641541494.jsonl.meta.json +1 -0
  81. package/.beads/.br_history/issues.20260308_212227_735550996.jsonl +35 -0
  82. package/.beads/.br_history/issues.20260308_212227_735550996.jsonl.meta.json +1 -0
  83. package/.beads/.br_history/issues.20260308_212232_547298548.jsonl +36 -0
  84. package/.beads/.br_history/issues.20260308_212232_547298548.jsonl.meta.json +1 -0
  85. package/.beads/.br_history/issues.20260308_212528_843628125.jsonl +37 -0
  86. package/.beads/.br_history/issues.20260308_212528_843628125.jsonl.meta.json +1 -0
  87. package/.beads/.br_history/issues.20260308_212529_094530502.jsonl +38 -0
  88. package/.beads/.br_history/issues.20260308_212529_094530502.jsonl.meta.json +1 -0
  89. package/.beads/.br_history/issues.20260308_212529_331000853.jsonl +39 -0
  90. package/.beads/.br_history/issues.20260308_212529_331000853.jsonl.meta.json +1 -0
  91. package/.beads/.br_history/issues.20260308_212529_587925652.jsonl +40 -0
  92. package/.beads/.br_history/issues.20260308_212529_587925652.jsonl.meta.json +1 -0
  93. package/.beads/.br_history/issues.20260308_212804_927764103.jsonl +41 -0
  94. package/.beads/.br_history/issues.20260308_212804_927764103.jsonl.meta.json +1 -0
  95. package/.beads/.br_history/issues.20260308_212805_153673453.jsonl +42 -0
  96. package/.beads/.br_history/issues.20260308_212805_153673453.jsonl.meta.json +1 -0
  97. package/.beads/.br_history/issues.20260308_212805_415982363.jsonl +43 -0
  98. package/.beads/.br_history/issues.20260308_212805_415982363.jsonl.meta.json +1 -0
  99. package/.beads/.br_history/issues.20260308_212805_657497741.jsonl +44 -0
  100. package/.beads/.br_history/issues.20260308_212805_657497741.jsonl.meta.json +1 -0
  101. package/.beads/.br_history/issues.20260308_212805_952838724.jsonl +45 -0
  102. package/.beads/.br_history/issues.20260308_212805_952838724.jsonl.meta.json +1 -0
  103. package/.beads/.br_history/issues.20260308_212806_325433779.jsonl +46 -0
  104. package/.beads/.br_history/issues.20260308_212806_325433779.jsonl.meta.json +1 -0
  105. package/.beads/.br_history/issues.20260308_212806_584685598.jsonl +47 -0
  106. package/.beads/.br_history/issues.20260308_212806_584685598.jsonl.meta.json +1 -0
  107. package/.beads/.br_history/issues.20260308_212806_827817208.jsonl +48 -0
  108. package/.beads/.br_history/issues.20260308_212806_827817208.jsonl.meta.json +1 -0
  109. package/.beads/.br_history/issues.20260308_212807_111320451.jsonl +49 -0
  110. package/.beads/.br_history/issues.20260308_212807_111320451.jsonl.meta.json +1 -0
  111. package/.beads/.br_history/issues.20260308_212807_409545536.jsonl +50 -0
  112. package/.beads/.br_history/issues.20260308_212807_409545536.jsonl.meta.json +1 -0
  113. package/.beads/.br_history/issues.20260308_212807_625063294.jsonl +51 -0
  114. package/.beads/.br_history/issues.20260308_212807_625063294.jsonl.meta.json +1 -0
  115. package/.beads/.br_history/issues.20260308_212807_843906551.jsonl +52 -0
  116. package/.beads/.br_history/issues.20260308_212807_843906551.jsonl.meta.json +1 -0
  117. package/.beads/.br_history/issues.20260308_212808_100304073.jsonl +53 -0
  118. package/.beads/.br_history/issues.20260308_212808_100304073.jsonl.meta.json +1 -0
  119. package/.beads/.br_history/issues.20260308_212808_324723976.jsonl +54 -0
  120. package/.beads/.br_history/issues.20260308_212808_324723976.jsonl.meta.json +1 -0
  121. package/.beads/.br_history/issues.20260308_212808_557513104.jsonl +55 -0
  122. package/.beads/.br_history/issues.20260308_212808_557513104.jsonl.meta.json +1 -0
  123. package/.beads/.br_history/issues.20260308_212808_788048322.jsonl +56 -0
  124. package/.beads/.br_history/issues.20260308_212808_788048322.jsonl.meta.json +1 -0
  125. package/.beads/.br_history/issues.20260308_213702_613249728.jsonl +57 -0
  126. package/.beads/.br_history/issues.20260308_213702_613249728.jsonl.meta.json +1 -0
  127. package/.beads/.br_history/issues.20260308_213715_115792063.jsonl +57 -0
  128. package/.beads/.br_history/issues.20260308_213715_115792063.jsonl.meta.json +1 -0
  129. package/.beads/.br_history/issues.20260308_213715_462220666.jsonl +57 -0
  130. package/.beads/.br_history/issues.20260308_213715_462220666.jsonl.meta.json +1 -0
  131. package/.beads/.br_history/issues.20260308_213727_191258923.jsonl +57 -0
  132. package/.beads/.br_history/issues.20260308_213727_191258923.jsonl.meta.json +1 -0
  133. package/.beads/.br_history/issues.20260308_213727_684383652.jsonl +57 -0
  134. package/.beads/.br_history/issues.20260308_213727_684383652.jsonl.meta.json +1 -0
  135. package/.beads/.br_history/issues.20260308_213735_751882991.jsonl +57 -0
  136. package/.beads/.br_history/issues.20260308_213735_751882991.jsonl.meta.json +1 -0
  137. package/.beads/.br_history/issues.20260308_222052_279844960.jsonl +57 -0
  138. package/.beads/.br_history/issues.20260308_222052_279844960.jsonl.meta.json +1 -0
  139. package/.beads/.br_history/issues.20260308_222056_873282114.jsonl +57 -0
  140. package/.beads/.br_history/issues.20260308_222056_873282114.jsonl.meta.json +1 -0
  141. package/.beads/.br_history/issues.20260308_222103_402410761.jsonl +57 -0
  142. package/.beads/.br_history/issues.20260308_222103_402410761.jsonl.meta.json +1 -0
  143. package/.beads/.br_history/issues.20260308_235202_180577215.jsonl +57 -0
  144. package/.beads/.br_history/issues.20260308_235202_180577215.jsonl.meta.json +1 -0
  145. package/.beads/.br_history/issues.20260308_235202_387414163.jsonl +57 -0
  146. package/.beads/.br_history/issues.20260308_235202_387414163.jsonl.meta.json +1 -0
  147. package/.beads/.br_history/issues.20260308_235202_564422794.jsonl +57 -0
  148. package/.beads/.br_history/issues.20260308_235202_564422794.jsonl.meta.json +1 -0
  149. package/.beads/.br_history/issues.20260308_235202_742600597.jsonl +57 -0
  150. package/.beads/.br_history/issues.20260308_235202_742600597.jsonl.meta.json +1 -0
  151. package/.beads/.br_history/issues.20260308_235208_133360069.jsonl +57 -0
  152. package/.beads/.br_history/issues.20260308_235208_133360069.jsonl.meta.json +1 -0
  153. package/.beads/.br_history/issues.20260308_235505_473406307.jsonl +57 -0
  154. package/.beads/.br_history/issues.20260308_235505_473406307.jsonl.meta.json +1 -0
  155. package/.beads/.br_history/issues.20260308_235505_662360489.jsonl +57 -0
  156. package/.beads/.br_history/issues.20260308_235505_662360489.jsonl.meta.json +1 -0
  157. package/.beads/.br_history/issues.20260308_235505_843935624.jsonl +57 -0
  158. package/.beads/.br_history/issues.20260308_235505_843935624.jsonl.meta.json +1 -0
  159. package/.beads/.br_history/issues.20260308_235506_044530221.jsonl +57 -0
  160. package/.beads/.br_history/issues.20260308_235506_044530221.jsonl.meta.json +1 -0
  161. package/.beads/.br_history/issues.20260309_002618_115728731.jsonl +57 -0
  162. package/.beads/.br_history/issues.20260309_002618_115728731.jsonl.meta.json +1 -0
  163. package/.beads/.br_history/issues.20260309_003748_878174586.jsonl +57 -0
  164. package/.beads/.br_history/issues.20260309_003748_878174586.jsonl.meta.json +1 -0
  165. package/.beads/.br_history/issues.20260309_004057_868755623.jsonl +57 -0
  166. package/.beads/.br_history/issues.20260309_004057_868755623.jsonl.meta.json +1 -0
  167. package/.beads/.br_history/issues.20260309_004058_512842163.jsonl +57 -0
  168. package/.beads/.br_history/issues.20260309_004058_512842163.jsonl.meta.json +1 -0
  169. package/.beads/.br_history/issues.20260309_004058_994445226.jsonl +57 -0
  170. package/.beads/.br_history/issues.20260309_004058_994445226.jsonl.meta.json +1 -0
  171. package/.beads/.br_history/issues.20260309_004059_475988596.jsonl +57 -0
  172. package/.beads/.br_history/issues.20260309_004059_475988596.jsonl.meta.json +1 -0
  173. package/.beads/.br_history/issues.20260309_161902_566857851.jsonl +57 -0
  174. package/.beads/.br_history/issues.20260309_161902_566857851.jsonl.meta.json +1 -0
  175. package/.beads/.br_history/issues.20260309_170512_277017739.jsonl +57 -0
  176. package/.beads/.br_history/issues.20260309_170512_277017739.jsonl.meta.json +1 -0
  177. package/.beads/.br_history/issues.20260309_170512_477876921.jsonl +57 -0
  178. package/.beads/.br_history/issues.20260309_170512_477876921.jsonl.meta.json +1 -0
  179. package/.beads/.br_history/issues.20260309_170512_664382701.jsonl +57 -0
  180. package/.beads/.br_history/issues.20260309_170512_664382701.jsonl.meta.json +1 -0
  181. package/.beads/.br_history/issues.20260309_170512_859400333.jsonl +57 -0
  182. package/.beads/.br_history/issues.20260309_170512_859400333.jsonl.meta.json +1 -0
  183. package/.beads/.br_history/issues.20260309_212326_082771164.jsonl +57 -0
  184. package/.beads/.br_history/issues.20260309_212326_082771164.jsonl.meta.json +1 -0
  185. package/.beads/.br_history/issues.20260309_212326_245619716.jsonl +58 -0
  186. package/.beads/.br_history/issues.20260309_212326_245619716.jsonl.meta.json +1 -0
  187. package/.beads/.br_history/issues.20260309_212326_403198317.jsonl +59 -0
  188. package/.beads/.br_history/issues.20260309_212326_403198317.jsonl.meta.json +1 -0
  189. package/.beads/.br_history/issues.20260309_212332_539197678.jsonl +60 -0
  190. package/.beads/.br_history/issues.20260309_212332_539197678.jsonl.meta.json +1 -0
  191. package/.beads/.br_history/issues.20260309_212332_731373599.jsonl +60 -0
  192. package/.beads/.br_history/issues.20260309_212332_731373599.jsonl.meta.json +1 -0
  193. package/.beads/.br_history/issues.20260309_212332_928710953.jsonl +60 -0
  194. package/.beads/.br_history/issues.20260309_212332_928710953.jsonl.meta.json +1 -0
  195. package/.beads/.br_history/issues.20260309_213021_341505240.jsonl +60 -0
  196. package/.beads/.br_history/issues.20260309_213021_341505240.jsonl.meta.json +1 -0
  197. package/.beads/.br_history/issues.20260309_213022_023136934.jsonl +60 -0
  198. package/.beads/.br_history/issues.20260309_213022_023136934.jsonl.meta.json +1 -0
  199. package/.beads/.br_history/issues.20260309_213022_400050719.jsonl +60 -0
  200. package/.beads/.br_history/issues.20260309_213022_400050719.jsonl.meta.json +1 -0
  201. package/.beads/config.yaml +4 -0
  202. package/.beads/issues.jsonl +60 -0
  203. package/.beads/metadata.json +4 -0
  204. package/README.md +226 -43
  205. package/__tests__/adapter-schema.test.js +119 -0
  206. package/__tests__/ask.test.js +327 -0
  207. package/__tests__/aws-plugin.test.js +84 -0
  208. package/__tests__/az-plugin.test.js +84 -0
  209. package/__tests__/builtin-adapter.test.js +29 -0
  210. package/__tests__/cline-plugin.test.js +109 -0
  211. package/__tests__/cline-skill.test.js +49 -0
  212. package/__tests__/config.test.js +297 -0
  213. package/__tests__/docker-plugin.test.js +95 -0
  214. package/__tests__/executor.test.js +303 -0
  215. package/__tests__/eza-plugin.test.js +81 -0
  216. package/__tests__/gcloud-plugin.test.js +86 -0
  217. package/__tests__/gh-plugin.test.js +86 -0
  218. package/__tests__/helm-plugin.test.js +81 -0
  219. package/__tests__/help-json.test.js +19 -0
  220. package/__tests__/http-adapter.test.js +118 -0
  221. package/__tests__/just-plugin.test.js +82 -0
  222. package/__tests__/kubectl-plugin.test.js +83 -0
  223. package/__tests__/linear-plugin.test.js +81 -0
  224. package/__tests__/mcp-adapter.test.js +187 -0
  225. package/__tests__/mcp-local.test.js +105 -0
  226. package/__tests__/namespace-passthrough.test.js +69 -0
  227. package/__tests__/nextest-plugin.test.js +82 -0
  228. package/__tests__/npm-plugin.test.js +81 -0
  229. package/__tests__/nullclaw-plugin.test.js +157 -0
  230. package/__tests__/openapi-adapter.test.js +199 -0
  231. package/__tests__/plan-runtime.test.js +43 -0
  232. package/__tests__/planner.test.js +47 -0
  233. package/__tests__/plugin-agency-agents.test.js +62 -0
  234. package/__tests__/plugin-nullclaw.test.js +78 -0
  235. package/__tests__/plugin-visual-explainer.test.js +62 -0
  236. package/__tests__/plugins-command.test.js +220 -0
  237. package/__tests__/plugins-manager.test.js +353 -0
  238. package/__tests__/plugins-registry.test.js +114 -0
  239. package/__tests__/plugins-store.test.js +115 -0
  240. package/__tests__/pnpm-plugin.test.js +81 -0
  241. package/__tests__/poetry-plugin.test.js +83 -0
  242. package/__tests__/process-adapter.test.js +143 -0
  243. package/__tests__/pulumi-plugin.test.js +81 -0
  244. package/__tests__/railway-plugin.test.js +84 -0
  245. package/__tests__/server-app.test.js +67 -0
  246. package/__tests__/server-config-service.test.js +79 -0
  247. package/__tests__/server-routes-ask.test.js +89 -0
  248. package/__tests__/server-routes-commands.test.js +55 -0
  249. package/__tests__/server-routes-config.test.js +87 -0
  250. package/__tests__/server-routes-jobs.test.js +53 -0
  251. package/__tests__/server-routes-misc.test.js +112 -0
  252. package/__tests__/server-storage-adapter.test.js +40 -0
  253. package/__tests__/server-storage-file.test.js +73 -0
  254. package/__tests__/server-storage-mongo.test.js +74 -0
  255. package/__tests__/shell-adapter.test.js +90 -0
  256. package/__tests__/skills-catalog.test.js +98 -0
  257. package/__tests__/skills.test.js +442 -0
  258. package/__tests__/stripe-plugin.test.js +81 -0
  259. package/__tests__/supabase-plugin.test.js +86 -0
  260. package/__tests__/terraform-plugin.test.js +83 -0
  261. package/__tests__/uv-plugin.test.js +81 -0
  262. package/__tests__/vercel-plugin.test.js +81 -0
  263. package/__tests__/watchexec-plugin.test.js +80 -0
  264. package/cli/adapter-schema.js +108 -0
  265. package/cli/adapters/builtin.js +43 -0
  266. package/cli/adapters/process.js +262 -0
  267. package/cli/adapters/shell.js +82 -0
  268. package/cli/config.js +12 -9
  269. package/cli/executor.js +6 -1
  270. package/cli/help-json.js +3 -1
  271. package/cli/namespace-passthrough.js +38 -0
  272. package/cli/plugin-install-guidance.js +320 -0
  273. package/cli/plugins-command.js +138 -0
  274. package/cli/plugins-manager.js +552 -0
  275. package/cli/plugins-registry.js +80 -0
  276. package/cli/plugins-store.js +56 -0
  277. package/cli/skills-catalog.js +237 -0
  278. package/cli/skills.js +180 -6
  279. package/cli/supercli.js +150 -58
  280. package/docs/docs.html +224 -0
  281. package/docs/feature-gaps.md +16 -0
  282. package/docs/index.html +164 -0
  283. package/docs/plugin-examples.md +397 -0
  284. package/docs/plugin-harness-guide.md +452 -0
  285. package/docs/plugins.md +44 -0
  286. package/docs/skills/cline-non-interactive/SKILL.md +59 -0
  287. package/docs/skills-catalog.md +81 -0
  288. package/docs/supported-harnesses.md +277 -0
  289. package/docs/visual-overview.md +21 -0
  290. package/jest.config.js +25 -0
  291. package/package.json +9 -3
  292. package/plugins/agency-agents/plugin.json +15 -0
  293. package/plugins/agency-agents/scripts/post-install.js +122 -0
  294. package/plugins/aws/README.md +46 -0
  295. package/plugins/aws/plugin.json +42 -0
  296. package/plugins/az/README.md +46 -0
  297. package/plugins/az/plugin.json +42 -0
  298. package/plugins/beads/plugin.json +202 -0
  299. package/plugins/clickup/plugin.json +38 -0
  300. package/plugins/clickup/scripts/post-install.js +107 -0
  301. package/plugins/clickup/scripts/post-uninstall.js +30 -0
  302. package/plugins/cline/README.md +48 -0
  303. package/plugins/cline/plugin.json +92 -0
  304. package/plugins/commiat/plugin.json +36 -0
  305. package/plugins/docker/MANIFEST.md +39 -0
  306. package/plugins/docker/README.md +35 -0
  307. package/plugins/docker/examples/build-image.sh +7 -0
  308. package/plugins/docker/examples/inspect-container.sh +6 -0
  309. package/plugins/docker/examples/list-containers.sh +4 -0
  310. package/plugins/docker/examples/multi-step-workflow.sh +10 -0
  311. package/plugins/docker/examples/run-container.sh +7 -0
  312. package/plugins/docker/plugin.json +266 -0
  313. package/plugins/eza/README.md +40 -0
  314. package/plugins/eza/plugin.json +42 -0
  315. package/plugins/gcloud/README.md +46 -0
  316. package/plugins/gcloud/plugin.json +42 -0
  317. package/plugins/gh/README.md +46 -0
  318. package/plugins/gh/plugin.json +43 -0
  319. package/plugins/gwc/plugin.json +35 -0
  320. package/plugins/helm/README.md +42 -0
  321. package/plugins/helm/plugin.json +42 -0
  322. package/plugins/just/README.md +42 -0
  323. package/plugins/just/plugin.json +42 -0
  324. package/plugins/kubectl/README.md +46 -0
  325. package/plugins/kubectl/plugin.json +42 -0
  326. package/plugins/linear/README.md +60 -0
  327. package/plugins/linear/plugin.json +42 -0
  328. package/plugins/nextest/README.md +42 -0
  329. package/plugins/nextest/plugin.json +42 -0
  330. package/plugins/npm/README.md +46 -0
  331. package/plugins/npm/plugin.json +42 -0
  332. package/plugins/nullclaw/README.md +45 -0
  333. package/plugins/nullclaw/plugin.json +64 -0
  334. package/plugins/nullclaw/scripts/post-install.js +189 -0
  335. package/plugins/nullclaw/scripts/post-uninstall.js +25 -0
  336. package/plugins/openfang/plugin.json +37 -0
  337. package/plugins/openfang/scripts/post-install.js +163 -0
  338. package/plugins/openfang/scripts/post-uninstall.js +30 -0
  339. package/plugins/plugins.json +295 -0
  340. package/plugins/pnpm/README.md +46 -0
  341. package/plugins/pnpm/plugin.json +42 -0
  342. package/plugins/poetry/README.md +46 -0
  343. package/plugins/poetry/plugin.json +42 -0
  344. package/plugins/pulumi/README.md +46 -0
  345. package/plugins/pulumi/plugin.json +42 -0
  346. package/plugins/railway/README.md +58 -0
  347. package/plugins/railway/plugin.json +43 -0
  348. package/plugins/stripe/README.md +49 -0
  349. package/plugins/stripe/plugin.json +52 -0
  350. package/plugins/supabase/README.md +55 -0
  351. package/plugins/supabase/plugin.json +42 -0
  352. package/plugins/superpowers/plugin.json +22 -0
  353. package/plugins/superpowers/scripts/post-install.js +124 -0
  354. package/plugins/superpowers/scripts/post-uninstall.js +30 -0
  355. package/plugins/terraform/README.md +46 -0
  356. package/plugins/terraform/plugin.json +42 -0
  357. package/plugins/uv/README.md +46 -0
  358. package/plugins/uv/plugin.json +42 -0
  359. package/plugins/vercel/README.md +47 -0
  360. package/plugins/vercel/plugin.json +42 -0
  361. package/plugins/visual-explainer/plugin.json +15 -0
  362. package/plugins/visual-explainer/scripts/post-install.js +111 -0
  363. package/plugins/watchexec/README.md +40 -0
  364. package/plugins/watchexec/plugin.json +42 -0
  365. package/tests/test-aws-smoke.sh +56 -0
  366. package/tests/test-az-smoke.sh +56 -0
  367. package/tests/test-cli.js +116 -2
  368. package/tests/test-cline-smoke.sh +37 -0
  369. package/tests/test-eza-smoke.sh +33 -0
  370. package/tests/test-gcloud-smoke.sh +56 -0
  371. package/tests/test-gh-smoke.sh +56 -0
  372. package/tests/test-helm-smoke.sh +33 -0
  373. package/tests/test-just-smoke.sh +40 -0
  374. package/tests/test-kubectl-smoke.sh +37 -0
  375. package/tests/test-linear-smoke.sh +97 -0
  376. package/tests/test-nextest-smoke.sh +33 -0
  377. package/tests/test-npm-smoke.sh +32 -0
  378. package/tests/test-nullclaw-smoke.sh +51 -0
  379. package/tests/test-plugins-registry.js +212 -0
  380. package/tests/test-pnpm-smoke.sh +33 -0
  381. package/tests/test-poetry-smoke.sh +33 -0
  382. package/tests/test-pulumi-smoke.sh +33 -0
  383. package/tests/test-railway-smoke.sh +95 -0
  384. package/tests/test-stripe-smoke.sh +55 -0
  385. package/tests/test-supabase-smoke.sh +95 -0
  386. package/tests/test-terraform-smoke.sh +33 -0
  387. package/tests/test-uv-smoke.sh +33 -0
  388. package/tests/test-vercel-smoke.sh +55 -0
  389. package/tests/test-watchexec-smoke.sh +33 -0
@@ -0,0 +1,297 @@
1
+ const fs = require("fs")
2
+ const os = require("os")
3
+
4
+ jest.mock("fs")
5
+ jest.mock("os", () => ({
6
+ homedir: jest.fn(() => "/home/user")
7
+ }))
8
+ jest.mock("../cli/plugins-store")
9
+
10
+ const {
11
+ loadConfig,
12
+ syncConfig,
13
+ showConfig,
14
+ setMcpServer,
15
+ removeMcpServer,
16
+ listMcpServers
17
+ } = require("../cli/config")
18
+ const { getInstalledPluginCommands, listInstalledPlugins } = require("../cli/plugins-store")
19
+
20
+ global.fetch = jest.fn()
21
+
22
+ describe("config", () => {
23
+ const mockHomedir = "/home/user"
24
+ const cacheDir = mockHomedir + "/.supercli"
25
+ const cacheFile = cacheDir + "/config.json"
26
+
27
+ beforeEach(() => {
28
+ jest.clearAllMocks()
29
+ os.homedir.mockReturnValue(mockHomedir)
30
+ getInstalledPluginCommands.mockReturnValue([])
31
+ listInstalledPlugins.mockReturnValue([])
32
+ jest.spyOn(Date, "now").mockReturnValue(1000000)
33
+ })
34
+
35
+ afterEach(() => {
36
+ jest.restoreAllMocks()
37
+ })
38
+
39
+ describe("loadConfig", () => {
40
+ test("returns empty config if no cache exists", async () => {
41
+ fs.existsSync.mockReturnValue(false)
42
+ const config = await loadConfig()
43
+ expect(config.version).toBe("1")
44
+ expect(config.commands).toEqual([])
45
+ })
46
+
47
+ test("returns cached config merged with plugin commands", async () => {
48
+ fs.existsSync.mockReturnValue(true)
49
+ fs.readFileSync.mockReturnValue(JSON.stringify({
50
+ version: "2",
51
+ commands: [{ id: "base" }]
52
+ }))
53
+ getInstalledPluginCommands.mockReturnValue([{ id: "plugin" }])
54
+
55
+ const config = await loadConfig()
56
+ expect(config.version).toBe("2")
57
+ expect(config.commands).toEqual([{ id: "base" }, { id: "plugin" }])
58
+ })
59
+
60
+ test("handles corrupted cache by returning empty config", async () => {
61
+ fs.existsSync.mockReturnValue(true)
62
+ fs.readFileSync.mockReturnValue("invalid-json")
63
+ const config = await loadConfig()
64
+ expect(config.commands).toEqual([])
65
+ })
66
+
67
+ test("handles cache with missing commands field", async () => {
68
+ fs.existsSync.mockReturnValue(true)
69
+ fs.readFileSync.mockReturnValue(JSON.stringify({ version: "2" }))
70
+ const config = await loadConfig()
71
+ expect(config.commands).toEqual([])
72
+ })
73
+ })
74
+
75
+ describe("syncConfig", () => {
76
+ test("fetches and writes cache", async () => {
77
+ fs.existsSync.mockReturnValue(false) // Trigger mkdirSync
78
+ const mockConfig = { version: "2", mcp_servers: [], specs: [], commands: [] }
79
+ global.fetch.mockResolvedValue({
80
+ ok: true,
81
+ json: () => Promise.resolve(mockConfig)
82
+ })
83
+
84
+ const result = await syncConfig("http://server")
85
+
86
+ expect(fs.mkdirSync).toHaveBeenCalledWith(cacheDir, { recursive: true })
87
+ expect(fs.writeFileSync).toHaveBeenCalledWith(
88
+ cacheFile,
89
+ expect.stringContaining('"version": "2"')
90
+ )
91
+ expect(result.version).toBe("2")
92
+ expect(result.fetchedAt).toBe(1000000)
93
+ })
94
+
95
+ test("throws if server not provided", async () => {
96
+ await expect(syncConfig()).rejects.toThrow("SUPERCLI_SERVER is not configured")
97
+ })
98
+
99
+ test("throws if fetch fails", async () => {
100
+ global.fetch.mockResolvedValue({ ok: false, status: 500, statusText: "Internal Error" })
101
+ await expect(syncConfig("http://server")).rejects.toThrow("Failed to fetch config: 500 Internal Error")
102
+ })
103
+
104
+ test("handles missing mcp_servers or specs in main response", async () => {
105
+ global.fetch
106
+ .mockResolvedValueOnce({
107
+ ok: true,
108
+ json: () => Promise.resolve({ version: "2" })
109
+ })
110
+ .mockResolvedValueOnce({
111
+ ok: true,
112
+ json: () => Promise.resolve([{ name: "mcp1" }])
113
+ })
114
+ .mockResolvedValueOnce({
115
+ ok: true,
116
+ json: () => Promise.resolve([{ name: "spec1" }])
117
+ })
118
+
119
+ const config = await syncConfig("http://server")
120
+ expect(config.mcp_servers).toEqual([{ name: "mcp1" }])
121
+ expect(config.specs).toEqual([{ name: "spec1" }])
122
+ })
123
+
124
+ test("handles non-ok response from secondary fetches", async () => {
125
+ global.fetch
126
+ .mockResolvedValueOnce({
127
+ ok: true,
128
+ json: () => Promise.resolve({ version: "2" })
129
+ })
130
+ .mockResolvedValueOnce({ ok: false })
131
+ .mockResolvedValueOnce({ ok: false })
132
+
133
+ const config = await syncConfig("http://server")
134
+ expect(config.mcp_servers).toEqual([])
135
+ expect(config.specs).toEqual([])
136
+ })
137
+
138
+ test("handles network errors in secondary mcp/specs fetches", async () => {
139
+ global.fetch
140
+ .mockResolvedValueOnce({
141
+ ok: true,
142
+ json: () => Promise.resolve({ version: "2" })
143
+ })
144
+ .mockRejectedValueOnce(new Error("network error"))
145
+ .mockRejectedValueOnce(new Error("network error"))
146
+
147
+ const config = await syncConfig("http://server")
148
+ expect(config.mcp_servers).toEqual([])
149
+ expect(config.specs).toEqual([])
150
+ })
151
+
152
+ test("ensures commands is an array if missing", async () => {
153
+ global.fetch.mockResolvedValue({
154
+ ok: true,
155
+ json: () => Promise.resolve({ version: "2", mcp_servers: [], specs: [] })
156
+ })
157
+ const config = await syncConfig("http://server")
158
+ expect(config.commands).toEqual([])
159
+ })
160
+ })
161
+
162
+ describe("MCP Server management", () => {
163
+ test("setMcpServer adds new server to empty config", async () => {
164
+ fs.existsSync.mockReturnValue(false)
165
+ await setMcpServer("new", "http://new")
166
+
167
+ const lastWrite = JSON.parse(fs.writeFileSync.mock.calls[0][1])
168
+ expect(lastWrite.mcp_servers).toContainEqual({ name: "new", url: "http://new" })
169
+ })
170
+
171
+ test("setMcpServer updates existing server and sorts correctly", async () => {
172
+ fs.existsSync.mockReturnValue(true)
173
+ fs.readFileSync.mockReturnValue(JSON.stringify({
174
+ mcp_servers: [
175
+ { name: "z", url: "http://z" },
176
+ { name: "m", url: "http://m" },
177
+ { name: "a", url: "http://a" }
178
+ ]
179
+ }))
180
+
181
+ await setMcpServer("m", "http://updated")
182
+
183
+ const lastWrite = JSON.parse(fs.writeFileSync.mock.calls[0][1])
184
+ expect(lastWrite.mcp_servers.map(s => s.name)).toEqual(["a", "m", "z"])
185
+ })
186
+
187
+ test("setMcpServer handles config without mcp_servers array", async () => {
188
+ fs.existsSync.mockReturnValue(true)
189
+ fs.readFileSync.mockReturnValue(JSON.stringify({ version: "1" }))
190
+ await setMcpServer("s1", "u1")
191
+ const lastWrite = JSON.parse(fs.writeFileSync.mock.calls[0][1])
192
+ expect(lastWrite.mcp_servers).toEqual([{ name: "s1", url: "u1" }])
193
+ })
194
+
195
+ test("removeMcpServer removes existing server", async () => {
196
+ fs.existsSync.mockReturnValue(true)
197
+ fs.readFileSync.mockReturnValue(JSON.stringify({
198
+ mcp_servers: [{ name: "target", url: "http://target" }, { name: "other" }]
199
+ }))
200
+
201
+ const removed = await removeMcpServer("target")
202
+ expect(removed).toBe(true)
203
+
204
+ const lastWrite = JSON.parse(fs.writeFileSync.mock.calls[0][1])
205
+ expect(lastWrite.mcp_servers).toHaveLength(1)
206
+ expect(lastWrite.mcp_servers[0].name).toBe("other")
207
+ })
208
+
209
+ test("removeMcpServer returns false if not found", async () => {
210
+ fs.existsSync.mockReturnValue(true)
211
+ fs.readFileSync.mockReturnValue(JSON.stringify({
212
+ mcp_servers: [{ name: "other" }]
213
+ }))
214
+ const removed = await removeMcpServer("missing")
215
+ expect(removed).toBe(false)
216
+ })
217
+
218
+ test("removeMcpServer handles empty config", async () => {
219
+ fs.existsSync.mockReturnValue(false)
220
+ const removed = await removeMcpServer("any")
221
+ expect(removed).toBe(false)
222
+ })
223
+
224
+ test("listMcpServers returns servers from config", async () => {
225
+ fs.existsSync.mockReturnValue(true)
226
+ fs.readFileSync.mockReturnValue(JSON.stringify({
227
+ mcp_servers: [{ name: "s1" }]
228
+ }))
229
+ const servers = await listMcpServers()
230
+ expect(servers).toEqual([{ name: "s1" }])
231
+ })
232
+
233
+ test("listMcpServers returns empty array if field missing", async () => {
234
+ fs.existsSync.mockReturnValue(true)
235
+ fs.readFileSync.mockReturnValue(JSON.stringify({ version: "1" }))
236
+ const servers = await listMcpServers()
237
+ expect(servers).toEqual([])
238
+ })
239
+
240
+ test("handles null or invalid items in mcp_servers array", async () => {
241
+ fs.existsSync.mockReturnValue(true)
242
+ fs.readFileSync.mockReturnValue(JSON.stringify({
243
+ mcp_servers: [null, { name: 123 }, { name: "z" }]
244
+ }))
245
+
246
+ await setMcpServer("a", "http://a")
247
+ const lastWrite = JSON.parse(fs.writeFileSync.mock.calls[0][1])
248
+ expect(lastWrite.mcp_servers.some(s => s && s.name === "a")).toBe(true)
249
+ expect(lastWrite.mcp_servers.find(s => s && s.name === 123)).toBeUndefined()
250
+
251
+ const removed = await removeMcpServer("z")
252
+ expect(removed).toBe(true)
253
+ })
254
+ })
255
+
256
+ describe("showConfig", () => {
257
+ test("returns message if no cache", async () => {
258
+ fs.existsSync.mockReturnValue(false)
259
+ const result = await showConfig()
260
+ expect(result.cached).toBe(false)
261
+ expect(result.message).toContain("No config cached")
262
+ })
263
+
264
+ test("returns summary of cached config", async () => {
265
+ fs.existsSync.mockReturnValue(true)
266
+ fs.readFileSync.mockReturnValue(JSON.stringify({
267
+ version: "1.0",
268
+ ttl: 3600,
269
+ fetchedAt: 1000000,
270
+ commands: [1, 2],
271
+ mcp_servers: [1],
272
+ specs: [1, 2, 3]
273
+ }))
274
+ listInstalledPlugins.mockReturnValue([1, 2, 3, 4])
275
+
276
+ const result = await showConfig()
277
+ expect(result.version).toBe("1.0")
278
+ expect(result.commands).toBe(2)
279
+ expect(result.plugins).toBe(4)
280
+ expect(result.mcp_servers).toBe(1)
281
+ expect(result.specs).toBe(3)
282
+ expect(result.cacheFile).toBe(cacheFile)
283
+ })
284
+
285
+ test("handles cached config with missing fields in showConfig", async () => {
286
+ fs.existsSync.mockReturnValue(true)
287
+ fs.readFileSync.mockReturnValue(JSON.stringify({
288
+ version: "1.0",
289
+ fetchedAt: 1000000
290
+ }))
291
+ const result = await showConfig()
292
+ expect(result.commands).toBe(0)
293
+ expect(result.mcp_servers).toBe(0)
294
+ expect(result.specs).toBe(0)
295
+ })
296
+ })
297
+ })
@@ -0,0 +1,95 @@
1
+ const fs = require("fs")
2
+ const os = require("os")
3
+ const path = require("path")
4
+ const { execSync, spawnSync } = require("child_process")
5
+
6
+ const CLI = path.join(__dirname, "..", "cli", "supercli.js")
7
+
8
+ function runNoServer(args, options = {}) {
9
+ try {
10
+ const env = { ...process.env }
11
+ delete env.SUPERCLI_SERVER
12
+ const out = execSync(`node ${CLI} ${args}`, {
13
+ encoding: "utf-8",
14
+ timeout: 15000,
15
+ env: { ...env, ...(options.env || {}) }
16
+ })
17
+ return { ok: true, output: out.trim(), code: 0 }
18
+ } catch (err) {
19
+ return {
20
+ ok: false,
21
+ output: (err.stdout || "").trim(),
22
+ stderr: (err.stderr || "").trim(),
23
+ code: err.status
24
+ }
25
+ }
26
+ }
27
+
28
+ function writeFakeDockerBinary(dir) {
29
+ const bin = path.join(dir, "docker")
30
+ fs.writeFileSync(bin, [
31
+ "#!/usr/bin/env node",
32
+ "const args = process.argv.slice(2);",
33
+ "if (args.includes('--version')) { console.log('Docker version 26.1.0, build test'); process.exit(0); }",
34
+ "console.log(JSON.stringify({ ok: true, args }));"
35
+ ].join("\n"), "utf-8")
36
+ fs.chmodSync(bin, 0o755)
37
+ return bin
38
+ }
39
+
40
+ describe("docker plugin", () => {
41
+ const fakeDir = fs.mkdtempSync(path.join(os.tmpdir(), "dcli-docker-"))
42
+ const tempHome = fs.mkdtempSync(path.join(os.tmpdir(), "dcli-home-docker-"))
43
+ writeFakeDockerBinary(fakeDir)
44
+ const env = { ...process.env, PATH: `${fakeDir}:${process.env.PATH || ""}`, SUPERCLI_HOME: tempHome }
45
+
46
+ beforeAll(() => {
47
+ runNoServer("plugins install ./plugins/docker --on-conflict replace --json", { env })
48
+ })
49
+
50
+ afterAll(() => {
51
+ runNoServer("plugins remove docker --json", { env })
52
+ fs.rmSync(fakeDir, { recursive: true, force: true })
53
+ fs.rmSync(tempHome, { recursive: true, force: true })
54
+ })
55
+
56
+ test("routes docker container ls to docker ps", () => {
57
+ const r = runNoServer("docker container ls --json", { env })
58
+ expect(r.ok).toBe(true)
59
+ const data = JSON.parse(r.output)
60
+ expect(data.command).toBe("docker.container.ls")
61
+ expect(data.data.args[0]).toBe("ps")
62
+ })
63
+
64
+ test("maps docker run args and flags", () => {
65
+ const r = runNoServer("docker container run --image nginx:latest --detach --publish 8080:80 --volume /tmp:/tmp --env A=B --name demo --json", { env })
66
+ expect(r.ok).toBe(true)
67
+ const data = JSON.parse(r.output)
68
+ expect(data.command).toBe("docker.container.run")
69
+ expect(data.data.args[0]).toBe("run")
70
+ expect(data.data.args).toContain("nginx:latest")
71
+ expect(data.data.args).toContain("--detach")
72
+ expect(data.data.args).toContain("--publish")
73
+ expect(data.data.args).toContain("8080:80")
74
+ expect(data.data.args).toContain("--env")
75
+ expect(data.data.args).toContain("A=B")
76
+ })
77
+
78
+ test("rejects interactive flags in non-tty mode", () => {
79
+ const r = runNoServer("docker container run --image nginx:latest --interactive --json", { env })
80
+ expect(r.ok).toBe(false)
81
+ expect(r.code).toBe(91)
82
+ const payload = JSON.parse(r.output)
83
+ expect(payload.error.type).toBe("safety_violation")
84
+ })
85
+
86
+ test("can call real docker system version if installed", () => {
87
+ const whichDocker = spawnSync("which", ["docker"], { encoding: "utf-8", timeout: 3000 })
88
+ if (whichDocker.status !== 0) return
89
+
90
+ const r = runNoServer("docker system version --json")
91
+ expect(r.ok).toBe(true)
92
+ const data = JSON.parse(r.output)
93
+ expect(data.command).toBe("docker.system.version")
94
+ })
95
+ })
@@ -0,0 +1,303 @@
1
+ const { execute } = require("../cli/executor")
2
+ const { validateAdapterConfig } = require("../cli/adapter-schema")
3
+ const path = require("path")
4
+
5
+ jest.mock("../cli/adapter-schema")
6
+
7
+ // Mock adapters
8
+ const mockAdapters = {
9
+ process: { execute: jest.fn() },
10
+ builtin: { execute: jest.fn() },
11
+ shell: { execute: jest.fn() },
12
+ http: { execute: jest.fn() },
13
+ mcp: { execute: jest.fn() },
14
+ openapi: { execute: jest.fn() }
15
+ }
16
+
17
+ jest.mock("../cli/adapters/process", () => mockAdapters.process, { virtual: true })
18
+ jest.mock("../cli/adapters/builtin", () => mockAdapters.builtin, { virtual: true })
19
+ jest.mock("../cli/adapters/shell", () => mockAdapters.shell, { virtual: true })
20
+ jest.mock("../cli/adapters/http", () => mockAdapters.http, { virtual: true })
21
+ jest.mock("../cli/adapters/mcp", () => mockAdapters.mcp, { virtual: true })
22
+ jest.mock("../cli/adapters/openapi", () => mockAdapters.openapi, { virtual: true })
23
+
24
+ global.fetch = jest.fn()
25
+
26
+ describe("executor", () => {
27
+ beforeEach(() => {
28
+ jest.clearAllMocks()
29
+ })
30
+
31
+ test("executes basic command through adapter", async () => {
32
+ const cmd = { adapter: "process", namespace: "test", resource: "res", action: "act" }
33
+ const flags = { foo: "bar" }
34
+ const context = {}
35
+
36
+ mockAdapters.process.execute.mockResolvedValue({ ok: true })
37
+
38
+ const result = await execute(cmd, flags, context)
39
+
40
+ expect(validateAdapterConfig).toHaveBeenCalledWith(cmd)
41
+ expect(mockAdapters.process.execute).toHaveBeenCalledWith(cmd, flags, context)
42
+ expect(result).toEqual({ ok: true })
43
+ })
44
+
45
+ test("throws error for unknown adapter", async () => {
46
+ const cmd = { adapter: "nonexistent", namespace: "test", resource: "res", action: "act" }
47
+
48
+ await expect(execute(cmd, {}, {})).rejects.toMatchObject({
49
+ code: 110,
50
+ type: "internal_error"
51
+ })
52
+ })
53
+
54
+ test("executes workflow with multiple steps", async () => {
55
+ const workflow = {
56
+ type: "workflow",
57
+ namespace: "wf",
58
+ resource: "res",
59
+ action: "act",
60
+ steps: [
61
+ "ns1.res1.act1",
62
+ { command: "ns2.res2.act2", args: { extra: "val" } }
63
+ ]
64
+ }
65
+
66
+ const context = {
67
+ config: {
68
+ commands: [
69
+ { namespace: "ns1", resource: "res1", action: "act1", adapter: "process" },
70
+ { namespace: "ns2", resource: "res2", action: "act2", adapter: "builtin" }
71
+ ]
72
+ }
73
+ }
74
+
75
+ mockAdapters.process.execute.mockResolvedValue({ data: "result1" })
76
+ mockAdapters.builtin.execute.mockResolvedValue({ data: "result2" })
77
+
78
+ const result = await execute(workflow, { initial: "flag" }, context)
79
+
80
+ expect(result.steps).toHaveLength(2)
81
+ expect(result.steps[0].result).toEqual({ data: "result1" })
82
+ expect(result.steps[1].result).toEqual({ data: "result2" })
83
+
84
+ // Verify data piping and merging
85
+ expect(mockAdapters.builtin.execute).toHaveBeenCalledWith(
86
+ expect.objectContaining({ namespace: "ns2" }),
87
+ expect.objectContaining({ initial: "flag", extra: "val", data: "result1" }),
88
+ context
89
+ )
90
+ })
91
+
92
+ test("handles workflow step template replacement", async () => {
93
+ const workflow = {
94
+ type: "workflow",
95
+ steps: [
96
+ { command: "ns.res.act1", args: { name: "initial" } },
97
+ { command: "ns.res.act2", args: { greeting: "Hello {{args.user}}", info: "Last was {{step.0.result.data}}" } }
98
+ ]
99
+ }
100
+
101
+ const context = {
102
+ config: {
103
+ commands: [
104
+ { namespace: "ns", resource: "res", action: "act1", adapter: "builtin" },
105
+ { namespace: "ns", resource: "res", action: "act2", adapter: "builtin" }
106
+ ]
107
+ }
108
+ }
109
+
110
+ mockAdapters.builtin.execute
111
+ .mockResolvedValueOnce({ data: "first-result" })
112
+ .mockResolvedValueOnce({ data: "second-result" })
113
+
114
+ await execute(workflow, { user: "Alice" }, context)
115
+
116
+ expect(mockAdapters.builtin.execute).toHaveBeenLastCalledWith(
117
+ expect.anything(),
118
+ expect.objectContaining({
119
+ greeting: "Hello Alice",
120
+ info: "Last was first-result"
121
+ }),
122
+ expect.anything()
123
+ )
124
+ })
125
+
126
+ test("handles workflow template replacement with invalid path", async () => {
127
+ const workflow = {
128
+ type: "workflow",
129
+ steps: [
130
+ { command: "ns.res.act1", args: { name: "initial" } },
131
+ { command: "ns.res.act2", args: { info: "Val is {{step.0.result.nonexistent}}" } }
132
+ ]
133
+ }
134
+
135
+ const context = {
136
+ config: {
137
+ commands: [
138
+ { namespace: "ns", resource: "res", action: "act1", adapter: "builtin" },
139
+ { namespace: "ns", resource: "res", action: "act2", adapter: "builtin" }
140
+ ]
141
+ }
142
+ }
143
+
144
+ mockAdapters.builtin.execute
145
+ .mockResolvedValueOnce({ data: "result" })
146
+ .mockResolvedValueOnce({ ok: true })
147
+
148
+ await execute(workflow, {}, context)
149
+
150
+ expect(mockAdapters.builtin.execute).toHaveBeenLastCalledWith(
151
+ expect.anything(),
152
+ expect.objectContaining({
153
+ info: "Val is "
154
+ }),
155
+ expect.anything()
156
+ )
157
+ })
158
+
159
+ test("handles workflow template replacement with missing step", async () => {
160
+ const workflow = {
161
+ type: "workflow",
162
+ steps: [
163
+ { command: "ns.res.act", args: { info: "Val is {{step.5.result.data}}" } }
164
+ ]
165
+ }
166
+
167
+ const context = {
168
+ config: {
169
+ commands: [
170
+ { namespace: "ns", resource: "res", action: "act", adapter: "builtin" }
171
+ ]
172
+ }
173
+ }
174
+
175
+ mockAdapters.builtin.execute.mockResolvedValue({ ok: true })
176
+
177
+ await execute(workflow, {}, context)
178
+
179
+ expect(mockAdapters.builtin.execute).toHaveBeenCalledWith(
180
+ expect.anything(),
181
+ expect.objectContaining({
182
+ info: "Val is "
183
+ }),
184
+ expect.anything()
185
+ )
186
+ })
187
+
188
+ test("handles workflow template replacement when value is not an object", async () => {
189
+ const workflow = {
190
+ type: "workflow",
191
+ steps: [
192
+ { command: "ns.res.act1", args: { name: "initial" } },
193
+ { command: "ns.res.act2", args: { info: "Val is {{step.0.result.data.sub}}" } }
194
+ ]
195
+ }
196
+
197
+ const context = {
198
+ config: {
199
+ commands: [
200
+ { namespace: "ns", resource: "res", action: "act1", adapter: "builtin" },
201
+ { namespace: "ns", resource: "res", action: "act2", adapter: "builtin" }
202
+ ]
203
+ }
204
+ }
205
+
206
+ // result.data is a string, not an object, so data.sub should hit line 108
207
+ mockAdapters.builtin.execute
208
+ .mockResolvedValueOnce({ data: "not-an-object" })
209
+ .mockResolvedValueOnce({ ok: true })
210
+
211
+ await execute(workflow, {}, context)
212
+
213
+ expect(mockAdapters.builtin.execute).toHaveBeenLastCalledWith(
214
+ expect.anything(),
215
+ expect.objectContaining({
216
+ info: "Val is "
217
+ }),
218
+ expect.anything()
219
+ )
220
+ })
221
+
222
+ test("handles custom adapter loading", async () => {
223
+ const cmd = { adapter: "custom-adapter", namespace: "test", resource: "res", action: "act" }
224
+ const mockCustom = { execute: jest.fn().mockResolvedValue({ ok: true }) }
225
+
226
+ // We need to mock path.resolve and require
227
+ // Actually, we can just mock the whole custom adapter path
228
+ jest.doMock(path.resolve("adapters", "custom-adapter"), () => mockCustom, { virtual: true })
229
+
230
+ const result = await execute(cmd, {}, {})
231
+ expect(result).toEqual({ ok: true })
232
+ expect(mockCustom.execute).toHaveBeenCalled()
233
+ })
234
+
235
+ test("fetches missing command from server during workflow", async () => {
236
+ const workflow = {
237
+ type: "workflow",
238
+ steps: ["remote.res.act"]
239
+ }
240
+
241
+ const context = {
242
+ server: "http://api.test",
243
+ config: { commands: [] }
244
+ }
245
+
246
+ const remoteCmd = { namespace: "remote", resource: "res", action: "act", adapter: "shell" }
247
+
248
+ global.fetch.mockResolvedValue({
249
+ ok: true,
250
+ json: () => Promise.resolve(remoteCmd)
251
+ })
252
+
253
+ mockAdapters.shell.execute.mockResolvedValue({ ok: true })
254
+
255
+ await execute(workflow, {}, context)
256
+
257
+ expect(global.fetch).toHaveBeenCalledWith("http://api.test/api/command/remote/res/act")
258
+ expect(mockAdapters.shell.execute).toHaveBeenCalledWith(remoteCmd, expect.anything(), context)
259
+ })
260
+
261
+ test("throws error if workflow step is invalid", async () => {
262
+ const workflow = {
263
+ type: "workflow",
264
+ steps: ["invalid-step"]
265
+ }
266
+
267
+ await expect(execute(workflow, {}, {})).rejects.toMatchObject({
268
+ code: 85,
269
+ type: "invalid_argument"
270
+ })
271
+ })
272
+
273
+ test("throws error if command not found and no server", async () => {
274
+ const workflow = {
275
+ type: "workflow",
276
+ steps: ["missing.ns.act"]
277
+ }
278
+
279
+ await expect(execute(workflow, {}, { config: { commands: [] } })).rejects.toMatchObject({
280
+ code: 92,
281
+ type: "resource_not_found"
282
+ })
283
+ })
284
+
285
+ test("throws error if server fetch fails", async () => {
286
+ const workflow = {
287
+ type: "workflow",
288
+ steps: ["remote.res.act"]
289
+ }
290
+
291
+ const context = {
292
+ server: "http://api.test",
293
+ config: { commands: [] }
294
+ }
295
+
296
+ global.fetch.mockResolvedValue({ ok: false })
297
+
298
+ await expect(execute(workflow, {}, context)).rejects.toMatchObject({
299
+ code: 92,
300
+ type: "resource_not_found"
301
+ })
302
+ })
303
+ })