takt 0.1.0 → 0.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 (357) hide show
  1. package/README.md +78 -4
  2. package/dist/agents/runner.d.ts +3 -0
  3. package/dist/agents/runner.d.ts.map +1 -1
  4. package/dist/agents/runner.js +70 -14
  5. package/dist/agents/runner.js.map +1 -1
  6. package/dist/claude/client.d.ts +1 -1
  7. package/dist/claude/client.d.ts.map +1 -1
  8. package/dist/claude/client.js +4 -3
  9. package/dist/claude/client.js.map +1 -1
  10. package/dist/claude/index.d.ts +1 -1
  11. package/dist/claude/index.d.ts.map +1 -1
  12. package/dist/claude/index.js.map +1 -1
  13. package/dist/claude/process.d.ts +1 -1
  14. package/dist/claude/process.d.ts.map +1 -1
  15. package/dist/claude/process.js.map +1 -1
  16. package/dist/claude/types.d.ts +7 -0
  17. package/dist/claude/types.d.ts.map +1 -1
  18. package/dist/cli.d.ts +1 -0
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +10 -4
  21. package/dist/cli.js.map +1 -1
  22. package/dist/codex/client.d.ts +26 -0
  23. package/dist/codex/client.d.ts.map +1 -0
  24. package/dist/codex/client.js +418 -0
  25. package/dist/codex/client.js.map +1 -0
  26. package/dist/codex/index.d.ts +5 -0
  27. package/dist/codex/index.d.ts.map +1 -0
  28. package/dist/codex/index.js +5 -0
  29. package/dist/codex/index.js.map +1 -0
  30. package/dist/commands/config.d.ts +33 -0
  31. package/dist/commands/config.d.ts.map +1 -0
  32. package/dist/commands/config.js +110 -0
  33. package/dist/commands/config.js.map +1 -0
  34. package/dist/commands/index.d.ts +1 -0
  35. package/dist/commands/index.d.ts.map +1 -1
  36. package/dist/commands/index.js +1 -0
  37. package/dist/commands/index.js.map +1 -1
  38. package/dist/commands/workflow.js +1 -1
  39. package/dist/commands/workflow.js.map +1 -1
  40. package/dist/commands/workflowExecution.d.ts.map +1 -1
  41. package/dist/commands/workflowExecution.js +3 -1
  42. package/dist/commands/workflowExecution.js.map +1 -1
  43. package/dist/config/globalConfig.d.ts +2 -0
  44. package/dist/config/globalConfig.d.ts.map +1 -1
  45. package/dist/config/globalConfig.js +12 -0
  46. package/dist/config/globalConfig.js.map +1 -1
  47. package/dist/config/initialization.d.ts +10 -0
  48. package/dist/config/initialization.d.ts.map +1 -1
  49. package/dist/config/initialization.js +26 -4
  50. package/dist/config/initialization.js.map +1 -1
  51. package/dist/config/projectConfig.d.ts +14 -1
  52. package/dist/config/projectConfig.d.ts.map +1 -1
  53. package/dist/config/projectConfig.js +4 -0
  54. package/dist/config/projectConfig.js.map +1 -1
  55. package/dist/config/workflowLoader.d.ts.map +1 -1
  56. package/dist/config/workflowLoader.js +3 -0
  57. package/dist/config/workflowLoader.js.map +1 -1
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +2 -0
  61. package/dist/index.js.map +1 -1
  62. package/dist/models/schemas.d.ts +54 -3
  63. package/dist/models/schemas.d.ts.map +1 -1
  64. package/dist/models/schemas.js +34 -46
  65. package/dist/models/schemas.js.map +1 -1
  66. package/dist/models/types.d.ts +12 -2
  67. package/dist/models/types.d.ts.map +1 -1
  68. package/dist/{interactive/prompt.d.ts → prompt/index.d.ts} +3 -1
  69. package/dist/prompt/index.d.ts.map +1 -0
  70. package/dist/{interactive/prompt.js → prompt/index.js} +11 -1
  71. package/dist/prompt/index.js.map +1 -0
  72. package/dist/resources/index.d.ts +9 -0
  73. package/dist/resources/index.d.ts.map +1 -1
  74. package/dist/resources/index.js +21 -2
  75. package/dist/resources/index.js.map +1 -1
  76. package/dist/utils/session.d.ts +5 -0
  77. package/dist/utils/session.d.ts.map +1 -1
  78. package/dist/utils/session.js +19 -0
  79. package/dist/utils/session.js.map +1 -1
  80. package/dist/utils/ui.d.ts +7 -0
  81. package/dist/utils/ui.d.ts.map +1 -1
  82. package/dist/utils/ui.js +51 -0
  83. package/dist/utils/ui.js.map +1 -1
  84. package/dist/workflow/engine.d.ts +10 -0
  85. package/dist/workflow/engine.d.ts.map +1 -1
  86. package/dist/workflow/engine.js +31 -0
  87. package/dist/workflow/engine.js.map +1 -1
  88. package/dist/workflow/instruction-builder.d.ts +3 -0
  89. package/dist/workflow/instruction-builder.d.ts.map +1 -1
  90. package/dist/workflow/instruction-builder.js +5 -0
  91. package/dist/workflow/instruction-builder.js.map +1 -1
  92. package/dist/workflow/transitions.d.ts.map +1 -1
  93. package/dist/workflow/transitions.js +1 -0
  94. package/dist/workflow/transitions.js.map +1 -1
  95. package/package.json +3 -1
  96. package/resources/global/en/agents/default/ai-reviewer.md +136 -0
  97. package/resources/global/en/agents/default/architect.md +81 -30
  98. package/resources/global/en/agents/default/coder.md +60 -44
  99. package/resources/global/en/agents/default/planner.md +78 -0
  100. package/resources/global/en/agents/default/security.md +67 -75
  101. package/resources/global/en/agents/default/supervisor.md +94 -86
  102. package/resources/global/en/agents/expert-review/cqrs-es-reviewer.md +199 -0
  103. package/resources/global/en/agents/expert-review/frontend-reviewer.md +260 -0
  104. package/resources/global/en/agents/expert-review/qa-reviewer.md +260 -0
  105. package/resources/global/en/agents/expert-review/security-reviewer.md +222 -0
  106. package/resources/global/en/agents/expert-review/supervisor.md +186 -0
  107. package/resources/global/en/config.yaml +8 -0
  108. package/resources/global/en/workflows/default.yaml +474 -21
  109. package/resources/global/en/workflows/expert-review.yaml +936 -0
  110. package/resources/global/en/workflows/magi.yaml +18 -0
  111. package/resources/global/en/workflows/research.yaml +18 -0
  112. package/resources/global/ja/agents/default/ai-reviewer.md +136 -0
  113. package/resources/global/ja/agents/default/architect.md +81 -30
  114. package/resources/global/ja/agents/default/coder.md +21 -6
  115. package/resources/global/ja/agents/default/planner.md +78 -0
  116. package/resources/global/ja/agents/default/security.md +20 -28
  117. package/resources/global/ja/agents/default/supervisor.md +54 -46
  118. package/resources/global/ja/agents/expert-review/cqrs-es-reviewer.md +199 -0
  119. package/resources/global/ja/agents/expert-review/frontend-reviewer.md +260 -0
  120. package/resources/global/ja/agents/expert-review/qa-reviewer.md +260 -0
  121. package/resources/global/ja/agents/expert-review/security-reviewer.md +222 -0
  122. package/resources/global/ja/agents/expert-review/supervisor.md +186 -0
  123. package/resources/global/ja/config.yaml +8 -0
  124. package/resources/global/ja/workflows/default.yaml +485 -32
  125. package/resources/global/ja/workflows/expert-review.yaml +936 -0
  126. package/resources/global/ja/workflows/magi.yaml +18 -0
  127. package/resources/global/ja/workflows/research.yaml +18 -0
  128. package/dist/cli/agentExecution.d.ts +0 -16
  129. package/dist/cli/agentExecution.d.ts.map +0 -1
  130. package/dist/cli/agentExecution.js +0 -40
  131. package/dist/cli/agentExecution.js.map +0 -1
  132. package/dist/cli/help.d.ts +0 -8
  133. package/dist/cli/help.d.ts.map +0 -1
  134. package/dist/cli/help.js +0 -46
  135. package/dist/cli/help.js.map +0 -1
  136. package/dist/cli/index.d.ts +0 -8
  137. package/dist/cli/index.d.ts.map +0 -1
  138. package/dist/cli/index.js +0 -8
  139. package/dist/cli/index.js.map +0 -1
  140. package/dist/cli/taskBatch.d.ts +0 -8
  141. package/dist/cli/taskBatch.d.ts.map +0 -1
  142. package/dist/cli/taskBatch.js +0 -69
  143. package/dist/cli/taskBatch.js.map +0 -1
  144. package/dist/cli/workflowExecution.d.ts +0 -18
  145. package/dist/cli/workflowExecution.d.ts.map +0 -1
  146. package/dist/cli/workflowExecution.js +0 -112
  147. package/dist/cli/workflowExecution.js.map +0 -1
  148. package/dist/commands/agentExecution.d.ts +0 -8
  149. package/dist/commands/agentExecution.d.ts.map +0 -1
  150. package/dist/commands/agentExecution.js +0 -44
  151. package/dist/commands/agentExecution.js.map +0 -1
  152. package/dist/interactive/commands/agent.d.ts +0 -7
  153. package/dist/interactive/commands/agent.d.ts.map +0 -1
  154. package/dist/interactive/commands/agent.js +0 -65
  155. package/dist/interactive/commands/agent.js.map +0 -1
  156. package/dist/interactive/commands/basic.d.ts +0 -7
  157. package/dist/interactive/commands/basic.d.ts.map +0 -1
  158. package/dist/interactive/commands/basic.js +0 -81
  159. package/dist/interactive/commands/basic.js.map +0 -1
  160. package/dist/interactive/commands/index.d.ts +0 -12
  161. package/dist/interactive/commands/index.d.ts.map +0 -1
  162. package/dist/interactive/commands/index.js +0 -14
  163. package/dist/interactive/commands/index.js.map +0 -1
  164. package/dist/interactive/commands/registry.d.ts +0 -41
  165. package/dist/interactive/commands/registry.d.ts.map +0 -1
  166. package/dist/interactive/commands/registry.js +0 -37
  167. package/dist/interactive/commands/registry.js.map +0 -1
  168. package/dist/interactive/commands/session.d.ts +0 -7
  169. package/dist/interactive/commands/session.d.ts.map +0 -1
  170. package/dist/interactive/commands/session.js +0 -75
  171. package/dist/interactive/commands/session.js.map +0 -1
  172. package/dist/interactive/commands/task.d.ts +0 -7
  173. package/dist/interactive/commands/task.d.ts.map +0 -1
  174. package/dist/interactive/commands/task.js +0 -156
  175. package/dist/interactive/commands/task.js.map +0 -1
  176. package/dist/interactive/commands/workflow.d.ts +0 -7
  177. package/dist/interactive/commands/workflow.d.ts.map +0 -1
  178. package/dist/interactive/commands/workflow.js +0 -56
  179. package/dist/interactive/commands/workflow.js.map +0 -1
  180. package/dist/interactive/escape-tracker.d.ts +0 -37
  181. package/dist/interactive/escape-tracker.d.ts.map +0 -1
  182. package/dist/interactive/escape-tracker.js +0 -52
  183. package/dist/interactive/escape-tracker.js.map +0 -1
  184. package/dist/interactive/handlers.d.ts +0 -24
  185. package/dist/interactive/handlers.d.ts.map +0 -1
  186. package/dist/interactive/handlers.js +0 -191
  187. package/dist/interactive/handlers.js.map +0 -1
  188. package/dist/interactive/history-manager.d.ts +0 -45
  189. package/dist/interactive/history-manager.d.ts.map +0 -1
  190. package/dist/interactive/history-manager.js +0 -91
  191. package/dist/interactive/history-manager.js.map +0 -1
  192. package/dist/interactive/index.d.ts +0 -8
  193. package/dist/interactive/index.d.ts.map +0 -1
  194. package/dist/interactive/index.js +0 -8
  195. package/dist/interactive/index.js.map +0 -1
  196. package/dist/interactive/ink/components/App.d.ts +0 -16
  197. package/dist/interactive/ink/components/App.d.ts.map +0 -1
  198. package/dist/interactive/ink/components/App.js +0 -123
  199. package/dist/interactive/ink/components/App.js.map +0 -1
  200. package/dist/interactive/ink/components/AskUserQuestion.d.ts +0 -16
  201. package/dist/interactive/ink/components/AskUserQuestion.d.ts.map +0 -1
  202. package/dist/interactive/ink/components/AskUserQuestion.js +0 -139
  203. package/dist/interactive/ink/components/AskUserQuestion.js.map +0 -1
  204. package/dist/interactive/ink/components/Header.d.ts +0 -20
  205. package/dist/interactive/ink/components/Header.d.ts.map +0 -1
  206. package/dist/interactive/ink/components/Header.js +0 -7
  207. package/dist/interactive/ink/components/Header.js.map +0 -1
  208. package/dist/interactive/ink/components/HelpView.d.ts +0 -13
  209. package/dist/interactive/ink/components/HelpView.d.ts.map +0 -1
  210. package/dist/interactive/ink/components/HelpView.js +0 -45
  211. package/dist/interactive/ink/components/HelpView.js.map +0 -1
  212. package/dist/interactive/ink/components/IterationLimit.d.ts +0 -19
  213. package/dist/interactive/ink/components/IterationLimit.d.ts.map +0 -1
  214. package/dist/interactive/ink/components/IterationLimit.js +0 -59
  215. package/dist/interactive/ink/components/IterationLimit.js.map +0 -1
  216. package/dist/interactive/ink/components/ModalRouter.d.ts +0 -11
  217. package/dist/interactive/ink/components/ModalRouter.d.ts.map +0 -1
  218. package/dist/interactive/ink/components/ModalRouter.js +0 -71
  219. package/dist/interactive/ink/components/ModalRouter.js.map +0 -1
  220. package/dist/interactive/ink/components/PermissionPrompt.d.ts +0 -17
  221. package/dist/interactive/ink/components/PermissionPrompt.d.ts.map +0 -1
  222. package/dist/interactive/ink/components/PermissionPrompt.js +0 -102
  223. package/dist/interactive/ink/components/PermissionPrompt.js.map +0 -1
  224. package/dist/interactive/ink/components/PromptInput.d.ts +0 -26
  225. package/dist/interactive/ink/components/PromptInput.d.ts.map +0 -1
  226. package/dist/interactive/ink/components/PromptInput.js +0 -70
  227. package/dist/interactive/ink/components/PromptInput.js.map +0 -1
  228. package/dist/interactive/ink/components/Spinner.d.ts +0 -14
  229. package/dist/interactive/ink/components/Spinner.d.ts.map +0 -1
  230. package/dist/interactive/ink/components/Spinner.js +0 -8
  231. package/dist/interactive/ink/components/Spinner.js.map +0 -1
  232. package/dist/interactive/ink/components/StreamingOutput.d.ts +0 -25
  233. package/dist/interactive/ink/components/StreamingOutput.d.ts.map +0 -1
  234. package/dist/interactive/ink/components/StreamingOutput.js +0 -8
  235. package/dist/interactive/ink/components/StreamingOutput.js.map +0 -1
  236. package/dist/interactive/ink/components/UserInputPrompt.d.ts +0 -18
  237. package/dist/interactive/ink/components/UserInputPrompt.d.ts.map +0 -1
  238. package/dist/interactive/ink/components/UserInputPrompt.js +0 -30
  239. package/dist/interactive/ink/components/UserInputPrompt.js.map +0 -1
  240. package/dist/interactive/ink/components/WorkflowSelector.d.ts +0 -18
  241. package/dist/interactive/ink/components/WorkflowSelector.d.ts.map +0 -1
  242. package/dist/interactive/ink/components/WorkflowSelector.js +0 -65
  243. package/dist/interactive/ink/components/WorkflowSelector.js.map +0 -1
  244. package/dist/interactive/ink/constants.d.ts +0 -8
  245. package/dist/interactive/ink/constants.d.ts.map +0 -1
  246. package/dist/interactive/ink/constants.js +0 -8
  247. package/dist/interactive/ink/constants.js.map +0 -1
  248. package/dist/interactive/ink/context/AppContext.d.ts +0 -26
  249. package/dist/interactive/ink/context/AppContext.d.ts.map +0 -1
  250. package/dist/interactive/ink/context/AppContext.js +0 -30
  251. package/dist/interactive/ink/context/AppContext.js.map +0 -1
  252. package/dist/interactive/ink/context/appReducer.d.ts +0 -13
  253. package/dist/interactive/ink/context/appReducer.d.ts.map +0 -1
  254. package/dist/interactive/ink/context/appReducer.js +0 -183
  255. package/dist/interactive/ink/context/appReducer.js.map +0 -1
  256. package/dist/interactive/ink/context/types.d.ts +0 -144
  257. package/dist/interactive/ink/context/types.d.ts.map +0 -1
  258. package/dist/interactive/ink/context/types.js +0 -5
  259. package/dist/interactive/ink/context/types.js.map +0 -1
  260. package/dist/interactive/ink/hooks/keyDetection.d.ts +0 -116
  261. package/dist/interactive/ink/hooks/keyDetection.d.ts.map +0 -1
  262. package/dist/interactive/ink/hooks/keyDetection.js +0 -183
  263. package/dist/interactive/ink/hooks/keyDetection.js.map +0 -1
  264. package/dist/interactive/ink/hooks/multilineInputLogic.d.ts +0 -50
  265. package/dist/interactive/ink/hooks/multilineInputLogic.d.ts.map +0 -1
  266. package/dist/interactive/ink/hooks/multilineInputLogic.js +0 -150
  267. package/dist/interactive/ink/hooks/multilineInputLogic.js.map +0 -1
  268. package/dist/interactive/ink/hooks/useCommands.d.ts +0 -20
  269. package/dist/interactive/ink/hooks/useCommands.d.ts.map +0 -1
  270. package/dist/interactive/ink/hooks/useCommands.js +0 -129
  271. package/dist/interactive/ink/hooks/useCommands.js.map +0 -1
  272. package/dist/interactive/ink/hooks/useHistory.d.ts +0 -28
  273. package/dist/interactive/ink/hooks/useHistory.d.ts.map +0 -1
  274. package/dist/interactive/ink/hooks/useHistory.js +0 -59
  275. package/dist/interactive/ink/hooks/useHistory.js.map +0 -1
  276. package/dist/interactive/ink/hooks/useMultilineInput.d.ts +0 -49
  277. package/dist/interactive/ink/hooks/useMultilineInput.d.ts.map +0 -1
  278. package/dist/interactive/ink/hooks/useMultilineInput.js +0 -106
  279. package/dist/interactive/ink/hooks/useMultilineInput.js.map +0 -1
  280. package/dist/interactive/ink/hooks/usePermissionHandlers.d.ts +0 -16
  281. package/dist/interactive/ink/hooks/usePermissionHandlers.d.ts.map +0 -1
  282. package/dist/interactive/ink/hooks/usePermissionHandlers.js +0 -172
  283. package/dist/interactive/ink/hooks/usePermissionHandlers.js.map +0 -1
  284. package/dist/interactive/ink/hooks/useRawKeypress.d.ts +0 -41
  285. package/dist/interactive/ink/hooks/useRawKeypress.d.ts.map +0 -1
  286. package/dist/interactive/ink/hooks/useRawKeypress.js +0 -79
  287. package/dist/interactive/ink/hooks/useRawKeypress.js.map +0 -1
  288. package/dist/interactive/ink/hooks/useTaskQueue.d.ts +0 -32
  289. package/dist/interactive/ink/hooks/useTaskQueue.d.ts.map +0 -1
  290. package/dist/interactive/ink/hooks/useTaskQueue.js +0 -68
  291. package/dist/interactive/ink/hooks/useTaskQueue.js.map +0 -1
  292. package/dist/interactive/ink/hooks/useWorkflow.d.ts +0 -45
  293. package/dist/interactive/ink/hooks/useWorkflow.d.ts.map +0 -1
  294. package/dist/interactive/ink/hooks/useWorkflow.js +0 -93
  295. package/dist/interactive/ink/hooks/useWorkflow.js.map +0 -1
  296. package/dist/interactive/ink/hooks/useWorkflowExecution.d.ts +0 -14
  297. package/dist/interactive/ink/hooks/useWorkflowExecution.d.ts.map +0 -1
  298. package/dist/interactive/ink/hooks/useWorkflowExecution.js +0 -144
  299. package/dist/interactive/ink/hooks/useWorkflowExecution.js.map +0 -1
  300. package/dist/interactive/ink/index.d.ts +0 -30
  301. package/dist/interactive/ink/index.d.ts.map +0 -1
  302. package/dist/interactive/ink/index.js +0 -33
  303. package/dist/interactive/ink/index.js.map +0 -1
  304. package/dist/interactive/ink/utils/workflow.d.ts +0 -11
  305. package/dist/interactive/ink/utils/workflow.d.ts.map +0 -1
  306. package/dist/interactive/ink/utils/workflow.js +0 -19
  307. package/dist/interactive/ink/utils/workflow.js.map +0 -1
  308. package/dist/interactive/input-buffer.d.ts +0 -67
  309. package/dist/interactive/input-buffer.d.ts.map +0 -1
  310. package/dist/interactive/input-buffer.js +0 -162
  311. package/dist/interactive/input-buffer.js.map +0 -1
  312. package/dist/interactive/input-handlers.d.ts +0 -50
  313. package/dist/interactive/input-handlers.d.ts.map +0 -1
  314. package/dist/interactive/input-handlers.js +0 -170
  315. package/dist/interactive/input-handlers.js.map +0 -1
  316. package/dist/interactive/input.d.ts +0 -43
  317. package/dist/interactive/input.d.ts.map +0 -1
  318. package/dist/interactive/input.js +0 -74
  319. package/dist/interactive/input.js.map +0 -1
  320. package/dist/interactive/keyDetection.d.ts +0 -85
  321. package/dist/interactive/keyDetection.d.ts.map +0 -1
  322. package/dist/interactive/keyDetection.js +0 -167
  323. package/dist/interactive/keyDetection.js.map +0 -1
  324. package/dist/interactive/multilineInputLogic.d.ts +0 -30
  325. package/dist/interactive/multilineInputLogic.d.ts.map +0 -1
  326. package/dist/interactive/multilineInputLogic.js +0 -143
  327. package/dist/interactive/multilineInputLogic.js.map +0 -1
  328. package/dist/interactive/passthrough.d.ts +0 -30
  329. package/dist/interactive/passthrough.d.ts.map +0 -1
  330. package/dist/interactive/passthrough.js +0 -94
  331. package/dist/interactive/passthrough.js.map +0 -1
  332. package/dist/interactive/permission.d.ts +0 -33
  333. package/dist/interactive/permission.d.ts.map +0 -1
  334. package/dist/interactive/permission.js +0 -231
  335. package/dist/interactive/permission.js.map +0 -1
  336. package/dist/interactive/prompt.d.ts.map +0 -1
  337. package/dist/interactive/prompt.js.map +0 -1
  338. package/dist/interactive/repl.d.ts +0 -13
  339. package/dist/interactive/repl.d.ts.map +0 -1
  340. package/dist/interactive/repl.js +0 -202
  341. package/dist/interactive/repl.js.map +0 -1
  342. package/dist/interactive/types.d.ts +0 -35
  343. package/dist/interactive/types.d.ts.map +0 -1
  344. package/dist/interactive/types.js +0 -5
  345. package/dist/interactive/types.js.map +0 -1
  346. package/dist/interactive/ui.d.ts +0 -16
  347. package/dist/interactive/ui.d.ts.map +0 -1
  348. package/dist/interactive/ui.js +0 -122
  349. package/dist/interactive/ui.js.map +0 -1
  350. package/dist/interactive/user-input.d.ts +0 -26
  351. package/dist/interactive/user-input.d.ts.map +0 -1
  352. package/dist/interactive/user-input.js +0 -115
  353. package/dist/interactive/user-input.js.map +0 -1
  354. package/dist/interactive/workflow-executor.d.ts +0 -20
  355. package/dist/interactive/workflow-executor.d.ts.map +0 -1
  356. package/dist/interactive/workflow-executor.js +0 -200
  357. package/dist/interactive/workflow-executor.js.map +0 -1
@@ -1,11 +0,0 @@
1
- /**
2
- * Workflow utility functions for ink interactive mode
3
- */
4
- import type { Dispatch } from 'react';
5
- import type { AppAction } from '../context/AppContext.js';
6
- /**
7
- * Set workflow by name, loading from builtin or custom sources
8
- * @returns true if workflow was found and set, false otherwise
9
- */
10
- export declare function setWorkflowByName(name: string, cwd: string, dispatch: Dispatch<AppAction>): boolean;
11
- //# sourceMappingURL=workflow.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../../src/interactive/ink/utils/workflow.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,GAC5B,OAAO,CAQT"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Workflow utility functions for ink interactive mode
3
- */
4
- import { loadWorkflow, getBuiltinWorkflow } from '../../../config/loader.js';
5
- import { saveLastWorkflow } from '../../../config/paths.js';
6
- /**
7
- * Set workflow by name, loading from builtin or custom sources
8
- * @returns true if workflow was found and set, false otherwise
9
- */
10
- export function setWorkflowByName(name, cwd, dispatch) {
11
- const config = getBuiltinWorkflow(name) || loadWorkflow(name);
12
- if (config) {
13
- dispatch({ type: 'SET_WORKFLOW', payload: { name, config } });
14
- saveLastWorkflow(cwd, name);
15
- return true;
16
- }
17
- return false;
18
- }
19
- //# sourceMappingURL=workflow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../../src/interactive/ink/utils/workflow.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,GAAW,EACX,QAA6B;IAE7B,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,MAAM,EAAE,CAAC;QACX,QAAQ,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9D,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,67 +0,0 @@
1
- /**
2
- * Asynchronous input buffer for takt
3
- *
4
- * Allows collecting user hints during workflow execution.
5
- * The workflow can retrieve these hints at any time without blocking.
6
- */
7
- import { EventEmitter } from 'node:events';
8
- /** Events emitted by InputBuffer */
9
- export interface InputBufferEvents {
10
- 'hint': (hint: string) => void;
11
- 'close': () => void;
12
- }
13
- /**
14
- * Asynchronous input buffer that collects user hints during workflow execution.
15
- *
16
- * This enables Claude Code-like behavior where users can provide hints
17
- * while the agent is processing, without interrupting the workflow.
18
- */
19
- export declare class InputBuffer extends EventEmitter {
20
- private buffer;
21
- private isActive;
22
- private keyHandler;
23
- private currentLine;
24
- constructor();
25
- /**
26
- * Start collecting input in the background.
27
- * User can type hints that will be buffered for later retrieval.
28
- */
29
- start(): void;
30
- /**
31
- * Stop collecting input.
32
- */
33
- stop(): void;
34
- /**
35
- * Get all buffered hints and clear the buffer.
36
- */
37
- flush(): string[];
38
- /**
39
- * Get all buffered hints without clearing.
40
- */
41
- peek(): readonly string[];
42
- /**
43
- * Check if there are any buffered hints.
44
- */
45
- hasHints(): boolean;
46
- /**
47
- * Get the count of buffered hints.
48
- */
49
- get hintCount(): number;
50
- /**
51
- * Check if the buffer is active.
52
- */
53
- get active(): boolean;
54
- /**
55
- * Add a hint programmatically (useful for testing).
56
- */
57
- addHint(hint: string): void;
58
- }
59
- /**
60
- * Get or create the global input buffer instance.
61
- */
62
- export declare function getInputBuffer(): InputBuffer;
63
- /**
64
- * Reset the global input buffer (for testing).
65
- */
66
- export declare function resetInputBuffer(): void;
67
- //# sourceMappingURL=input-buffer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-buffer.d.ts","sourceRoot":"","sources":["../../src/interactive/input-buffer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,oCAAoC;AACpC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,UAAU,CAA0C;IAC5D,OAAO,CAAC,WAAW,CAAc;;IAMjC;;;OAGG;IACH,KAAK,IAAI,IAAI;IAsDb;;OAEG;IACH,IAAI,IAAI,IAAI;IAmBZ;;OAEG;IACH,KAAK,IAAI,MAAM,EAAE;IAOjB;;OAEG;IACH,IAAI,IAAI,SAAS,MAAM,EAAE;IAIzB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAI5B;AAKD;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -1,162 +0,0 @@
1
- /**
2
- * Asynchronous input buffer for takt
3
- *
4
- * Allows collecting user hints during workflow execution.
5
- * The workflow can retrieve these hints at any time without blocking.
6
- */
7
- import { EventEmitter } from 'node:events';
8
- import chalk from 'chalk';
9
- import { createLogger } from '../utils/debug.js';
10
- const log = createLogger('input-buffer');
11
- /**
12
- * Asynchronous input buffer that collects user hints during workflow execution.
13
- *
14
- * This enables Claude Code-like behavior where users can provide hints
15
- * while the agent is processing, without interrupting the workflow.
16
- */
17
- export class InputBuffer extends EventEmitter {
18
- buffer = [];
19
- isActive = false;
20
- keyHandler = null;
21
- currentLine = '';
22
- constructor() {
23
- super();
24
- }
25
- /**
26
- * Start collecting input in the background.
27
- * User can type hints that will be buffered for later retrieval.
28
- */
29
- start() {
30
- if (this.isActive)
31
- return;
32
- this.isActive = true;
33
- this.buffer = [];
34
- this.currentLine = '';
35
- // Set stdin to raw mode if TTY
36
- if (process.stdin.isTTY) {
37
- process.stdin.setRawMode(true);
38
- }
39
- process.stdin.resume();
40
- // Create key handler
41
- this.keyHandler = (chunk) => {
42
- const key = chunk.toString();
43
- // Handle special keys
44
- if (key === '\r' || key === '\n') {
45
- // Enter key - submit the hint
46
- if (this.currentLine.trim()) {
47
- log.debug('Hint submitted', { hint: this.currentLine });
48
- this.buffer.push(this.currentLine);
49
- this.emit('hint', this.currentLine);
50
- // Show confirmation
51
- process.stdout.write(chalk.gray(`\n[Hint queued: ${this.currentLine.slice(0, 50)}${this.currentLine.length > 50 ? '...' : ''}]\n`));
52
- }
53
- this.currentLine = '';
54
- }
55
- else if (key === '\u0003') {
56
- // Ctrl+C - interrupt (let the main handler deal with it)
57
- // Don't add to buffer
58
- this.currentLine = '';
59
- }
60
- else if (key === '\u007F' || key === '\b') {
61
- // Backspace
62
- if (this.currentLine.length > 0) {
63
- this.currentLine = this.currentLine.slice(0, -1);
64
- // Visual feedback for backspace
65
- process.stdout.write('\b \b');
66
- }
67
- }
68
- else if (key === '\u001b') {
69
- // Escape - clear current input
70
- this.currentLine = '';
71
- }
72
- else if (key.charCodeAt(0) >= 32) {
73
- // Regular printable character
74
- this.currentLine += key;
75
- // Echo the character in gray (hint mode)
76
- process.stdout.write(chalk.gray(key));
77
- }
78
- };
79
- process.stdin.on('data', this.keyHandler);
80
- log.debug('Input buffer started');
81
- }
82
- /**
83
- * Stop collecting input.
84
- */
85
- stop() {
86
- if (!this.isActive)
87
- return;
88
- this.isActive = false;
89
- if (this.keyHandler) {
90
- process.stdin.removeListener('data', this.keyHandler);
91
- this.keyHandler = null;
92
- }
93
- // Restore stdin state
94
- if (process.stdin.isTTY) {
95
- process.stdin.setRawMode(false);
96
- }
97
- process.stdin.pause();
98
- this.emit('close');
99
- log.debug('Input buffer stopped');
100
- }
101
- /**
102
- * Get all buffered hints and clear the buffer.
103
- */
104
- flush() {
105
- const hints = [...this.buffer];
106
- this.buffer = [];
107
- log.debug('Buffer flushed', { hintCount: hints.length });
108
- return hints;
109
- }
110
- /**
111
- * Get all buffered hints without clearing.
112
- */
113
- peek() {
114
- return this.buffer;
115
- }
116
- /**
117
- * Check if there are any buffered hints.
118
- */
119
- hasHints() {
120
- return this.buffer.length > 0;
121
- }
122
- /**
123
- * Get the count of buffered hints.
124
- */
125
- get hintCount() {
126
- return this.buffer.length;
127
- }
128
- /**
129
- * Check if the buffer is active.
130
- */
131
- get active() {
132
- return this.isActive;
133
- }
134
- /**
135
- * Add a hint programmatically (useful for testing).
136
- */
137
- addHint(hint) {
138
- this.buffer.push(hint);
139
- this.emit('hint', hint);
140
- }
141
- }
142
- /** Singleton instance for global access */
143
- let globalInputBuffer = null;
144
- /**
145
- * Get or create the global input buffer instance.
146
- */
147
- export function getInputBuffer() {
148
- if (!globalInputBuffer) {
149
- globalInputBuffer = new InputBuffer();
150
- }
151
- return globalInputBuffer;
152
- }
153
- /**
154
- * Reset the global input buffer (for testing).
155
- */
156
- export function resetInputBuffer() {
157
- if (globalInputBuffer) {
158
- globalInputBuffer.stop();
159
- globalInputBuffer = null;
160
- }
161
- }
162
- //# sourceMappingURL=input-buffer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-buffer.js","sourceRoot":"","sources":["../../src/interactive/input-buffer.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CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF;AAED,2CAA2C;AAC3C,IAAI,iBAAiB,GAAuB,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,iBAAiB,GAAG,IAAI,WAAW,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,iBAAiB,EAAE,CAAC;QACtB,iBAAiB,CAAC,IAAI,EAAE,CAAC;QACzB,iBAAiB,GAAG,IAAI,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -1,50 +0,0 @@
1
- /**
2
- * Input event handlers for multiline input
3
- *
4
- * Contains keypress and line handlers used by multiLineQuestion.
5
- */
6
- import * as readline from 'node:readline';
7
- import { EscapeSequenceTracker } from './escape-tracker.js';
8
- import { InputHistoryManager } from './history-manager.js';
9
- /** Key event interface for keypress handling */
10
- export interface KeyEvent {
11
- name?: string;
12
- ctrl?: boolean;
13
- meta?: boolean;
14
- shift?: boolean;
15
- sequence?: string;
16
- }
17
- /** State for multiline input session */
18
- export interface MultilineInputState {
19
- lines: string[];
20
- insertNewlineOnNextLine: boolean;
21
- isFirstLine: boolean;
22
- promptStr: string;
23
- }
24
- /** Get readline's internal line state */
25
- export declare function getReadlineLine(rl: readline.Interface): string;
26
- /** Set readline's internal line and cursor state */
27
- export declare function setReadlineState(rl: readline.Interface, line: string, cursor: number): void;
28
- /** Format a history entry for display (truncate multi-line entries) */
29
- export declare function formatHistoryEntry(entry: string): string;
30
- /**
31
- * Determines if a key event should trigger multi-line input mode.
32
- */
33
- export declare function isMultilineInputTrigger(key: KeyEvent, escapeTracker: EscapeSequenceTracker): boolean;
34
- /** Check if a line ends with backslash for line continuation */
35
- export declare function hasBackslashContinuation(line: string): boolean;
36
- /** Remove trailing backslash used for line continuation */
37
- export declare function removeBackslashContinuation(line: string): string;
38
- /**
39
- * Create keypress handler for multiline input.
40
- */
41
- export declare function createKeypressHandler(rl: readline.Interface, state: MultilineInputState, escapeTracker: EscapeSequenceTracker, historyManager: InputHistoryManager): (str: string | undefined, key: KeyEvent) => void;
42
- /**
43
- * Create line handler for multiline input.
44
- */
45
- export declare function createLineHandler(rl: readline.Interface, state: MultilineInputState, historyManager: InputHistoryManager, cleanup: () => void, resolve: (value: string) => void): (line: string) => void;
46
- /**
47
- * Create SIGINT handler for multiline input.
48
- */
49
- export declare function createSigintHandler(rl: readline.Interface, state: MultilineInputState, historyManager: InputHistoryManager, onCtrlC: () => boolean | void, cleanup: () => void, resolve: (value: string) => void): () => void;
50
- //# sourceMappingURL=input-handlers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-handlers.d.ts","sourceRoot":"","sources":["../../src/interactive/input-handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI3D,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAA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C,KAAK,EAAE,MAAM,KAAK,IAAI,GAC/B,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAgCxB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,CAAC,SAAS,EACtB,KAAK,EAAE,mBAAmB,EAC1B,cAAc,EAAE,mBAAmB,EACnC,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,EAC7B,OAAO,EAAE,MAAM,IAAI,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAC/B,MAAM,IAAI,CAwBZ"}
@@ -1,170 +0,0 @@
1
- /**
2
- * Input event handlers for multiline input
3
- *
4
- * Contains keypress and line handlers used by multiLineQuestion.
5
- */
6
- import chalk from 'chalk';
7
- import { createLogger } from '../utils/debug.js';
8
- const log = createLogger('input');
9
- /** Get readline's internal line state */
10
- export function getReadlineLine(rl) {
11
- const internal = rl;
12
- return internal.line ?? '';
13
- }
14
- /** Set readline's internal line and cursor state */
15
- export function setReadlineState(rl, line, cursor) {
16
- const internal = rl;
17
- if ('line' in rl) {
18
- internal.line = line;
19
- }
20
- if ('cursor' in rl) {
21
- internal.cursor = cursor;
22
- }
23
- }
24
- /** Format a history entry for display (truncate multi-line entries) */
25
- export function formatHistoryEntry(entry) {
26
- const firstLine = entry.split('\n')[0] ?? '';
27
- const hasMoreLines = entry.includes('\n');
28
- return hasMoreLines ? firstLine + ' ...' : firstLine;
29
- }
30
- /**
31
- * Determines if a key event should trigger multi-line input mode.
32
- */
33
- export function isMultilineInputTrigger(key, escapeTracker) {
34
- const isEnterKey = key.name === 'return' || key.name === 'enter';
35
- const modifiedEnter = isEnterKey && (key.ctrl || key.meta || key.shift);
36
- const isCtrlJ = key.ctrl && (key.name === 'j' || key.sequence === '\n');
37
- const escapeSequences = key.sequence === '\x1b\r' ||
38
- key.sequence === '\u001b\r' ||
39
- key.sequence === '\x1bOM' ||
40
- key.sequence === '\u001bOM';
41
- const iterm2Style = isEnterKey && escapeTracker.isEscapeThenEnter();
42
- const result = modifiedEnter || isCtrlJ || escapeSequences || iterm2Style;
43
- if (isEnterKey || escapeSequences) {
44
- log.debug('isMultilineInputTrigger', {
45
- isEnterKey, modifiedEnter, isCtrlJ, escapeSequences, iterm2Style, result,
46
- });
47
- }
48
- return result;
49
- }
50
- /** Check if a line ends with backslash for line continuation */
51
- export function hasBackslashContinuation(line) {
52
- let backslashCount = 0;
53
- for (let i = line.length - 1; i >= 0 && line[i] === '\\'; i--) {
54
- backslashCount++;
55
- }
56
- return backslashCount % 2 === 1;
57
- }
58
- /** Remove trailing backslash used for line continuation */
59
- export function removeBackslashContinuation(line) {
60
- if (hasBackslashContinuation(line)) {
61
- return line.slice(0, -1);
62
- }
63
- return line;
64
- }
65
- /**
66
- * Create keypress handler for multiline input.
67
- */
68
- export function createKeypressHandler(rl, state, escapeTracker, historyManager) {
69
- const replaceCurrentLine = (newContent) => {
70
- const currentLine = getReadlineLine(rl);
71
- process.stdout.write('\r' + state.promptStr);
72
- process.stdout.write(' '.repeat(currentLine.length));
73
- process.stdout.write('\r' + state.promptStr + newContent);
74
- setReadlineState(rl, newContent, newContent.length);
75
- };
76
- return (_str, key) => {
77
- if (!key)
78
- return;
79
- const seqHex = key.sequence
80
- ? [...key.sequence].map(c => '0x' + c.charCodeAt(0).toString(16).padStart(2, '0')).join(' ')
81
- : '(none)';
82
- log.debug('keypress', {
83
- name: key.name, sequence: seqHex, ctrl: key.ctrl, meta: key.meta, shift: key.shift,
84
- });
85
- if (key.name === 'escape' || key.sequence === '\x1b') {
86
- escapeTracker.trackEscape();
87
- }
88
- if (isMultilineInputTrigger(key, escapeTracker)) {
89
- state.insertNewlineOnNextLine = true;
90
- return;
91
- }
92
- if (!state.isFirstLine)
93
- return;
94
- if (key.name === 'up' && historyManager.length > 0) {
95
- historyManager.saveCurrentInput(getReadlineLine(rl));
96
- const entry = historyManager.navigatePrevious();
97
- if (entry !== undefined) {
98
- replaceCurrentLine(formatHistoryEntry(entry));
99
- }
100
- return;
101
- }
102
- if (key.name === 'down') {
103
- const result = historyManager.navigateNext();
104
- if (result !== undefined) {
105
- const displayText = result.isCurrentInput ? result.entry : formatHistoryEntry(result.entry);
106
- replaceCurrentLine(displayText);
107
- }
108
- }
109
- };
110
- }
111
- /**
112
- * Create line handler for multiline input.
113
- */
114
- export function createLineHandler(rl, state, historyManager, cleanup, resolve) {
115
- const showPrompt = () => {
116
- const prefix = state.isFirstLine ? state.promptStr : chalk.gray('... ');
117
- rl.setPrompt(prefix);
118
- rl.prompt();
119
- };
120
- return (line) => {
121
- const hasBackslash = hasBackslashContinuation(line);
122
- log.debug('handleLine', { line, insertNewlineOnNextLine: state.insertNewlineOnNextLine, hasBackslash });
123
- if (state.insertNewlineOnNextLine || hasBackslash) {
124
- const cleanLine = hasBackslash ? removeBackslashContinuation(line) : line;
125
- state.lines.push(cleanLine);
126
- state.isFirstLine = false;
127
- state.insertNewlineOnNextLine = false;
128
- showPrompt();
129
- }
130
- else {
131
- cleanup();
132
- if (historyManager.isAtHistoryEntry() && state.isFirstLine) {
133
- const historyEntry = historyManager.getCurrentEntry();
134
- if (historyEntry !== undefined) {
135
- resolve(historyEntry);
136
- return;
137
- }
138
- }
139
- state.lines.push(line);
140
- resolve(state.lines.join('\n'));
141
- }
142
- };
143
- }
144
- /**
145
- * Create SIGINT handler for multiline input.
146
- */
147
- export function createSigintHandler(rl, state, historyManager, onCtrlC, cleanup, resolve) {
148
- const showPrompt = () => {
149
- const prefix = state.isFirstLine ? state.promptStr : chalk.gray('... ');
150
- rl.setPrompt(prefix);
151
- rl.prompt();
152
- };
153
- return () => {
154
- if (state.lines.length > 0) {
155
- state.lines.length = 0;
156
- state.isFirstLine = true;
157
- state.insertNewlineOnNextLine = false;
158
- historyManager.resetIndex();
159
- console.log();
160
- showPrompt();
161
- return;
162
- }
163
- const shouldCancel = onCtrlC();
164
- if (shouldCancel === true) {
165
- cleanup();
166
- resolve('');
167
- }
168
- };
169
- }
170
- //# source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;YACvB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,EAAsB,EACtB,KAA0B,EAC1B,cAAmC,EACnC,OAA6B,EAC7B,OAAmB,EACnB,OAAgC;IAEhC,MAAM,UAAU,GAAG,GAAS,EAAE;QAC5B,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACrB,EAAE,CAAC,MAAM,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,GAAS,EAAE;QAChB,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YACvB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YACzB,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC;YACtC,cAAc,CAAC,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,UAAU,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC;QAC/B,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;YAC1B,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Input handling module for takt interactive mode
3
- *
4
- * Handles readline interface, multi-line input, and input history management.
5
- *
6
- * Multi-line input methods:
7
- * - Ctrl+J: Works on all terminals (recommended for mac Terminal.app)
8
- * - Ctrl+Enter: Works on terminals that support it
9
- * - Option+Enter: Works on iTerm2 and some other Mac terminals
10
- * - Backslash continuation: End line with \ to continue on next line
11
- */
12
- import * as readline from 'node:readline';
13
- import { InputHistoryManager } from './history-manager.js';
14
- export { EscapeSequenceTracker } from './escape-tracker.js';
15
- export { InputHistoryManager } from './history-manager.js';
16
- export { isMultilineInputTrigger, hasBackslashContinuation, removeBackslashContinuation, type KeyEvent, } from './input-handlers.js';
17
- /** Create readline interface with keypress support */
18
- export declare function createReadlineInterface(): readline.Interface;
19
- /** Options for multiLineQuestion */
20
- export interface MultiLineQuestionOptions {
21
- promptStr: string;
22
- /**
23
- * Callback when Ctrl+C is pressed on the first line (no accumulated input).
24
- * Return `true` to cancel and resolve with empty string.
25
- * Return `void` or `false` to continue input (REPL behavior).
26
- */
27
- onCtrlC: () => boolean | void;
28
- historyManager: InputHistoryManager;
29
- }
30
- /**
31
- * Multi-line input using standard readline with Option+Return support and input history.
32
- *
33
- * This approach preserves all readline features (arrow keys, history, etc.)
34
- * while adding multi-line support via keypress event interception.
35
- *
36
- * - Enter: submit input (execute)
37
- * - Option+Enter (Mac) / Ctrl+Enter: insert newline (multi-line input)
38
- * - Up Arrow: navigate to previous input in history
39
- * - Down Arrow: navigate to next input in history
40
- * - Ctrl+C: interrupt / cancel
41
- */
42
- export declare function multiLineQuestion(rl: readline.Interface, options: MultiLineQuestionOptions): Promise<string>;
43
- //# sourceMappingURL=input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/interactive/input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAS3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAE7B,sDAAsD;AACtD,wBAAgB,uBAAuB,IAAI,QAAQ,CAAC,SAAS,CAS5D;AAED,oCAAoC;AACpC,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,mBAAmB,CAAC;CACrC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,QAAQ,CAAC,SAAS,EACtB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAsCjB"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Input handling module for takt interactive mode
3
- *
4
- * Handles readline interface, multi-line input, and input history management.
5
- *
6
- * Multi-line input methods:
7
- * - Ctrl+J: Works on all terminals (recommended for mac Terminal.app)
8
- * - Ctrl+Enter: Works on terminals that support it
9
- * - Option+Enter: Works on iTerm2 and some other Mac terminals
10
- * - Backslash continuation: End line with \ to continue on next line
11
- */
12
- import * as readline from 'node:readline';
13
- import { emitKeypressEvents } from 'node:readline';
14
- import { EscapeSequenceTracker } from './escape-tracker.js';
15
- import { createKeypressHandler, createLineHandler, createSigintHandler, } from './input-handlers.js';
16
- // Re-export for backward compatibility
17
- export { EscapeSequenceTracker } from './escape-tracker.js';
18
- export { InputHistoryManager } from './history-manager.js';
19
- export { isMultilineInputTrigger, hasBackslashContinuation, removeBackslashContinuation, } from './input-handlers.js';
20
- /** Create readline interface with keypress support */
21
- export function createReadlineInterface() {
22
- if (process.stdin.isTTY) {
23
- emitKeypressEvents(process.stdin);
24
- }
25
- return readline.createInterface({
26
- input: process.stdin,
27
- output: process.stdout,
28
- });
29
- }
30
- /**
31
- * Multi-line input using standard readline with Option+Return support and input history.
32
- *
33
- * This approach preserves all readline features (arrow keys, history, etc.)
34
- * while adding multi-line support via keypress event interception.
35
- *
36
- * - Enter: submit input (execute)
37
- * - Option+Enter (Mac) / Ctrl+Enter: insert newline (multi-line input)
38
- * - Up Arrow: navigate to previous input in history
39
- * - Down Arrow: navigate to next input in history
40
- * - Ctrl+C: interrupt / cancel
41
- */
42
- export function multiLineQuestion(rl, options) {
43
- const { promptStr, onCtrlC, historyManager } = options;
44
- return new Promise((resolve) => {
45
- const state = {
46
- lines: [],
47
- insertNewlineOnNextLine: false,
48
- isFirstLine: true,
49
- promptStr,
50
- };
51
- const escapeTracker = new EscapeSequenceTracker();
52
- historyManager.resetIndex();
53
- const cleanup = () => {
54
- process.stdin.removeListener('keypress', handleKeypress);
55
- rl.removeListener('line', handleLine);
56
- rl.removeListener('close', handleClose);
57
- rl.removeListener('SIGINT', handleSigint);
58
- };
59
- const handleKeypress = createKeypressHandler(rl, state, escapeTracker, historyManager);
60
- const handleLine = createLineHandler(rl, state, historyManager, cleanup, resolve);
61
- const handleSigint = createSigintHandler(rl, state, historyManager, onCtrlC, cleanup, resolve);
62
- const handleClose = () => {
63
- cleanup();
64
- resolve(state.lines.length > 0 ? state.lines.join('\n') : '');
65
- };
66
- process.stdin.on('keypress', handleKeypress);
67
- rl.on('line', handleLine);
68
- rl.on('close', handleClose);
69
- rl.on('SIGINT', handleSigint);
70
- rl.setPrompt(promptStr);
71
- rl.prompt();
72
- });
73
- }
74
- //# sourceMappingURL=input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/interactive/input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,qBAAqB,CAAC;AAE7B,uCAAuC;AACvC,OAA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