@ebowwa/coder 0.7.63 → 0.7.65

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 (364) hide show
  1. package/dist/core/__tests__/permissions.test.d.ts +12 -0
  2. package/dist/core/__tests__/permissions.test.d.ts.map +1 -0
  3. package/dist/core/__tests__/permissions.test.js +851 -0
  4. package/dist/core/agent-loop/__tests__/compaction.test.d.ts +5 -0
  5. package/dist/core/agent-loop/__tests__/compaction.test.d.ts.map +1 -0
  6. package/dist/core/agent-loop/__tests__/compaction.test.js +209 -0
  7. package/dist/core/agent-loop/__tests__/formatters.test.d.ts +5 -0
  8. package/dist/core/agent-loop/__tests__/formatters.test.d.ts.map +1 -0
  9. package/dist/core/agent-loop/__tests__/formatters.test.js +195 -0
  10. package/dist/core/agent-loop/__tests__/index.test.d.ts +5 -0
  11. package/dist/core/agent-loop/__tests__/index.test.d.ts.map +1 -0
  12. package/dist/core/agent-loop/__tests__/index.test.js +121 -0
  13. package/dist/core/agent-loop/__tests__/loop-state.test.d.ts +5 -0
  14. package/dist/core/agent-loop/__tests__/loop-state.test.d.ts.map +1 -0
  15. package/dist/core/agent-loop/__tests__/loop-state.test.js +340 -0
  16. package/dist/core/agent-loop/__tests__/message-builder.test.d.ts +5 -0
  17. package/dist/core/agent-loop/__tests__/message-builder.test.d.ts.map +1 -0
  18. package/dist/core/agent-loop/__tests__/message-builder.test.js +178 -0
  19. package/dist/core/agent-loop/__tests__/tool-executor.test.d.ts +5 -0
  20. package/dist/core/agent-loop/__tests__/tool-executor.test.d.ts.map +1 -0
  21. package/dist/core/agent-loop/__tests__/tool-executor.test.js +331 -0
  22. package/dist/core/agent-loop/compaction.d.ts +39 -0
  23. package/dist/core/agent-loop/compaction.d.ts.map +1 -0
  24. package/dist/core/agent-loop/compaction.js +51 -0
  25. package/dist/core/agent-loop/formatters.d.ts +21 -0
  26. package/dist/core/agent-loop/formatters.d.ts.map +1 -0
  27. package/dist/core/agent-loop/formatters.js +42 -0
  28. package/dist/core/agent-loop/index.d.ts +25 -0
  29. package/dist/core/agent-loop/index.d.ts.map +1 -0
  30. package/dist/core/agent-loop/index.js +83 -0
  31. package/dist/core/agent-loop/loop-state.d.ts +74 -0
  32. package/dist/core/agent-loop/loop-state.d.ts.map +1 -0
  33. package/dist/core/agent-loop/loop-state.js +147 -0
  34. package/dist/core/agent-loop/message-builder.d.ts +13 -0
  35. package/dist/core/agent-loop/message-builder.d.ts.map +1 -0
  36. package/dist/core/agent-loop/message-builder.js +49 -0
  37. package/dist/core/agent-loop/tool-executor.d.ts +23 -0
  38. package/dist/core/agent-loop/tool-executor.d.ts.map +1 -0
  39. package/dist/core/agent-loop/tool-executor.js +152 -0
  40. package/dist/core/agent-loop/turn-executor.d.ts +57 -0
  41. package/dist/core/agent-loop/turn-executor.d.ts.map +1 -0
  42. package/dist/core/agent-loop/turn-executor.js +124 -0
  43. package/dist/core/agent-loop/types.d.ts +141 -0
  44. package/dist/core/agent-loop/types.d.ts.map +1 -0
  45. package/dist/core/agent-loop/types.js +4 -0
  46. package/dist/core/agent-loop.d.ts +17 -0
  47. package/dist/core/agent-loop.d.ts.map +1 -0
  48. package/dist/core/agent-loop.js +16 -0
  49. package/dist/core/api-client-impl.d.ts +62 -0
  50. package/dist/core/api-client-impl.d.ts.map +1 -0
  51. package/dist/core/api-client-impl.js +479 -0
  52. package/dist/core/api-client.d.ts +6 -0
  53. package/dist/core/api-client.d.ts.map +1 -0
  54. package/dist/core/api-client.js +5 -0
  55. package/dist/core/checkpoints.d.ts +128 -0
  56. package/dist/core/checkpoints.d.ts.map +1 -0
  57. package/dist/core/checkpoints.js +438 -0
  58. package/dist/core/claude-md.d.ts +71 -0
  59. package/dist/core/claude-md.d.ts.map +1 -0
  60. package/dist/core/claude-md.js +198 -0
  61. package/dist/core/cognitive-security/hooks.d.ts +138 -0
  62. package/dist/core/cognitive-security/hooks.d.ts.map +1 -0
  63. package/dist/core/cognitive-security/hooks.js +389 -0
  64. package/dist/core/cognitive-security/index.d.ts +751 -0
  65. package/dist/core/cognitive-security/index.d.ts.map +1 -0
  66. package/dist/core/cognitive-security/index.js +1123 -0
  67. package/dist/core/cognitive-security/middleware.d.ts +136 -0
  68. package/dist/core/cognitive-security/middleware.d.ts.map +1 -0
  69. package/dist/core/cognitive-security/middleware.js +376 -0
  70. package/dist/core/config-loader.d.ts +127 -0
  71. package/dist/core/config-loader.d.ts.map +1 -0
  72. package/dist/core/config-loader.js +219 -0
  73. package/dist/core/context-compaction.d.ts +87 -0
  74. package/dist/core/context-compaction.d.ts.map +1 -0
  75. package/dist/core/context-compaction.js +428 -0
  76. package/dist/core/git-status.d.ts +25 -0
  77. package/dist/core/git-status.d.ts.map +1 -0
  78. package/dist/core/git-status.js +204 -0
  79. package/dist/core/image.d.ts +69 -0
  80. package/dist/core/image.d.ts.map +1 -0
  81. package/dist/core/image.js +290 -0
  82. package/dist/core/image.test.d.ts +2 -0
  83. package/dist/core/image.test.d.ts.map +1 -0
  84. package/dist/core/image.test.js +149 -0
  85. package/dist/core/models.d.ts +123 -0
  86. package/dist/core/models.d.ts.map +1 -0
  87. package/dist/core/models.js +325 -0
  88. package/dist/core/permissions.d.ts +81 -0
  89. package/dist/core/permissions.d.ts.map +1 -0
  90. package/dist/core/permissions.js +327 -0
  91. package/dist/core/retry.d.ts +25 -0
  92. package/dist/core/retry.d.ts.map +1 -0
  93. package/dist/core/retry.js +121 -0
  94. package/dist/core/session-store.d.ts +9 -0
  95. package/dist/core/session-store.d.ts.map +1 -0
  96. package/dist/core/session-store.js +10 -0
  97. package/dist/core/sessions/export.d.ts +47 -0
  98. package/dist/core/sessions/export.d.ts.map +1 -0
  99. package/dist/core/sessions/export.js +256 -0
  100. package/dist/core/sessions/index.d.ts +132 -0
  101. package/dist/core/sessions/index.d.ts.map +1 -0
  102. package/dist/core/sessions/index.js +442 -0
  103. package/dist/core/sessions/metadata.d.ts +77 -0
  104. package/dist/core/sessions/metadata.d.ts.map +1 -0
  105. package/dist/core/sessions/metadata.js +233 -0
  106. package/dist/core/sessions/persistence.d.ts +72 -0
  107. package/dist/core/sessions/persistence.d.ts.map +1 -0
  108. package/dist/core/sessions/persistence.js +201 -0
  109. package/dist/core/sessions/types.d.ts +110 -0
  110. package/dist/core/sessions/types.d.ts.map +1 -0
  111. package/dist/core/sessions/types.js +4 -0
  112. package/dist/core/stream-highlighter.d.ts +18 -0
  113. package/dist/core/stream-highlighter.d.ts.map +1 -0
  114. package/dist/core/stream-highlighter.js +916 -0
  115. package/dist/core/system-reminders.d.ts +89 -0
  116. package/dist/core/system-reminders.d.ts.map +1 -0
  117. package/dist/core/system-reminders.js +285 -0
  118. package/dist/ecosystem/hooks/__tests__/index.test.d.ts +5 -0
  119. package/dist/ecosystem/hooks/__tests__/index.test.d.ts.map +1 -0
  120. package/dist/ecosystem/hooks/__tests__/index.test.js +458 -0
  121. package/dist/ecosystem/hooks/index.d.ts +59 -0
  122. package/dist/ecosystem/hooks/index.d.ts.map +1 -0
  123. package/dist/ecosystem/hooks/index.js +294 -0
  124. package/dist/ecosystem/hooks/prompt-evaluator.d.ts +32 -0
  125. package/dist/ecosystem/hooks/prompt-evaluator.d.ts.map +1 -0
  126. package/dist/ecosystem/hooks/prompt-evaluator.js +229 -0
  127. package/dist/ecosystem/skills/index.d.ts +55 -0
  128. package/dist/ecosystem/skills/index.d.ts.map +1 -0
  129. package/dist/ecosystem/skills/index.js +258 -0
  130. package/dist/ecosystem/tools/__tests__/index.test.d.ts +7 -0
  131. package/dist/ecosystem/tools/__tests__/index.test.d.ts.map +1 -0
  132. package/dist/ecosystem/tools/__tests__/index.test.js +856 -0
  133. package/dist/ecosystem/tools/index.d.ts +24 -0
  134. package/dist/ecosystem/tools/index.d.ts.map +1 -0
  135. package/dist/ecosystem/tools/index.js +1709 -0
  136. package/dist/index.d.ts +24 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.js +33688 -49712
  139. package/dist/interfaces/mcp/client.d.ts +40 -0
  140. package/dist/interfaces/mcp/client.d.ts.map +1 -0
  141. package/dist/interfaces/mcp/client.js +309 -0
  142. package/dist/interfaces/ui/index.d.ts +36 -0
  143. package/dist/interfaces/ui/index.d.ts.map +1 -0
  144. package/dist/interfaces/ui/index.js +61 -0
  145. package/dist/interfaces/ui/spinner.d.ts +140 -0
  146. package/dist/interfaces/ui/spinner.d.ts.map +1 -0
  147. package/dist/interfaces/ui/spinner.js +342 -0
  148. package/dist/interfaces/ui/terminal/cli/index.d.ts +12 -0
  149. package/dist/interfaces/ui/terminal/cli/index.d.ts.map +1 -0
  150. package/dist/interfaces/ui/terminal/cli/index.js +32012 -50526
  151. package/dist/interfaces/ui/terminal/native/README.md +53 -0
  152. package/dist/interfaces/ui/terminal/native/claude_code_native.darwin-x64.node +0 -0
  153. package/dist/interfaces/ui/terminal/native/claude_code_native.dylib +0 -0
  154. package/dist/interfaces/ui/terminal/native/index.d.ts +0 -0
  155. package/dist/interfaces/ui/terminal/native/index.darwin-arm64.node +0 -0
  156. package/dist/interfaces/ui/terminal/native/index.js +43 -0
  157. package/dist/interfaces/ui/terminal/native/index.node +0 -0
  158. package/dist/interfaces/ui/terminal/native/package.json +34 -0
  159. package/dist/interfaces/ui/terminal/shared/args.d.ts +39 -0
  160. package/dist/interfaces/ui/terminal/shared/args.d.ts.map +1 -0
  161. package/dist/interfaces/ui/terminal/shared/args.js +176 -0
  162. package/dist/interfaces/ui/terminal/shared/index.d.ts +11 -0
  163. package/dist/interfaces/ui/terminal/shared/index.d.ts.map +1 -0
  164. package/dist/interfaces/ui/terminal/shared/index.js +16 -0
  165. package/dist/interfaces/ui/terminal/shared/loading-state.d.ts +124 -0
  166. package/dist/interfaces/ui/terminal/shared/loading-state.d.ts.map +1 -0
  167. package/dist/interfaces/ui/terminal/shared/loading-state.js +246 -0
  168. package/dist/interfaces/ui/terminal/shared/query.d.ts +22 -0
  169. package/dist/interfaces/ui/terminal/shared/query.d.ts.map +1 -0
  170. package/dist/interfaces/ui/terminal/shared/query.js +100 -0
  171. package/dist/interfaces/ui/terminal/shared/setup.d.ts +33 -0
  172. package/dist/interfaces/ui/terminal/shared/setup.d.ts.map +1 -0
  173. package/dist/interfaces/ui/terminal/shared/setup.js +226 -0
  174. package/dist/interfaces/ui/terminal/shared/status-line.d.ts +117 -0
  175. package/dist/interfaces/ui/terminal/shared/status-line.d.ts.map +1 -0
  176. package/dist/interfaces/ui/terminal/shared/status-line.js +267 -0
  177. package/dist/interfaces/ui/terminal/shared/system-prompt.d.ts +38 -0
  178. package/dist/interfaces/ui/terminal/shared/system-prompt.d.ts.map +1 -0
  179. package/dist/interfaces/ui/terminal/shared/system-prompt.js +102 -0
  180. package/dist/interfaces/ui/terminal/tui/HelpPanel.d.ts +39 -0
  181. package/dist/interfaces/ui/terminal/tui/HelpPanel.d.ts.map +1 -0
  182. package/dist/interfaces/ui/terminal/tui/HelpPanel.js +215 -0
  183. package/dist/interfaces/ui/terminal/tui/InputContext.d.ts +91 -0
  184. package/dist/interfaces/ui/terminal/tui/InputContext.d.ts.map +1 -0
  185. package/dist/interfaces/ui/terminal/tui/InputContext.js +154 -0
  186. package/dist/interfaces/ui/terminal/tui/InputField.d.ts +18 -0
  187. package/dist/interfaces/ui/terminal/tui/InputField.d.ts.map +1 -0
  188. package/dist/interfaces/ui/terminal/tui/InputField.js +41 -0
  189. package/dist/interfaces/ui/terminal/tui/InteractiveTUI.d.ts +16 -0
  190. package/dist/interfaces/ui/terminal/tui/InteractiveTUI.d.ts.map +1 -0
  191. package/dist/interfaces/ui/terminal/tui/InteractiveTUI.js +451 -0
  192. package/dist/interfaces/ui/terminal/tui/MessageArea.d.ts +10 -0
  193. package/dist/interfaces/ui/terminal/tui/MessageArea.d.ts.map +1 -0
  194. package/dist/interfaces/ui/terminal/tui/MessageArea.js +91 -0
  195. package/dist/interfaces/ui/terminal/tui/MessageStore.d.ts +48 -0
  196. package/dist/interfaces/ui/terminal/tui/MessageStore.d.ts.map +1 -0
  197. package/dist/interfaces/ui/terminal/tui/MessageStore.js +151 -0
  198. package/dist/interfaces/ui/terminal/tui/StatusBar.d.ts +9 -0
  199. package/dist/interfaces/ui/terminal/tui/StatusBar.d.ts.map +1 -0
  200. package/dist/interfaces/ui/terminal/tui/StatusBar.js +36 -0
  201. package/dist/interfaces/ui/terminal/tui/commands.d.ts +21 -0
  202. package/dist/interfaces/ui/terminal/tui/commands.d.ts.map +1 -0
  203. package/dist/interfaces/ui/terminal/tui/commands.js +359 -0
  204. package/dist/interfaces/ui/terminal/tui/components/InteractiveElements.d.ts +115 -0
  205. package/dist/interfaces/ui/terminal/tui/components/InteractiveElements.d.ts.map +1 -0
  206. package/dist/interfaces/ui/terminal/tui/components/InteractiveElements.js +306 -0
  207. package/dist/interfaces/ui/terminal/tui/components/MultilineInput.d.ts +92 -0
  208. package/dist/interfaces/ui/terminal/tui/components/MultilineInput.d.ts.map +1 -0
  209. package/dist/interfaces/ui/terminal/tui/components/MultilineInput.js +399 -0
  210. package/dist/interfaces/ui/terminal/tui/components/PaneManager.d.ts +59 -0
  211. package/dist/interfaces/ui/terminal/tui/components/PaneManager.d.ts.map +1 -0
  212. package/dist/interfaces/ui/terminal/tui/components/PaneManager.js +139 -0
  213. package/dist/interfaces/ui/terminal/tui/components/Sidebar.d.ts +68 -0
  214. package/dist/interfaces/ui/terminal/tui/components/Sidebar.d.ts.map +1 -0
  215. package/dist/interfaces/ui/terminal/tui/components/Sidebar.js +340 -0
  216. package/dist/interfaces/ui/terminal/tui/components/index.d.ts +23 -0
  217. package/dist/interfaces/ui/terminal/tui/components/index.d.ts.map +1 -0
  218. package/dist/interfaces/ui/terminal/tui/components/index.js +51 -0
  219. package/dist/interfaces/ui/terminal/tui/console.d.ts +20 -0
  220. package/dist/interfaces/ui/terminal/tui/console.d.ts.map +1 -0
  221. package/dist/interfaces/ui/terminal/tui/console.js +46 -0
  222. package/dist/interfaces/ui/terminal/tui/index.d.ts +20 -0
  223. package/dist/interfaces/ui/terminal/tui/index.d.ts.map +1 -0
  224. package/dist/interfaces/ui/terminal/tui/index.js +28 -0
  225. package/dist/interfaces/ui/terminal/tui/run.d.ts +13 -0
  226. package/dist/interfaces/ui/terminal/tui/run.d.ts.map +1 -0
  227. package/dist/interfaces/ui/terminal/tui/run.js +31 -0
  228. package/dist/interfaces/ui/terminal/tui/spinner.d.ts +44 -0
  229. package/dist/interfaces/ui/terminal/tui/spinner.d.ts.map +1 -0
  230. package/dist/interfaces/ui/terminal/tui/spinner.js +59 -0
  231. package/dist/interfaces/ui/terminal/tui/tui-app.d.ts +39 -0
  232. package/dist/interfaces/ui/terminal/tui/tui-app.d.ts.map +1 -0
  233. package/dist/interfaces/ui/terminal/tui/tui-app.js +198 -0
  234. package/dist/interfaces/ui/terminal/tui/tui-footer.d.ts +167 -0
  235. package/dist/interfaces/ui/terminal/tui/tui-footer.d.ts.map +1 -0
  236. package/dist/interfaces/ui/terminal/tui/tui-footer.js +330 -0
  237. package/dist/interfaces/ui/terminal/tui/types.d.ts +165 -0
  238. package/dist/interfaces/ui/terminal/tui/types.d.ts.map +1 -0
  239. package/dist/interfaces/ui/terminal/tui/types.js +5 -0
  240. package/dist/interfaces/ui/terminal/tui/useInputHandler.d.ts +23 -0
  241. package/dist/interfaces/ui/terminal/tui/useInputHandler.d.ts.map +1 -0
  242. package/dist/interfaces/ui/terminal/tui/useInputHandler.js +72 -0
  243. package/dist/interfaces/ui/terminal/tui/useNativeInput.d.ts +90 -0
  244. package/dist/interfaces/ui/terminal/tui/useNativeInput.d.ts.map +1 -0
  245. package/dist/interfaces/ui/terminal/tui/useNativeInput.js +188 -0
  246. package/dist/native/README.md +53 -0
  247. package/dist/native/claude_code_native.darwin-x64.node +0 -0
  248. package/dist/native/claude_code_native.dylib +0 -0
  249. package/dist/native/index.d.ts +0 -0
  250. package/dist/native/index.d.ts.map +1 -0
  251. package/dist/native/index.darwin-arm64.node +0 -0
  252. package/dist/native/index.js +43 -0
  253. package/dist/native/index.node +0 -0
  254. package/dist/native/package.json +34 -0
  255. package/dist/teammates/index.d.ts +161 -0
  256. package/dist/teammates/index.d.ts.map +1 -0
  257. package/dist/teammates/index.js +827 -0
  258. package/dist/types/index.d.ts +482 -0
  259. package/dist/types/index.d.ts.map +1 -0
  260. package/dist/types/index.js +52 -0
  261. package/native/index.darwin-arm64.node +0 -0
  262. package/native/index.js +33 -19
  263. package/package.json +6 -3
  264. package/packages/src/core/__tests__/permissions.test.ts +1091 -0
  265. package/packages/src/core/agent-loop/__tests__/compaction.test.ts +283 -0
  266. package/packages/src/core/agent-loop/__tests__/formatters.test.ts +234 -0
  267. package/packages/src/core/agent-loop/__tests__/index.test.ts +162 -0
  268. package/packages/src/core/agent-loop/__tests__/loop-state.test.ts +413 -0
  269. package/packages/src/core/agent-loop/__tests__/message-builder.test.ts +229 -0
  270. package/packages/src/core/agent-loop/__tests__/tool-executor.test.ts +457 -0
  271. package/packages/src/core/agent-loop/compaction.ts +92 -0
  272. package/packages/src/core/agent-loop/formatters.ts +50 -0
  273. package/packages/src/core/agent-loop/index.ts +137 -0
  274. package/packages/src/core/agent-loop/loop-state.ts +187 -0
  275. package/packages/src/core/agent-loop/message-builder.ts +62 -0
  276. package/packages/src/core/agent-loop/tool-executor.ts +211 -0
  277. package/packages/src/core/agent-loop/turn-executor.ts +226 -0
  278. package/packages/src/core/agent-loop/types.ts +152 -0
  279. package/packages/src/core/agent-loop.ts +18 -0
  280. package/packages/src/core/api-client-impl.ts +729 -0
  281. package/packages/src/core/api-client.ts +6 -0
  282. package/packages/src/core/checkpoints.ts +606 -0
  283. package/packages/src/core/claude-md.ts +272 -0
  284. package/packages/src/core/cognitive-security/hooks.ts +591 -0
  285. package/packages/src/core/cognitive-security/index.ts +2041 -0
  286. package/packages/src/core/cognitive-security/middleware.ts +536 -0
  287. package/packages/src/core/config/todo +7 -0
  288. package/packages/src/core/config-loader.ts +324 -0
  289. package/packages/src/core/context/__tests__/integration.test.ts +334 -0
  290. package/packages/src/core/context/compaction.ts +170 -0
  291. package/packages/src/core/context/constants.ts +58 -0
  292. package/packages/src/core/context/extraction.ts +85 -0
  293. package/packages/src/core/context/index.ts +66 -0
  294. package/packages/src/core/context/summarization.ts +251 -0
  295. package/packages/src/core/context/token-estimation.ts +98 -0
  296. package/packages/src/core/context/types.ts +59 -0
  297. package/packages/src/core/git-status.ts +262 -0
  298. package/packages/src/core/image.test.ts +180 -0
  299. package/packages/src/core/image.ts +350 -0
  300. package/packages/src/core/lmdb.db +0 -0
  301. package/packages/src/core/lmdb.db-lock +0 -0
  302. package/packages/src/core/models.ts +507 -0
  303. package/packages/src/core/normalizers/todo +8 -0
  304. package/packages/src/core/permissions.ts +431 -0
  305. package/packages/src/core/providers/README.md +230 -0
  306. package/packages/src/core/providers/__tests__/providers.test.ts +135 -0
  307. package/packages/src/core/providers/index.ts +419 -0
  308. package/packages/src/core/providers/types.ts +132 -0
  309. package/packages/src/core/retry.ts +180 -0
  310. package/packages/src/core/session-store.ts +36 -0
  311. package/packages/src/core/sessions/export.ts +329 -0
  312. package/packages/src/core/sessions/index.ts +587 -0
  313. package/packages/src/core/sessions/metadata.ts +309 -0
  314. package/packages/src/core/sessions/persistence.ts +244 -0
  315. package/packages/src/core/sessions/types.ts +169 -0
  316. package/packages/src/core/stream-highlighter.ts +1123 -0
  317. package/packages/src/core/system-reminders.ts +402 -0
  318. package/packages/src/core/todo +8 -0
  319. package/packages/src/ecosystem/hooks/__tests__/index.test.ts +561 -0
  320. package/packages/src/ecosystem/hooks/index.ts +341 -0
  321. package/packages/src/ecosystem/hooks/prompt-evaluator.ts +300 -0
  322. package/packages/src/ecosystem/skills/index.ts +295 -0
  323. package/packages/src/ecosystem/tools/__tests__/index.test.ts +1335 -0
  324. package/packages/src/ecosystem/tools/index.ts +2051 -0
  325. package/packages/src/index.ts +141 -0
  326. package/packages/src/interfaces/mcp/client.ts +389 -0
  327. package/packages/src/interfaces/ui/index.ts +158 -0
  328. package/packages/src/interfaces/ui/lmdb.db +0 -0
  329. package/packages/src/interfaces/ui/lmdb.db-lock +0 -0
  330. package/packages/src/interfaces/ui/spinner.ts +451 -0
  331. package/packages/src/interfaces/ui/terminal/bridge/index.ts +370 -0
  332. package/packages/src/interfaces/ui/terminal/bridge/ipc.ts +829 -0
  333. package/packages/src/interfaces/ui/terminal/bridge/screen-export.ts +968 -0
  334. package/packages/src/interfaces/ui/terminal/bridge/types.ts +226 -0
  335. package/packages/src/interfaces/ui/terminal/bridge/useBridge.ts +210 -0
  336. package/packages/src/interfaces/ui/terminal/cli/bootstrap.ts +132 -0
  337. package/packages/src/interfaces/ui/terminal/cli/index.ts +415 -0
  338. package/packages/src/interfaces/ui/terminal/cli/interactive/index.ts +110 -0
  339. package/packages/src/interfaces/ui/terminal/cli/interactive/input-handler.ts +393 -0
  340. package/packages/src/interfaces/ui/terminal/cli/interactive/interactive-runner.ts +820 -0
  341. package/packages/src/interfaces/ui/terminal/cli/interactive/message-store.ts +299 -0
  342. package/packages/src/interfaces/ui/terminal/cli/interactive/types.ts +274 -0
  343. package/packages/src/interfaces/ui/terminal/lmdb.db +0 -0
  344. package/packages/src/interfaces/ui/terminal/lmdb.db-lock +0 -0
  345. package/packages/src/interfaces/ui/terminal/shared/args.ts +222 -0
  346. package/packages/src/interfaces/ui/terminal/shared/index.ts +84 -0
  347. package/packages/src/interfaces/ui/terminal/shared/loading-state.ts +322 -0
  348. package/packages/src/interfaces/ui/terminal/shared/query.ts +152 -0
  349. package/packages/src/interfaces/ui/terminal/shared/setup.ts +299 -0
  350. package/packages/src/interfaces/ui/terminal/shared/spinner-frames.ts +73 -0
  351. package/packages/src/interfaces/ui/terminal/shared/status-line.ts +366 -0
  352. package/packages/src/interfaces/ui/terminal/shared/system-prompt.ts +146 -0
  353. package/packages/src/lmdb.db +0 -0
  354. package/packages/src/lmdb.db-lock +0 -0
  355. package/packages/src/native/index.ts +2722 -0
  356. package/packages/src/native/tui_v2_types.ts +39 -0
  357. package/packages/src/teammates/coordination.test.ts +279 -0
  358. package/packages/src/teammates/coordination.ts +646 -0
  359. package/packages/src/teammates/index.ts +1052 -0
  360. package/packages/src/teammates/integration.test.ts +272 -0
  361. package/packages/src/teammates/runner.test.ts +235 -0
  362. package/packages/src/teammates/runner.ts +750 -0
  363. package/packages/src/teammates/schemas.ts +673 -0
  364. package/packages/src/types/index.ts +723 -0
@@ -0,0 +1,215 @@
1
+ /** @jsx React.createElement */
2
+ /**
3
+ * Help Panel Component
4
+ * Displays contextual help with tabbed sections
5
+ */
6
+ import React, { useState, useEffect } from "react";
7
+ import { Box, Text, useStdout } from "ink";
8
+ import chalk from "chalk";
9
+ /**
10
+ * General help section - basic usage
11
+ */
12
+ const GENERAL_HELP = `
13
+ ${chalk.bold.cyan("Claude understands your codebase, makes edits with your permission,")}
14
+ ${chalk.bold.cyan("and executes commands — right from your terminal.")}
15
+
16
+ ${chalk.gray("─").repeat(60)}
17
+
18
+ ${chalk.yellow("Input Features:")}
19
+ ${chalk.green("@")} <path> ${chalk.gray("Reference files or directories")}
20
+ ${chalk.green("&")} ${chalk.gray("Run command in background")}
21
+ ${chalk.green("#")} <memory> ${chalk.gray("Add to persistent memory")}
22
+
23
+ ${chalk.yellow("Keyboard Shortcuts:")}
24
+ ${chalk.cyan("ctrl + o")} ${chalk.gray("Toggle verbose output")}
25
+ ${chalk.cyan("meta + o")} ${chalk.gray("Toggle fast mode")}
26
+ ${chalk.cyan("shift + ⏎")} ${chalk.gray("Insert newline")}
27
+ ${chalk.cyan("ctrl + c")} ${chalk.gray("Exit session")}
28
+ ${chalk.cyan("ctrl + b")} ${chalk.gray("Background task menu")}
29
+
30
+ ${chalk.gray("─").repeat(60)}
31
+
32
+ ${chalk.dim("For more help:")} ${chalk.blue.underline("https://code.claude.com/docs/en/overview")}
33
+ `;
34
+ /**
35
+ * Commands help section
36
+ */
37
+ const COMMANDS_HELP = `
38
+ ${chalk.bold.yellow("Session Commands:")}
39
+ ${chalk.green("/help")}, ${chalk.green("/?")} Show this help
40
+ ${chalk.green("/exit")}, ${chalk.green("/q")} Exit the session
41
+ ${chalk.green("/new")} Start a fresh session
42
+ ${chalk.green("/clear")} Clear conversation history
43
+ ${chalk.green("/status")} Show session status
44
+ ${chalk.green("/cost")} Show total cost
45
+
46
+ ${chalk.bold.yellow("Model Commands:")}
47
+ ${chalk.green("/model")} <name> Switch model
48
+ ${chalk.green("/models")} List available models
49
+ ${chalk.green("/tools")} List available tools
50
+
51
+ ${chalk.bold.yellow("Context Commands:")}
52
+ ${chalk.green("/compact")} Force context compaction
53
+ ${chalk.green("/export")} [fmt] Export session (json/md/jsonl)
54
+
55
+ ${chalk.bold.yellow("Session Management:")}
56
+ ${chalk.green("/resume")} [id] Resume session
57
+ ${chalk.green("/sessions")} List recent sessions
58
+ `;
59
+ /**
60
+ * Checkpoint commands help section
61
+ */
62
+ const CHECKPOINTS_HELP = `
63
+ ${chalk.bold.magenta("Checkpoint Commands:")}
64
+ ${chalk.gray("Save and restore conversation + code state")}
65
+
66
+ ${chalk.green("/checkpoint")} <label> Save checkpoint
67
+ ${chalk.green("/checkpoints")} List saved checkpoints
68
+ ${chalk.green("/restore")} <id> Restore checkpoint
69
+ ${chalk.green("/restore-chat")} <id> Restore chat only
70
+ ${chalk.green("/undo")} Go back to previous state
71
+ ${chalk.green("/redo")} Go forward
72
+ ${chalk.green("/cps-status")} Navigation status
73
+
74
+ ${chalk.gray("─").repeat(60)}
75
+
76
+ ${chalk.dim("Checkpoints capture:")}
77
+ ${chalk.gray("• Conversation history")}
78
+ ${chalk.gray("• File snapshots")}
79
+ ${chalk.gray("• Git state")}
80
+ ${chalk.gray("• Cost/tokens used")}
81
+ `;
82
+ /**
83
+ * Custom commands help section
84
+ */
85
+ const CUSTOM_HELP = `
86
+ ${chalk.bold.blue("Custom Commands & Skills:")}
87
+ ${chalk.gray("Extend Coder with your own commands")}
88
+
89
+ ${chalk.yellow("Skills:")}
90
+ ${chalk.green("/commit")} Create a git commit
91
+ ${chalk.green("/review-pr")} Review a pull request
92
+ ${chalk.green("/git")} Git workflow helper
93
+ ${chalk.green("/mcp-builder")} Build MCP servers
94
+
95
+ ${chalk.yellow("Configuration:")}
96
+ ${chalk.cyan("~/.claude/CLAUDE.md")} ${chalk.gray("Global instructions")}
97
+ ${chalk.cyan(".claude/CLAUDE.md")} ${chalk.gray("Project instructions")}
98
+ ${chalk.cyan("~/.claude.json")} ${chalk.gray("MCP servers config")}
99
+ ${chalk.cyan("~/.claude/settings.json")} ${chalk.gray("Hooks & permissions")}
100
+ ${chalk.cyan("~/.claude/keybindings.json")} ${chalk.gray("Custom keybindings")}
101
+
102
+ ${chalk.gray("─").repeat(60)}
103
+
104
+ ${chalk.dim("Create custom skills in:")} ${chalk.cyan("~/.claude/skills/")}
105
+ `;
106
+ /**
107
+ * Keybindings help section
108
+ */
109
+ const KEYBINDINGS_HELP = `
110
+ ${chalk.bold.green("Keyboard Shortcuts")}
111
+
112
+ ${chalk.yellow("Input Editing:")}
113
+ ${chalk.cyan("← →")} Move cursor
114
+ ${chalk.cyan("Home / End")} Jump to start/end
115
+ ${chalk.cyan("ctrl + a")} Jump to start
116
+ ${chalk.cyan("ctrl + e")} Jump to end
117
+ ${chalk.cyan("ctrl + u")} Clear line
118
+ ${chalk.cyan("ctrl + w")} Delete word
119
+
120
+ ${chalk.yellow("Navigation:")}
121
+ ${chalk.cyan("Page Up / Down")} Scroll messages
122
+ ${chalk.cyan("shift + ↑ ↓")} Scroll one line
123
+ ${chalk.cyan("tab")} Cycle help sections
124
+ ${chalk.cyan("← →")} Cycle sections (in help)
125
+
126
+ ${chalk.yellow("Session:")}
127
+ ${chalk.cyan("ctrl + c")} Exit session
128
+ ${chalk.cyan("ctrl + d")} Exit (alternative)
129
+ ${chalk.cyan("ctrl + b")} Background tasks
130
+
131
+ ${chalk.gray("─").repeat(60)}
132
+
133
+ ${chalk.dim("Customize:")} ${chalk.green("/keybindings")}
134
+ `;
135
+ /**
136
+ * All help sections
137
+ */
138
+ const HELP_SECTIONS = [
139
+ { id: "general", title: "general", content: GENERAL_HELP },
140
+ { id: "commands", title: "commands", content: COMMANDS_HELP },
141
+ { id: "checkpoints", title: "checkpoints", content: CHECKPOINTS_HELP },
142
+ { id: "custom", title: "custom-commands", content: CUSTOM_HELP },
143
+ { id: "keybindings", title: "keybindings", content: KEYBINDINGS_HELP },
144
+ ];
145
+ /**
146
+ * Help Panel Component
147
+ */
148
+ export function HelpPanel({ activeSection = "general", onClose }) {
149
+ const [currentSection, setCurrentSection] = useState(0);
150
+ const { stdout } = useStdout();
151
+ // Find initial section index
152
+ useEffect(() => {
153
+ const index = HELP_SECTIONS.findIndex(s => s.id === activeSection);
154
+ if (index >= 0) {
155
+ setCurrentSection(index);
156
+ }
157
+ }, [activeSection]);
158
+ const section = HELP_SECTIONS[currentSection];
159
+ if (!section)
160
+ return null;
161
+ // Build tab bar
162
+ const tabBar = HELP_SECTIONS.map((s, i) => {
163
+ const isActive = i === currentSection;
164
+ const label = s.title;
165
+ if (isActive) {
166
+ return chalk.bgCyan.black(` ${label} `);
167
+ }
168
+ return chalk.dim(` ${label} `);
169
+ }).join(chalk.gray("│"));
170
+ // Navigation hint
171
+ const navHint = chalk.dim("←/→ or tab to cycle");
172
+ return (React.createElement(Box, { flexDirection: "column", width: stdout.columns || 80 },
173
+ React.createElement(Box, null,
174
+ React.createElement(Text, null,
175
+ chalk.gray("─").repeat(3),
176
+ chalk.bold.cyan(" Coder "),
177
+ chalk.gray("v0.2.0 ─ "),
178
+ tabBar,
179
+ chalk.gray(" ─ "),
180
+ navHint,
181
+ chalk.gray("─".repeat(Math.max(0, (stdout.columns || 80) - 60))))),
182
+ React.createElement(Box, { flexDirection: "column", paddingX: 1 },
183
+ React.createElement(Text, null, section.content)),
184
+ React.createElement(Box, null,
185
+ React.createElement(Text, { dimColor: true }, chalk.gray("─").repeat(Math.min((stdout.columns || 80), 80))))));
186
+ }
187
+ /**
188
+ * Get all help sections
189
+ */
190
+ export function getHelpSections() {
191
+ return HELP_SECTIONS;
192
+ }
193
+ /**
194
+ * Get help text for a specific section (for non-interactive display)
195
+ */
196
+ export function getHelpText(section) {
197
+ if (section) {
198
+ const s = HELP_SECTIONS.find(s => s.id === section || s.title === section);
199
+ if (s)
200
+ return s.content;
201
+ }
202
+ // Return all sections combined
203
+ return HELP_SECTIONS.map(s => s.content).join("\n");
204
+ }
205
+ /**
206
+ * Get compact help text (single line per command)
207
+ */
208
+ export function getCompactHelpText() {
209
+ return `
210
+ Commands: /help /exit /new /clear /compact /model /models /tools /cost /status /resume
211
+ Checkpoints: /checkpoint /checkpoints /restore /undo /redo /cps-status
212
+ Export: /export [json|md|jsonl]
213
+ `;
214
+ }
215
+ export default HelpPanel;
@@ -0,0 +1,91 @@
1
+ /** @jsx React.createElement */
2
+ /** @jsxFrag React.Fragment */
3
+ /**
4
+ * Centralized Input Management System
5
+ *
6
+ * Single source of truth for keyboard input across all TUI components.
7
+ * Solves the problem of multiple components fighting over stdin.
8
+ *
9
+ * Architecture:
10
+ * - InputProvider wraps the entire TUI
11
+ * - Components register/unregister as input handlers
12
+ * - Focus system ensures only ONE handler receives input
13
+ * - Priority system for modals/overlays
14
+ */
15
+ import React from "react";
16
+ import type { NativeKeyEvent } from "../../../../native/index.js";
17
+ export type { NativeKeyEvent } from "../../../../native/index.js";
18
+ export type InputHandler = (event: NativeKeyEvent) => boolean;
19
+ export interface InputHandlerOptions {
20
+ /** Unique ID for this handler */
21
+ id: string;
22
+ /** Priority (higher = receives input first) */
23
+ priority?: number;
24
+ /** Handler function - return true to consume, false to pass through */
25
+ handler: InputHandler;
26
+ /** Whether this handler is currently active */
27
+ isActive?: boolean;
28
+ }
29
+ export interface InputContextValue {
30
+ /** Register an input handler */
31
+ register: (options: InputHandlerOptions) => () => void;
32
+ /** Set focus to a specific handler */
33
+ focus: (handlerId: string) => void;
34
+ /** Get currently focused handler ID */
35
+ focusedId: string | null;
36
+ /** Dispatch a key event to handlers */
37
+ dispatch: (event: NativeKeyEvent) => boolean;
38
+ /** Whether input is currently blocked */
39
+ isBlocked: boolean;
40
+ /** Block/unblock input (for loading states) */
41
+ setBlocked: (blocked: boolean) => void;
42
+ }
43
+ declare const InputContext: React.Context<InputContextValue | null>;
44
+ export declare function useInputContext(): InputContextValue;
45
+ export interface InputProviderProps {
46
+ children: React.ReactNode;
47
+ /** Initial blocked state */
48
+ initialBlocked?: boolean;
49
+ }
50
+ export declare function InputProvider({ children, initialBlocked }: InputProviderProps): React.JSX.Element;
51
+ /**
52
+ * Hook to register an input handler with the centralized system
53
+ * Automatically unregisters on unmount
54
+ */
55
+ export declare function useInputRegistration(id: string, handler: InputHandler, options?: {
56
+ priority?: number;
57
+ isActive?: boolean;
58
+ }): void;
59
+ export declare const useInputHandler: typeof useInputRegistration;
60
+ /**
61
+ * Hook to receive focus for a handler
62
+ */
63
+ export declare function useInputFocus(handlerId: string): {
64
+ isFocused: boolean;
65
+ focus: () => void;
66
+ };
67
+ /**
68
+ * Hook for components that need to block input
69
+ */
70
+ export declare function useInputBlock(): {
71
+ isBlocked: boolean;
72
+ setBlocked: (blocked: boolean) => void;
73
+ };
74
+ export declare const InputPriority: {
75
+ /** Normal components */
76
+ readonly DEFAULT: 0;
77
+ /** Focused input fields */
78
+ readonly INPUT: 10;
79
+ /** Selectable lists */
80
+ readonly LIST: 20;
81
+ /** Sidebar */
82
+ readonly SIDEBAR: 30;
83
+ /** Modal dialogs */
84
+ readonly MODAL: 100;
85
+ /** Toast notifications (can dismiss) */
86
+ readonly TOAST: 110;
87
+ /** System-level (Ctrl+C, etc.) */
88
+ readonly SYSTEM: 1000;
89
+ };
90
+ export default InputContext;
91
+ //# sourceMappingURL=InputContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputContext.d.ts","sourceRoot":"","sources":["../../../../../packages/src/interfaces/ui/terminal/tui/InputContext.tsx"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,8BAA8B;AAC9B;;;;;;;;;;;GAWG;AAEH,OAAO,KAA8E,MAAM,OAAO,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAMlE,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;AAE9D,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,OAAO,EAAE,YAAY,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,QAAQ,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,MAAM,IAAI,CAAC;IACvD,sCAAsC;IACtC,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,uCAAuC;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uCAAuC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;IAC7C,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAMD,QAAA,MAAM,YAAY,yCAAgD,CAAC;AAEnE,wBAAgB,eAAe,IAAI,iBAAiB,CAMnD;AAMD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4BAA4B;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,cAAsB,EAAE,EAAE,kBAAkB,qBA8ErF;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,QAYxD;AAGD,eAAO,MAAM,eAAe,6BAAuB,CAAC;AAEpD;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM;;;EAQ9C;AAED;;GAEG;AACH,wBAAgB,aAAa;;0BAvJL,OAAO,KAAK,IAAI;EA0JvC;AAMD,eAAO,MAAM,aAAa;IACxB,wBAAwB;;IAExB,2BAA2B;;IAE3B,uBAAuB;;IAEvB,cAAc;;IAEd,oBAAoB;;IAEpB,wCAAwC;;IAExC,kCAAkC;;CAE1B,CAAC;AAMX,eAAe,YAAY,CAAC"}
@@ -0,0 +1,154 @@
1
+ /** @jsx React.createElement */
2
+ /** @jsxFrag React.Fragment */
3
+ /**
4
+ * Centralized Input Management System
5
+ *
6
+ * Single source of truth for keyboard input across all TUI components.
7
+ * Solves the problem of multiple components fighting over stdin.
8
+ *
9
+ * Architecture:
10
+ * - InputProvider wraps the entire TUI
11
+ * - Components register/unregister as input handlers
12
+ * - Focus system ensures only ONE handler receives input
13
+ * - Priority system for modals/overlays
14
+ */
15
+ import React, { createContext, useContext, useState, useCallback, useRef, useEffect } from "react";
16
+ // ============================================
17
+ // CONTEXT
18
+ // ============================================
19
+ const InputContext = createContext(null);
20
+ export function useInputContext() {
21
+ const ctx = useContext(InputContext);
22
+ if (!ctx) {
23
+ throw new Error("useInputContext must be used within InputProvider");
24
+ }
25
+ return ctx;
26
+ }
27
+ export function InputProvider({ children, initialBlocked = false }) {
28
+ const handlersRef = useRef(new Map());
29
+ const [focusedId, setFocusedId] = useState(null);
30
+ const [isBlocked, setIsBlocked] = useState(initialBlocked);
31
+ const register = useCallback((options) => {
32
+ const { id } = options;
33
+ handlersRef.current.set(id, options);
34
+ // If no focus set, focus this handler
35
+ if (!focusedId) {
36
+ setFocusedId(id);
37
+ }
38
+ // Return unregister function
39
+ return () => {
40
+ handlersRef.current.delete(id);
41
+ if (focusedId === id) {
42
+ // Focus next available handler (highest priority)
43
+ const remaining = Array.from(handlersRef.current.values())
44
+ .filter(h => h.isActive !== false)
45
+ .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
46
+ setFocusedId(remaining[0]?.id ?? null);
47
+ }
48
+ };
49
+ }, [focusedId]);
50
+ const focus = useCallback((handlerId) => {
51
+ if (handlersRef.current.has(handlerId)) {
52
+ setFocusedId(handlerId);
53
+ }
54
+ }, []);
55
+ const dispatch = useCallback((event) => {
56
+ if (isBlocked)
57
+ return false;
58
+ // Get all active handlers sorted by priority (highest first)
59
+ const activeHandlers = Array.from(handlersRef.current.values())
60
+ .filter(h => h.isActive !== false)
61
+ .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
62
+ // First, try the focused handler
63
+ if (focusedId) {
64
+ const focused = handlersRef.current.get(focusedId);
65
+ if (focused?.isActive !== false && focused?.handler) {
66
+ const consumed = focused.handler(event);
67
+ if (consumed)
68
+ return true;
69
+ }
70
+ }
71
+ // Then try other handlers by priority
72
+ for (const h of activeHandlers) {
73
+ if (h.id === focusedId)
74
+ continue; // Already tried
75
+ const consumed = h.handler(event);
76
+ if (consumed)
77
+ return true;
78
+ }
79
+ return false;
80
+ }, [isBlocked, focusedId]);
81
+ const setBlocked = useCallback((blocked) => {
82
+ setIsBlocked(blocked);
83
+ }, []);
84
+ const value = {
85
+ register,
86
+ focus,
87
+ focusedId,
88
+ dispatch,
89
+ isBlocked,
90
+ setBlocked,
91
+ };
92
+ return (React.createElement(InputContext.Provider, { value: value }, children));
93
+ }
94
+ // ============================================
95
+ // CONVENIENCE HOOKS
96
+ // ============================================
97
+ /**
98
+ * Hook to register an input handler with the centralized system
99
+ * Automatically unregisters on unmount
100
+ */
101
+ export function useInputRegistration(id, handler, options = {}) {
102
+ const { register } = useInputContext();
103
+ useEffect(() => {
104
+ return register({
105
+ id,
106
+ handler,
107
+ priority: options.priority,
108
+ isActive: options.isActive,
109
+ });
110
+ }, [id, handler, options.priority, options.isActive, register]);
111
+ }
112
+ // Alias for convenience
113
+ export const useInputHandler = useInputRegistration;
114
+ /**
115
+ * Hook to receive focus for a handler
116
+ */
117
+ export function useInputFocus(handlerId) {
118
+ const { focus, focusedId } = useInputContext();
119
+ const isFocused = focusedId === handlerId;
120
+ return {
121
+ isFocused,
122
+ focus: () => focus(handlerId),
123
+ };
124
+ }
125
+ /**
126
+ * Hook for components that need to block input
127
+ */
128
+ export function useInputBlock() {
129
+ const { isBlocked, setBlocked } = useInputContext();
130
+ return { isBlocked, setBlocked };
131
+ }
132
+ // ============================================
133
+ // PRIORITY CONSTANTS
134
+ // ============================================
135
+ export const InputPriority = {
136
+ /** Normal components */
137
+ DEFAULT: 0,
138
+ /** Focused input fields */
139
+ INPUT: 10,
140
+ /** Selectable lists */
141
+ LIST: 20,
142
+ /** Sidebar */
143
+ SIDEBAR: 30,
144
+ /** Modal dialogs */
145
+ MODAL: 100,
146
+ /** Toast notifications (can dismiss) */
147
+ TOAST: 110,
148
+ /** System-level (Ctrl+C, etc.) */
149
+ SYSTEM: 1000,
150
+ };
151
+ // ============================================
152
+ // EXPORTS
153
+ // ============================================
154
+ export default InputContext;
@@ -0,0 +1,18 @@
1
+ /** @jsx React.createElement */
2
+ /** @jsxFrag React.Fragment */
3
+ /**
4
+ * Input Field Component - Simple plain text input
5
+ */
6
+ import React from "react";
7
+ import type { InputFieldProps } from "./types.js";
8
+ export declare function setGlobalInput(value: string, cursor: number): void;
9
+ export declare function getGlobalInput(): {
10
+ value: string;
11
+ cursorPos: number;
12
+ };
13
+ /**
14
+ * Simple input field - just text, no box
15
+ */
16
+ export declare function InputField({ placeholder, isActive }: Omit<InputFieldProps, "value" | "cursorPos">): React.JSX.Element;
17
+ export default InputField;
18
+ //# sourceMappingURL=InputField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../../../../packages/src/interfaces/ui/terminal/tui/InputField.tsx"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,8BAA8B;AAC9B;;GAEG;AAEH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAI3D;AAED,wBAAgB,cAAc;;;EAE7B;AAWD;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,WAAW,CAAC,qBAsBjG;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,41 @@
1
+ /** @jsx React.createElement */
2
+ /** @jsxFrag React.Fragment */
3
+ /**
4
+ * Input Field Component - Simple plain text input
5
+ */
6
+ import React, { useSyncExternalStore } from "react";
7
+ import { Text } from "ink";
8
+ // Global input display state - bypasses React batching
9
+ let globalInputValue = "";
10
+ let globalCursorPos = 0;
11
+ const listeners = new Set();
12
+ export function setGlobalInput(value, cursor) {
13
+ globalInputValue = value;
14
+ globalCursorPos = cursor;
15
+ listeners.forEach((listener) => listener());
16
+ }
17
+ export function getGlobalInput() {
18
+ return { value: globalInputValue, cursorPos: globalCursorPos };
19
+ }
20
+ function subscribe(callback) {
21
+ listeners.add(callback);
22
+ return () => listeners.delete(callback);
23
+ }
24
+ function getSnapshot() {
25
+ return { value: globalInputValue, cursorPos: globalCursorPos };
26
+ }
27
+ /**
28
+ * Simple input field - just text, no box
29
+ */
30
+ export function InputField({ placeholder, isActive }) {
31
+ const { value, cursorPos } = useSyncExternalStore(subscribe, getSnapshot);
32
+ const beforeCursor = value.slice(0, cursorPos);
33
+ const afterCursor = value.slice(cursorPos);
34
+ return (React.createElement(Text, null,
35
+ React.createElement(Text, { bold: true, color: isActive ? "cyan" : "gray" }, "You: "),
36
+ value.length > 0 ? (React.createElement(React.Fragment, null,
37
+ beforeCursor,
38
+ React.createElement(Text, { backgroundColor: "cyan", color: "black" }, cursorPos < value.length ? value[cursorPos] : " "),
39
+ afterCursor)) : (React.createElement(Text, { dimColor: true }, placeholder))));
40
+ }
41
+ export default InputField;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Main Interactive TUI Component
3
+ * Orchestrates all sub-components and manages state and agent loop
4
+ *
5
+ * Uses:
6
+ * - MessageStore: Centralized message state management
7
+ * - InputContext: Centralized keyboard input handling
8
+ */
9
+ import React from "react";
10
+ import type { InteractiveTUIProps } from "./types.js";
11
+ /**
12
+ * Main Interactive TUI Component with providers
13
+ */
14
+ declare function InteractiveTUI(props: InteractiveTUIProps): React.JSX.Element;
15
+ export default InteractiveTUI;
16
+ //# sourceMappingURL=InteractiveTUI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractiveTUI.d.ts","sourceRoot":"","sources":["../../../../../packages/src/interfaces/ui/terminal/tui/InteractiveTUI.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAA4D,MAAM,OAAO,CAAC;AAcjF,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,YAAY,CAAC;AAsftE;;GAEG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAMjD;AAED,eAAe,cAAc,CAAC"}