helixmind 0.5.4

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 (808) hide show
  1. package/LICENSE +73 -0
  2. package/README.md +323 -0
  3. package/dist/cli/agent/autonomous.d.ts +24 -0
  4. package/dist/cli/agent/autonomous.d.ts.map +1 -0
  5. package/dist/cli/agent/autonomous.js +194 -0
  6. package/dist/cli/agent/autonomous.js.map +1 -0
  7. package/dist/cli/agent/loop.d.ts +87 -0
  8. package/dist/cli/agent/loop.d.ts.map +1 -0
  9. package/dist/cli/agent/loop.js +492 -0
  10. package/dist/cli/agent/loop.js.map +1 -0
  11. package/dist/cli/agent/monitor/alerter.d.ts +29 -0
  12. package/dist/cli/agent/monitor/alerter.d.ts.map +1 -0
  13. package/dist/cli/agent/monitor/alerter.js +80 -0
  14. package/dist/cli/agent/monitor/alerter.js.map +1 -0
  15. package/dist/cli/agent/monitor/baseline.d.ts +14 -0
  16. package/dist/cli/agent/monitor/baseline.d.ts.map +1 -0
  17. package/dist/cli/agent/monitor/baseline.js +157 -0
  18. package/dist/cli/agent/monitor/baseline.js.map +1 -0
  19. package/dist/cli/agent/monitor/prompts.d.ts +9 -0
  20. package/dist/cli/agent/monitor/prompts.d.ts.map +1 -0
  21. package/dist/cli/agent/monitor/prompts.js +103 -0
  22. package/dist/cli/agent/monitor/prompts.js.map +1 -0
  23. package/dist/cli/agent/monitor/responder.d.ts +12 -0
  24. package/dist/cli/agent/monitor/responder.d.ts.map +1 -0
  25. package/dist/cli/agent/monitor/responder.js +59 -0
  26. package/dist/cli/agent/monitor/responder.js.map +1 -0
  27. package/dist/cli/agent/monitor/scanner.d.ts +18 -0
  28. package/dist/cli/agent/monitor/scanner.d.ts.map +1 -0
  29. package/dist/cli/agent/monitor/scanner.js +81 -0
  30. package/dist/cli/agent/monitor/scanner.js.map +1 -0
  31. package/dist/cli/agent/monitor/types.d.ts +119 -0
  32. package/dist/cli/agent/monitor/types.d.ts.map +1 -0
  33. package/dist/cli/agent/monitor/types.js +5 -0
  34. package/dist/cli/agent/monitor/types.js.map +1 -0
  35. package/dist/cli/agent/monitor/watcher.d.ts +4 -0
  36. package/dist/cli/agent/monitor/watcher.d.ts.map +1 -0
  37. package/dist/cli/agent/monitor/watcher.js +214 -0
  38. package/dist/cli/agent/monitor/watcher.js.map +1 -0
  39. package/dist/cli/agent/permissions.d.ts +65 -0
  40. package/dist/cli/agent/permissions.d.ts.map +1 -0
  41. package/dist/cli/agent/permissions.js +447 -0
  42. package/dist/cli/agent/permissions.js.map +1 -0
  43. package/dist/cli/agent/plan-engine.d.ts +72 -0
  44. package/dist/cli/agent/plan-engine.d.ts.map +1 -0
  45. package/dist/cli/agent/plan-engine.js +261 -0
  46. package/dist/cli/agent/plan-engine.js.map +1 -0
  47. package/dist/cli/agent/plan-executor.d.ts +37 -0
  48. package/dist/cli/agent/plan-executor.d.ts.map +1 -0
  49. package/dist/cli/agent/plan-executor.js +105 -0
  50. package/dist/cli/agent/plan-executor.js.map +1 -0
  51. package/dist/cli/agent/plan-types.d.ts +50 -0
  52. package/dist/cli/agent/plan-types.d.ts.map +1 -0
  53. package/dist/cli/agent/plan-types.js +58 -0
  54. package/dist/cli/agent/plan-types.js.map +1 -0
  55. package/dist/cli/agent/sandbox.d.ts +28 -0
  56. package/dist/cli/agent/sandbox.d.ts.map +1 -0
  57. package/dist/cli/agent/sandbox.js +298 -0
  58. package/dist/cli/agent/sandbox.js.map +1 -0
  59. package/dist/cli/agent/swarm.d.ts +75 -0
  60. package/dist/cli/agent/swarm.d.ts.map +1 -0
  61. package/dist/cli/agent/swarm.js +272 -0
  62. package/dist/cli/agent/swarm.js.map +1 -0
  63. package/dist/cli/agent/tools/browser-click.d.ts +2 -0
  64. package/dist/cli/agent/tools/browser-click.d.ts.map +1 -0
  65. package/dist/cli/agent/tools/browser-click.js +35 -0
  66. package/dist/cli/agent/tools/browser-click.js.map +1 -0
  67. package/dist/cli/agent/tools/browser-close.d.ts +2 -0
  68. package/dist/cli/agent/tools/browser-close.d.ts.map +1 -0
  69. package/dist/cli/agent/tools/browser-close.js +27 -0
  70. package/dist/cli/agent/tools/browser-close.js.map +1 -0
  71. package/dist/cli/agent/tools/browser-navigate.d.ts +2 -0
  72. package/dist/cli/agent/tools/browser-navigate.d.ts.map +1 -0
  73. package/dist/cli/agent/tools/browser-navigate.js +27 -0
  74. package/dist/cli/agent/tools/browser-navigate.js.map +1 -0
  75. package/dist/cli/agent/tools/browser-open.d.ts +2 -0
  76. package/dist/cli/agent/tools/browser-open.d.ts.map +1 -0
  77. package/dist/cli/agent/tools/browser-open.js +38 -0
  78. package/dist/cli/agent/tools/browser-open.js.map +1 -0
  79. package/dist/cli/agent/tools/browser-screenshot.d.ts +2 -0
  80. package/dist/cli/agent/tools/browser-screenshot.d.ts.map +1 -0
  81. package/dist/cli/agent/tools/browser-screenshot.js +68 -0
  82. package/dist/cli/agent/tools/browser-screenshot.js.map +1 -0
  83. package/dist/cli/agent/tools/browser-type.d.ts +2 -0
  84. package/dist/cli/agent/tools/browser-type.d.ts.map +1 -0
  85. package/dist/cli/agent/tools/browser-type.js +33 -0
  86. package/dist/cli/agent/tools/browser-type.js.map +1 -0
  87. package/dist/cli/agent/tools/bug-list.d.ts +2 -0
  88. package/dist/cli/agent/tools/bug-list.d.ts.map +1 -0
  89. package/dist/cli/agent/tools/bug-list.js +82 -0
  90. package/dist/cli/agent/tools/bug-list.js.map +1 -0
  91. package/dist/cli/agent/tools/bug-report.d.ts +2 -0
  92. package/dist/cli/agent/tools/bug-report.d.ts.map +1 -0
  93. package/dist/cli/agent/tools/bug-report.js +130 -0
  94. package/dist/cli/agent/tools/bug-report.js.map +1 -0
  95. package/dist/cli/agent/tools/edit-file.d.ts +2 -0
  96. package/dist/cli/agent/tools/edit-file.d.ts.map +1 -0
  97. package/dist/cli/agent/tools/edit-file.js +61 -0
  98. package/dist/cli/agent/tools/edit-file.js.map +1 -0
  99. package/dist/cli/agent/tools/find.d.ts +2 -0
  100. package/dist/cli/agent/tools/find.d.ts.map +1 -0
  101. package/dist/cli/agent/tools/find.js +35 -0
  102. package/dist/cli/agent/tools/find.js.map +1 -0
  103. package/dist/cli/agent/tools/git-commit.d.ts +2 -0
  104. package/dist/cli/agent/tools/git-commit.d.ts.map +1 -0
  105. package/dist/cli/agent/tools/git-commit.js +57 -0
  106. package/dist/cli/agent/tools/git-commit.js.map +1 -0
  107. package/dist/cli/agent/tools/git-diff.d.ts +2 -0
  108. package/dist/cli/agent/tools/git-diff.d.ts.map +1 -0
  109. package/dist/cli/agent/tools/git-diff.js +45 -0
  110. package/dist/cli/agent/tools/git-diff.js.map +1 -0
  111. package/dist/cli/agent/tools/git-log.d.ts +2 -0
  112. package/dist/cli/agent/tools/git-log.d.ts.map +1 -0
  113. package/dist/cli/agent/tools/git-log.js +41 -0
  114. package/dist/cli/agent/tools/git-log.js.map +1 -0
  115. package/dist/cli/agent/tools/git-status.d.ts +2 -0
  116. package/dist/cli/agent/tools/git-status.d.ts.map +1 -0
  117. package/dist/cli/agent/tools/git-status.js +52 -0
  118. package/dist/cli/agent/tools/git-status.js.map +1 -0
  119. package/dist/cli/agent/tools/list-dir.d.ts +2 -0
  120. package/dist/cli/agent/tools/list-dir.d.ts.map +1 -0
  121. package/dist/cli/agent/tools/list-dir.js +73 -0
  122. package/dist/cli/agent/tools/list-dir.js.map +1 -0
  123. package/dist/cli/agent/tools/read-file.d.ts +2 -0
  124. package/dist/cli/agent/tools/read-file.d.ts.map +1 -0
  125. package/dist/cli/agent/tools/read-file.js +45 -0
  126. package/dist/cli/agent/tools/read-file.js.map +1 -0
  127. package/dist/cli/agent/tools/registry.d.ts +34 -0
  128. package/dist/cli/agent/tools/registry.d.ts.map +1 -0
  129. package/dist/cli/agent/tools/registry.js +53 -0
  130. package/dist/cli/agent/tools/registry.js.map +1 -0
  131. package/dist/cli/agent/tools/run-command.d.ts +2 -0
  132. package/dist/cli/agent/tools/run-command.d.ts.map +1 -0
  133. package/dist/cli/agent/tools/run-command.js +112 -0
  134. package/dist/cli/agent/tools/run-command.js.map +1 -0
  135. package/dist/cli/agent/tools/search.d.ts +2 -0
  136. package/dist/cli/agent/tools/search.d.ts.map +1 -0
  137. package/dist/cli/agent/tools/search.js +104 -0
  138. package/dist/cli/agent/tools/search.js.map +1 -0
  139. package/dist/cli/agent/tools/spiral-query.d.ts +2 -0
  140. package/dist/cli/agent/tools/spiral-query.d.ts.map +1 -0
  141. package/dist/cli/agent/tools/spiral-query.js +52 -0
  142. package/dist/cli/agent/tools/spiral-query.js.map +1 -0
  143. package/dist/cli/agent/tools/spiral-store.d.ts +2 -0
  144. package/dist/cli/agent/tools/spiral-store.d.ts.map +1 -0
  145. package/dist/cli/agent/tools/spiral-store.js +37 -0
  146. package/dist/cli/agent/tools/spiral-store.js.map +1 -0
  147. package/dist/cli/agent/tools/web-research.d.ts +2 -0
  148. package/dist/cli/agent/tools/web-research.d.ts.map +1 -0
  149. package/dist/cli/agent/tools/web-research.js +96 -0
  150. package/dist/cli/agent/tools/web-research.js.map +1 -0
  151. package/dist/cli/agent/tools/write-file.d.ts +2 -0
  152. package/dist/cli/agent/tools/write-file.d.ts.map +1 -0
  153. package/dist/cli/agent/tools/write-file.js +86 -0
  154. package/dist/cli/agent/tools/write-file.js.map +1 -0
  155. package/dist/cli/agent/undo.d.ts +30 -0
  156. package/dist/cli/agent/undo.d.ts.map +1 -0
  157. package/dist/cli/agent/undo.js +48 -0
  158. package/dist/cli/agent/undo.js.map +1 -0
  159. package/dist/cli/auth/callback-server.d.ts +15 -0
  160. package/dist/cli/auth/callback-server.d.ts.map +1 -0
  161. package/dist/cli/auth/callback-server.js +169 -0
  162. package/dist/cli/auth/callback-server.js.map +1 -0
  163. package/dist/cli/auth/feature-gate.d.ts +47 -0
  164. package/dist/cli/auth/feature-gate.d.ts.map +1 -0
  165. package/dist/cli/auth/feature-gate.js +171 -0
  166. package/dist/cli/auth/feature-gate.js.map +1 -0
  167. package/dist/cli/auth/guard.d.ts +11 -0
  168. package/dist/cli/auth/guard.d.ts.map +1 -0
  169. package/dist/cli/auth/guard.js +94 -0
  170. package/dist/cli/auth/guard.js.map +1 -0
  171. package/dist/cli/auth/login.d.ts +22 -0
  172. package/dist/cli/auth/login.d.ts.map +1 -0
  173. package/dist/cli/auth/login.js +287 -0
  174. package/dist/cli/auth/login.js.map +1 -0
  175. package/dist/cli/auth/logout.d.ts +6 -0
  176. package/dist/cli/auth/logout.d.ts.map +1 -0
  177. package/dist/cli/auth/logout.js +36 -0
  178. package/dist/cli/auth/logout.js.map +1 -0
  179. package/dist/cli/bench/dataset.d.ts +13 -0
  180. package/dist/cli/bench/dataset.d.ts.map +1 -0
  181. package/dist/cli/bench/dataset.js +97 -0
  182. package/dist/cli/bench/dataset.js.map +1 -0
  183. package/dist/cli/bench/harness.d.ts +7 -0
  184. package/dist/cli/bench/harness.d.ts.map +1 -0
  185. package/dist/cli/bench/harness.js +135 -0
  186. package/dist/cli/bench/harness.js.map +1 -0
  187. package/dist/cli/bench/metrics.d.ts +15 -0
  188. package/dist/cli/bench/metrics.d.ts.map +1 -0
  189. package/dist/cli/bench/metrics.js +98 -0
  190. package/dist/cli/bench/metrics.js.map +1 -0
  191. package/dist/cli/bench/output.d.ts +42 -0
  192. package/dist/cli/bench/output.d.ts.map +1 -0
  193. package/dist/cli/bench/output.js +140 -0
  194. package/dist/cli/bench/output.js.map +1 -0
  195. package/dist/cli/bench/prompt.d.ts +13 -0
  196. package/dist/cli/bench/prompt.d.ts.map +1 -0
  197. package/dist/cli/bench/prompt.js +106 -0
  198. package/dist/cli/bench/prompt.js.map +1 -0
  199. package/dist/cli/bench/runner.d.ts +14 -0
  200. package/dist/cli/bench/runner.d.ts.map +1 -0
  201. package/dist/cli/bench/runner.js +334 -0
  202. package/dist/cli/bench/runner.js.map +1 -0
  203. package/dist/cli/bench/types.d.ts +109 -0
  204. package/dist/cli/bench/types.d.ts.map +1 -0
  205. package/dist/cli/bench/types.js +2 -0
  206. package/dist/cli/bench/types.js.map +1 -0
  207. package/dist/cli/bench/ui.d.ts +12 -0
  208. package/dist/cli/bench/ui.d.ts.map +1 -0
  209. package/dist/cli/bench/ui.js +126 -0
  210. package/dist/cli/bench/ui.js.map +1 -0
  211. package/dist/cli/brain/archive.d.ts +33 -0
  212. package/dist/cli/brain/archive.d.ts.map +1 -0
  213. package/dist/cli/brain/archive.js +166 -0
  214. package/dist/cli/brain/archive.js.map +1 -0
  215. package/dist/cli/brain/control-protocol.d.ts +913 -0
  216. package/dist/cli/brain/control-protocol.d.ts.map +1 -0
  217. package/dist/cli/brain/control-protocol.js +87 -0
  218. package/dist/cli/brain/control-protocol.js.map +1 -0
  219. package/dist/cli/brain/exporter.d.ts +34 -0
  220. package/dist/cli/brain/exporter.d.ts.map +1 -0
  221. package/dist/cli/brain/exporter.js +37 -0
  222. package/dist/cli/brain/exporter.js.map +1 -0
  223. package/dist/cli/brain/generator.d.ts +157 -0
  224. package/dist/cli/brain/generator.d.ts.map +1 -0
  225. package/dist/cli/brain/generator.js +633 -0
  226. package/dist/cli/brain/generator.js.map +1 -0
  227. package/dist/cli/brain/instance-manager.d.ts +42 -0
  228. package/dist/cli/brain/instance-manager.d.ts.map +1 -0
  229. package/dist/cli/brain/instance-manager.js +152 -0
  230. package/dist/cli/brain/instance-manager.js.map +1 -0
  231. package/dist/cli/brain/relay-client.d.ts +8 -0
  232. package/dist/cli/brain/relay-client.d.ts.map +1 -0
  233. package/dist/cli/brain/relay-client.js +505 -0
  234. package/dist/cli/brain/relay-client.js.map +1 -0
  235. package/dist/cli/brain/server.d.ts +40 -0
  236. package/dist/cli/brain/server.d.ts.map +1 -0
  237. package/dist/cli/brain/server.js +873 -0
  238. package/dist/cli/brain/server.js.map +1 -0
  239. package/dist/cli/brain/stdout-capture.d.ts +19 -0
  240. package/dist/cli/brain/stdout-capture.d.ts.map +1 -0
  241. package/dist/cli/brain/stdout-capture.js +45 -0
  242. package/dist/cli/brain/stdout-capture.js.map +1 -0
  243. package/dist/cli/brain/sync.d.ts +53 -0
  244. package/dist/cli/brain/sync.d.ts.map +1 -0
  245. package/dist/cli/brain/sync.js +113 -0
  246. package/dist/cli/brain/sync.js.map +1 -0
  247. package/dist/cli/brain/template.d.ts +3 -0
  248. package/dist/cli/brain/template.d.ts.map +1 -0
  249. package/dist/cli/brain/template.js +2099 -0
  250. package/dist/cli/brain/template.js.map +1 -0
  251. package/dist/cli/brain/web-chat-handler.d.ts +26 -0
  252. package/dist/cli/brain/web-chat-handler.d.ts.map +1 -0
  253. package/dist/cli/brain/web-chat-handler.js +134 -0
  254. package/dist/cli/brain/web-chat-handler.js.map +1 -0
  255. package/dist/cli/browser/chrome-finder.d.ts +12 -0
  256. package/dist/cli/browser/chrome-finder.d.ts.map +1 -0
  257. package/dist/cli/browser/chrome-finder.js +74 -0
  258. package/dist/cli/browser/chrome-finder.js.map +1 -0
  259. package/dist/cli/browser/controller.d.ts +51 -0
  260. package/dist/cli/browser/controller.d.ts.map +1 -0
  261. package/dist/cli/browser/controller.js +152 -0
  262. package/dist/cli/browser/controller.js.map +1 -0
  263. package/dist/cli/browser/vision.d.ts +38 -0
  264. package/dist/cli/browser/vision.d.ts.map +1 -0
  265. package/dist/cli/browser/vision.js +123 -0
  266. package/dist/cli/browser/vision.js.map +1 -0
  267. package/dist/cli/bugs/detector.d.ts +14 -0
  268. package/dist/cli/bugs/detector.d.ts.map +1 -0
  269. package/dist/cli/bugs/detector.js +108 -0
  270. package/dist/cli/bugs/detector.js.map +1 -0
  271. package/dist/cli/bugs/journal.d.ts +39 -0
  272. package/dist/cli/bugs/journal.d.ts.map +1 -0
  273. package/dist/cli/bugs/journal.js +195 -0
  274. package/dist/cli/bugs/journal.js.map +1 -0
  275. package/dist/cli/bugs/types.d.ts +27 -0
  276. package/dist/cli/bugs/types.d.ts.map +1 -0
  277. package/dist/cli/bugs/types.js +2 -0
  278. package/dist/cli/bugs/types.js.map +1 -0
  279. package/dist/cli/checkpoints/browser.d.ts +26 -0
  280. package/dist/cli/checkpoints/browser.d.ts.map +1 -0
  281. package/dist/cli/checkpoints/browser.js +272 -0
  282. package/dist/cli/checkpoints/browser.js.map +1 -0
  283. package/dist/cli/checkpoints/keybinding.d.ts +22 -0
  284. package/dist/cli/checkpoints/keybinding.d.ts.map +1 -0
  285. package/dist/cli/checkpoints/keybinding.js +44 -0
  286. package/dist/cli/checkpoints/keybinding.js.map +1 -0
  287. package/dist/cli/checkpoints/revert.d.ts +37 -0
  288. package/dist/cli/checkpoints/revert.d.ts.map +1 -0
  289. package/dist/cli/checkpoints/revert.js +144 -0
  290. package/dist/cli/checkpoints/revert.js.map +1 -0
  291. package/dist/cli/checkpoints/store.d.ts +48 -0
  292. package/dist/cli/checkpoints/store.d.ts.map +1 -0
  293. package/dist/cli/checkpoints/store.js +196 -0
  294. package/dist/cli/checkpoints/store.js.map +1 -0
  295. package/dist/cli/commands/archive.d.ts +7 -0
  296. package/dist/cli/commands/archive.d.ts.map +1 -0
  297. package/dist/cli/commands/archive.js +66 -0
  298. package/dist/cli/commands/archive.js.map +1 -0
  299. package/dist/cli/commands/auth.d.ts +10 -0
  300. package/dist/cli/commands/auth.d.ts.map +1 -0
  301. package/dist/cli/commands/auth.js +44 -0
  302. package/dist/cli/commands/auth.js.map +1 -0
  303. package/dist/cli/commands/bench.d.ts +25 -0
  304. package/dist/cli/commands/bench.d.ts.map +1 -0
  305. package/dist/cli/commands/bench.js +114 -0
  306. package/dist/cli/commands/bench.js.map +1 -0
  307. package/dist/cli/commands/chat.d.ts +11 -0
  308. package/dist/cli/commands/chat.d.ts.map +1 -0
  309. package/dist/cli/commands/chat.js +5363 -0
  310. package/dist/cli/commands/chat.js.map +1 -0
  311. package/dist/cli/commands/config.d.ts +4 -0
  312. package/dist/cli/commands/config.d.ts.map +1 -0
  313. package/dist/cli/commands/config.js +43 -0
  314. package/dist/cli/commands/config.js.map +1 -0
  315. package/dist/cli/commands/feed.d.ts +6 -0
  316. package/dist/cli/commands/feed.d.ts.map +1 -0
  317. package/dist/cli/commands/feed.js +95 -0
  318. package/dist/cli/commands/feed.js.map +1 -0
  319. package/dist/cli/commands/helix-menu.d.ts +4 -0
  320. package/dist/cli/commands/helix-menu.d.ts.map +1 -0
  321. package/dist/cli/commands/helix-menu.js +400 -0
  322. package/dist/cli/commands/helix-menu.js.map +1 -0
  323. package/dist/cli/commands/init.d.ts +2 -0
  324. package/dist/cli/commands/init.d.ts.map +1 -0
  325. package/dist/cli/commands/init.js +38 -0
  326. package/dist/cli/commands/init.js.map +1 -0
  327. package/dist/cli/commands/setup.d.ts +20 -0
  328. package/dist/cli/commands/setup.d.ts.map +1 -0
  329. package/dist/cli/commands/setup.js +310 -0
  330. package/dist/cli/commands/setup.js.map +1 -0
  331. package/dist/cli/commands/spiral.d.ts +4 -0
  332. package/dist/cli/commands/spiral.d.ts.map +1 -0
  333. package/dist/cli/commands/spiral.js +81 -0
  334. package/dist/cli/commands/spiral.js.map +1 -0
  335. package/dist/cli/config/store.d.ts +80 -0
  336. package/dist/cli/config/store.d.ts.map +1 -0
  337. package/dist/cli/config/store.js +247 -0
  338. package/dist/cli/config/store.js.map +1 -0
  339. package/dist/cli/config/trust.d.ts +21 -0
  340. package/dist/cli/config/trust.d.ts.map +1 -0
  341. package/dist/cli/config/trust.js +106 -0
  342. package/dist/cli/config/trust.js.map +1 -0
  343. package/dist/cli/context/assembler.d.ts +9 -0
  344. package/dist/cli/context/assembler.d.ts.map +1 -0
  345. package/dist/cli/context/assembler.js +217 -0
  346. package/dist/cli/context/assembler.js.map +1 -0
  347. package/dist/cli/context/project.d.ts +13 -0
  348. package/dist/cli/context/project.d.ts.map +1 -0
  349. package/dist/cli/context/project.js +126 -0
  350. package/dist/cli/context/project.js.map +1 -0
  351. package/dist/cli/context/session-buffer.d.ts +69 -0
  352. package/dist/cli/context/session-buffer.d.ts.map +1 -0
  353. package/dist/cli/context/session-buffer.js +362 -0
  354. package/dist/cli/context/session-buffer.js.map +1 -0
  355. package/dist/cli/context/trimmer.d.ts +26 -0
  356. package/dist/cli/context/trimmer.d.ts.map +1 -0
  357. package/dist/cli/context/trimmer.js +137 -0
  358. package/dist/cli/context/trimmer.js.map +1 -0
  359. package/dist/cli/core/index.d.ts +15 -0
  360. package/dist/cli/core/index.d.ts.map +1 -0
  361. package/dist/cli/core/index.js +12 -0
  362. package/dist/cli/core/index.js.map +1 -0
  363. package/dist/cli/core/input.d.ts +208 -0
  364. package/dist/cli/core/input.d.ts.map +1 -0
  365. package/dist/cli/core/input.js +807 -0
  366. package/dist/cli/core/input.js.map +1 -0
  367. package/dist/cli/core/screen.d.ts +211 -0
  368. package/dist/cli/core/screen.d.ts.map +1 -0
  369. package/dist/cli/core/screen.js +826 -0
  370. package/dist/cli/core/screen.js.map +1 -0
  371. package/dist/cli/core/terminal.d.ts +88 -0
  372. package/dist/cli/core/terminal.d.ts.map +1 -0
  373. package/dist/cli/core/terminal.js +200 -0
  374. package/dist/cli/core/terminal.js.map +1 -0
  375. package/dist/cli/feed/analyzer.d.ts +17 -0
  376. package/dist/cli/feed/analyzer.d.ts.map +1 -0
  377. package/dist/cli/feed/analyzer.js +220 -0
  378. package/dist/cli/feed/analyzer.js.map +1 -0
  379. package/dist/cli/feed/intent.d.ts +8 -0
  380. package/dist/cli/feed/intent.d.ts.map +1 -0
  381. package/dist/cli/feed/intent.js +70 -0
  382. package/dist/cli/feed/intent.js.map +1 -0
  383. package/dist/cli/feed/parser.d.ts +23 -0
  384. package/dist/cli/feed/parser.d.ts.map +1 -0
  385. package/dist/cli/feed/parser.js +166 -0
  386. package/dist/cli/feed/parser.js.map +1 -0
  387. package/dist/cli/feed/pipeline.d.ts +33 -0
  388. package/dist/cli/feed/pipeline.d.ts.map +1 -0
  389. package/dist/cli/feed/pipeline.js +250 -0
  390. package/dist/cli/feed/pipeline.js.map +1 -0
  391. package/dist/cli/feed/reader.d.ts +10 -0
  392. package/dist/cli/feed/reader.d.ts.map +1 -0
  393. package/dist/cli/feed/reader.js +61 -0
  394. package/dist/cli/feed/reader.js.map +1 -0
  395. package/dist/cli/feed/scanner.d.ts +10 -0
  396. package/dist/cli/feed/scanner.d.ts.map +1 -0
  397. package/dist/cli/feed/scanner.js +124 -0
  398. package/dist/cli/feed/scanner.js.map +1 -0
  399. package/dist/cli/feed/watcher.d.ts +14 -0
  400. package/dist/cli/feed/watcher.d.ts.map +1 -0
  401. package/dist/cli/feed/watcher.js +76 -0
  402. package/dist/cli/feed/watcher.js.map +1 -0
  403. package/dist/cli/helixmind.cmd +2 -0
  404. package/dist/cli/index.d.ts +3 -0
  405. package/dist/cli/index.d.ts.map +1 -0
  406. package/dist/cli/index.js +297 -0
  407. package/dist/cli/index.js.map +1 -0
  408. package/dist/cli/jarvis/autonomy.d.ts +55 -0
  409. package/dist/cli/jarvis/autonomy.d.ts.map +1 -0
  410. package/dist/cli/jarvis/autonomy.js +176 -0
  411. package/dist/cli/jarvis/autonomy.js.map +1 -0
  412. package/dist/cli/jarvis/code-reviewer.d.ts +35 -0
  413. package/dist/cli/jarvis/code-reviewer.d.ts.map +1 -0
  414. package/dist/cli/jarvis/code-reviewer.js +93 -0
  415. package/dist/cli/jarvis/code-reviewer.js.map +1 -0
  416. package/dist/cli/jarvis/core-ethics.d.ts +35 -0
  417. package/dist/cli/jarvis/core-ethics.d.ts.map +1 -0
  418. package/dist/cli/jarvis/core-ethics.js +246 -0
  419. package/dist/cli/jarvis/core-ethics.js.map +1 -0
  420. package/dist/cli/jarvis/daemon.d.ts +24 -0
  421. package/dist/cli/jarvis/daemon.d.ts.map +1 -0
  422. package/dist/cli/jarvis/daemon.js +230 -0
  423. package/dist/cli/jarvis/daemon.js.map +1 -0
  424. package/dist/cli/jarvis/dependency-guardian.d.ts +40 -0
  425. package/dist/cli/jarvis/dependency-guardian.d.ts.map +1 -0
  426. package/dist/cli/jarvis/dependency-guardian.js +148 -0
  427. package/dist/cli/jarvis/dependency-guardian.js.map +1 -0
  428. package/dist/cli/jarvis/git-intelligence.d.ts +36 -0
  429. package/dist/cli/jarvis/git-intelligence.d.ts.map +1 -0
  430. package/dist/cli/jarvis/git-intelligence.js +222 -0
  431. package/dist/cli/jarvis/git-intelligence.js.map +1 -0
  432. package/dist/cli/jarvis/identity.d.ts +57 -0
  433. package/dist/cli/jarvis/identity.d.ts.map +1 -0
  434. package/dist/cli/jarvis/identity.js +416 -0
  435. package/dist/cli/jarvis/identity.js.map +1 -0
  436. package/dist/cli/jarvis/index.d.ts +9 -0
  437. package/dist/cli/jarvis/index.d.ts.map +1 -0
  438. package/dist/cli/jarvis/index.js +7 -0
  439. package/dist/cli/jarvis/index.js.map +1 -0
  440. package/dist/cli/jarvis/instance-lock.d.ts +15 -0
  441. package/dist/cli/jarvis/instance-lock.d.ts.map +1 -0
  442. package/dist/cli/jarvis/instance-lock.js +95 -0
  443. package/dist/cli/jarvis/instance-lock.js.map +1 -0
  444. package/dist/cli/jarvis/learning.d.ts +73 -0
  445. package/dist/cli/jarvis/learning.d.ts.map +1 -0
  446. package/dist/cli/jarvis/learning.js +284 -0
  447. package/dist/cli/jarvis/learning.js.map +1 -0
  448. package/dist/cli/jarvis/multi-project.d.ts +39 -0
  449. package/dist/cli/jarvis/multi-project.d.ts.map +1 -0
  450. package/dist/cli/jarvis/multi-project.js +152 -0
  451. package/dist/cli/jarvis/multi-project.js.map +1 -0
  452. package/dist/cli/jarvis/notifications.d.ts +39 -0
  453. package/dist/cli/jarvis/notifications.d.ts.map +1 -0
  454. package/dist/cli/jarvis/notifications.js +216 -0
  455. package/dist/cli/jarvis/notifications.js.map +1 -0
  456. package/dist/cli/jarvis/onboarding.d.ts +19 -0
  457. package/dist/cli/jarvis/onboarding.d.ts.map +1 -0
  458. package/dist/cli/jarvis/onboarding.js +116 -0
  459. package/dist/cli/jarvis/onboarding.js.map +1 -0
  460. package/dist/cli/jarvis/orchestrator.d.ts +46 -0
  461. package/dist/cli/jarvis/orchestrator.d.ts.map +1 -0
  462. package/dist/cli/jarvis/orchestrator.js +253 -0
  463. package/dist/cli/jarvis/orchestrator.js.map +1 -0
  464. package/dist/cli/jarvis/parallel.d.ts +63 -0
  465. package/dist/cli/jarvis/parallel.d.ts.map +1 -0
  466. package/dist/cli/jarvis/parallel.js +172 -0
  467. package/dist/cli/jarvis/parallel.js.map +1 -0
  468. package/dist/cli/jarvis/performance-profiler.d.ts +31 -0
  469. package/dist/cli/jarvis/performance-profiler.d.ts.map +1 -0
  470. package/dist/cli/jarvis/performance-profiler.js +229 -0
  471. package/dist/cli/jarvis/performance-profiler.js.map +1 -0
  472. package/dist/cli/jarvis/proposals.d.ts +80 -0
  473. package/dist/cli/jarvis/proposals.d.ts.map +1 -0
  474. package/dist/cli/jarvis/proposals.js +286 -0
  475. package/dist/cli/jarvis/proposals.js.map +1 -0
  476. package/dist/cli/jarvis/queue.d.ts +41 -0
  477. package/dist/cli/jarvis/queue.d.ts.map +1 -0
  478. package/dist/cli/jarvis/queue.js +245 -0
  479. package/dist/cli/jarvis/queue.js.map +1 -0
  480. package/dist/cli/jarvis/runtime-context.d.ts +34 -0
  481. package/dist/cli/jarvis/runtime-context.d.ts.map +1 -0
  482. package/dist/cli/jarvis/runtime-context.js +113 -0
  483. package/dist/cli/jarvis/runtime-context.js.map +1 -0
  484. package/dist/cli/jarvis/scheduler.d.ts +21 -0
  485. package/dist/cli/jarvis/scheduler.d.ts.map +1 -0
  486. package/dist/cli/jarvis/scheduler.js +182 -0
  487. package/dist/cli/jarvis/scheduler.js.map +1 -0
  488. package/dist/cli/jarvis/sentiment.d.ts +29 -0
  489. package/dist/cli/jarvis/sentiment.d.ts.map +1 -0
  490. package/dist/cli/jarvis/sentiment.js +221 -0
  491. package/dist/cli/jarvis/sentiment.js.map +1 -0
  492. package/dist/cli/jarvis/skill-scoring.d.ts +63 -0
  493. package/dist/cli/jarvis/skill-scoring.d.ts.map +1 -0
  494. package/dist/cli/jarvis/skill-scoring.js +226 -0
  495. package/dist/cli/jarvis/skill-scoring.js.map +1 -0
  496. package/dist/cli/jarvis/skills.d.ts +87 -0
  497. package/dist/cli/jarvis/skills.d.ts.map +1 -0
  498. package/dist/cli/jarvis/skills.js +367 -0
  499. package/dist/cli/jarvis/skills.js.map +1 -0
  500. package/dist/cli/jarvis/telegram-bot.d.ts +77 -0
  501. package/dist/cli/jarvis/telegram-bot.d.ts.map +1 -0
  502. package/dist/cli/jarvis/telegram-bot.js +251 -0
  503. package/dist/cli/jarvis/telegram-bot.js.map +1 -0
  504. package/dist/cli/jarvis/telemetry.d.ts +32 -0
  505. package/dist/cli/jarvis/telemetry.d.ts.map +1 -0
  506. package/dist/cli/jarvis/telemetry.js +213 -0
  507. package/dist/cli/jarvis/telemetry.js.map +1 -0
  508. package/dist/cli/jarvis/test-sentinel.d.ts +36 -0
  509. package/dist/cli/jarvis/test-sentinel.d.ts.map +1 -0
  510. package/dist/cli/jarvis/test-sentinel.js +178 -0
  511. package/dist/cli/jarvis/test-sentinel.js.map +1 -0
  512. package/dist/cli/jarvis/thinking-loop.d.ts +15 -0
  513. package/dist/cli/jarvis/thinking-loop.d.ts.map +1 -0
  514. package/dist/cli/jarvis/thinking-loop.js +437 -0
  515. package/dist/cli/jarvis/thinking-loop.js.map +1 -0
  516. package/dist/cli/jarvis/triggers.d.ts +23 -0
  517. package/dist/cli/jarvis/triggers.d.ts.map +1 -0
  518. package/dist/cli/jarvis/triggers.js +157 -0
  519. package/dist/cli/jarvis/triggers.js.map +1 -0
  520. package/dist/cli/jarvis/types.d.ts +582 -0
  521. package/dist/cli/jarvis/types.d.ts.map +1 -0
  522. package/dist/cli/jarvis/types.js +18 -0
  523. package/dist/cli/jarvis/types.js.map +1 -0
  524. package/dist/cli/jarvis/voice-bridge.d.ts +68 -0
  525. package/dist/cli/jarvis/voice-bridge.d.ts.map +1 -0
  526. package/dist/cli/jarvis/voice-bridge.js +254 -0
  527. package/dist/cli/jarvis/voice-bridge.js.map +1 -0
  528. package/dist/cli/jarvis/world-model.d.ts +43 -0
  529. package/dist/cli/jarvis/world-model.d.ts.map +1 -0
  530. package/dist/cli/jarvis/world-model.js +209 -0
  531. package/dist/cli/jarvis/world-model.js.map +1 -0
  532. package/dist/cli/jarvis-proxy/client.d.ts +18 -0
  533. package/dist/cli/jarvis-proxy/client.d.ts.map +1 -0
  534. package/dist/cli/jarvis-proxy/client.js +64 -0
  535. package/dist/cli/jarvis-proxy/client.js.map +1 -0
  536. package/dist/cli/jarvis-proxy/executor.d.ts +13 -0
  537. package/dist/cli/jarvis-proxy/executor.d.ts.map +1 -0
  538. package/dist/cli/jarvis-proxy/executor.js +32 -0
  539. package/dist/cli/jarvis-proxy/executor.js.map +1 -0
  540. package/dist/cli/jarvis-proxy/types.d.ts +25 -0
  541. package/dist/cli/jarvis-proxy/types.d.ts.map +1 -0
  542. package/dist/cli/jarvis-proxy/types.js +7 -0
  543. package/dist/cli/jarvis-proxy/types.js.map +1 -0
  544. package/dist/cli/license/checker.d.ts +11 -0
  545. package/dist/cli/license/checker.d.ts.map +1 -0
  546. package/dist/cli/license/checker.js +28 -0
  547. package/dist/cli/license/checker.js.map +1 -0
  548. package/dist/cli/license/validator.d.ts +13 -0
  549. package/dist/cli/license/validator.d.ts.map +1 -0
  550. package/dist/cli/license/validator.js +72 -0
  551. package/dist/cli/license/validator.js.map +1 -0
  552. package/dist/cli/providers/anthropic.d.ts +11 -0
  553. package/dist/cli/providers/anthropic.d.ts.map +1 -0
  554. package/dist/cli/providers/anthropic.js +120 -0
  555. package/dist/cli/providers/anthropic.js.map +1 -0
  556. package/dist/cli/providers/model-limits.d.ts +12 -0
  557. package/dist/cli/providers/model-limits.d.ts.map +1 -0
  558. package/dist/cli/providers/model-limits.js +63 -0
  559. package/dist/cli/providers/model-limits.js.map +1 -0
  560. package/dist/cli/providers/ollama.d.ts +37 -0
  561. package/dist/cli/providers/ollama.d.ts.map +1 -0
  562. package/dist/cli/providers/ollama.js +151 -0
  563. package/dist/cli/providers/ollama.js.map +1 -0
  564. package/dist/cli/providers/openai.d.ts +14 -0
  565. package/dist/cli/providers/openai.d.ts.map +1 -0
  566. package/dist/cli/providers/openai.js +319 -0
  567. package/dist/cli/providers/openai.js.map +1 -0
  568. package/dist/cli/providers/rate-limiter.d.ts +51 -0
  569. package/dist/cli/providers/rate-limiter.d.ts.map +1 -0
  570. package/dist/cli/providers/rate-limiter.js +164 -0
  571. package/dist/cli/providers/rate-limiter.js.map +1 -0
  572. package/dist/cli/providers/registry.d.ts +16 -0
  573. package/dist/cli/providers/registry.d.ts.map +1 -0
  574. package/dist/cli/providers/registry.js +99 -0
  575. package/dist/cli/providers/registry.js.map +1 -0
  576. package/dist/cli/providers/types.d.ts +72 -0
  577. package/dist/cli/providers/types.d.ts.map +1 -0
  578. package/dist/cli/providers/types.js +2 -0
  579. package/dist/cli/providers/types.js.map +1 -0
  580. package/dist/cli/sessions/manager.d.ts +69 -0
  581. package/dist/cli/sessions/manager.d.ts.map +1 -0
  582. package/dist/cli/sessions/manager.js +201 -0
  583. package/dist/cli/sessions/manager.js.map +1 -0
  584. package/dist/cli/sessions/session.d.ts +58 -0
  585. package/dist/cli/sessions/session.d.ts.map +1 -0
  586. package/dist/cli/sessions/session.js +74 -0
  587. package/dist/cli/sessions/session.js.map +1 -0
  588. package/dist/cli/sessions/tab-view.d.ts +18 -0
  589. package/dist/cli/sessions/tab-view.d.ts.map +1 -0
  590. package/dist/cli/sessions/tab-view.js +137 -0
  591. package/dist/cli/sessions/tab-view.js.map +1 -0
  592. package/dist/cli/ui/activity.d.ts +81 -0
  593. package/dist/cli/ui/activity.d.ts.map +1 -0
  594. package/dist/cli/ui/activity.js +286 -0
  595. package/dist/cli/ui/activity.js.map +1 -0
  596. package/dist/cli/ui/agent-display.d.ts +24 -0
  597. package/dist/cli/ui/agent-display.d.ts.map +1 -0
  598. package/dist/cli/ui/agent-display.js +36 -0
  599. package/dist/cli/ui/agent-display.js.map +1 -0
  600. package/dist/cli/ui/bottom-chrome.d.ts +121 -0
  601. package/dist/cli/ui/bottom-chrome.d.ts.map +1 -0
  602. package/dist/cli/ui/bottom-chrome.js +428 -0
  603. package/dist/cli/ui/bottom-chrome.js.map +1 -0
  604. package/dist/cli/ui/chat-view.d.ts +10 -0
  605. package/dist/cli/ui/chat-view.d.ts.map +1 -0
  606. package/dist/cli/ui/chat-view.js +237 -0
  607. package/dist/cli/ui/chat-view.js.map +1 -0
  608. package/dist/cli/ui/command-suggest.d.ts +22 -0
  609. package/dist/cli/ui/command-suggest.d.ts.map +1 -0
  610. package/dist/cli/ui/command-suggest.js +118 -0
  611. package/dist/cli/ui/command-suggest.js.map +1 -0
  612. package/dist/cli/ui/input-window.d.ts +145 -0
  613. package/dist/cli/ui/input-window.d.ts.map +1 -0
  614. package/dist/cli/ui/input-window.js +415 -0
  615. package/dist/cli/ui/input-window.js.map +1 -0
  616. package/dist/cli/ui/logo.d.ts +3 -0
  617. package/dist/cli/ui/logo.d.ts.map +1 -0
  618. package/dist/cli/ui/logo.js +25 -0
  619. package/dist/cli/ui/logo.js.map +1 -0
  620. package/dist/cli/ui/plan-display.d.ts +35 -0
  621. package/dist/cli/ui/plan-display.d.ts.map +1 -0
  622. package/dist/cli/ui/plan-display.js +381 -0
  623. package/dist/cli/ui/plan-display.js.map +1 -0
  624. package/dist/cli/ui/progress.d.ts +22 -0
  625. package/dist/cli/ui/progress.d.ts.map +1 -0
  626. package/dist/cli/ui/progress.js +126 -0
  627. package/dist/cli/ui/progress.js.map +1 -0
  628. package/dist/cli/ui/prompt-history.d.ts +37 -0
  629. package/dist/cli/ui/prompt-history.d.ts.map +1 -0
  630. package/dist/cli/ui/prompt-history.js +156 -0
  631. package/dist/cli/ui/prompt-history.js.map +1 -0
  632. package/dist/cli/ui/select-menu.d.ts +45 -0
  633. package/dist/cli/ui/select-menu.d.ts.map +1 -0
  634. package/dist/cli/ui/select-menu.js +330 -0
  635. package/dist/cli/ui/select-menu.js.map +1 -0
  636. package/dist/cli/ui/spinner.d.ts +3 -0
  637. package/dist/cli/ui/spinner.d.ts.map +1 -0
  638. package/dist/cli/ui/spinner.js +14 -0
  639. package/dist/cli/ui/spinner.js.map +1 -0
  640. package/dist/cli/ui/statusbar.d.ts +72 -0
  641. package/dist/cli/ui/statusbar.d.ts.map +1 -0
  642. package/dist/cli/ui/statusbar.js +376 -0
  643. package/dist/cli/ui/statusbar.js.map +1 -0
  644. package/dist/cli/ui/suggestion-panel.d.ts +52 -0
  645. package/dist/cli/ui/suggestion-panel.d.ts.map +1 -0
  646. package/dist/cli/ui/suggestion-panel.js +159 -0
  647. package/dist/cli/ui/suggestion-panel.js.map +1 -0
  648. package/dist/cli/ui/theme.d.ts +20 -0
  649. package/dist/cli/ui/theme.d.ts.map +1 -0
  650. package/dist/cli/ui/theme.js +25 -0
  651. package/dist/cli/ui/theme.js.map +1 -0
  652. package/dist/cli/ui/tool-output.d.ts +31 -0
  653. package/dist/cli/ui/tool-output.d.ts.map +1 -0
  654. package/dist/cli/ui/tool-output.js +204 -0
  655. package/dist/cli/ui/tool-output.js.map +1 -0
  656. package/dist/cli/validation/autofix.d.ts +32 -0
  657. package/dist/cli/validation/autofix.d.ts.map +1 -0
  658. package/dist/cli/validation/autofix.js +148 -0
  659. package/dist/cli/validation/autofix.js.map +1 -0
  660. package/dist/cli/validation/classifier.d.ts +17 -0
  661. package/dist/cli/validation/classifier.d.ts.map +1 -0
  662. package/dist/cli/validation/classifier.js +174 -0
  663. package/dist/cli/validation/classifier.js.map +1 -0
  664. package/dist/cli/validation/criteria.d.ts +22 -0
  665. package/dist/cli/validation/criteria.d.ts.map +1 -0
  666. package/dist/cli/validation/criteria.js +188 -0
  667. package/dist/cli/validation/criteria.js.map +1 -0
  668. package/dist/cli/validation/dynamic-checks.d.ts +16 -0
  669. package/dist/cli/validation/dynamic-checks.d.ts.map +1 -0
  670. package/dist/cli/validation/dynamic-checks.js +109 -0
  671. package/dist/cli/validation/dynamic-checks.js.map +1 -0
  672. package/dist/cli/validation/model.d.ts +16 -0
  673. package/dist/cli/validation/model.d.ts.map +1 -0
  674. package/dist/cli/validation/model.js +59 -0
  675. package/dist/cli/validation/model.js.map +1 -0
  676. package/dist/cli/validation/reporter.d.ts +18 -0
  677. package/dist/cli/validation/reporter.d.ts.map +1 -0
  678. package/dist/cli/validation/reporter.js +209 -0
  679. package/dist/cli/validation/reporter.js.map +1 -0
  680. package/dist/cli/validation/spiral-checks.d.ts +12 -0
  681. package/dist/cli/validation/spiral-checks.d.ts.map +1 -0
  682. package/dist/cli/validation/spiral-checks.js +167 -0
  683. package/dist/cli/validation/spiral-checks.js.map +1 -0
  684. package/dist/cli/validation/static-checks.d.ts +26 -0
  685. package/dist/cli/validation/static-checks.d.ts.map +1 -0
  686. package/dist/cli/validation/static-checks.js +648 -0
  687. package/dist/cli/validation/static-checks.js.map +1 -0
  688. package/dist/cli/validation/stats.d.ts +29 -0
  689. package/dist/cli/validation/stats.d.ts.map +1 -0
  690. package/dist/cli/validation/stats.js +137 -0
  691. package/dist/cli/validation/stats.js.map +1 -0
  692. package/dist/cli/version.d.ts +2 -0
  693. package/dist/cli/version.d.ts.map +1 -0
  694. package/dist/cli/version.js +5 -0
  695. package/dist/cli/version.js.map +1 -0
  696. package/dist/cli/voice/clone-manager.d.ts +19 -0
  697. package/dist/cli/voice/clone-manager.d.ts.map +1 -0
  698. package/dist/cli/voice/clone-manager.js +55 -0
  699. package/dist/cli/voice/clone-manager.js.map +1 -0
  700. package/dist/cli/voice/engine.d.ts +43 -0
  701. package/dist/cli/voice/engine.d.ts.map +1 -0
  702. package/dist/cli/voice/engine.js +109 -0
  703. package/dist/cli/voice/engine.js.map +1 -0
  704. package/dist/cli/voice/whisper-stt.d.ts +28 -0
  705. package/dist/cli/voice/whisper-stt.d.ts.map +1 -0
  706. package/dist/cli/voice/whisper-stt.js +78 -0
  707. package/dist/cli/voice/whisper-stt.js.map +1 -0
  708. package/dist/index.d.ts +3 -0
  709. package/dist/index.d.ts.map +1 -0
  710. package/dist/index.js +35 -0
  711. package/dist/index.js.map +1 -0
  712. package/dist/server.d.ts +8 -0
  713. package/dist/server.d.ts.map +1 -0
  714. package/dist/server.js +44 -0
  715. package/dist/server.js.map +1 -0
  716. package/dist/shared/protocol-types.d.ts +283 -0
  717. package/dist/shared/protocol-types.d.ts.map +1 -0
  718. package/dist/shared/protocol-types.js +9 -0
  719. package/dist/shared/protocol-types.js.map +1 -0
  720. package/dist/spiral/cloud/content-extractor.d.ts +27 -0
  721. package/dist/spiral/cloud/content-extractor.d.ts.map +1 -0
  722. package/dist/spiral/cloud/content-extractor.js +175 -0
  723. package/dist/spiral/cloud/content-extractor.js.map +1 -0
  724. package/dist/spiral/cloud/search-provider.d.ts +22 -0
  725. package/dist/spiral/cloud/search-provider.d.ts.map +1 -0
  726. package/dist/spiral/cloud/search-provider.js +241 -0
  727. package/dist/spiral/cloud/search-provider.js.map +1 -0
  728. package/dist/spiral/cloud/topic-detector.d.ts +25 -0
  729. package/dist/spiral/cloud/topic-detector.d.ts.map +1 -0
  730. package/dist/spiral/cloud/topic-detector.js +196 -0
  731. package/dist/spiral/cloud/topic-detector.js.map +1 -0
  732. package/dist/spiral/cloud/web-enricher.d.ts +58 -0
  733. package/dist/spiral/cloud/web-enricher.d.ts.map +1 -0
  734. package/dist/spiral/cloud/web-enricher.js +176 -0
  735. package/dist/spiral/cloud/web-enricher.js.map +1 -0
  736. package/dist/spiral/compression.d.ts +54 -0
  737. package/dist/spiral/compression.d.ts.map +1 -0
  738. package/dist/spiral/compression.js +175 -0
  739. package/dist/spiral/compression.js.map +1 -0
  740. package/dist/spiral/embeddings.d.ts +30 -0
  741. package/dist/spiral/embeddings.d.ts.map +1 -0
  742. package/dist/spiral/embeddings.js +99 -0
  743. package/dist/spiral/embeddings.js.map +1 -0
  744. package/dist/spiral/engine.d.ts +98 -0
  745. package/dist/spiral/engine.d.ts.map +1 -0
  746. package/dist/spiral/engine.js +330 -0
  747. package/dist/spiral/engine.js.map +1 -0
  748. package/dist/spiral/injection.d.ts +29 -0
  749. package/dist/spiral/injection.d.ts.map +1 -0
  750. package/dist/spiral/injection.js +176 -0
  751. package/dist/spiral/injection.js.map +1 -0
  752. package/dist/spiral/relevance.d.ts +37 -0
  753. package/dist/spiral/relevance.d.ts.map +1 -0
  754. package/dist/spiral/relevance.js +75 -0
  755. package/dist/spiral/relevance.js.map +1 -0
  756. package/dist/storage/database.d.ts +11 -0
  757. package/dist/storage/database.d.ts.map +1 -0
  758. package/dist/storage/database.js +169 -0
  759. package/dist/storage/database.js.map +1 -0
  760. package/dist/storage/edges.d.ts +30 -0
  761. package/dist/storage/edges.d.ts.map +1 -0
  762. package/dist/storage/edges.js +98 -0
  763. package/dist/storage/edges.js.map +1 -0
  764. package/dist/storage/nodes.d.ts +60 -0
  765. package/dist/storage/nodes.d.ts.map +1 -0
  766. package/dist/storage/nodes.js +161 -0
  767. package/dist/storage/nodes.js.map +1 -0
  768. package/dist/storage/vectors.d.ts +25 -0
  769. package/dist/storage/vectors.d.ts.map +1 -0
  770. package/dist/storage/vectors.js +110 -0
  771. package/dist/storage/vectors.js.map +1 -0
  772. package/dist/tools/spiral-compact.d.ts +14 -0
  773. package/dist/tools/spiral-compact.d.ts.map +1 -0
  774. package/dist/tools/spiral-compact.js +14 -0
  775. package/dist/tools/spiral-compact.js.map +1 -0
  776. package/dist/tools/spiral-query.d.ts +18 -0
  777. package/dist/tools/spiral-query.d.ts.map +1 -0
  778. package/dist/tools/spiral-query.js +16 -0
  779. package/dist/tools/spiral-query.js.map +1 -0
  780. package/dist/tools/spiral-relate.d.ts +21 -0
  781. package/dist/tools/spiral-relate.d.ts.map +1 -0
  782. package/dist/tools/spiral-relate.js +21 -0
  783. package/dist/tools/spiral-relate.js.map +1 -0
  784. package/dist/tools/spiral-status.d.ts +8 -0
  785. package/dist/tools/spiral-status.d.ts.map +1 -0
  786. package/dist/tools/spiral-status.js +10 -0
  787. package/dist/tools/spiral-status.js.map +1 -0
  788. package/dist/tools/spiral-store.d.ts +41 -0
  789. package/dist/tools/spiral-store.d.ts.map +1 -0
  790. package/dist/tools/spiral-store.js +22 -0
  791. package/dist/tools/spiral-store.js.map +1 -0
  792. package/dist/types.d.ts +94 -0
  793. package/dist/types.d.ts.map +1 -0
  794. package/dist/types.js +9 -0
  795. package/dist/types.js.map +1 -0
  796. package/dist/utils/config.d.ts +14 -0
  797. package/dist/utils/config.d.ts.map +1 -0
  798. package/dist/utils/config.js +44 -0
  799. package/dist/utils/config.js.map +1 -0
  800. package/dist/utils/logger.d.ts +10 -0
  801. package/dist/utils/logger.d.ts.map +1 -0
  802. package/dist/utils/logger.js +40 -0
  803. package/dist/utils/logger.js.map +1 -0
  804. package/dist/utils/tokens.d.ts +21 -0
  805. package/dist/utils/tokens.d.ts.map +1 -0
  806. package/dist/utils/tokens.js +33 -0
  807. package/dist/utils/tokens.js.map +1 -0
  808. package/package.json +93 -0
@@ -0,0 +1,826 @@
1
+ /**
2
+ * Screen — Central screen zone manager.
3
+ *
4
+ * Replaces BottomChrome with a clean architecture:
5
+ * - Manages scroll region, input frame, suggestions, and chrome rows
6
+ * - Single stdout intercept for backward compatibility
7
+ * - Dirty-check double-buffer prevents redundant redraws
8
+ * - Input frame with visible borders (╭─ │ ╰─) like Claude Code
9
+ *
10
+ * Layout (from bottom of terminal):
11
+ * Row N: Chrome row 3 — statusbar line 2
12
+ * Row N-1: Chrome row 2 — statusbar line 1
13
+ * Row N-2: Chrome row 1 — hints
14
+ * Row N-3: Chrome row 0 — activity indicator / separator
15
+ * Rows N-4...: Suggestion rows (0-6, dynamic)
16
+ * Row input: │ ❯ user input_ (input line, inside frame)
17
+ * Row frameTop: ╭────────────────────╮ (frame top border)
18
+ * Rows 1..scroll: Output scroll region (scrollable content)
19
+ *
20
+ * The input frame is always visible. Suggestions expand the frame downward.
21
+ * During agent work, chrome row 0 shows the activity indicator.
22
+ * When idle, chrome row 0 shows the frame bottom border ╰────╯.
23
+ *
24
+ * Web App Integration:
25
+ * - Provides onWrite callback for StdoutCapture (brain server streaming)
26
+ * - All output goes through writeOutput() which triggers the callback
27
+ * - Chrome/frame redraws bypass the callback (only user-visible output is streamed)
28
+ */
29
+ import chalk from 'chalk';
30
+ import { ANSI, visibleLength, moveTo, clearLineAt } from './terminal.js';
31
+ // ─── Constants ───────────────────────────────────────────────────────────────
32
+ const CHROME_ROWS = 4; // activity/separator, hints, statusbar×2
33
+ const MIN_TERMINAL_HEIGHT = 12;
34
+ const MAX_INPUT_FRAME_LINES = 8; // max visible input lines in frame
35
+ // Box-drawing characters for the input frame
36
+ const FRAME = {
37
+ TOP_LEFT: '╭',
38
+ TOP_RIGHT: '╮',
39
+ BOTTOM_LEFT: '╰',
40
+ BOTTOM_RIGHT: '╯',
41
+ HORIZONTAL: '─',
42
+ VERTICAL: '│',
43
+ T_RIGHT: '├',
44
+ T_LEFT: '┤',
45
+ };
46
+ // ─── Screen Class ────────────────────────────────────────────────────────────
47
+ export class Screen {
48
+ terminal;
49
+ _active = false;
50
+ _inlineMode = false;
51
+ _originalWrite = null;
52
+ _redrawScheduled = false;
53
+ // Content state
54
+ _chromeContent = ['', '', '', ''];
55
+ _prevChromeContent = ['', '', '', ''];
56
+ _suggestionContent = [];
57
+ _prevSuggestionContent = [];
58
+ _extraRows = 0;
59
+ // Input frame state (supports multi-line: paste preview, wrapped text)
60
+ _inputFrameLines = 1; // number of content lines in frame (1 = single line)
61
+ _inputLine = '';
62
+ _inputBadge = ''; // visual-only badge (e.g., paste block indicator)
63
+ _inputCursorPos = 0;
64
+ _prevInputLine = '';
65
+ _inputLines = []; // multi-line content
66
+ _prevInputLines = []; // dirty-check
67
+ _inputCursorLine = 0; // which line the cursor is on
68
+ _frameVisible = true;
69
+ // Guard flag: suppress hook redraws while input is being managed externally
70
+ _inputActive = false;
71
+ // Suspended mode: screen deactivated but stdout hook still active, buffering writes.
72
+ // Used during sub-menus so background output doesn't corrupt the menu.
73
+ _suspended = false;
74
+ _suspendedBuffer = [];
75
+ // Callbacks
76
+ _onOutputWrite;
77
+ _frameColor;
78
+ constructor(terminal, options = {}) {
79
+ this.terminal = terminal;
80
+ this._onOutputWrite = options.onOutputWrite ?? null;
81
+ this._frameColor = options.frameColor ?? '#00d4ff';
82
+ }
83
+ // ─── Getters (BottomChrome-compatible) ─────────────────────────────────
84
+ get isActive() { return this._active; }
85
+ get isInlineMode() { return this._inlineMode; }
86
+ get baseRows() { return CHROME_ROWS; }
87
+ get extraRows() { return this._extraRows; }
88
+ get inputFrameLines() { return this._inputFrameLines; }
89
+ /** Frame rows = 1 (top border) + N input content lines */
90
+ get _frameRows() {
91
+ return 1 + this._inputFrameLines;
92
+ }
93
+ /** Total rows reserved at bottom: frame + suggestions + chrome(4) */
94
+ get totalReservedRows() {
95
+ if (this._inlineMode)
96
+ return 0;
97
+ return this._frameRows + this._extraRows + CHROME_ROWS;
98
+ }
99
+ get reservedRows() { return this.totalReservedRows; }
100
+ /** Row where the first input line lives (with ❯ prompt) */
101
+ get inputRow() {
102
+ return this.terminal.rows - CHROME_ROWS - this._extraRows - this._inputFrameLines + 1;
103
+ }
104
+ /** Row where the last input line lives */
105
+ get lastInputRow() {
106
+ return this.inputRow + this._inputFrameLines - 1;
107
+ }
108
+ /** Row where the frame top border lives */
109
+ get frameTopRow() {
110
+ return this.inputRow - 1;
111
+ }
112
+ /** Bottom of the scroll region (last row where output can scroll) */
113
+ get scrollEnd() {
114
+ return this.frameTopRow - 1;
115
+ }
116
+ /** BottomChrome-compatible: row where readline prompt would go */
117
+ get promptRow() {
118
+ return this.inputRow;
119
+ }
120
+ // ─── Activation ────────────────────────────────────────────────────────
121
+ activate() {
122
+ if (this._active)
123
+ return;
124
+ if (!this.terminal.isTTY) {
125
+ this._inlineMode = true;
126
+ return;
127
+ }
128
+ const rows = this.terminal.rows;
129
+ if (rows < MIN_TERMINAL_HEIGHT) {
130
+ this._inlineMode = true;
131
+ return;
132
+ }
133
+ this._inlineMode = false;
134
+ this._active = true;
135
+ // Leave suspended mode — stdout hook was kept active during deactivation
136
+ const wasSuspended = this._suspended;
137
+ this._suspended = false;
138
+ this._updateScrollRegion();
139
+ if (!wasSuspended) {
140
+ // Fresh activation or returning from fullscreen overlay — (re)install stdout hook
141
+ this._hookStdout();
142
+ }
143
+ // Force full draw
144
+ this._prevChromeContent = ['', '', '', ''];
145
+ this._prevSuggestionContent = [];
146
+ this._prevInputLine = '';
147
+ this.redraw();
148
+ // Flush any output that was buffered during suspended mode
149
+ if (wasSuspended && this._suspendedBuffer.length > 0) {
150
+ const buffered = this._suspendedBuffer.join('');
151
+ this._suspendedBuffer = [];
152
+ this.writeOutput(buffered);
153
+ }
154
+ }
155
+ /**
156
+ * Deactivate the screen.
157
+ * @param options.suspend Keep stdout hook active and buffer writes (default: true).
158
+ * Use `suspend: false` for fullscreen overlays (e.g. Rewind browser) that need
159
+ * direct stdout access — the hook is removed entirely so process.stdout.write works normally.
160
+ */
161
+ deactivate(options) {
162
+ if (!this._active)
163
+ return;
164
+ this._active = false;
165
+ const suspend = options?.suspend ?? true;
166
+ // Remember scroll end before clearing (frameTopRow depends on _inputFrameLines/_extraRows)
167
+ const scrollBottom = this.scrollEnd;
168
+ this._clearAllFixed();
169
+ this.terminal.resetScrollRegion();
170
+ // Position cursor at the old scroll region bottom so subsequent writes
171
+ // (e.g. selectMenu) start from a predictable position above the cleared area.
172
+ this._rawWrite(`\x1b[${scrollBottom};1H`);
173
+ if (suspend) {
174
+ // Enter suspended mode: keep stdout hook active but buffer all writes.
175
+ // This prevents background output (session completion, agent results) from
176
+ // corrupting interactive sub-menus that render on the raw terminal.
177
+ this._suspended = true;
178
+ this._suspendedBuffer = [];
179
+ }
180
+ else {
181
+ // Fullscreen overlay mode: remove stdout hook entirely so the overlay
182
+ // can write directly to the terminal without buffering interference.
183
+ this._suspended = false;
184
+ this._suspendedBuffer = [];
185
+ this._unhookStdout();
186
+ }
187
+ this._chromeContent = ['', '', '', ''];
188
+ this._prevChromeContent = ['', '', '', ''];
189
+ this._extraRows = 0;
190
+ this._inputFrameLines = 1;
191
+ this._suggestionContent = [];
192
+ this._prevSuggestionContent = [];
193
+ this._inputLine = '';
194
+ this._inputBadge = '';
195
+ this._prevInputLine = '';
196
+ this._inputLines = [];
197
+ this._prevInputLines = [];
198
+ this._inputCursorLine = 0;
199
+ }
200
+ // ─── Input Active Guard ────────────────────────────────────────────────
201
+ /**
202
+ * Suppress stdout hook redraws while the InputManager is handling cursor.
203
+ * Prevents interference between readline echo and chrome repaints.
204
+ */
205
+ set inputActive(active) {
206
+ this._inputActive = active;
207
+ }
208
+ get inputActive() {
209
+ return this._inputActive;
210
+ }
211
+ // ─── Output Zone (scrollable) ──────────────────────────────────────────
212
+ /**
213
+ * Write content to the output zone (scroll region).
214
+ * This is the primary method for agent output, tool results, etc.
215
+ * Triggers the onOutputWrite callback for web streaming.
216
+ */
217
+ writeOutput(data) {
218
+ if (!this._active) {
219
+ this._rawWrite(data);
220
+ this._onOutputWrite?.(data);
221
+ return;
222
+ }
223
+ // Ensure cursor is in scroll region before writing
224
+ const scrollEnd = this.scrollEnd;
225
+ this._rawWrite(ANSI.HIDE_CURSOR +
226
+ moveTo(scrollEnd, 1) + // position at scroll region bottom
227
+ data);
228
+ // Callback for web streaming (only user-visible output, not chrome redraws)
229
+ this._onOutputWrite?.(data);
230
+ // Schedule chrome redraw in case output scrolled past the region
231
+ if (data.includes('\n')) {
232
+ this._scheduleRedraw();
233
+ }
234
+ }
235
+ // ─── Input Frame ───────────────────────────────────────────────────────
236
+ /**
237
+ * Draw the input frame with the given content and cursor position.
238
+ * Called by InputManager whenever the input changes.
239
+ *
240
+ * @param badge Optional visual-only badge (e.g. paste block indicator).
241
+ * Rendered after the text but does NOT affect cursor positioning.
242
+ */
243
+ renderInput(line, cursorPos, badge) {
244
+ this._inputLine = line;
245
+ this._inputCursorPos = cursorPos;
246
+ this._inputBadge = badge || '';
247
+ if (!this._active || this._inlineMode)
248
+ return;
249
+ const row = this.inputRow;
250
+ const cols = this.terminal.cols;
251
+ const fc = chalk.hex(this._frameColor).dim;
252
+ // Build input line: │ ❯ content[badge] │
253
+ const maxContent = cols - 6; // 2 border + space + ❯ + space + right border
254
+ const displayLine = line.length > maxContent ? line.slice(line.length - maxContent) : line;
255
+ const badgeVisLen = this._inputBadge ? visibleLength(this._inputBadge) : 0;
256
+ const padding = Math.max(0, maxContent - visibleLength(displayLine) - badgeVisLen);
257
+ const inputLineStr = fc(FRAME.VERTICAL) + ' ' +
258
+ chalk.hex(this._frameColor)('❯') + ' ' +
259
+ displayLine +
260
+ this._inputBadge +
261
+ ' '.repeat(padding) +
262
+ ' ' + fc(FRAME.VERTICAL);
263
+ // Only redraw if changed
264
+ if (inputLineStr !== this._prevInputLine) {
265
+ // Cursor position based on user text only — badge is after cursor
266
+ const cursorCol = 5 + Math.min(cursorPos, maxContent);
267
+ this._rawWrite(ANSI.HIDE_CURSOR +
268
+ `\x1b[${row};1H${ANSI.CLEAR_LINE}` +
269
+ inputLineStr +
270
+ `\x1b[${row};${cursorCol}H` +
271
+ ANSI.SHOW_CURSOR);
272
+ this._prevInputLine = inputLineStr;
273
+ }
274
+ else {
275
+ // Content unchanged — just position cursor
276
+ const cursorCol = 5 + Math.min(cursorPos, maxContent);
277
+ this._rawWrite(`\x1b[${row};${cursorCol}H${ANSI.SHOW_CURSOR}`);
278
+ }
279
+ }
280
+ /**
281
+ * Draw the frame top border.
282
+ */
283
+ drawFrameTop() {
284
+ if (!this._active || this._inlineMode)
285
+ return;
286
+ const row = this.frameTopRow;
287
+ const cols = this.terminal.cols;
288
+ const fc = chalk.hex(this._frameColor).dim;
289
+ const border = fc(FRAME.TOP_LEFT + FRAME.HORIZONTAL.repeat(cols - 2) + FRAME.TOP_RIGHT);
290
+ this._rawWrite(ANSI.HIDE_CURSOR +
291
+ `\x1b[${row};1H${ANSI.CLEAR_LINE}` +
292
+ border +
293
+ ANSI.SHOW_CURSOR);
294
+ }
295
+ /**
296
+ * Draw the frame bottom border (embedded in chrome row 0 when idle).
297
+ * When activity content is provided, it's shown inside the border.
298
+ */
299
+ drawFrameBottom(activityContent) {
300
+ if (!this._active || this._inlineMode)
301
+ return;
302
+ const cols = this.terminal.cols;
303
+ const fc = chalk.hex(this._frameColor).dim;
304
+ let content;
305
+ if (activityContent) {
306
+ // Embed activity in the bottom border: ╰── ◇ HelixMind working... ──╯
307
+ const actLen = visibleLength(activityContent);
308
+ const availBorder = cols - 5 - actLen; // ╰─(2) + space(1) + activity + space(1) + ─╯(1)
309
+ const rightBorder = Math.max(0, availBorder);
310
+ content = fc(FRAME.BOTTOM_LEFT + FRAME.HORIZONTAL) + ' ' +
311
+ activityContent + ' ' +
312
+ fc(FRAME.HORIZONTAL.repeat(rightBorder) + FRAME.BOTTOM_RIGHT);
313
+ }
314
+ else {
315
+ // Plain bottom border
316
+ content = fc(FRAME.BOTTOM_LEFT + FRAME.HORIZONTAL.repeat(cols - 2) + FRAME.BOTTOM_RIGHT);
317
+ }
318
+ // Set as chrome row 0 content
319
+ this._chromeContent[0] = content;
320
+ if (!this._active || this._inlineMode)
321
+ return;
322
+ this._drawChromeRow(0);
323
+ this._prevChromeContent[0] = content;
324
+ }
325
+ /**
326
+ * Position cursor at the input line for readline prompt.
327
+ * Called before readline.prompt() to ensure correct cursor placement.
328
+ */
329
+ positionCursorForInput() {
330
+ if (this._inlineMode || !this._active)
331
+ return;
332
+ const row = this.inputRow;
333
+ const cursorCol = 5 + this._inputCursorPos;
334
+ this._rawWrite(moveTo(row, cursorCol));
335
+ }
336
+ /**
337
+ * Write content at the input row (for type-ahead preview during agent work).
338
+ * Replaces the input content without disturbing cursor elsewhere.
339
+ */
340
+ writeAtInputRow(content) {
341
+ if (this._inlineMode || !this._active)
342
+ return;
343
+ const row = this.inputRow;
344
+ const cols = this.terminal.cols;
345
+ const fc = chalk.hex(this._frameColor).dim;
346
+ // Build framed line
347
+ const maxContent = cols - 6;
348
+ const padding = Math.max(0, maxContent - visibleLength(content));
349
+ const line = fc(FRAME.VERTICAL) + ' ' +
350
+ chalk.hex(this._frameColor)('❯') + ' ' +
351
+ content +
352
+ ' '.repeat(padding) +
353
+ ' ' + fc(FRAME.VERTICAL);
354
+ this._rawWrite(ANSI.HIDE_CURSOR +
355
+ `\x1b[${row};1H${ANSI.CLEAR_LINE}` +
356
+ line +
357
+ moveTo(row, 1) +
358
+ ANSI.SHOW_CURSOR);
359
+ }
360
+ /**
361
+ * Clear the input frame (frame top + all input lines + any suggestion rows).
362
+ * Called when user submits input, before rendering the formatted user message.
363
+ */
364
+ clearInputFrame() {
365
+ if (this._inlineMode || !this._active)
366
+ return;
367
+ const frameTop = this.frameTopRow;
368
+ const rowsToClear = this._frameRows + this._extraRows; // frame top + input lines + suggestions
369
+ let seq = ANSI.HIDE_CURSOR;
370
+ for (let i = 0; i < rowsToClear; i++) {
371
+ seq += `\x1b[${frameTop + i};1H${ANSI.CLEAR_LINE}`;
372
+ }
373
+ // Position cursor in scroll region so subsequent stdout writes go there
374
+ seq += moveTo(this.scrollEnd, 1) + ANSI.SHOW_CURSOR;
375
+ this._rawWrite(seq);
376
+ this._inputLine = '';
377
+ this._inputBadge = '';
378
+ this._prevInputLine = '';
379
+ this._inputCursorPos = 0;
380
+ this._inputLines = [];
381
+ this._prevInputLines = [];
382
+ this._inputCursorLine = 0;
383
+ // Reset to single line and update scroll region
384
+ if (this._inputFrameLines > 1) {
385
+ this._inputFrameLines = 1;
386
+ this._updateScrollRegion();
387
+ }
388
+ }
389
+ // ─── Multi-Line Input Frame ─────────────────────────────────────────
390
+ /**
391
+ * Set the number of visible input lines in the frame.
392
+ * Frame grows/shrinks to accommodate (e.g., paste preview lines).
393
+ * Triggers scroll region update and full redraw.
394
+ */
395
+ setInputFrameLines(n) {
396
+ const maxLines = Math.max(1, Math.min(n, MAX_INPUT_FRAME_LINES, this.terminal.rows - MIN_TERMINAL_HEIGHT - CHROME_ROWS - this._extraRows));
397
+ if (maxLines === this._inputFrameLines)
398
+ return;
399
+ const old = this._inputFrameLines;
400
+ this._inputFrameLines = maxLines;
401
+ if (!this._active || this._inlineMode)
402
+ return;
403
+ // Clear old frame area before resizing
404
+ this._clearFrameArea(old);
405
+ this._updateScrollRegion();
406
+ // Force full redraw (positions changed)
407
+ this._prevChromeContent = ['', '', '', ''];
408
+ this._prevInputLine = '';
409
+ this._prevInputLines = [];
410
+ this.redraw();
411
+ }
412
+ /**
413
+ * Render multiple input lines in the frame.
414
+ * First line shows ❯ prompt, subsequent lines show indented content.
415
+ * Used for paste preview and wrapped text.
416
+ *
417
+ * @param lines Array of display lines (already split/wrapped)
418
+ * @param cursorLine Which line the cursor is on (0-based)
419
+ * @param cursorCol Cursor column within that line
420
+ */
421
+ renderMultiLineInput(lines, cursorLine, cursorCol) {
422
+ this._inputLines = lines;
423
+ this._inputCursorLine = cursorLine;
424
+ this._inputCursorPos = cursorCol;
425
+ if (!this._active || this._inlineMode)
426
+ return;
427
+ const cols = this.terminal.cols;
428
+ const fc = chalk.hex(this._frameColor).dim;
429
+ const maxContent = cols - 6;
430
+ let buf = ANSI.HIDE_CURSOR;
431
+ let changed = false;
432
+ for (let i = 0; i < this._inputFrameLines; i++) {
433
+ const row = this.inputRow + i;
434
+ const content = lines[i] || '';
435
+ const displayContent = visibleLength(content) > maxContent
436
+ ? content.slice(0, maxContent) : content;
437
+ const padding = Math.max(0, maxContent - visibleLength(displayContent));
438
+ let lineStr;
439
+ if (i === 0) {
440
+ // First line: │ ❯ content │
441
+ lineStr = fc(FRAME.VERTICAL) + ' ' +
442
+ chalk.hex(this._frameColor)('❯') + ' ' +
443
+ displayContent + ' '.repeat(padding) +
444
+ ' ' + fc(FRAME.VERTICAL);
445
+ }
446
+ else {
447
+ // Subsequent lines: │ content │
448
+ lineStr = fc(FRAME.VERTICAL) + ' ' +
449
+ displayContent + ' '.repeat(padding) +
450
+ ' ' + fc(FRAME.VERTICAL);
451
+ }
452
+ if (!this._prevInputLines[i] || lineStr !== this._prevInputLines[i]) {
453
+ buf += `\x1b[${row};1H${ANSI.CLEAR_LINE}` + lineStr;
454
+ this._prevInputLines[i] = lineStr;
455
+ changed = true;
456
+ }
457
+ }
458
+ if (changed) {
459
+ // Position cursor on the correct line and column
460
+ const cRow = this.inputRow + cursorLine;
461
+ const cCol = 5 + Math.min(cursorCol, maxContent);
462
+ buf += `\x1b[${cRow};${cCol}H` + ANSI.SHOW_CURSOR;
463
+ this._rawWrite(buf);
464
+ }
465
+ else {
466
+ // Just reposition cursor
467
+ const cRow = this.inputRow + cursorLine;
468
+ const cCol = 5 + Math.min(cursorCol, maxContent);
469
+ this._rawWrite(`\x1b[${cRow};${cCol}H${ANSI.SHOW_CURSOR}`);
470
+ }
471
+ }
472
+ /** Clear the old frame area when resizing */
473
+ _clearFrameArea(oldInputFrameLines) {
474
+ const rows = this.terminal.rows;
475
+ const oldFrameRows = 1 + oldInputFrameLines;
476
+ const newFrameRows = this._frameRows;
477
+ const oldTotal = oldFrameRows + this._extraRows + CHROME_ROWS;
478
+ const newTotal = newFrameRows + this._extraRows + CHROME_ROWS;
479
+ const oldFrameTop = rows - oldTotal + 1;
480
+ const newFrameTop = rows - newTotal + 1;
481
+ const startRow = Math.min(oldFrameTop, newFrameTop);
482
+ const endRow = rows - CHROME_ROWS;
483
+ let buf = '';
484
+ for (let i = startRow; i <= endRow; i++) {
485
+ buf += clearLineAt(i);
486
+ }
487
+ this._rawWrite(buf);
488
+ }
489
+ // ─── Chrome Rows ───────────────────────────────────────────────────────
490
+ /**
491
+ * Update a chrome row. BottomChrome-compatible API.
492
+ * @param index 0 = activity/frame-bottom, 1 = hints, 2 = statusbar L1, 3 = statusbar L2
493
+ */
494
+ setRow(index, content) {
495
+ if (this._chromeContent[index] === content)
496
+ return;
497
+ this._chromeContent[index] = content;
498
+ if (!this._active || this._inlineMode)
499
+ return;
500
+ this._drawChromeRow(index);
501
+ this._prevChromeContent[index] = content;
502
+ }
503
+ // ─── Suggestion Rows ──────────────────────────────────────────────────
504
+ /**
505
+ * Set the number of suggestion rows. Re-establishes scroll region.
506
+ */
507
+ setExtraRows(n) {
508
+ const maxExtra = Math.max(0, this.terminal.rows - MIN_TERMINAL_HEIGHT - CHROME_ROWS - this._frameRows);
509
+ const clamped = Math.max(0, Math.min(n, maxExtra));
510
+ if (clamped === this._extraRows)
511
+ return;
512
+ const oldExtra = this._extraRows;
513
+ this._extraRows = clamped;
514
+ this._suggestionContent = new Array(clamped).fill('');
515
+ this._prevSuggestionContent = new Array(clamped).fill('');
516
+ if (!this._active || this._inlineMode)
517
+ return;
518
+ // Clear old suggestion area + frame before resizing
519
+ this._clearSuggestionArea(oldExtra);
520
+ this._updateScrollRegion();
521
+ // Force full redraw (positions changed)
522
+ this._prevChromeContent = ['', '', '', ''];
523
+ this._prevInputLine = '';
524
+ this.redraw();
525
+ }
526
+ /**
527
+ * Write content to a suggestion row (inside the frame).
528
+ */
529
+ setSuggestionRow(index, content) {
530
+ if (index < 0 || index >= this._extraRows)
531
+ return;
532
+ if (this._suggestionContent[index] === content)
533
+ return;
534
+ this._suggestionContent[index] = content;
535
+ if (!this._active || this._inlineMode)
536
+ return;
537
+ this._drawSuggestionRow(index);
538
+ this._prevSuggestionContent[index] = content;
539
+ }
540
+ // ─── Redraw & Resize ──────────────────────────────────────────────────
541
+ /**
542
+ * Full redraw of all fixed zones (frame, suggestions, chrome).
543
+ * Uses dirty-check: only redraws rows that changed.
544
+ */
545
+ redraw() {
546
+ if (!this._active || this._inlineMode)
547
+ return;
548
+ const rows = this.terminal.rows;
549
+ const cols = this.terminal.cols;
550
+ let buf = ANSI.HIDE_CURSOR;
551
+ // Frame top
552
+ const ftRow = this.frameTopRow;
553
+ const fc = chalk.hex(this._frameColor).dim;
554
+ buf += `\x1b[${ftRow};1H${ANSI.CLEAR_LINE}` +
555
+ fc(FRAME.TOP_LEFT + FRAME.HORIZONTAL.repeat(cols - 2) + FRAME.TOP_RIGHT);
556
+ // Input lines (1 or more)
557
+ const iRow = this.inputRow;
558
+ const maxContent = cols - 6;
559
+ if (this._inputFrameLines > 1 && this._inputLines.length > 0) {
560
+ // Multi-line mode
561
+ for (let li = 0; li < this._inputFrameLines; li++) {
562
+ const r = iRow + li;
563
+ const content = this._inputLines[li] || '';
564
+ const dc = visibleLength(content) > maxContent ? content.slice(0, maxContent) : content;
565
+ const pad = Math.max(0, maxContent - visibleLength(dc));
566
+ if (li === 0) {
567
+ buf += `\x1b[${r};1H${ANSI.CLEAR_LINE}` +
568
+ fc(FRAME.VERTICAL) + ' ' + chalk.hex(this._frameColor)('❯') + ' ' +
569
+ dc + ' '.repeat(pad) + ' ' + fc(FRAME.VERTICAL);
570
+ }
571
+ else {
572
+ buf += `\x1b[${r};1H${ANSI.CLEAR_LINE}` +
573
+ fc(FRAME.VERTICAL) + ' ' +
574
+ dc + ' '.repeat(pad) + ' ' + fc(FRAME.VERTICAL);
575
+ }
576
+ this._prevInputLines[li] = content;
577
+ }
578
+ }
579
+ else {
580
+ // Single-line mode (original behavior)
581
+ const displayLine = this._inputLine.length > maxContent
582
+ ? this._inputLine.slice(this._inputLine.length - maxContent)
583
+ : this._inputLine;
584
+ const badgeVisLen = this._inputBadge ? visibleLength(this._inputBadge) : 0;
585
+ const padding = Math.max(0, maxContent - visibleLength(displayLine) - badgeVisLen);
586
+ buf += `\x1b[${iRow};1H${ANSI.CLEAR_LINE}` +
587
+ fc(FRAME.VERTICAL) + ' ' +
588
+ chalk.hex(this._frameColor)('❯') + ' ' +
589
+ displayLine +
590
+ this._inputBadge +
591
+ ' '.repeat(padding) +
592
+ ' ' + fc(FRAME.VERTICAL);
593
+ }
594
+ // Suggestion rows (inside frame, after all input lines)
595
+ for (let i = 0; i < this._extraRows; i++) {
596
+ const sRow = iRow + this._inputFrameLines + i;
597
+ const sContent = this._suggestionContent[i] || '';
598
+ const sPadding = Math.max(0, cols - 4 - visibleLength(sContent));
599
+ buf += `\x1b[${sRow};1H${ANSI.CLEAR_LINE}` +
600
+ fc(FRAME.VERTICAL) + ' ' + sContent + ' '.repeat(sPadding) + ' ' + fc(FRAME.VERTICAL);
601
+ this._prevSuggestionContent[i] = this._suggestionContent[i];
602
+ }
603
+ // Chrome rows
604
+ const chromeStart = rows - CHROME_ROWS + 1;
605
+ for (let i = 0; i < CHROME_ROWS; i++) {
606
+ const cRow = chromeStart + i;
607
+ // Row 0 = frame bottom (no indent), rows 1-3 = hints/statusbar (1 space indent)
608
+ const prefix = i === 0 ? '' : ' ';
609
+ buf += `\x1b[${cRow};1H${ANSI.CLEAR_LINE}${prefix}${this._chromeContent[i]}`;
610
+ this._prevChromeContent[i] = this._chromeContent[i];
611
+ }
612
+ // Position cursor: at input row when user is typing, at scroll region when agent is running
613
+ if (this._inputActive) {
614
+ const cRow = iRow + this._inputCursorLine;
615
+ const cursorCol = 5 + Math.min(this._inputCursorPos, maxContent);
616
+ buf += moveTo(cRow, cursorCol) + ANSI.SHOW_CURSOR;
617
+ }
618
+ else {
619
+ buf += moveTo(this.scrollEnd, 1) + ANSI.SHOW_CURSOR;
620
+ }
621
+ this._rawWrite(buf);
622
+ this._prevInputLine = ''; // force next renderInput to redraw
623
+ }
624
+ handleResize() {
625
+ if (!this._active)
626
+ return;
627
+ const rows = this.terminal.rows;
628
+ if (rows < MIN_TERMINAL_HEIGHT) {
629
+ this.deactivate();
630
+ this._inlineMode = true;
631
+ return;
632
+ }
633
+ this._updateScrollRegion();
634
+ this._prevChromeContent = ['', '', '', ''];
635
+ this._prevSuggestionContent = new Array(this._extraRows).fill('');
636
+ this._prevInputLine = '';
637
+ this.redraw();
638
+ }
639
+ // ─── BottomChrome Compatibility ────────────────────────────────────────
640
+ /** BottomChrome-compatible: position cursor at prompt row */
641
+ positionCursorForPrompt() {
642
+ this.positionCursorForInput();
643
+ }
644
+ /** BottomChrome-compatible: suppress hook redraws during input */
645
+ set promptActive(active) {
646
+ this._inputActive = active;
647
+ }
648
+ /** BottomChrome-compatible: write at prompt row */
649
+ writeAtPromptRow(content) {
650
+ this.writeAtInputRow(content);
651
+ }
652
+ // ─── Web App Integration ───────────────────────────────────────────────
653
+ /** Update the output write callback (for StdoutCapture / brain streaming) */
654
+ setOutputWriteCallback(cb) {
655
+ this._onOutputWrite = cb;
656
+ }
657
+ // ─── Private: Scroll Region ────────────────────────────────────────────
658
+ _updateScrollRegion() {
659
+ if (!this.terminal.isTTY)
660
+ return;
661
+ const se = this.scrollEnd;
662
+ if (se < 1)
663
+ return;
664
+ this._rawWrite(`\x1b[1;${se}r` + // set scroll region
665
+ moveTo(se, 1));
666
+ }
667
+ // ─── Private: Stdout Hook ──────────────────────────────────────────────
668
+ /**
669
+ * Monkey-patch process.stdout.write for backward compatibility.
670
+ * Existing code that still calls process.stdout.write() directly
671
+ * (renderInfo, renderToolCall, etc.) gets routed through here.
672
+ *
673
+ * The hook:
674
+ * 1. Writes the data normally (via original write)
675
+ * 2. Triggers onOutputWrite callback for web streaming
676
+ * 3. Schedules a chrome redraw if the write contained newlines
677
+ *
678
+ * This hook is TEMPORARY — as more code migrates to screen.writeOutput(),
679
+ * fewer writes go through the hook. Eventually it can be removed.
680
+ */
681
+ _hookStdout() {
682
+ if (!this.terminal.isTTY || this._originalWrite)
683
+ return;
684
+ this._originalWrite = process.stdout.write.bind(process.stdout);
685
+ const self = this;
686
+ process.stdout.write = function (...args) {
687
+ const data = typeof args[0] === 'string' ? args[0] : '';
688
+ const isFrame = data ? self._isFrameContent(data) : false;
689
+ // Suspended mode: buffer writes while sub-menu is active.
690
+ // Prevents background output from corrupting interactive menus.
691
+ if (self._suspended && data && !isFrame) {
692
+ self._suspendedBuffer.push(data);
693
+ // Still stream to web app
694
+ if (self._onOutputWrite)
695
+ self._onOutputWrite(data);
696
+ return true;
697
+ }
698
+ // When user is at the prompt and something writes to stdout
699
+ // (e.g. async daemon events like Jarvis autonomy), redirect
700
+ // the write into the scroll region so it doesn't pollute the input frame.
701
+ if (self._active && self._inputActive && data && !isFrame) {
702
+ const scrollEnd = self.scrollEnd;
703
+ const inputRow = self.inputRow;
704
+ const cursorCol = 5 + self._inputCursorPos;
705
+ // Move to scroll region → write → restore cursor to input
706
+ self._originalWrite(ANSI.HIDE_CURSOR +
707
+ `\x1b[${scrollEnd};1H` +
708
+ data +
709
+ `\x1b[${inputRow};${cursorCol}H` +
710
+ ANSI.SHOW_CURSOR);
711
+ // Stream to web app
712
+ if (self._onOutputWrite) {
713
+ self._onOutputWrite(data);
714
+ }
715
+ return true;
716
+ }
717
+ const result = self._originalWrite(...args);
718
+ // Stream to web app
719
+ if (data && self._onOutputWrite && !isFrame) {
720
+ self._onOutputWrite(data);
721
+ }
722
+ // Schedule chrome redraw on newlines (protects against terminals ignoring DECSTBM)
723
+ if (self._active && !self._redrawScheduled && !self._inputActive) {
724
+ if (data.includes('\n')) {
725
+ self._scheduleRedraw();
726
+ }
727
+ }
728
+ return result;
729
+ };
730
+ }
731
+ _unhookStdout() {
732
+ if (this._originalWrite) {
733
+ process.stdout.write = this._originalWrite;
734
+ this._originalWrite = null;
735
+ }
736
+ this._redrawScheduled = false;
737
+ }
738
+ /**
739
+ * Detect if a write is our own frame/chrome content (to avoid streaming it to web).
740
+ * Frame content always starts with cursor positioning escape sequences.
741
+ */
742
+ _isFrameContent(data) {
743
+ // Our _rawWrite calls start with hide-cursor or cursor-position sequences
744
+ // This is a heuristic — better than nothing for filtering out chrome redraws
745
+ return data.startsWith(ANSI.HIDE_CURSOR) ||
746
+ (data.startsWith('\x1b[') && data.includes(';') && data.includes('H'));
747
+ }
748
+ _scheduleRedraw() {
749
+ this._redrawScheduled = true;
750
+ setTimeout(() => {
751
+ this._redrawScheduled = false;
752
+ if (this._active) {
753
+ this._prevChromeContent = ['', '', '', ''];
754
+ this._prevInputLine = '';
755
+ this.redraw();
756
+ }
757
+ }, 16);
758
+ }
759
+ // ─── Private: Raw Write ────────────────────────────────────────────────
760
+ /** Write directly to stdout, bypassing the hook */
761
+ _rawWrite(data) {
762
+ const write = this._originalWrite || process.stdout.write.bind(process.stdout);
763
+ write(data);
764
+ }
765
+ // ─── Private: Drawing ──────────────────────────────────────────────────
766
+ _drawChromeRow(index) {
767
+ const rows = this.terminal.rows;
768
+ const chromeStart = rows - CHROME_ROWS + 1;
769
+ const row = chromeStart + index;
770
+ const content = this._chromeContent[index];
771
+ // Chrome row 0 = frame bottom border (no left padding, must align with frame top)
772
+ // Chrome rows 1-3 = hints/statusbar (1 space indent)
773
+ const prefix = index === 0 ? '' : ' ';
774
+ // When input is active (user typing), position cursor at input row for readline.
775
+ // When input is NOT active (agent running), position cursor in scroll region
776
+ // so that concurrent stdout writes (agent output, Done line) go to the right place.
777
+ const cursorRow = this._inputActive ? this.inputRow : this.scrollEnd;
778
+ const cursorCol = this._inputActive ? 5 + this._inputCursorPos : 1;
779
+ this._rawWrite(ANSI.HIDE_CURSOR +
780
+ `\x1b[${row};1H${ANSI.CLEAR_LINE}` +
781
+ prefix + content +
782
+ moveTo(cursorRow, cursorCol) +
783
+ ANSI.SHOW_CURSOR);
784
+ }
785
+ _drawSuggestionRow(index) {
786
+ const iRow = this.inputRow;
787
+ const sRow = iRow + this._inputFrameLines + index;
788
+ const cols = this.terminal.cols;
789
+ const fc = chalk.hex(this._frameColor).dim;
790
+ const content = this._suggestionContent[index] || '';
791
+ const padding = Math.max(0, cols - 4 - visibleLength(content));
792
+ const cursorRow = this._inputActive ? this.inputRow : this.scrollEnd;
793
+ const cursorCol = this._inputActive ? 5 + this._inputCursorPos : 1;
794
+ this._rawWrite(ANSI.HIDE_CURSOR +
795
+ `\x1b[${sRow};1H${ANSI.CLEAR_LINE}` +
796
+ fc(FRAME.VERTICAL) + ' ' + content + ' '.repeat(padding) + ' ' + fc(FRAME.VERTICAL) +
797
+ moveTo(cursorRow, cursorCol) +
798
+ ANSI.SHOW_CURSOR);
799
+ }
800
+ _clearAllFixed() {
801
+ const rows = this.terminal.rows;
802
+ const total = this._frameRows + this._extraRows + CHROME_ROWS;
803
+ const startRow = rows - total + 1;
804
+ let buf = '';
805
+ for (let i = 0; i < total; i++) {
806
+ buf += clearLineAt(startRow + i);
807
+ }
808
+ this._rawWrite(buf);
809
+ }
810
+ _clearSuggestionArea(oldExtraCount) {
811
+ const rows = this.terminal.rows;
812
+ const oldTotal = this._frameRows + oldExtraCount + CHROME_ROWS;
813
+ const newTotal = this._frameRows + this._extraRows + CHROME_ROWS;
814
+ // Clear from old frame top down to chrome start
815
+ const oldFrameTop = rows - oldTotal + 1;
816
+ const newFrameTop = rows - newTotal + 1;
817
+ const startRow = Math.min(oldFrameTop, newFrameTop);
818
+ const endRow = rows - CHROME_ROWS;
819
+ let buf = '';
820
+ for (let i = startRow; i <= endRow; i++) {
821
+ buf += clearLineAt(i);
822
+ }
823
+ this._rawWrite(buf);
824
+ }
825
+ }
826
+ //# sourceMappingURL=screen.js.map