plugsuits 1.0.0

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 (560) hide show
  1. package/cli.js +3 -0
  2. package/dist/agent-reasoning-default.test.d.ts +2 -0
  3. package/dist/agent-reasoning-default.test.d.ts.map +1 -0
  4. package/dist/agent-reasoning-default.test.js +38 -0
  5. package/dist/agent-reasoning-default.test.js.map +1 -0
  6. package/dist/agent.d.ts +61 -0
  7. package/dist/agent.d.ts.map +1 -0
  8. package/dist/agent.js +308 -0
  9. package/dist/agent.js.map +1 -0
  10. package/dist/agent.test.d.ts +2 -0
  11. package/dist/agent.test.d.ts.map +1 -0
  12. package/dist/agent.test.js +38 -0
  13. package/dist/agent.test.js.map +1 -0
  14. package/dist/cli-args.d.ts +15 -0
  15. package/dist/cli-args.d.ts.map +1 -0
  16. package/dist/cli-args.js +63 -0
  17. package/dist/cli-args.js.map +1 -0
  18. package/dist/cli-args.test.d.ts +2 -0
  19. package/dist/cli-args.test.d.ts.map +1 -0
  20. package/dist/cli-args.test.js +105 -0
  21. package/dist/cli-args.test.js.map +1 -0
  22. package/dist/commands/aliases-and-tool-fallback.test.d.ts +2 -0
  23. package/dist/commands/aliases-and-tool-fallback.test.d.ts.map +1 -0
  24. package/dist/commands/aliases-and-tool-fallback.test.js +132 -0
  25. package/dist/commands/aliases-and-tool-fallback.test.js.map +1 -0
  26. package/dist/commands/clear.d.ts +3 -0
  27. package/dist/commands/clear.d.ts.map +1 -0
  28. package/dist/commands/clear.js +12 -0
  29. package/dist/commands/clear.js.map +1 -0
  30. package/dist/commands/factories/create-toggle-command.d.ts +13 -0
  31. package/dist/commands/factories/create-toggle-command.d.ts.map +1 -0
  32. package/dist/commands/factories/create-toggle-command.js +38 -0
  33. package/dist/commands/factories/create-toggle-command.js.map +1 -0
  34. package/dist/commands/help.d.ts +3 -0
  35. package/dist/commands/help.d.ts.map +1 -0
  36. package/dist/commands/help.js +23 -0
  37. package/dist/commands/help.js.map +1 -0
  38. package/dist/commands/index.d.ts +18 -0
  39. package/dist/commands/index.d.ts.map +1 -0
  40. package/dist/commands/index.js +82 -0
  41. package/dist/commands/index.js.map +1 -0
  42. package/dist/commands/model.d.ts +15 -0
  43. package/dist/commands/model.d.ts.map +1 -0
  44. package/dist/commands/model.js +100 -0
  45. package/dist/commands/model.js.map +1 -0
  46. package/dist/commands/reasoning-mode.d.ts +3 -0
  47. package/dist/commands/reasoning-mode.d.ts.map +1 -0
  48. package/dist/commands/reasoning-mode.js +47 -0
  49. package/dist/commands/reasoning-mode.js.map +1 -0
  50. package/dist/commands/render.d.ts +19 -0
  51. package/dist/commands/render.d.ts.map +1 -0
  52. package/dist/commands/render.js +140 -0
  53. package/dist/commands/render.js.map +1 -0
  54. package/dist/commands/render.test.d.ts +2 -0
  55. package/dist/commands/render.test.d.ts.map +1 -0
  56. package/dist/commands/render.test.js +36 -0
  57. package/dist/commands/render.test.js.map +1 -0
  58. package/dist/commands/tool-fallback.d.ts +3 -0
  59. package/dist/commands/tool-fallback.d.ts.map +1 -0
  60. package/dist/commands/tool-fallback.js +38 -0
  61. package/dist/commands/tool-fallback.js.map +1 -0
  62. package/dist/commands/translate.d.ts +3 -0
  63. package/dist/commands/translate.d.ts.map +1 -0
  64. package/dist/commands/translate.js +12 -0
  65. package/dist/commands/translate.js.map +1 -0
  66. package/dist/commands/translate.test.d.ts +2 -0
  67. package/dist/commands/translate.test.d.ts.map +1 -0
  68. package/dist/commands/translate.test.js +49 -0
  69. package/dist/commands/translate.test.js.map +1 -0
  70. package/dist/commands/types.d.ts +17 -0
  71. package/dist/commands/types.d.ts.map +1 -0
  72. package/dist/commands/types.js +2 -0
  73. package/dist/commands/types.js.map +1 -0
  74. package/dist/context/environment-context.d.ts +2 -0
  75. package/dist/context/environment-context.d.ts.map +1 -0
  76. package/dist/context/environment-context.js +11 -0
  77. package/dist/context/environment-context.js.map +1 -0
  78. package/dist/context/paths.d.ts +3 -0
  79. package/dist/context/paths.d.ts.map +1 -0
  80. package/dist/context/paths.js +3 -0
  81. package/dist/context/paths.js.map +1 -0
  82. package/dist/context/session.d.ts +4 -0
  83. package/dist/context/session.d.ts.map +1 -0
  84. package/dist/context/session.js +16 -0
  85. package/dist/context/session.js.map +1 -0
  86. package/dist/context/skill-command-prefix.d.ts +4 -0
  87. package/dist/context/skill-command-prefix.d.ts.map +1 -0
  88. package/dist/context/skill-command-prefix.js +15 -0
  89. package/dist/context/skill-command-prefix.js.map +1 -0
  90. package/dist/context/skills-integration.test.d.ts +2 -0
  91. package/dist/context/skills-integration.test.d.ts.map +1 -0
  92. package/dist/context/skills-integration.test.js +87 -0
  93. package/dist/context/skills-integration.test.js.map +1 -0
  94. package/dist/context/skills.d.ts +18 -0
  95. package/dist/context/skills.d.ts.map +1 -0
  96. package/dist/context/skills.js +431 -0
  97. package/dist/context/skills.js.map +1 -0
  98. package/dist/context/skills.test.d.ts +2 -0
  99. package/dist/context/skills.test.d.ts.map +1 -0
  100. package/dist/context/skills.test.js +20 -0
  101. package/dist/context/skills.test.js.map +1 -0
  102. package/dist/context/system-prompt.d.ts +2 -0
  103. package/dist/context/system-prompt.d.ts.map +1 -0
  104. package/dist/context/system-prompt.js +100 -0
  105. package/dist/context/system-prompt.js.map +1 -0
  106. package/dist/context/translation-integration.test.d.ts +2 -0
  107. package/dist/context/translation-integration.test.d.ts.map +1 -0
  108. package/dist/context/translation-integration.test.js +138 -0
  109. package/dist/context/translation-integration.test.js.map +1 -0
  110. package/dist/context/translation.d.ts +21 -0
  111. package/dist/context/translation.d.ts.map +1 -0
  112. package/dist/context/translation.js +82 -0
  113. package/dist/context/translation.js.map +1 -0
  114. package/dist/context/translation.test.d.ts +2 -0
  115. package/dist/context/translation.test.d.ts.map +1 -0
  116. package/dist/context/translation.test.js +129 -0
  117. package/dist/context/translation.test.js.map +1 -0
  118. package/dist/entrypoints/cli-input-rendering.test.d.ts +2 -0
  119. package/dist/entrypoints/cli-input-rendering.test.d.ts.map +1 -0
  120. package/dist/entrypoints/cli-input-rendering.test.js +192 -0
  121. package/dist/entrypoints/cli-input-rendering.test.js.map +1 -0
  122. package/dist/entrypoints/cli.d.ts +3 -0
  123. package/dist/entrypoints/cli.d.ts.map +1 -0
  124. package/dist/entrypoints/cli.js +1268 -0
  125. package/dist/entrypoints/cli.js.map +1 -0
  126. package/dist/entrypoints/headless-agent-config.d.ts +21 -0
  127. package/dist/entrypoints/headless-agent-config.d.ts.map +1 -0
  128. package/dist/entrypoints/headless-agent-config.js +15 -0
  129. package/dist/entrypoints/headless-agent-config.js.map +1 -0
  130. package/dist/entrypoints/headless-agent-config.test.d.ts +2 -0
  131. package/dist/entrypoints/headless-agent-config.test.d.ts.map +1 -0
  132. package/dist/entrypoints/headless-agent-config.test.js +63 -0
  133. package/dist/entrypoints/headless-agent-config.test.js.map +1 -0
  134. package/dist/entrypoints/headless.d.ts +3 -0
  135. package/dist/entrypoints/headless.d.ts.map +1 -0
  136. package/dist/entrypoints/headless.js +396 -0
  137. package/dist/entrypoints/headless.js.map +1 -0
  138. package/dist/env.d.ts +8 -0
  139. package/dist/env.d.ts.map +1 -0
  140. package/dist/env.js +14 -0
  141. package/dist/env.js.map +1 -0
  142. package/dist/friendli-models.d.ts +21 -0
  143. package/dist/friendli-models.d.ts.map +1 -0
  144. package/dist/friendli-models.js +57 -0
  145. package/dist/friendli-models.js.map +1 -0
  146. package/dist/friendli-reasoning.d.ts +10 -0
  147. package/dist/friendli-reasoning.d.ts.map +1 -0
  148. package/dist/friendli-reasoning.js +181 -0
  149. package/dist/friendli-reasoning.js.map +1 -0
  150. package/dist/friendli-reasoning.test.d.ts +2 -0
  151. package/dist/friendli-reasoning.test.d.ts.map +1 -0
  152. package/dist/friendli-reasoning.test.js +77 -0
  153. package/dist/friendli-reasoning.test.js.map +1 -0
  154. package/dist/index.d.ts +3 -0
  155. package/dist/index.d.ts.map +1 -0
  156. package/dist/index.js +3 -0
  157. package/dist/index.js.map +1 -0
  158. package/dist/interaction/colors.d.ts +22 -0
  159. package/dist/interaction/colors.d.ts.map +1 -0
  160. package/dist/interaction/colors.js +24 -0
  161. package/dist/interaction/colors.js.map +1 -0
  162. package/dist/interaction/pi-tui-stream-renderer.d.ts +19 -0
  163. package/dist/interaction/pi-tui-stream-renderer.d.ts.map +1 -0
  164. package/dist/interaction/pi-tui-stream-renderer.js +1509 -0
  165. package/dist/interaction/pi-tui-stream-renderer.js.map +1 -0
  166. package/dist/interaction/pi-tui-stream-renderer.test.d.ts +2 -0
  167. package/dist/interaction/pi-tui-stream-renderer.test.d.ts.map +1 -0
  168. package/dist/interaction/pi-tui-stream-renderer.test.js +1314 -0
  169. package/dist/interaction/pi-tui-stream-renderer.test.js.map +1 -0
  170. package/dist/interaction/spinner.d.ts +13 -0
  171. package/dist/interaction/spinner.d.ts.map +1 -0
  172. package/dist/interaction/spinner.js +51 -0
  173. package/dist/interaction/spinner.js.map +1 -0
  174. package/dist/middleware/index.d.ts +7 -0
  175. package/dist/middleware/index.d.ts.map +1 -0
  176. package/dist/middleware/index.js +15 -0
  177. package/dist/middleware/index.js.map +1 -0
  178. package/dist/middleware/todo-continuation.d.ts +11 -0
  179. package/dist/middleware/todo-continuation.d.ts.map +1 -0
  180. package/dist/middleware/todo-continuation.js +103 -0
  181. package/dist/middleware/todo-continuation.js.map +1 -0
  182. package/dist/middleware/trim-leading-newlines.d.ts +3 -0
  183. package/dist/middleware/trim-leading-newlines.d.ts.map +1 -0
  184. package/dist/middleware/trim-leading-newlines.js +49 -0
  185. package/dist/middleware/trim-leading-newlines.js.map +1 -0
  186. package/dist/reasoning-mode.d.ts +5 -0
  187. package/dist/reasoning-mode.d.ts.map +1 -0
  188. package/dist/reasoning-mode.js +30 -0
  189. package/dist/reasoning-mode.js.map +1 -0
  190. package/dist/reasoning-mode.test.d.ts +2 -0
  191. package/dist/reasoning-mode.test.d.ts.map +1 -0
  192. package/dist/reasoning-mode.test.js +22 -0
  193. package/dist/reasoning-mode.test.js.map +1 -0
  194. package/dist/tool-fallback-mode.d.ts +6 -0
  195. package/dist/tool-fallback-mode.d.ts.map +1 -0
  196. package/dist/tool-fallback-mode.js +25 -0
  197. package/dist/tool-fallback-mode.js.map +1 -0
  198. package/dist/tools/execute/shell-execute.d.ts +17 -0
  199. package/dist/tools/execute/shell-execute.d.ts.map +1 -0
  200. package/dist/tools/execute/shell-execute.js +55 -0
  201. package/dist/tools/execute/shell-execute.js.map +1 -0
  202. package/dist/tools/execute/shell-execute.test.d.ts +2 -0
  203. package/dist/tools/execute/shell-execute.test.d.ts.map +1 -0
  204. package/dist/tools/execute/shell-execute.test.js +86 -0
  205. package/dist/tools/execute/shell-execute.test.js.map +1 -0
  206. package/dist/tools/execute/shell-interact.d.ts +10 -0
  207. package/dist/tools/execute/shell-interact.d.ts.map +1 -0
  208. package/dist/tools/execute/shell-interact.js +122 -0
  209. package/dist/tools/execute/shell-interact.js.map +1 -0
  210. package/dist/tools/execute/shell-interact.test.d.ts +2 -0
  211. package/dist/tools/execute/shell-interact.test.d.ts.map +1 -0
  212. package/dist/tools/execute/shell-interact.test.js +175 -0
  213. package/dist/tools/execute/shell-interact.test.js.map +1 -0
  214. package/dist/tools/explore/glob.d.ts +15 -0
  215. package/dist/tools/explore/glob.d.ts.map +1 -0
  216. package/dist/tools/explore/glob.js +107 -0
  217. package/dist/tools/explore/glob.js.map +1 -0
  218. package/dist/tools/explore/glob.test.d.ts +2 -0
  219. package/dist/tools/explore/glob.test.d.ts.map +1 -0
  220. package/dist/tools/explore/glob.test.js +183 -0
  221. package/dist/tools/explore/glob.test.js.map +1 -0
  222. package/dist/tools/explore/grep.d.ts +27 -0
  223. package/dist/tools/explore/grep.d.ts.map +1 -0
  224. package/dist/tools/explore/grep.js +203 -0
  225. package/dist/tools/explore/grep.js.map +1 -0
  226. package/dist/tools/explore/grep.test.d.ts +2 -0
  227. package/dist/tools/explore/grep.test.d.ts.map +1 -0
  228. package/dist/tools/explore/grep.test.js +132 -0
  229. package/dist/tools/explore/grep.test.js.map +1 -0
  230. package/dist/tools/explore/read-file.d.ts +23 -0
  231. package/dist/tools/explore/read-file.d.ts.map +1 -0
  232. package/dist/tools/explore/read-file.js +84 -0
  233. package/dist/tools/explore/read-file.js.map +1 -0
  234. package/dist/tools/explore/read-file.test.d.ts +2 -0
  235. package/dist/tools/explore/read-file.test.d.ts.map +1 -0
  236. package/dist/tools/explore/read-file.test.js +278 -0
  237. package/dist/tools/explore/read-file.test.js.map +1 -0
  238. package/dist/tools/index.d.ts +71 -0
  239. package/dist/tools/index.d.ts.map +1 -0
  240. package/dist/tools/index.js +26 -0
  241. package/dist/tools/index.js.map +1 -0
  242. package/dist/tools/modify/delete-file.d.ts +19 -0
  243. package/dist/tools/modify/delete-file.d.ts.map +1 -0
  244. package/dist/tools/modify/delete-file.js +71 -0
  245. package/dist/tools/modify/delete-file.js.map +1 -0
  246. package/dist/tools/modify/delete-file.test.d.ts +2 -0
  247. package/dist/tools/modify/delete-file.test.d.ts.map +1 -0
  248. package/dist/tools/modify/delete-file.test.js +136 -0
  249. package/dist/tools/modify/delete-file.test.js.map +1 -0
  250. package/dist/tools/modify/edit-file-diagnostics.d.ts +17 -0
  251. package/dist/tools/modify/edit-file-diagnostics.d.ts.map +1 -0
  252. package/dist/tools/modify/edit-file-diagnostics.js +157 -0
  253. package/dist/tools/modify/edit-file-diagnostics.js.map +1 -0
  254. package/dist/tools/modify/edit-file-repair.d.ts +13 -0
  255. package/dist/tools/modify/edit-file-repair.d.ts.map +1 -0
  256. package/dist/tools/modify/edit-file-repair.js +135 -0
  257. package/dist/tools/modify/edit-file-repair.js.map +1 -0
  258. package/dist/tools/modify/edit-file-stress.test.d.ts +2 -0
  259. package/dist/tools/modify/edit-file-stress.test.d.ts.map +1 -0
  260. package/dist/tools/modify/edit-file-stress.test.js +163 -0
  261. package/dist/tools/modify/edit-file-stress.test.js.map +1 -0
  262. package/dist/tools/modify/edit-file-validation.d.ts +9 -0
  263. package/dist/tools/modify/edit-file-validation.d.ts.map +1 -0
  264. package/dist/tools/modify/edit-file-validation.js +86 -0
  265. package/dist/tools/modify/edit-file-validation.js.map +1 -0
  266. package/dist/tools/modify/edit-file-whitespace.test.d.ts +2 -0
  267. package/dist/tools/modify/edit-file-whitespace.test.d.ts.map +1 -0
  268. package/dist/tools/modify/edit-file-whitespace.test.js +90 -0
  269. package/dist/tools/modify/edit-file-whitespace.test.js.map +1 -0
  270. package/dist/tools/modify/edit-file.d.ts +33 -0
  271. package/dist/tools/modify/edit-file.d.ts.map +1 -0
  272. package/dist/tools/modify/edit-file.js +177 -0
  273. package/dist/tools/modify/edit-file.js.map +1 -0
  274. package/dist/tools/modify/edit-file.test.d.ts +2 -0
  275. package/dist/tools/modify/edit-file.test.d.ts.map +1 -0
  276. package/dist/tools/modify/edit-file.test.js +948 -0
  277. package/dist/tools/modify/edit-file.test.js.map +1 -0
  278. package/dist/tools/modify/write-file.d.ts +17 -0
  279. package/dist/tools/modify/write-file.d.ts.map +1 -0
  280. package/dist/tools/modify/write-file.js +39 -0
  281. package/dist/tools/modify/write-file.js.map +1 -0
  282. package/dist/tools/modify/write-file.test.d.ts +2 -0
  283. package/dist/tools/modify/write-file.test.d.ts.map +1 -0
  284. package/dist/tools/modify/write-file.test.js +168 -0
  285. package/dist/tools/modify/write-file.test.js.map +1 -0
  286. package/dist/tools/planning/load-skill.d.ts +13 -0
  287. package/dist/tools/planning/load-skill.d.ts.map +1 -0
  288. package/dist/tools/planning/load-skill.js +101 -0
  289. package/dist/tools/planning/load-skill.js.map +1 -0
  290. package/dist/tools/planning/load-skill.test.d.ts +2 -0
  291. package/dist/tools/planning/load-skill.test.d.ts.map +1 -0
  292. package/dist/tools/planning/load-skill.test.js +37 -0
  293. package/dist/tools/planning/load-skill.test.js.map +1 -0
  294. package/dist/tools/planning/todo-write.d.ts +49 -0
  295. package/dist/tools/planning/todo-write.d.ts.map +1 -0
  296. package/dist/tools/planning/todo-write.js +118 -0
  297. package/dist/tools/planning/todo-write.js.map +1 -0
  298. package/dist/tools/planning/todo-write.test.d.ts +2 -0
  299. package/dist/tools/planning/todo-write.test.d.ts.map +1 -0
  300. package/dist/tools/planning/todo-write.test.js +82 -0
  301. package/dist/tools/planning/todo-write.test.js.map +1 -0
  302. package/dist/tools/utils/execute/format-utils.d.ts +4 -0
  303. package/dist/tools/utils/execute/format-utils.d.ts.map +1 -0
  304. package/dist/tools/utils/execute/format-utils.js +31 -0
  305. package/dist/tools/utils/execute/format-utils.js.map +1 -0
  306. package/dist/tools/utils/execute/format-utils.test.d.ts +2 -0
  307. package/dist/tools/utils/execute/format-utils.test.d.ts.map +1 -0
  308. package/dist/tools/utils/execute/format-utils.test.js +40 -0
  309. package/dist/tools/utils/execute/format-utils.test.js.map +1 -0
  310. package/dist/tools/utils/execute/noninteractive-wrapper.d.ts +12 -0
  311. package/dist/tools/utils/execute/noninteractive-wrapper.d.ts.map +1 -0
  312. package/dist/tools/utils/execute/noninteractive-wrapper.js +269 -0
  313. package/dist/tools/utils/execute/noninteractive-wrapper.js.map +1 -0
  314. package/dist/tools/utils/execute/noninteractive-wrapper.test.d.ts +2 -0
  315. package/dist/tools/utils/execute/noninteractive-wrapper.test.d.ts.map +1 -0
  316. package/dist/tools/utils/execute/noninteractive-wrapper.test.js +233 -0
  317. package/dist/tools/utils/execute/noninteractive-wrapper.test.js.map +1 -0
  318. package/dist/tools/utils/execute/output-handler.d.ts +14 -0
  319. package/dist/tools/utils/execute/output-handler.d.ts.map +1 -0
  320. package/dist/tools/utils/execute/output-handler.js +71 -0
  321. package/dist/tools/utils/execute/output-handler.js.map +1 -0
  322. package/dist/tools/utils/execute/output-handler.test.d.ts +2 -0
  323. package/dist/tools/utils/execute/output-handler.test.d.ts.map +1 -0
  324. package/dist/tools/utils/execute/output-handler.test.js +58 -0
  325. package/dist/tools/utils/execute/output-handler.test.js.map +1 -0
  326. package/dist/tools/utils/execute/process-manager.d.ts +17 -0
  327. package/dist/tools/utils/execute/process-manager.d.ts.map +1 -0
  328. package/dist/tools/utils/execute/process-manager.js +229 -0
  329. package/dist/tools/utils/execute/process-manager.js.map +1 -0
  330. package/dist/tools/utils/execute/process-manager.test.d.ts +2 -0
  331. package/dist/tools/utils/execute/process-manager.test.d.ts.map +1 -0
  332. package/dist/tools/utils/execute/process-manager.test.js +139 -0
  333. package/dist/tools/utils/execute/process-manager.test.js.map +1 -0
  334. package/dist/tools/utils/execute/shell-detection.d.ts +3 -0
  335. package/dist/tools/utils/execute/shell-detection.d.ts.map +1 -0
  336. package/dist/tools/utils/execute/shell-detection.js +56 -0
  337. package/dist/tools/utils/execute/shell-detection.js.map +1 -0
  338. package/dist/tools/utils/execute/shell-detection.test.d.ts +2 -0
  339. package/dist/tools/utils/execute/shell-detection.test.d.ts.map +1 -0
  340. package/dist/tools/utils/execute/shell-detection.test.js +86 -0
  341. package/dist/tools/utils/execute/shell-detection.test.js.map +1 -0
  342. package/dist/tools/utils/hashline/autocorrect-replacement-lines.d.ts +5 -0
  343. package/dist/tools/utils/hashline/autocorrect-replacement-lines.d.ts.map +1 -0
  344. package/dist/tools/utils/hashline/autocorrect-replacement-lines.js +113 -0
  345. package/dist/tools/utils/hashline/autocorrect-replacement-lines.js.map +1 -0
  346. package/dist/tools/utils/hashline/constants.d.ts +5 -0
  347. package/dist/tools/utils/hashline/constants.d.ts.map +1 -0
  348. package/dist/tools/utils/hashline/constants.js +11 -0
  349. package/dist/tools/utils/hashline/constants.js.map +1 -0
  350. package/dist/tools/utils/hashline/diff-utils.d.ts +7 -0
  351. package/dist/tools/utils/hashline/diff-utils.d.ts.map +1 -0
  352. package/dist/tools/utils/hashline/diff-utils.js +50 -0
  353. package/dist/tools/utils/hashline/diff-utils.js.map +1 -0
  354. package/dist/tools/utils/hashline/diff-utils.test.d.ts +2 -0
  355. package/dist/tools/utils/hashline/diff-utils.test.d.ts.map +1 -0
  356. package/dist/tools/utils/hashline/diff-utils.test.js +46 -0
  357. package/dist/tools/utils/hashline/diff-utils.test.js.map +1 -0
  358. package/dist/tools/utils/hashline/edit-deduplication.d.ts +6 -0
  359. package/dist/tools/utils/hashline/edit-deduplication.d.ts.map +1 -0
  360. package/dist/tools/utils/hashline/edit-deduplication.js +32 -0
  361. package/dist/tools/utils/hashline/edit-deduplication.js.map +1 -0
  362. package/dist/tools/utils/hashline/edit-operation-primitives.d.ts +11 -0
  363. package/dist/tools/utils/hashline/edit-operation-primitives.d.ts.map +1 -0
  364. package/dist/tools/utils/hashline/edit-operation-primitives.js +93 -0
  365. package/dist/tools/utils/hashline/edit-operation-primitives.js.map +1 -0
  366. package/dist/tools/utils/hashline/edit-operations.d.ts +9 -0
  367. package/dist/tools/utils/hashline/edit-operations.d.ts.map +1 -0
  368. package/dist/tools/utils/hashline/edit-operations.js +101 -0
  369. package/dist/tools/utils/hashline/edit-operations.js.map +1 -0
  370. package/dist/tools/utils/hashline/edit-operations.test.d.ts +2 -0
  371. package/dist/tools/utils/hashline/edit-operations.test.d.ts.map +1 -0
  372. package/dist/tools/utils/hashline/edit-operations.test.js +135 -0
  373. package/dist/tools/utils/hashline/edit-operations.test.js.map +1 -0
  374. package/dist/tools/utils/hashline/edit-ordering.d.ts +5 -0
  375. package/dist/tools/utils/hashline/edit-ordering.d.ts.map +1 -0
  376. package/dist/tools/utils/hashline/edit-ordering.js +54 -0
  377. package/dist/tools/utils/hashline/edit-ordering.js.map +1 -0
  378. package/dist/tools/utils/hashline/edit-text-normalization.d.ts +9 -0
  379. package/dist/tools/utils/hashline/edit-text-normalization.d.ts.map +1 -0
  380. package/dist/tools/utils/hashline/edit-text-normalization.js +135 -0
  381. package/dist/tools/utils/hashline/edit-text-normalization.js.map +1 -0
  382. package/dist/tools/utils/hashline/file-text-canonicalization.d.ts +8 -0
  383. package/dist/tools/utils/hashline/file-text-canonicalization.d.ts.map +1 -0
  384. package/dist/tools/utils/hashline/file-text-canonicalization.js +42 -0
  385. package/dist/tools/utils/hashline/file-text-canonicalization.js.map +1 -0
  386. package/dist/tools/utils/hashline/hash-computation.d.ts +14 -0
  387. package/dist/tools/utils/hashline/hash-computation.d.ts.map +1 -0
  388. package/dist/tools/utils/hashline/hash-computation.js +158 -0
  389. package/dist/tools/utils/hashline/hash-computation.js.map +1 -0
  390. package/dist/tools/utils/hashline/hash-computation.test.d.ts +2 -0
  391. package/dist/tools/utils/hashline/hash-computation.test.d.ts.map +1 -0
  392. package/dist/tools/utils/hashline/hash-computation.test.js +63 -0
  393. package/dist/tools/utils/hashline/hash-computation.test.js.map +1 -0
  394. package/dist/tools/utils/hashline/hashline-chunk-formatter.d.ts +11 -0
  395. package/dist/tools/utils/hashline/hashline-chunk-formatter.d.ts.map +1 -0
  396. package/dist/tools/utils/hashline/hashline-chunk-formatter.js +41 -0
  397. package/dist/tools/utils/hashline/hashline-chunk-formatter.js.map +1 -0
  398. package/dist/tools/utils/hashline/hashline-edit-diff.d.ts +2 -0
  399. package/dist/tools/utils/hashline/hashline-edit-diff.d.ts.map +1 -0
  400. package/dist/tools/utils/hashline/hashline-edit-diff.js +27 -0
  401. package/dist/tools/utils/hashline/hashline-edit-diff.js.map +1 -0
  402. package/dist/tools/utils/hashline/index.d.ts +14 -0
  403. package/dist/tools/utils/hashline/index.d.ts.map +1 -0
  404. package/dist/tools/utils/hashline/index.js +11 -0
  405. package/dist/tools/utils/hashline/index.js.map +1 -0
  406. package/dist/tools/utils/hashline/merge-expansion.d.ts +4 -0
  407. package/dist/tools/utils/hashline/merge-expansion.d.ts.map +1 -0
  408. package/dist/tools/utils/hashline/merge-expansion.js +105 -0
  409. package/dist/tools/utils/hashline/merge-expansion.js.map +1 -0
  410. package/dist/tools/utils/hashline/normalize-edits.d.ts +11 -0
  411. package/dist/tools/utils/hashline/normalize-edits.d.ts.map +1 -0
  412. package/dist/tools/utils/hashline/normalize-edits.js +81 -0
  413. package/dist/tools/utils/hashline/normalize-edits.js.map +1 -0
  414. package/dist/tools/utils/hashline/types.d.ts +18 -0
  415. package/dist/tools/utils/hashline/types.d.ts.map +1 -0
  416. package/dist/tools/utils/hashline/types.js +2 -0
  417. package/dist/tools/utils/hashline/types.js.map +1 -0
  418. package/dist/tools/utils/hashline/validation.d.ts +19 -0
  419. package/dist/tools/utils/hashline/validation.d.ts.map +1 -0
  420. package/dist/tools/utils/hashline/validation.js +161 -0
  421. package/dist/tools/utils/hashline/validation.js.map +1 -0
  422. package/dist/tools/utils/hashline/validation.test.d.ts +2 -0
  423. package/dist/tools/utils/hashline/validation.test.d.ts.map +1 -0
  424. package/dist/tools/utils/hashline/validation.test.js +86 -0
  425. package/dist/tools/utils/hashline/validation.test.js.map +1 -0
  426. package/dist/tools/utils/safety-utils.d.ts +66 -0
  427. package/dist/tools/utils/safety-utils.d.ts.map +1 -0
  428. package/dist/tools/utils/safety-utils.js +681 -0
  429. package/dist/tools/utils/safety-utils.js.map +1 -0
  430. package/dist/utils/tools-manager.d.ts +16 -0
  431. package/dist/utils/tools-manager.d.ts.map +1 -0
  432. package/dist/utils/tools-manager.js +257 -0
  433. package/dist/utils/tools-manager.js.map +1 -0
  434. package/package.json +49 -0
  435. package/src/AGENTS.md +52 -0
  436. package/src/agent-reasoning-default.test.ts +48 -0
  437. package/src/agent.test.ts +49 -0
  438. package/src/agent.ts +455 -0
  439. package/src/cli-args.test.ts +152 -0
  440. package/src/cli-args.ts +90 -0
  441. package/src/commands/aliases-and-tool-fallback.test.ts +172 -0
  442. package/src/commands/clear.ts +14 -0
  443. package/src/commands/factories/create-toggle-command.ts +68 -0
  444. package/src/commands/help.ts +30 -0
  445. package/src/commands/index.ts +125 -0
  446. package/src/commands/model.ts +146 -0
  447. package/src/commands/reasoning-mode.ts +55 -0
  448. package/src/commands/render.test.ts +47 -0
  449. package/src/commands/render.ts +205 -0
  450. package/src/commands/tool-fallback.ts +47 -0
  451. package/src/commands/translate.test.ts +62 -0
  452. package/src/commands/translate.ts +14 -0
  453. package/src/commands/types.ts +18 -0
  454. package/src/context/environment-context.ts +11 -0
  455. package/src/context/paths.ts +2 -0
  456. package/src/context/session.ts +18 -0
  457. package/src/context/skill-command-prefix.ts +18 -0
  458. package/src/context/skills-integration.test.ts +113 -0
  459. package/src/context/skills.test.ts +25 -0
  460. package/src/context/skills.ts +566 -0
  461. package/src/context/system-prompt.ts +100 -0
  462. package/src/context/translation-integration.test.ts +194 -0
  463. package/src/context/translation.test.ts +186 -0
  464. package/src/context/translation.ts +122 -0
  465. package/src/entrypoints/AGENTS.md +33 -0
  466. package/src/entrypoints/cli-input-rendering.test.ts +236 -0
  467. package/src/entrypoints/cli.ts +1845 -0
  468. package/src/entrypoints/headless-agent-config.test.ts +82 -0
  469. package/src/entrypoints/headless-agent-config.ts +42 -0
  470. package/src/entrypoints/headless.ts +622 -0
  471. package/src/env.ts +14 -0
  472. package/src/friendli-models.ts +81 -0
  473. package/src/friendli-reasoning.test.ts +147 -0
  474. package/src/friendli-reasoning.ts +280 -0
  475. package/src/index.ts +3 -0
  476. package/src/interaction/colors.ts +24 -0
  477. package/src/interaction/pi-tui-stream-renderer.test.ts +1471 -0
  478. package/src/interaction/pi-tui-stream-renderer.ts +2150 -0
  479. package/src/interaction/spinner.ts +61 -0
  480. package/src/middleware/index.ts +32 -0
  481. package/src/middleware/todo-continuation.ts +128 -0
  482. package/src/middleware/trim-leading-newlines.ts +66 -0
  483. package/src/reasoning-mode.test.ts +24 -0
  484. package/src/reasoning-mode.ts +40 -0
  485. package/src/skills/example/SKILL.md +44 -0
  486. package/src/skills/example/references/api.md +37 -0
  487. package/src/skills/example/scripts/setup.sh +13 -0
  488. package/src/skills/git-workflow.md +405 -0
  489. package/src/tool-fallback-mode.ts +34 -0
  490. package/src/tools/AGENTS.md +44 -0
  491. package/src/tools/execute/shell-execute.test.ts +114 -0
  492. package/src/tools/execute/shell-execute.ts +74 -0
  493. package/src/tools/execute/shell-execute.txt +27 -0
  494. package/src/tools/execute/shell-interact.test.ts +236 -0
  495. package/src/tools/execute/shell-interact.ts +151 -0
  496. package/src/tools/execute/shell-interact.txt +15 -0
  497. package/src/tools/explore/glob-files.txt +8 -0
  498. package/src/tools/explore/glob.test.ts +217 -0
  499. package/src/tools/explore/glob.ts +137 -0
  500. package/src/tools/explore/grep-files.txt +12 -0
  501. package/src/tools/explore/grep.test.ts +183 -0
  502. package/src/tools/explore/grep.ts +266 -0
  503. package/src/tools/explore/read-file.test.ts +355 -0
  504. package/src/tools/explore/read-file.ts +102 -0
  505. package/src/tools/explore/read-file.txt +24 -0
  506. package/src/tools/index.ts +29 -0
  507. package/src/tools/modify/AGENTS.md +38 -0
  508. package/src/tools/modify/delete-file.test.ts +200 -0
  509. package/src/tools/modify/delete-file.ts +95 -0
  510. package/src/tools/modify/delete-file.txt +9 -0
  511. package/src/tools/modify/edit-file-diagnostics.ts +210 -0
  512. package/src/tools/modify/edit-file-repair.ts +183 -0
  513. package/src/tools/modify/edit-file-stress.test.ts +200 -0
  514. package/src/tools/modify/edit-file-validation.ts +134 -0
  515. package/src/tools/modify/edit-file-whitespace.test.ts +117 -0
  516. package/src/tools/modify/edit-file.test.ts +1231 -0
  517. package/src/tools/modify/edit-file.ts +252 -0
  518. package/src/tools/modify/edit-file.txt +73 -0
  519. package/src/tools/modify/write-file.test.ts +240 -0
  520. package/src/tools/modify/write-file.ts +56 -0
  521. package/src/tools/modify/write-file.txt +9 -0
  522. package/src/tools/planning/load-skill.test.ts +48 -0
  523. package/src/tools/planning/load-skill.ts +136 -0
  524. package/src/tools/planning/load-skill.txt +6 -0
  525. package/src/tools/planning/todo-write.test.ts +91 -0
  526. package/src/tools/planning/todo-write.ts +141 -0
  527. package/src/tools/planning/todo-write.txt +7 -0
  528. package/src/tools/utils/execute/format-utils.test.ts +53 -0
  529. package/src/tools/utils/execute/format-utils.ts +37 -0
  530. package/src/tools/utils/execute/noninteractive-wrapper.test.ts +306 -0
  531. package/src/tools/utils/execute/noninteractive-wrapper.ts +314 -0
  532. package/src/tools/utils/execute/output-handler.test.ts +72 -0
  533. package/src/tools/utils/execute/output-handler.ts +101 -0
  534. package/src/tools/utils/execute/process-manager.test.ts +175 -0
  535. package/src/tools/utils/execute/process-manager.ts +310 -0
  536. package/src/tools/utils/execute/shell-detection.test.ts +112 -0
  537. package/src/tools/utils/execute/shell-detection.ts +72 -0
  538. package/src/tools/utils/hashline/autocorrect-replacement-lines.ts +159 -0
  539. package/src/tools/utils/hashline/constants.ts +13 -0
  540. package/src/tools/utils/hashline/diff-utils.test.ts +61 -0
  541. package/src/tools/utils/hashline/diff-utils.ts +64 -0
  542. package/src/tools/utils/hashline/edit-deduplication.ts +40 -0
  543. package/src/tools/utils/hashline/edit-operation-primitives.ts +149 -0
  544. package/src/tools/utils/hashline/edit-operations.test.ts +154 -0
  545. package/src/tools/utils/hashline/edit-operations.ts +132 -0
  546. package/src/tools/utils/hashline/edit-ordering.ts +60 -0
  547. package/src/tools/utils/hashline/edit-text-normalization.ts +180 -0
  548. package/src/tools/utils/hashline/file-text-canonicalization.ts +58 -0
  549. package/src/tools/utils/hashline/hash-computation.test.ts +82 -0
  550. package/src/tools/utils/hashline/hash-computation.ts +199 -0
  551. package/src/tools/utils/hashline/hashline-chunk-formatter.ts +61 -0
  552. package/src/tools/utils/hashline/hashline-edit-diff.ts +35 -0
  553. package/src/tools/utils/hashline/index.ts +55 -0
  554. package/src/tools/utils/hashline/merge-expansion.ts +120 -0
  555. package/src/tools/utils/hashline/normalize-edits.ts +127 -0
  556. package/src/tools/utils/hashline/types.ts +20 -0
  557. package/src/tools/utils/hashline/validation.test.ts +109 -0
  558. package/src/tools/utils/hashline/validation.ts +212 -0
  559. package/src/tools/utils/safety-utils.ts +938 -0
  560. package/src/utils/tools-manager.ts +353 -0
@@ -0,0 +1,405 @@
1
+ ---
2
+ name: Git Workflow
3
+ description: Complete git workflow including branch management, commits, and GitHub PR creation using gh CLI. Use when user requests to create PR, push changes, commit code, or perform git operations with GitHub.
4
+ triggers:
5
+ - create pr
6
+ - make pull request
7
+ - commit and push
8
+ - gh pr create
9
+ - push changes
10
+ - create pull request
11
+ - 올려줘
12
+ - PR 만들어줘
13
+ - 커밋해줘
14
+ - 푸시해줘
15
+ version: 1.0.0
16
+ ---
17
+
18
+ # Git Workflow Skill
19
+
20
+ ## Overview
21
+
22
+ This skill provides comprehensive guidance for git operations, branch management, commit creation, and **GitHub Pull Request creation using GitHub CLI**.
23
+
24
+ ## Core Responsibilities
25
+
26
+ 1. **Branch Management** - Create, switch, and manage feature branches
27
+ 2. **Commit Operations** - Stage changes and create meaningful commits
28
+ 3. **Push Operations** - Push branches to remote repository
29
+ 4. **Pull Request Creation** - Create PRs using GitHub CLI (`gh pr create`)
30
+ 5. **Workflow Completion** - Ensure full cycle from changes to PR
31
+
32
+ ## Available Tools
33
+
34
+ - `shell_execute` - Execute git and gh CLI commands
35
+ - `read_file` - Read git config, commit messages, PR templates
36
+ - `grep_files` - Search for patterns in git history
37
+ - `glob_files` - Find git-related files
38
+
39
+ ## Git Command Reference
40
+
41
+ ### Safe Commands (Always OK)
42
+ ```bash
43
+ git status # Check working tree status
44
+ git branch # List branches
45
+ git log # View commit history
46
+ git diff # Show changes
47
+ git show # Show commit details
48
+ gh pr list # List pull requests
49
+ gh pr view # View PR details
50
+ ```
51
+
52
+ ### Careful Commands (Require Verification)
53
+ ```bash
54
+ git checkout -b <branch> # Create new branch
55
+ git add . # Stage all changes
56
+ git commit -m "message" # Create commit
57
+ git push -u origin <branch> # Push new branch
58
+ gh pr create # Create pull request
59
+ ```
60
+
61
+ ### Dangerous Commands (Require Explicit User Confirmation)
62
+ ```bash
63
+ git push --force # Force push (NEVER on main/master)
64
+ git reset --hard # Discard changes permanently
65
+ git rebase # Rewrite history
66
+ git push --delete # Delete remote branch
67
+ ```
68
+
69
+ ## Workflow Patterns
70
+
71
+ ### Standard Feature Workflow
72
+
73
+ When user requests "create PR" or "make a pull request":
74
+
75
+ **Step 1: Check Current State**
76
+ ```bash
77
+ git status
78
+ git branch
79
+ ```
80
+
81
+ **Step 2: Create Feature Branch (if needed)**
82
+ ```bash
83
+ # Branch naming conventions:
84
+ # - feature/description
85
+ # - fix/issue-description
86
+ # - refactor/component-name
87
+ # - docs/topic
88
+
89
+ git checkout -b feature/descriptive-name
90
+ ```
91
+
92
+ **Step 3: Stage Changes**
93
+ ```bash
94
+ git add .
95
+ # Or selectively:
96
+ git add src/specific/file.ts
97
+ ```
98
+
99
+ **Step 4: Create Descriptive Commit**
100
+ ```bash
101
+ # Commit message format:
102
+ # <type>: <short description>
103
+ #
104
+ # <detailed explanation if needed>
105
+ #
106
+ # Types: feat, fix, refactor, docs, test, chore
107
+
108
+ git commit -m "feat: add user authentication system
109
+
110
+ - Implement JWT token generation
111
+ - Add login/logout endpoints
112
+ - Create auth middleware"
113
+ ```
114
+
115
+ **Step 5: Push to Remote**
116
+ ```bash
117
+ git push -u origin feature/descriptive-name
118
+ ```
119
+
120
+ **Step 6: Create Pull Request**
121
+ ```bash
122
+ # Basic PR creation:
123
+ gh pr create --base main --head feature/descriptive-name \
124
+ --title "Add user authentication system" \
125
+ --body "## Summary
126
+ - Implements JWT-based authentication
127
+ - Adds login/logout endpoints
128
+ - Includes auth middleware
129
+
130
+ ## Testing
131
+ - All tests passing
132
+ - Manual testing completed"
133
+
134
+ # Interactive PR creation (if user wants to review):
135
+ gh pr create --web
136
+ ```
137
+
138
+ ### Quick Commit and PR Workflow
139
+
140
+ For simple changes where user says "commit and create PR":
141
+
142
+ ```bash
143
+ # All in one flow:
144
+ git add .
145
+ git commit -m "fix: resolve authentication bug"
146
+ git push -u origin fix/auth-bug
147
+ gh pr create --base main --title "Fix authentication bug" --body "Resolves issue with token expiration"
148
+ ```
149
+
150
+ ### PR Creation Options
151
+
152
+ **Option 1: Direct Creation (Recommended)**
153
+ ```bash
154
+ gh pr create \
155
+ --base main \
156
+ --head feature/branch-name \
157
+ --title "Clear, descriptive title" \
158
+ --body "## Summary
159
+ What changed and why
160
+
161
+ ## Changes
162
+ - Bullet point list
163
+ - Of key changes
164
+
165
+ ## Testing
166
+ How it was tested"
167
+ ```
168
+
169
+ **Option 2: Interactive Web UI**
170
+ ```bash
171
+ gh pr create --web
172
+ # Opens browser for user to fill in details
173
+ ```
174
+
175
+ **Option 3: Using PR Template**
176
+ ```bash
177
+ # If .github/pull_request_template.md exists:
178
+ gh pr create --base main --fill
179
+ # Automatically uses template
180
+ ```
181
+
182
+ ### Checking PR Status
183
+
184
+ After creating PR:
185
+ ```bash
186
+ # Get PR URL and status:
187
+ gh pr view
188
+
189
+ # Check CI status:
190
+ gh pr checks
191
+
192
+ # List all PRs:
193
+ gh pr list
194
+ ```
195
+
196
+ ## Branch Naming Conventions
197
+
198
+ Follow these patterns:
199
+ - `feature/user-auth` - New features
200
+ - `fix/login-bug` - Bug fixes
201
+ - `refactor/api-client` - Code refactoring
202
+ - `docs/readme-update` - Documentation
203
+ - `test/auth-coverage` - Test additions
204
+ - `chore/deps-update` - Maintenance tasks
205
+
206
+ ## Commit Message Guidelines
207
+
208
+ ### Format
209
+ ```
210
+ <type>: <subject>
211
+
212
+ <body>
213
+
214
+ <footer>
215
+ ```
216
+
217
+ ### Types
218
+ - `feat` - New feature
219
+ - `fix` - Bug fix
220
+ - `refactor` - Code restructuring
221
+ - `docs` - Documentation changes
222
+ - `test` - Test additions/changes
223
+ - `chore` - Maintenance tasks
224
+ - `perf` - Performance improvements
225
+ - `style` - Code style changes (formatting)
226
+
227
+ ### Examples
228
+
229
+ **Good:**
230
+ ```
231
+ feat: add GitHub OAuth integration
232
+
233
+ - Implement OAuth flow
234
+ - Add callback handler
235
+ - Store tokens securely
236
+
237
+ Closes #123
238
+ ```
239
+
240
+ **Bad:**
241
+ ```
242
+ update stuff
243
+ ```
244
+
245
+ ## PR Description Template
246
+
247
+ When creating PR, use this structure:
248
+
249
+ ```markdown
250
+ ## Summary
251
+ Brief overview of what changed and why
252
+
253
+ ## Changes
254
+ - Key change 1
255
+ - Key change 2
256
+ - Key change 3
257
+
258
+ ## Testing
259
+ - [ ] Unit tests added/updated
260
+ - [ ] Manual testing completed
261
+ - [ ] All tests passing
262
+
263
+ ## Related Issues
264
+ Closes #123
265
+ Relates to #456
266
+ ```
267
+
268
+ ## Safety Guardrails
269
+
270
+ ### NEVER Do These Without Explicit User Confirmation:
271
+ 1. `git push --force` on main/master branch
272
+ 2. `git reset --hard` (loses uncommitted changes)
273
+ 3. Delete remote branches that others might use
274
+ 4. Rebase commits that have been pushed
275
+ 5. Amend commits that have been pushed
276
+
277
+ ### ALWAYS Do These:
278
+ 1. Check `git status` before committing
279
+ 2. Review `git diff` before staging
280
+ 3. Use descriptive commit messages
281
+ 4. Push to feature branch, not main
282
+ 5. Create PR instead of pushing directly to main
283
+
284
+ ## Error Handling
285
+
286
+ ### Common Issues and Solutions
287
+
288
+ **Issue: "gh: command not found"**
289
+ ```bash
290
+ # Solution: Install GitHub CLI
291
+ # macOS:
292
+ brew install gh
293
+
294
+ # Linux:
295
+ # See: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
296
+
297
+ # Then authenticate:
298
+ gh auth login
299
+ ```
300
+
301
+ **Issue: "failed to push some refs"**
302
+ ```bash
303
+ # Solution: Pull latest changes first
304
+ git pull origin main
305
+ # Resolve conflicts if any
306
+ git push
307
+ ```
308
+
309
+ **Issue: "not a git repository"**
310
+ ```bash
311
+ # Solution: Initialize git repo
312
+ git init
313
+ git remote add origin <repo-url>
314
+ ```
315
+
316
+ **Issue: "gh: Not authenticated"**
317
+ ```bash
318
+ # Solution: Login to GitHub
319
+ gh auth login
320
+ # Follow interactive prompts
321
+ ```
322
+
323
+ ## Complete Example Workflow
324
+
325
+ User says: "이 변경사항들을 PR로 올려줘"
326
+
327
+ **AI Response:**
328
+ ```bash
329
+ # Step 1: Check current state
330
+ git status
331
+
332
+ # Step 2: Create feature branch (if on main)
333
+ git checkout -b feature/implement-todo-system
334
+
335
+ # Step 3: Stage all changes
336
+ git add .
337
+
338
+ # Step 4: Create commit
339
+ git commit -m "feat: implement todo system with auto-resume
340
+
341
+ - Add todo_write and todo_read tools
342
+ - Implement auto-continuation middleware
343
+ - Update system prompts for autonomous execution
344
+ - Add session-based todo isolation"
345
+
346
+ # Step 5: Push branch
347
+ git push -u origin feature/implement-todo-system
348
+
349
+ # Step 6: Create PR
350
+ gh pr create \
351
+ --base main \
352
+ --title "Implement todo system with auto-resume functionality" \
353
+ --body "## Summary
354
+ Adds a comprehensive todo system that enables AI to track and automatically continue incomplete tasks.
355
+
356
+ ## Changes
357
+ - Created todo_write and todo_read tools
358
+ - Built auto-continuation middleware
359
+ - Updated system prompts for autonomous execution
360
+ - Implemented session-based todo isolation
361
+
362
+ ## Testing
363
+ - All unit tests passing (7/7)
364
+ - TypeScript compilation clean
365
+ - Linting passing
366
+ - Manual testing completed in CLI mode"
367
+
368
+ # Step 7: Report success
369
+ echo "✅ Pull request created successfully!"
370
+ gh pr view --web
371
+ ```
372
+
373
+ ## Integration with Other Skills
374
+
375
+ This skill works with:
376
+ - **Shell Execution** - All git/gh commands use `shell_execute`
377
+ - **File Reading** - Read commit templates, PR templates
378
+ - **Todo System** - Mark "create PR" tasks as complete after success
379
+
380
+ ## Key Principles
381
+
382
+ 1. **Complete the Cycle** - Don't stop at commit; create the PR
383
+ 2. **Descriptive Messages** - Commits and PRs should explain WHY, not just WHAT
384
+ 3. **Safety First** - Never force push to main, always use feature branches
385
+ 4. **User Visibility** - Report each step and final PR URL
386
+ 5. **Autonomous Execution** - Don't ask user to run commands; execute them
387
+
388
+ ## When to Use This Skill
389
+
390
+ Trigger phrases:
391
+ - "create a PR"
392
+ - "make a pull request"
393
+ - "commit and push"
394
+ - "올려줘" / "PR 만들어줘"
395
+ - "push these changes"
396
+ - "create PR from these changes"
397
+
398
+ ## Expected Outcomes
399
+
400
+ After using this skill:
401
+ - ✅ Changes committed with descriptive message
402
+ - ✅ Branch pushed to remote
403
+ - ✅ Pull request created on GitHub
404
+ - ✅ PR URL provided to user
405
+ - ✅ User can review PR in browser
@@ -0,0 +1,34 @@
1
+ export const TOOL_FALLBACK_MODES = [
2
+ "disable",
3
+ "morphxml",
4
+ "hermes",
5
+ "qwen3coder",
6
+ ] as const;
7
+
8
+ export type ToolFallbackMode = (typeof TOOL_FALLBACK_MODES)[number];
9
+
10
+ export const DEFAULT_TOOL_FALLBACK_MODE: ToolFallbackMode = "disable";
11
+ export const LEGACY_ENABLED_TOOL_FALLBACK_MODE: ToolFallbackMode = "morphxml";
12
+
13
+ const isToolFallbackMode = (value: string): value is ToolFallbackMode => {
14
+ return TOOL_FALLBACK_MODES.includes(value as ToolFallbackMode);
15
+ };
16
+
17
+ export const parseToolFallbackMode = (
18
+ rawValue: string
19
+ ): ToolFallbackMode | null => {
20
+ const value = rawValue.toLowerCase();
21
+ if (isToolFallbackMode(value)) {
22
+ return value;
23
+ }
24
+
25
+ if (value === "on" || value === "enable" || value === "true") {
26
+ return LEGACY_ENABLED_TOOL_FALLBACK_MODE;
27
+ }
28
+
29
+ if (value === "off" || value === "false") {
30
+ return DEFAULT_TOOL_FALLBACK_MODE;
31
+ }
32
+
33
+ return null;
34
+ };
@@ -0,0 +1,44 @@
1
+ # TOOLS SUBSYSTEM KNOWLEDGE BASE
2
+
3
+ **Generated:** 2026-02-23 14:40 KST
4
+ **Scope:** `src/tools/**`
5
+
6
+ ## OVERVIEW
7
+ `src/tools/` implements all callable tools and maps stable public tool keys to concrete executors.
8
+
9
+ ## STRUCTURE
10
+ ```text
11
+ src/tools/
12
+ |- index.ts # Public tool registry keys
13
+ |- execute/ # Shell execution and process management
14
+ |- explore/ # Read, glob, grep, and safety checks
15
+ |- modify/ # Deterministic file mutation operations
16
+ | `- AGENTS.md # High-risk mutation constraints
17
+ `- planning/ # Skill loading and todo state updates
18
+ ```
19
+
20
+ ## WHERE TO LOOK
21
+ | Task | Location | Notes |
22
+ |------|----------|-------|
23
+ | Add or rename a tool key | `src/tools/index.ts` | Keep key names stable for model/tool contracts |
24
+ | Shell execution semantics | `src/tools/execute/shell-execute.ts` | Timeout, background handling, non-interactive wrapping |
25
+ | File read/search behavior | `src/tools/explore/read-file.ts` | Enforces limits and safe read semantics |
26
+ | Deterministic file editing | `src/tools/modify/edit-file.ts` | Hashline-native edits |
27
+ | Todo persistence semantics | `src/tools/planning/todo-write.ts` | Status accounting and validation |
28
+ | Skill content resolution | `src/tools/planning/load-skill.ts` | Local/project/bundled skill lookup behavior |
29
+
30
+ ## CONVENTIONS
31
+ - `index.ts` is the single source of truth for exported tool key names (`shell_execute`, `read_file`, `edit_file`, etc.).
32
+ - Keep per-tool description files (`<tool-name>.txt`) synchronized with implementation and prompt wiring.
33
+ - Prefer dedicated `explore/modify` tools for file operations; shell is for build/test/git/system operations.
34
+ - `modify/edit-file.ts` is hashline-first: preserve `expected_file_hash` checks and deterministic anchors.
35
+ - New tool behavior must ship with colocated tests under the same subdirectory.
36
+
37
+ ## ANTI-PATTERNS
38
+ - Introducing file reads/writes through shell commands when dedicated tools already exist.
39
+ - Changing tool key strings in `index.ts` without coordinated updates to callers and tests.
40
+ - Bypassing stale-safety checks in edit flows (`expected_file_hash`, anchored operations).
41
+ - Expanding planning behavior without updating validation and summary outputs in tests.
42
+
43
+ ## NOTES
44
+ - `src/tools/modify/AGENTS.md` is the source of truth for hashline/legacy-edit constraints.
@@ -0,0 +1,114 @@
1
+ import { afterAll, beforeAll, describe, expect, it } from "bun:test";
2
+ import { existsSync, mkdtempSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { executeCommand } from "./shell-execute";
6
+
7
+ describe("executeCommand", () => {
8
+ let tempDir: string;
9
+
10
+ beforeAll(() => {
11
+ tempDir = mkdtempSync(join(tmpdir(), "shell-test-"));
12
+ });
13
+
14
+ afterAll(() => {
15
+ if (existsSync(tempDir)) {
16
+ rmSync(tempDir, { recursive: true });
17
+ }
18
+ });
19
+
20
+ describe("basic execution", () => {
21
+ it("executes simple echo command", async () => {
22
+ const result = await executeCommand('echo "hello world"');
23
+
24
+ expect(result.output).toContain("hello world");
25
+ expect(result.exitCode).toBe(0);
26
+ });
27
+
28
+ it("captures multiline output", async () => {
29
+ const result = await executeCommand("printf 'line1\\nline2\\nline3'");
30
+
31
+ expect(result.output).toContain("line1");
32
+ expect(result.output).toContain("line2");
33
+ expect(result.output).toContain("line3");
34
+ });
35
+
36
+ it("combines stdout and stderr", async () => {
37
+ const result = await executeCommand('echo "stdout" && echo "stderr" >&2');
38
+
39
+ expect(result.output).toContain("stdout");
40
+ expect(result.output).toContain("stderr");
41
+ });
42
+
43
+ it("handles empty output", async () => {
44
+ const result = await executeCommand("true");
45
+
46
+ expect(result.output).toBe("");
47
+ expect(result.exitCode).toBe(0);
48
+ });
49
+
50
+ it("executes command in specified workdir", async () => {
51
+ const result = await executeCommand("pwd", { workdir: tempDir });
52
+
53
+ expect(result.output).toContain("shell-test-");
54
+ expect(result.exitCode).toBe(0);
55
+ });
56
+ });
57
+
58
+ describe("exit code propagation", () => {
59
+ it("returns non-zero exit code for failed command", async () => {
60
+ const result = await executeCommand("exit 42");
61
+
62
+ expect(result.exitCode).toBe(42);
63
+ });
64
+
65
+ it("returns zero for successful command", async () => {
66
+ const result = await executeCommand("echo ok");
67
+
68
+ expect(result.exitCode).toBe(0);
69
+ });
70
+
71
+ it("returns exit code from last command in chain", async () => {
72
+ const result = await executeCommand("true && exit 5");
73
+
74
+ expect(result.exitCode).toBe(5);
75
+ });
76
+ });
77
+
78
+ describe("timeout formatting", () => {
79
+ it("includes [TIMEOUT] prefix when command exceeds timeout", async () => {
80
+ const result = await executeCommand("sleep 10", { timeoutMs: 200 });
81
+
82
+ expect(result.output).toContain("[TIMEOUT]");
83
+ expect(result.exitCode).toBe(124);
84
+ }, 5000);
85
+
86
+ it("includes timeout duration in timeout message", async () => {
87
+ const result = await executeCommand("sleep 10", { timeoutMs: 300 });
88
+
89
+ expect(result.output).toContain("300ms");
90
+ }, 5000);
91
+ });
92
+
93
+ describe("background process detection", () => {
94
+ it("wraps output with background message for commands ending with &", async () => {
95
+ const result = await executeCommand("sleep 0.1 &");
96
+
97
+ expect(result.exitCode).toBe(0);
98
+ expect(result.output).toContain("[Background process started]");
99
+ });
100
+
101
+ it("does not treat && as background operator", async () => {
102
+ const result = await executeCommand('echo "first" && echo "second"');
103
+
104
+ expect(result.output).toContain("first");
105
+ expect(result.output).not.toContain("[Background process started]");
106
+ });
107
+
108
+ it("does not treat mid-command & as background", async () => {
109
+ const result = await executeCommand("sleep 0.1 & wait");
110
+
111
+ expect(result.output).not.toContain("[Background process started]");
112
+ });
113
+ });
114
+ });
@@ -0,0 +1,74 @@
1
+ import { tool } from "ai";
2
+ import { z } from "zod";
3
+ import {
4
+ formatBackgroundMessage,
5
+ formatTimeoutMessage,
6
+ } from "../utils/execute/format-utils";
7
+ import { executeCommand as pmExecuteCommand } from "../utils/execute/process-manager";
8
+ import SHELL_EXECUTE_DESCRIPTION from "./shell-execute.txt";
9
+
10
+ const DEFAULT_TIMEOUT_MS = 120_000;
11
+
12
+ function isBackgroundCommand(command: string): boolean {
13
+ const trimmed = command.trimEnd();
14
+ return trimmed.endsWith("&") && !trimmed.endsWith("&&");
15
+ }
16
+
17
+ export interface ToolOutput {
18
+ exit_code: number;
19
+ output: string;
20
+ }
21
+
22
+ export async function executeCommand(
23
+ command: string,
24
+ options: { workdir?: string; timeoutMs?: number } = {}
25
+ ): Promise<{ exitCode: number; output: string }> {
26
+ const { workdir, timeoutMs = DEFAULT_TIMEOUT_MS } = options;
27
+ const result = await pmExecuteCommand(command, { workdir, timeoutMs });
28
+
29
+ if (result.timedOut) {
30
+ return {
31
+ exitCode: result.exitCode,
32
+ output: formatTimeoutMessage(timeoutMs, result.output),
33
+ };
34
+ }
35
+
36
+ if (isBackgroundCommand(command)) {
37
+ return {
38
+ exitCode: result.exitCode,
39
+ output: formatBackgroundMessage(result.output),
40
+ };
41
+ }
42
+
43
+ return {
44
+ exitCode: result.exitCode,
45
+ output: result.output,
46
+ };
47
+ }
48
+
49
+ export const shellExecuteTool = tool({
50
+ description: SHELL_EXECUTE_DESCRIPTION,
51
+
52
+ inputSchema: z.object({
53
+ command: z.string().describe("Shell command to execute"),
54
+ workdir: z
55
+ .string()
56
+ .optional()
57
+ .describe("Working directory (absolute path)"),
58
+ timeout_ms: z
59
+ .number()
60
+ .optional()
61
+ .describe("Timeout in milliseconds (default: 120000)"),
62
+ }),
63
+
64
+ execute: async ({ command, workdir, timeout_ms }): Promise<ToolOutput> => {
65
+ const result = await executeCommand(command, {
66
+ workdir,
67
+ timeoutMs: timeout_ms ?? DEFAULT_TIMEOUT_MS,
68
+ });
69
+ return {
70
+ exit_code: result.exitCode,
71
+ output: result.output,
72
+ };
73
+ },
74
+ });
@@ -0,0 +1,27 @@
1
+ ### shell_execute
2
+ **Purpose**: Run shell commands with configurable timeout (default: 120s)
3
+
4
+ **When to use**:
5
+ - Package management: `npm install`, `pip install`, `cargo build`
6
+ - Version control: `git status`, `git commit`, `git push`
7
+ - Build systems: `make`, `npm run build`, `docker build`
8
+ - Running tests: `npm test`, `pytest`, `cargo test`
9
+ - OS-level only: `chmod`, `ln -s`, `chown`
10
+
11
+ **Timeout guidance**:
12
+ - Quick commands: default 120s
13
+ - Build/test/install: use larger timeout (`300000`-`600000` ms)
14
+
15
+ **Non-interactive behavior**:
16
+ - Wrapper applies non-interactive flags/env when possible (`CI=true`, `DEBIAN_FRONTEND=noninteractive`, `GIT_TERMINAL_PROMPT=0`)
17
+
18
+ **Background commands**:
19
+ - Commands ending with `&` run in background
20
+ - Always verify startup with follow-up checks (`sleep`, health check, logs)
21
+
22
+ **Notes**:
23
+ - Large outputs are truncated automatically
24
+ - Background commands (`&`) should be verified with follow-up checks
25
+
26
+ **Do not use shell for file ops**:
27
+ - Use dedicated tools for read/write/edit/delete/search/glob