aven-ai 0.0.1

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 (386) hide show
  1. package/README.md +171 -0
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +4 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/libs/config/config-store.d.ts +109 -0
  7. package/dist/libs/config/config-store.d.ts.map +1 -0
  8. package/dist/libs/config/config-store.js +169 -0
  9. package/dist/libs/config/config-store.js.map +1 -0
  10. package/dist/libs/config/index.d.ts +2 -0
  11. package/dist/libs/config/index.d.ts.map +1 -0
  12. package/dist/libs/config/index.js +2 -0
  13. package/dist/libs/config/index.js.map +1 -0
  14. package/dist/libs/provider-clients/index.d.ts +2 -0
  15. package/dist/libs/provider-clients/index.d.ts.map +1 -0
  16. package/dist/libs/provider-clients/index.js +2 -0
  17. package/dist/libs/provider-clients/index.js.map +1 -0
  18. package/dist/libs/provider-clients/provider-client.d.ts +34 -0
  19. package/dist/libs/provider-clients/provider-client.d.ts.map +1 -0
  20. package/dist/libs/provider-clients/provider-client.js +167 -0
  21. package/dist/libs/provider-clients/provider-client.js.map +1 -0
  22. package/dist/libs/provider-definitions/index.d.ts +2 -0
  23. package/dist/libs/provider-definitions/index.d.ts.map +1 -0
  24. package/dist/libs/provider-definitions/index.js +2 -0
  25. package/dist/libs/provider-definitions/index.js.map +1 -0
  26. package/dist/libs/provider-definitions/provider-definitions.d.ts +16 -0
  27. package/dist/libs/provider-definitions/provider-definitions.d.ts.map +1 -0
  28. package/dist/libs/provider-definitions/provider-definitions.js +59 -0
  29. package/dist/libs/provider-definitions/provider-definitions.js.map +1 -0
  30. package/dist/libs/pty/index.d.ts +2 -0
  31. package/dist/libs/pty/index.d.ts.map +1 -0
  32. package/dist/libs/pty/index.js +2 -0
  33. package/dist/libs/pty/index.js.map +1 -0
  34. package/dist/libs/pty/pty-runner.d.ts +26 -0
  35. package/dist/libs/pty/pty-runner.d.ts.map +1 -0
  36. package/dist/libs/pty/pty-runner.js +153 -0
  37. package/dist/libs/pty/pty-runner.js.map +1 -0
  38. package/dist/libs/session-storage/index.d.ts +2 -0
  39. package/dist/libs/session-storage/index.d.ts.map +1 -0
  40. package/dist/libs/session-storage/index.js +2 -0
  41. package/dist/libs/session-storage/index.js.map +1 -0
  42. package/dist/libs/session-storage/session-catalog.d.ts +19 -0
  43. package/dist/libs/session-storage/session-catalog.d.ts.map +1 -0
  44. package/dist/libs/session-storage/session-catalog.js +180 -0
  45. package/dist/libs/session-storage/session-catalog.js.map +1 -0
  46. package/dist/libs/terminal/clipboard.d.ts +3 -0
  47. package/dist/libs/terminal/clipboard.d.ts.map +1 -0
  48. package/dist/libs/terminal/clipboard.js +8 -0
  49. package/dist/libs/terminal/clipboard.js.map +1 -0
  50. package/dist/libs/terminal/index.d.ts +6 -0
  51. package/dist/libs/terminal/index.d.ts.map +1 -0
  52. package/dist/libs/terminal/index.js +6 -0
  53. package/dist/libs/terminal/index.js.map +1 -0
  54. package/dist/libs/terminal/keyboard-protocol.d.ts +3 -0
  55. package/dist/libs/terminal/keyboard-protocol.d.ts.map +1 -0
  56. package/dist/libs/terminal/keyboard-protocol.js +7 -0
  57. package/dist/libs/terminal/keyboard-protocol.js.map +1 -0
  58. package/dist/libs/terminal/mouse-protocol.d.ts +22 -0
  59. package/dist/libs/terminal/mouse-protocol.d.ts.map +1 -0
  60. package/dist/libs/terminal/mouse-protocol.js +51 -0
  61. package/dist/libs/terminal/mouse-protocol.js.map +1 -0
  62. package/dist/libs/terminal/terminal-provider.d.ts +15 -0
  63. package/dist/libs/terminal/terminal-provider.d.ts.map +1 -0
  64. package/dist/libs/terminal/terminal-provider.js +47 -0
  65. package/dist/libs/terminal/terminal-provider.js.map +1 -0
  66. package/dist/libs/terminal/theme.d.ts +24 -0
  67. package/dist/libs/terminal/theme.d.ts.map +1 -0
  68. package/dist/libs/terminal/theme.js +23 -0
  69. package/dist/libs/terminal/theme.js.map +1 -0
  70. package/dist/modules/agent/core.d.ts +41 -0
  71. package/dist/modules/agent/core.d.ts.map +1 -0
  72. package/dist/modules/agent/core.js +149 -0
  73. package/dist/modules/agent/core.js.map +1 -0
  74. package/dist/modules/agent/events/memory-message-adapter.d.ts +4 -0
  75. package/dist/modules/agent/events/memory-message-adapter.d.ts.map +1 -0
  76. package/dist/modules/agent/events/memory-message-adapter.js +48 -0
  77. package/dist/modules/agent/events/memory-message-adapter.js.map +1 -0
  78. package/dist/modules/agent/events/stream-event-adapter.d.ts +17 -0
  79. package/dist/modules/agent/events/stream-event-adapter.d.ts.map +1 -0
  80. package/dist/modules/agent/events/stream-event-adapter.js +82 -0
  81. package/dist/modules/agent/events/stream-event-adapter.js.map +1 -0
  82. package/dist/modules/agent/events/tool-message-adapter.d.ts +21 -0
  83. package/dist/modules/agent/events/tool-message-adapter.d.ts.map +1 -0
  84. package/dist/modules/agent/events/tool-message-adapter.js +123 -0
  85. package/dist/modules/agent/events/tool-message-adapter.js.map +1 -0
  86. package/dist/modules/agent/index.d.ts +5 -0
  87. package/dist/modules/agent/index.d.ts.map +1 -0
  88. package/dist/modules/agent/index.js +5 -0
  89. package/dist/modules/agent/index.js.map +1 -0
  90. package/dist/modules/agent/mock.d.ts +10 -0
  91. package/dist/modules/agent/mock.d.ts.map +1 -0
  92. package/dist/modules/agent/mock.js +60 -0
  93. package/dist/modules/agent/mock.js.map +1 -0
  94. package/dist/modules/agent/prompts/commands.d.ts +2 -0
  95. package/dist/modules/agent/prompts/commands.d.ts.map +1 -0
  96. package/dist/modules/agent/prompts/commands.js +5 -0
  97. package/dist/modules/agent/prompts/commands.js.map +1 -0
  98. package/dist/modules/agent/prompts/file-tools.d.ts +2 -0
  99. package/dist/modules/agent/prompts/file-tools.d.ts.map +1 -0
  100. package/dist/modules/agent/prompts/file-tools.js +7 -0
  101. package/dist/modules/agent/prompts/file-tools.js.map +1 -0
  102. package/dist/modules/agent/prompts/identity.d.ts +2 -0
  103. package/dist/modules/agent/prompts/identity.d.ts.map +1 -0
  104. package/dist/modules/agent/prompts/identity.js +5 -0
  105. package/dist/modules/agent/prompts/identity.js.map +1 -0
  106. package/dist/modules/agent/prompts/system.d.ts +2 -0
  107. package/dist/modules/agent/prompts/system.d.ts.map +1 -0
  108. package/dist/modules/agent/prompts/system.js +5 -0
  109. package/dist/modules/agent/prompts/system.js.map +1 -0
  110. package/dist/modules/agent/services/direct-command-executor.d.ts +10 -0
  111. package/dist/modules/agent/services/direct-command-executor.d.ts.map +1 -0
  112. package/dist/modules/agent/services/direct-command-executor.js +58 -0
  113. package/dist/modules/agent/services/direct-command-executor.js.map +1 -0
  114. package/dist/modules/agent/services/prompt-turn-executor.d.ts +12 -0
  115. package/dist/modules/agent/services/prompt-turn-executor.d.ts.map +1 -0
  116. package/dist/modules/agent/services/prompt-turn-executor.js +79 -0
  117. package/dist/modules/agent/services/prompt-turn-executor.js.map +1 -0
  118. package/dist/modules/agent/tools/exec-command.d.ts +13 -0
  119. package/dist/modules/agent/tools/exec-command.d.ts.map +1 -0
  120. package/dist/modules/agent/tools/exec-command.js +11 -0
  121. package/dist/modules/agent/tools/exec-command.js.map +1 -0
  122. package/dist/modules/agent/tools/files/contracts.d.ts +132 -0
  123. package/dist/modules/agent/tools/files/contracts.d.ts.map +1 -0
  124. package/dist/modules/agent/tools/files/contracts.js +84 -0
  125. package/dist/modules/agent/tools/files/contracts.js.map +1 -0
  126. package/dist/modules/agent/tools/files/create-file-tools.d.ts +61 -0
  127. package/dist/modules/agent/tools/files/create-file-tools.d.ts.map +1 -0
  128. package/dist/modules/agent/tools/files/create-file-tools.js +26 -0
  129. package/dist/modules/agent/tools/files/create-file-tools.js.map +1 -0
  130. package/dist/modules/agent/tools/files/edit-file-operation.d.ts +4 -0
  131. package/dist/modules/agent/tools/files/edit-file-operation.d.ts.map +1 -0
  132. package/dist/modules/agent/tools/files/edit-file-operation.js +98 -0
  133. package/dist/modules/agent/tools/files/edit-file-operation.js.map +1 -0
  134. package/dist/modules/agent/tools/files/file-path-safety.d.ts +2 -0
  135. package/dist/modules/agent/tools/files/file-path-safety.d.ts.map +1 -0
  136. package/dist/modules/agent/tools/files/file-path-safety.js +10 -0
  137. package/dist/modules/agent/tools/files/file-path-safety.js.map +1 -0
  138. package/dist/modules/agent/tools/files/file-state-cache.d.ts +21 -0
  139. package/dist/modules/agent/tools/files/file-state-cache.d.ts.map +1 -0
  140. package/dist/modules/agent/tools/files/file-state-cache.js +54 -0
  141. package/dist/modules/agent/tools/files/file-state-cache.js.map +1 -0
  142. package/dist/modules/agent/tools/files/file-tool-error.d.ts +3 -0
  143. package/dist/modules/agent/tools/files/file-tool-error.d.ts.map +1 -0
  144. package/dist/modules/agent/tools/files/file-tool-error.js +3 -0
  145. package/dist/modules/agent/tools/files/file-tool-error.js.map +1 -0
  146. package/dist/modules/agent/tools/files/file-tool-operations.d.ts +22 -0
  147. package/dist/modules/agent/tools/files/file-tool-operations.d.ts.map +1 -0
  148. package/dist/modules/agent/tools/files/file-tool-operations.js +73 -0
  149. package/dist/modules/agent/tools/files/file-tool-operations.js.map +1 -0
  150. package/dist/modules/agent/tools/files/file-tool-service.d.ts +14 -0
  151. package/dist/modules/agent/tools/files/file-tool-service.d.ts.map +1 -0
  152. package/dist/modules/agent/tools/files/file-tool-service.js +28 -0
  153. package/dist/modules/agent/tools/files/file-tool-service.js.map +1 -0
  154. package/dist/modules/agent/tools/files/mutation-journal.d.ts +12 -0
  155. package/dist/modules/agent/tools/files/mutation-journal.d.ts.map +1 -0
  156. package/dist/modules/agent/tools/files/mutation-journal.js +25 -0
  157. package/dist/modules/agent/tools/files/mutation-journal.js.map +1 -0
  158. package/dist/modules/agent/tools/files/read-file-operation.d.ts +4 -0
  159. package/dist/modules/agent/tools/files/read-file-operation.d.ts.map +1 -0
  160. package/dist/modules/agent/tools/files/read-file-operation.js +92 -0
  161. package/dist/modules/agent/tools/files/read-file-operation.js.map +1 -0
  162. package/dist/modules/agent/tools/files/text-file-codec.d.ts +13 -0
  163. package/dist/modules/agent/tools/files/text-file-codec.d.ts.map +1 -0
  164. package/dist/modules/agent/tools/files/text-file-codec.js +45 -0
  165. package/dist/modules/agent/tools/files/text-file-codec.js.map +1 -0
  166. package/dist/modules/agent/tools/files/write-file-operation.d.ts +4 -0
  167. package/dist/modules/agent/tools/files/write-file-operation.d.ts.map +1 -0
  168. package/dist/modules/agent/tools/files/write-file-operation.js +61 -0
  169. package/dist/modules/agent/tools/files/write-file-operation.js.map +1 -0
  170. package/dist/modules/agent/types.d.ts +65 -0
  171. package/dist/modules/agent/types.d.ts.map +1 -0
  172. package/dist/modules/agent/types.js +21 -0
  173. package/dist/modules/agent/types.js.map +1 -0
  174. package/dist/modules/app/cli.d.ts +2 -0
  175. package/dist/modules/app/cli.d.ts.map +1 -0
  176. package/dist/modules/app/cli.js +23 -0
  177. package/dist/modules/app/cli.js.map +1 -0
  178. package/dist/modules/app/components/app-provider.d.ts +11 -0
  179. package/dist/modules/app/components/app-provider.d.ts.map +1 -0
  180. package/dist/modules/app/components/app-provider.js +18 -0
  181. package/dist/modules/app/components/app-provider.js.map +1 -0
  182. package/dist/modules/app/components/app.d.ts +7 -0
  183. package/dist/modules/app/components/app.d.ts.map +1 -0
  184. package/dist/modules/app/components/app.js +45 -0
  185. package/dist/modules/app/components/app.js.map +1 -0
  186. package/dist/modules/app/index.d.ts +6 -0
  187. package/dist/modules/app/index.d.ts.map +1 -0
  188. package/dist/modules/app/index.js +5 -0
  189. package/dist/modules/app/index.js.map +1 -0
  190. package/dist/modules/app/input/prompt-history.d.ts +3 -0
  191. package/dist/modules/app/input/prompt-history.d.ts.map +1 -0
  192. package/dist/modules/app/input/prompt-history.js +13 -0
  193. package/dist/modules/app/input/prompt-history.js.map +1 -0
  194. package/dist/modules/app/input/use-overlay-controller.d.ts +14 -0
  195. package/dist/modules/app/input/use-overlay-controller.d.ts.map +1 -0
  196. package/dist/modules/app/input/use-overlay-controller.js +168 -0
  197. package/dist/modules/app/input/use-overlay-controller.js.map +1 -0
  198. package/dist/modules/app/services/quit-controller.d.ts +2 -0
  199. package/dist/modules/app/services/quit-controller.d.ts.map +1 -0
  200. package/dist/modules/app/services/quit-controller.js +27 -0
  201. package/dist/modules/app/services/quit-controller.js.map +1 -0
  202. package/dist/modules/app/services/runtime-event-batcher.d.ts +13 -0
  203. package/dist/modules/app/services/runtime-event-batcher.d.ts.map +1 -0
  204. package/dist/modules/app/services/runtime-event-batcher.js +41 -0
  205. package/dist/modules/app/services/runtime-event-batcher.js.map +1 -0
  206. package/dist/modules/app/services/use-app-input.d.ts +14 -0
  207. package/dist/modules/app/services/use-app-input.d.ts.map +1 -0
  208. package/dist/modules/app/services/use-app-input.js +144 -0
  209. package/dist/modules/app/services/use-app-input.js.map +1 -0
  210. package/dist/modules/app/services/use-runtime-connection.d.ts +15 -0
  211. package/dist/modules/app/services/use-runtime-connection.d.ts.map +1 -0
  212. package/dist/modules/app/services/use-runtime-connection.js +128 -0
  213. package/dist/modules/app/services/use-runtime-connection.js.map +1 -0
  214. package/dist/modules/app/services/use-runtime-session.d.ts +8 -0
  215. package/dist/modules/app/services/use-runtime-session.d.ts.map +1 -0
  216. package/dist/modules/app/services/use-runtime-session.js +79 -0
  217. package/dist/modules/app/services/use-runtime-session.js.map +1 -0
  218. package/dist/modules/app/services/use-runtime-workspace.d.ts +16 -0
  219. package/dist/modules/app/services/use-runtime-workspace.d.ts.map +1 -0
  220. package/dist/modules/app/services/use-runtime-workspace.js +134 -0
  221. package/dist/modules/app/services/use-runtime-workspace.js.map +1 -0
  222. package/dist/modules/app/store/app-state.d.ts +39 -0
  223. package/dist/modules/app/store/app-state.d.ts.map +1 -0
  224. package/dist/modules/app/store/app-state.js +2 -0
  225. package/dist/modules/app/store/app-state.js.map +1 -0
  226. package/dist/modules/app/store/apply-runtime-event.d.ts +4 -0
  227. package/dist/modules/app/store/apply-runtime-event.d.ts.map +1 -0
  228. package/dist/modules/app/store/apply-runtime-event.js +72 -0
  229. package/dist/modules/app/store/apply-runtime-event.js.map +1 -0
  230. package/dist/modules/app/store/create-app-store.d.ts +5 -0
  231. package/dist/modules/app/store/create-app-store.d.ts.map +1 -0
  232. package/dist/modules/app/store/create-app-store.js +49 -0
  233. package/dist/modules/app/store/create-app-store.js.map +1 -0
  234. package/dist/modules/app/store/selectors.d.ts +20 -0
  235. package/dist/modules/app/store/selectors.d.ts.map +1 -0
  236. package/dist/modules/app/store/selectors.js +19 -0
  237. package/dist/modules/app/store/selectors.js.map +1 -0
  238. package/dist/modules/commands/index.d.ts +2 -0
  239. package/dist/modules/commands/index.d.ts.map +1 -0
  240. package/dist/modules/commands/index.js +2 -0
  241. package/dist/modules/commands/index.js.map +1 -0
  242. package/dist/modules/commands/registry.d.ts +11 -0
  243. package/dist/modules/commands/registry.d.ts.map +1 -0
  244. package/dist/modules/commands/registry.js +16 -0
  245. package/dist/modules/commands/registry.js.map +1 -0
  246. package/dist/modules/composer/components/composer.d.ts +17 -0
  247. package/dist/modules/composer/components/composer.d.ts.map +1 -0
  248. package/dist/modules/composer/components/composer.js +35 -0
  249. package/dist/modules/composer/components/composer.js.map +1 -0
  250. package/dist/modules/composer/index.d.ts +6 -0
  251. package/dist/modules/composer/index.d.ts.map +1 -0
  252. package/dist/modules/composer/index.js +5 -0
  253. package/dist/modules/composer/index.js.map +1 -0
  254. package/dist/modules/composer/services/editor.d.ts +9 -0
  255. package/dist/modules/composer/services/editor.d.ts.map +1 -0
  256. package/dist/modules/composer/services/editor.js +39 -0
  257. package/dist/modules/composer/services/editor.js.map +1 -0
  258. package/dist/modules/composer/services/input-intent.d.ts +40 -0
  259. package/dist/modules/composer/services/input-intent.d.ts.map +1 -0
  260. package/dist/modules/composer/services/input-intent.js +58 -0
  261. package/dist/modules/composer/services/input-intent.js.map +1 -0
  262. package/dist/modules/composer/services/suggestions.d.ts +9 -0
  263. package/dist/modules/composer/services/suggestions.d.ts.map +1 -0
  264. package/dist/modules/composer/services/suggestions.js +18 -0
  265. package/dist/modules/composer/services/suggestions.js.map +1 -0
  266. package/dist/modules/composer/types.d.ts +9 -0
  267. package/dist/modules/composer/types.d.ts.map +1 -0
  268. package/dist/modules/composer/types.js +2 -0
  269. package/dist/modules/composer/types.js.map +1 -0
  270. package/dist/modules/conversation/components/transcript-row.d.ts +9 -0
  271. package/dist/modules/conversation/components/transcript-row.d.ts.map +1 -0
  272. package/dist/modules/conversation/components/transcript-row.js +13 -0
  273. package/dist/modules/conversation/components/transcript-row.js.map +1 -0
  274. package/dist/modules/conversation/components/virtual-transcript.d.ts +9 -0
  275. package/dist/modules/conversation/components/virtual-transcript.d.ts.map +1 -0
  276. package/dist/modules/conversation/components/virtual-transcript.js +24 -0
  277. package/dist/modules/conversation/components/virtual-transcript.js.map +1 -0
  278. package/dist/modules/conversation/fixtures.d.ts +3 -0
  279. package/dist/modules/conversation/fixtures.d.ts.map +1 -0
  280. package/dist/modules/conversation/fixtures.js +22 -0
  281. package/dist/modules/conversation/fixtures.js.map +1 -0
  282. package/dist/modules/conversation/index.d.ts +5 -0
  283. package/dist/modules/conversation/index.d.ts.map +1 -0
  284. package/dist/modules/conversation/index.js +4 -0
  285. package/dist/modules/conversation/index.js.map +1 -0
  286. package/dist/modules/conversation/services/input-intent.d.ts +18 -0
  287. package/dist/modules/conversation/services/input-intent.d.ts.map +1 -0
  288. package/dist/modules/conversation/services/input-intent.js +18 -0
  289. package/dist/modules/conversation/services/input-intent.js.map +1 -0
  290. package/dist/modules/conversation/services/markdown-rows.d.ts +5 -0
  291. package/dist/modules/conversation/services/markdown-rows.d.ts.map +1 -0
  292. package/dist/modules/conversation/services/markdown-rows.js +96 -0
  293. package/dist/modules/conversation/services/markdown-rows.js.map +1 -0
  294. package/dist/modules/conversation/services/message-rows.d.ts +8 -0
  295. package/dist/modules/conversation/services/message-rows.d.ts.map +1 -0
  296. package/dist/modules/conversation/services/message-rows.js +141 -0
  297. package/dist/modules/conversation/services/message-rows.js.map +1 -0
  298. package/dist/modules/conversation/services/row-model.d.ts +5 -0
  299. package/dist/modules/conversation/services/row-model.d.ts.map +1 -0
  300. package/dist/modules/conversation/services/row-model.js +11 -0
  301. package/dist/modules/conversation/services/row-model.js.map +1 -0
  302. package/dist/modules/conversation/services/selection.d.ts +10 -0
  303. package/dist/modules/conversation/services/selection.d.ts.map +1 -0
  304. package/dist/modules/conversation/services/selection.js +92 -0
  305. package/dist/modules/conversation/services/selection.js.map +1 -0
  306. package/dist/modules/conversation/services/terminal-cells.d.ts +9 -0
  307. package/dist/modules/conversation/services/terminal-cells.d.ts.map +1 -0
  308. package/dist/modules/conversation/services/terminal-cells.js +24 -0
  309. package/dist/modules/conversation/services/terminal-cells.js.map +1 -0
  310. package/dist/modules/conversation/services/transcript-row-cache.d.ts +10 -0
  311. package/dist/modules/conversation/services/transcript-row-cache.d.ts.map +1 -0
  312. package/dist/modules/conversation/services/transcript-row-cache.js +40 -0
  313. package/dist/modules/conversation/services/transcript-row-cache.js.map +1 -0
  314. package/dist/modules/conversation/services/use-transcript-controller.d.ts +17 -0
  315. package/dist/modules/conversation/services/use-transcript-controller.d.ts.map +1 -0
  316. package/dist/modules/conversation/services/use-transcript-controller.js +157 -0
  317. package/dist/modules/conversation/services/use-transcript-controller.js.map +1 -0
  318. package/dist/modules/conversation/services/wrapping.d.ts +3 -0
  319. package/dist/modules/conversation/services/wrapping.d.ts.map +1 -0
  320. package/dist/modules/conversation/services/wrapping.js +46 -0
  321. package/dist/modules/conversation/services/wrapping.js.map +1 -0
  322. package/dist/modules/conversation/types.d.ts +77 -0
  323. package/dist/modules/conversation/types.d.ts.map +1 -0
  324. package/dist/modules/conversation/types.js +2 -0
  325. package/dist/modules/conversation/types.js.map +1 -0
  326. package/dist/modules/overlays/components/overlay.d.ts +10 -0
  327. package/dist/modules/overlays/components/overlay.d.ts.map +1 -0
  328. package/dist/modules/overlays/components/overlay.js +17 -0
  329. package/dist/modules/overlays/components/overlay.js.map +1 -0
  330. package/dist/modules/overlays/index.d.ts +6 -0
  331. package/dist/modules/overlays/index.d.ts.map +1 -0
  332. package/dist/modules/overlays/index.js +5 -0
  333. package/dist/modules/overlays/index.js.map +1 -0
  334. package/dist/modules/overlays/services/overlay-items.d.ts +20 -0
  335. package/dist/modules/overlays/services/overlay-items.d.ts.map +1 -0
  336. package/dist/modules/overlays/services/overlay-items.js +56 -0
  337. package/dist/modules/overlays/services/overlay-items.js.map +1 -0
  338. package/dist/modules/overlays/services/overlay-registry.d.ts +4 -0
  339. package/dist/modules/overlays/services/overlay-registry.d.ts.map +1 -0
  340. package/dist/modules/overlays/services/overlay-registry.js +42 -0
  341. package/dist/modules/overlays/services/overlay-registry.js.map +1 -0
  342. package/dist/modules/overlays/services/overlay-selection.d.ts +23 -0
  343. package/dist/modules/overlays/services/overlay-selection.d.ts.map +1 -0
  344. package/dist/modules/overlays/services/overlay-selection.js +23 -0
  345. package/dist/modules/overlays/services/overlay-selection.js.map +1 -0
  346. package/dist/modules/overlays/types.d.ts +15 -0
  347. package/dist/modules/overlays/types.d.ts.map +1 -0
  348. package/dist/modules/overlays/types.js +2 -0
  349. package/dist/modules/overlays/types.js.map +1 -0
  350. package/dist/modules/providers/catalog.d.ts +2 -0
  351. package/dist/modules/providers/catalog.d.ts.map +1 -0
  352. package/dist/modules/providers/catalog.js +2 -0
  353. package/dist/modules/providers/catalog.js.map +1 -0
  354. package/dist/modules/providers/index.d.ts +5 -0
  355. package/dist/modules/providers/index.d.ts.map +1 -0
  356. package/dist/modules/providers/index.js +3 -0
  357. package/dist/modules/providers/index.js.map +1 -0
  358. package/dist/modules/providers/services/provider-connection-manager.d.ts +22 -0
  359. package/dist/modules/providers/services/provider-connection-manager.d.ts.map +1 -0
  360. package/dist/modules/providers/services/provider-connection-manager.js +147 -0
  361. package/dist/modules/providers/services/provider-connection-manager.js.map +1 -0
  362. package/dist/modules/providers/types.d.ts +20 -0
  363. package/dist/modules/providers/types.d.ts.map +1 -0
  364. package/dist/modules/providers/types.js +2 -0
  365. package/dist/modules/providers/types.js.map +1 -0
  366. package/dist/modules/sessions/index.d.ts +3 -0
  367. package/dist/modules/sessions/index.d.ts.map +1 -0
  368. package/dist/modules/sessions/index.js +3 -0
  369. package/dist/modules/sessions/index.js.map +1 -0
  370. package/dist/modules/sessions/services/project-session-manager.d.ts +28 -0
  371. package/dist/modules/sessions/services/project-session-manager.d.ts.map +1 -0
  372. package/dist/modules/sessions/services/project-session-manager.js +90 -0
  373. package/dist/modules/sessions/services/project-session-manager.js.map +1 -0
  374. package/dist/modules/sessions/types.d.ts +13 -0
  375. package/dist/modules/sessions/types.d.ts.map +1 -0
  376. package/dist/modules/sessions/types.js +12 -0
  377. package/dist/modules/sessions/types.js.map +1 -0
  378. package/dist/utils/safe-error.d.ts +2 -0
  379. package/dist/utils/safe-error.d.ts.map +1 -0
  380. package/dist/utils/safe-error.js +10 -0
  381. package/dist/utils/safe-error.js.map +1 -0
  382. package/dist/utils/text.d.ts +2 -0
  383. package/dist/utils/text.d.ts.map +1 -0
  384. package/dist/utils/text.js +5 -0
  385. package/dist/utils/text.js.map +1 -0
  386. package/package.json +72 -0
@@ -0,0 +1,180 @@
1
+ import { chmodSync, mkdirSync } from 'node:fs';
2
+ import { dirname } from 'node:path';
3
+ import { DatabaseSync } from 'node:sqlite';
4
+ import { singleLineLabel } from '../../utils/text.js';
5
+ const LEGACY_SESSION_ID = 'aven-default';
6
+ const LEGACY_MIGRATION_KEY = 'legacy_session_checked';
7
+ const schema = `
8
+ CREATE TABLE IF NOT EXISTS aven_projects (
9
+ project_root TEXT PRIMARY KEY,
10
+ created_at TEXT NOT NULL,
11
+ updated_at TEXT NOT NULL
12
+ );
13
+
14
+ CREATE TABLE IF NOT EXISTS aven_sessions (
15
+ id TEXT PRIMARY KEY,
16
+ project_root TEXT NOT NULL REFERENCES aven_projects(project_root) ON DELETE CASCADE,
17
+ title TEXT NOT NULL,
18
+ created_at TEXT NOT NULL,
19
+ updated_at TEXT NOT NULL
20
+ );
21
+
22
+ CREATE INDEX IF NOT EXISTS aven_sessions_project_updated_idx
23
+ ON aven_sessions(project_root, updated_at DESC);
24
+
25
+ CREATE TABLE IF NOT EXISTS aven_session_metadata (
26
+ key TEXT PRIMARY KEY,
27
+ value TEXT NOT NULL
28
+ );
29
+ `;
30
+ const fromRow = (row) => ({
31
+ id: row.id,
32
+ projectRoot: row.project_root,
33
+ title: singleLineLabel(row.title) || 'New session',
34
+ createdAt: row.created_at,
35
+ updatedAt: row.updated_at,
36
+ });
37
+ export class SessionCatalog {
38
+ path;
39
+ #database;
40
+ constructor(path) {
41
+ this.path = path;
42
+ }
43
+ list(projectRoot) {
44
+ const rows = this.#db()
45
+ .prepare(`
46
+ SELECT id, project_root, title, created_at, updated_at
47
+ FROM aven_sessions
48
+ WHERE project_root = ?
49
+ ORDER BY updated_at DESC, created_at DESC
50
+ `)
51
+ .all(projectRoot);
52
+ return rows.map(fromRow);
53
+ }
54
+ get(projectRoot, sessionId) {
55
+ const row = this.#db()
56
+ .prepare(`
57
+ SELECT id, project_root, title, created_at, updated_at
58
+ FROM aven_sessions
59
+ WHERE project_root = ? AND id = ?
60
+ `)
61
+ .get(projectRoot, sessionId);
62
+ return row ? fromRow(row) : undefined;
63
+ }
64
+ save(session) {
65
+ const db = this.#db();
66
+ db.exec('BEGIN IMMEDIATE');
67
+ try {
68
+ const existing = db.prepare('SELECT project_root FROM aven_sessions WHERE id = ?').get(session.id);
69
+ if (existing && existing.project_root !== session.projectRoot) {
70
+ throw new Error('Session ID already belongs to another project.');
71
+ }
72
+ this.#upsertProject(db, session.projectRoot, session.createdAt, session.updatedAt);
73
+ db.prepare(`
74
+ INSERT INTO aven_sessions (id, project_root, title, created_at, updated_at)
75
+ VALUES (?, ?, ?, ?, ?)
76
+ ON CONFLICT(id) DO UPDATE SET
77
+ title = excluded.title,
78
+ updated_at = excluded.updated_at
79
+ `).run(session.id, session.projectRoot, session.title, session.createdAt, session.updatedAt);
80
+ db.exec('COMMIT');
81
+ }
82
+ catch (error) {
83
+ db.exec('ROLLBACK');
84
+ throw error;
85
+ }
86
+ }
87
+ touch(projectRoot, sessionId, updatedAt) {
88
+ const db = this.#db();
89
+ db.exec('BEGIN IMMEDIATE');
90
+ try {
91
+ const result = db
92
+ .prepare(`
93
+ UPDATE aven_sessions SET updated_at = ?
94
+ WHERE project_root = ? AND id = ?
95
+ `)
96
+ .run(updatedAt, projectRoot, sessionId);
97
+ if (result.changes !== 1)
98
+ throw new Error('Session does not belong to the current project.');
99
+ db.prepare('UPDATE aven_projects SET updated_at = ? WHERE project_root = ?').run(updatedAt, projectRoot);
100
+ const row = db
101
+ .prepare(`
102
+ SELECT id, project_root, title, created_at, updated_at
103
+ FROM aven_sessions WHERE project_root = ? AND id = ?
104
+ `)
105
+ .get(projectRoot, sessionId);
106
+ if (!row)
107
+ throw new Error('Session disappeared while it was being selected.');
108
+ db.exec('COMMIT');
109
+ return fromRow(row);
110
+ }
111
+ catch (error) {
112
+ db.exec('ROLLBACK');
113
+ throw error;
114
+ }
115
+ }
116
+ claimLegacy(projectRoot, hasLegacyHistory, now = new Date().toISOString()) {
117
+ const db = this.#db();
118
+ db.exec('BEGIN IMMEDIATE');
119
+ try {
120
+ const checked = db.prepare('SELECT value FROM aven_session_metadata WHERE key = ?').get(LEGACY_MIGRATION_KEY);
121
+ if (checked) {
122
+ db.exec('COMMIT');
123
+ return undefined;
124
+ }
125
+ db.prepare('INSERT INTO aven_session_metadata (key, value) VALUES (?, ?)').run(LEGACY_MIGRATION_KEY, projectRoot);
126
+ if (!hasLegacyHistory) {
127
+ db.exec('COMMIT');
128
+ return undefined;
129
+ }
130
+ this.#upsertProject(db, projectRoot, now, now);
131
+ db.prepare(`
132
+ INSERT OR IGNORE INTO aven_sessions (id, project_root, title, created_at, updated_at)
133
+ VALUES (?, ?, ?, ?, ?)
134
+ `).run(LEGACY_SESSION_ID, projectRoot, 'Legacy session', now, now);
135
+ const row = db
136
+ .prepare(`
137
+ SELECT id, project_root, title, created_at, updated_at
138
+ FROM aven_sessions WHERE project_root = ? AND id = ?
139
+ `)
140
+ .get(projectRoot, LEGACY_SESSION_ID);
141
+ db.exec('COMMIT');
142
+ return row ? fromRow(row) : undefined;
143
+ }
144
+ catch (error) {
145
+ db.exec('ROLLBACK');
146
+ throw error;
147
+ }
148
+ }
149
+ dispose() {
150
+ this.#database?.close();
151
+ this.#database = undefined;
152
+ }
153
+ #db() {
154
+ if (this.#database)
155
+ return this.#database;
156
+ mkdirSync(dirname(this.path), { recursive: true, mode: 0o700 });
157
+ chmodSync(dirname(this.path), 0o700);
158
+ const database = new DatabaseSync(this.path);
159
+ try {
160
+ database.exec('PRAGMA foreign_keys = ON');
161
+ database.exec('PRAGMA journal_mode = WAL');
162
+ database.exec(schema);
163
+ chmodSync(this.path, 0o600);
164
+ this.#database = database;
165
+ return database;
166
+ }
167
+ catch (error) {
168
+ database.close();
169
+ throw error;
170
+ }
171
+ }
172
+ #upsertProject(db, projectRoot, createdAt, updatedAt) {
173
+ db.prepare(`
174
+ INSERT INTO aven_projects (project_root, created_at, updated_at)
175
+ VALUES (?, ?, ?)
176
+ ON CONFLICT(project_root) DO UPDATE SET updated_at = excluded.updated_at
177
+ `).run(projectRoot, createdAt, updatedAt);
178
+ }
179
+ }
180
+ //# sourceMappingURL=session-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-catalog.js","sourceRoot":"","sources":["../../../src/libs/session-storage/session-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAUtD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBd,CAAC;AA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EAAE,CAAC,OAAO,CACT;;;;GAIA,CACA,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;CACD"}
@@ -0,0 +1,3 @@
1
+ import type { WriteStream } from 'node:tty';
2
+ export declare const writeOsc52: (stdout: Pick<WriteStream, 'write'>, value: string) => boolean;
3
+ //# sourceMappingURL=clipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../src/libs/terminal/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,UAAU,WAAY,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,MAAM,KAAG,OAK9E,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const writeOsc52 = (stdout, value) => {
2
+ if (!value)
3
+ return false;
4
+ const encoded = Buffer.from(value, 'utf8').toString('base64');
5
+ stdout.write(`\u001B]52;c;${encoded}\u0007`);
6
+ return true;
7
+ };
8
+ //# sourceMappingURL=clipboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../src/libs/terminal/clipboard.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAkC,EAAE,KAAa,EAAW,EAAE;IACxF,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,CAAC,KAAK,CAAC,eAAe,OAAO,QAAQ,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { writeOsc52 } from './clipboard.js';
2
+ export { keyboardProtocol } from './keyboard-protocol.js';
3
+ export { DISABLE_MOUSE, ENABLE_MOUSE, isMouseInputSequence, parseMouseEvents, SgrMouseDecoder, type MouseEvent, } from './mouse-protocol.js';
4
+ export { TerminalProvider, useTerminalController } from './terminal-provider.js';
5
+ export { theme, toneColor, type RowTone } from './theme.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACN,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,KAAK,UAAU,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,OAAO,EAAC,MAAM,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { writeOsc52 } from './clipboard.js';
2
+ export { keyboardProtocol } from './keyboard-protocol.js';
3
+ export { DISABLE_MOUSE, ENABLE_MOUSE, isMouseInputSequence, parseMouseEvents, SgrMouseDecoder, } from './mouse-protocol.js';
4
+ export { TerminalProvider, useTerminalController } from './terminal-provider.js';
5
+ export { theme, toneColor } from './theme.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/libs/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACN,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { KittyKeyboardOptions } from 'ink';
2
+ export declare const keyboardProtocol: KittyKeyboardOptions;
3
+ //# sourceMappingURL=keyboard-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard-protocol.d.ts","sourceRoot":"","sources":["../../../src/libs/terminal/keyboard-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,KAAK,CAAC;AAI9C,eAAO,MAAM,gBAAgB,EAAE,oBAG9B,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Direct enable avoids Ink's startup capability query, whose response can be
2
+ // visibly echoed by terminals before raw input ownership is established.
3
+ export const keyboardProtocol = {
4
+ mode: 'enabled',
5
+ flags: ['disambiguateEscapeCodes'],
6
+ };
7
+ //# sourceMappingURL=keyboard-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard-protocol.js","sourceRoot":"","sources":["../../../src/libs/terminal/keyboard-protocol.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,yEAAyE;AACzE,MAAM,CAAC,MAAM,gBAAgB,GAAyB;IACrD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,CAAC,yBAAyB,CAAC;CAClC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** Decoded SGR terminal mouse event. */
2
+ export type MouseEvent = {
3
+ type: 'down' | 'up' | 'move' | 'wheel';
4
+ button: 'left' | 'middle' | 'right' | 'none';
5
+ x: number;
6
+ y: number;
7
+ deltaY: number;
8
+ ctrl: boolean;
9
+ meta: boolean;
10
+ shift: boolean;
11
+ timestamp: number;
12
+ };
13
+ export declare const isMouseInputSequence: (input: string) => boolean;
14
+ export declare class SgrMouseDecoder {
15
+ #private;
16
+ feed(input: string, timestamp?: number): MouseEvent[];
17
+ reset(): void;
18
+ }
19
+ export declare const parseMouseEvents: (input: string, timestamp?: number) => MouseEvent[];
20
+ export declare const ENABLE_MOUSE = "\u001B[?1000h\u001B[?1002h\u001B[?1006h";
21
+ export declare const DISABLE_MOUSE = "\u001B[?1006l\u001B[?1002l\u001B[?1000l";
22
+ //# sourceMappingURL=mouse-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse-protocol.d.ts","sourceRoot":"","sources":["../../../src/libs/terminal/mouse-protocol.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAaF,eAAO,MAAM,oBAAoB,UAAW,MAAM,KAAG,OAAwC,CAAC;AA4B9F,qBAAa,eAAe;;IAG3B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,SAAa,GAAG,UAAU,EAAE,CAOxD;IAED,KAAK,IAAI,IAAI,CAEZ;CACD;AAED,eAAO,MAAM,gBAAgB,UAAW,MAAM,yBAA2B,UAAU,EAC/C,CAAC;AAErC,eAAO,MAAM,YAAY,4CAA4C,CAAC;AACtE,eAAO,MAAM,aAAa,4CAA4C,CAAC"}
@@ -0,0 +1,51 @@
1
+ const mousePattern = /\u001B\[<(\d+);(\d+);(\d+)([Mm])/gu;
2
+ const mouseInputPattern = /^(?:\u001B)?\[<\d+;\d+;\d+[Mm]$/u;
3
+ const isIncompleteMouseSequence = (value) => {
4
+ if (value === '\u001B' || value === '\u001B[' || value === '\u001B[<')
5
+ return true;
6
+ return /^\u001B\[<\d*(?:;\d*){0,2}$/u.test(value);
7
+ };
8
+ // Ink forwards unsupported CSI sequences through useInput after removing the
9
+ // leading Escape byte. Accept both the raw terminal form and Ink's forwarded
10
+ // form so mouse input can never leak into the composer.
11
+ export const isMouseInputSequence = (input) => mouseInputPattern.test(input);
12
+ const decodeMouseEvents = (input, timestamp) => {
13
+ const events = [];
14
+ for (const match of input.matchAll(mousePattern)) {
15
+ const code = Number(match[1]);
16
+ const wheel = (code & 64) !== 0;
17
+ const moving = (code & 32) !== 0;
18
+ const buttonCode = code & 3;
19
+ const button = buttonCode === 0 ? 'left' : buttonCode === 1 ? 'middle' : buttonCode === 2 ? 'right' : 'none';
20
+ events.push({
21
+ type: wheel ? 'wheel' : match[4] === 'm' ? 'up' : moving ? 'move' : 'down',
22
+ button: wheel ? 'none' : button,
23
+ x: Math.max(0, Number(match[2]) - 1),
24
+ y: Math.max(0, Number(match[3]) - 1),
25
+ deltaY: wheel ? ((code & 1) === 0 ? -1 : 1) : 0,
26
+ shift: (code & 4) !== 0,
27
+ meta: (code & 8) !== 0,
28
+ ctrl: (code & 16) !== 0,
29
+ timestamp,
30
+ });
31
+ }
32
+ return events;
33
+ };
34
+ export class SgrMouseDecoder {
35
+ #buffer = '';
36
+ feed(input, timestamp = Date.now()) {
37
+ const source = this.#buffer + input;
38
+ const events = decodeMouseEvents(source, timestamp);
39
+ const possibleStart = source.lastIndexOf('\u001B');
40
+ const suffix = possibleStart === -1 ? '' : source.slice(possibleStart);
41
+ this.#buffer = suffix && isIncompleteMouseSequence(suffix) ? suffix : '';
42
+ return events;
43
+ }
44
+ reset() {
45
+ this.#buffer = '';
46
+ }
47
+ }
48
+ export const parseMouseEvents = (input, timestamp = Date.now()) => decodeMouseEvents(input, timestamp);
49
+ export const ENABLE_MOUSE = '\u001B[?1000h\u001B[?1002h\u001B[?1006h';
50
+ export const DISABLE_MOUSE = '\u001B[?1006l\u001B[?1002l\u001B[?1000l';
51
+ //# sourceMappingURL=mouse-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse-protocol.js","sourceRoot":"","sources":["../../../src/libs/terminal/mouse-protocol.ts"],"names":[],"mappings":"AAaA,MAAM,YAAY,GAAG,oCAAoC,CAAC;AAC1D,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAE7D,MAAM,yBAAyB,GAAG,CAAC,KAAa,EAAW,EAAE;IAC5D,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACnF,OAAO,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,6EAA6E;AAC7E,6EAA6E;AAC7E,wDAAwD;AACxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE9F,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,SAAiB,EAAgB,EAAE;IAC5E,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAA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AAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACpD,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACvE,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,MAAM,CAAC;IACf,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACnB,CAAC;CACD;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,EAAgB,EAAE,CACvF,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,yCAAyC,CAAC;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,yCAAyC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type MouseEvent } from './mouse-protocol.js';
3
+ type MouseListener = (event: MouseEvent) => void;
4
+ type TerminalApi = {
5
+ mouseEnabled: boolean;
6
+ subscribeMouse: (listener: MouseListener) => () => void;
7
+ copyText: (text: string) => void;
8
+ };
9
+ export declare const TerminalProvider: ({ children, enableMouse }: {
10
+ children: ReactNode;
11
+ enableMouse?: boolean;
12
+ }) => import("react").JSX.Element;
13
+ export declare const useTerminalController: () => TerminalApi;
14
+ export {};
15
+ //# sourceMappingURL=terminal-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-provider.d.ts","sourceRoot":"","sources":["../../../src/libs/terminal/terminal-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGzG,OAAO,EAA+C,KAAK,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAElG,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;AAEjD,KAAK,WAAW,GAAG;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,MAAM,IAAI,CAAC;IACxD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAQF,eAAO,MAAM,gBAAgB,8BAAoC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAC,gCA2C5G,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,WAA0C,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
3
+ import { useStdin, useStdout } from 'ink';
4
+ import { writeOsc52 } from './clipboard.js';
5
+ import { DISABLE_MOUSE, ENABLE_MOUSE, SgrMouseDecoder } from './mouse-protocol.js';
6
+ const TerminalContext = createContext({
7
+ mouseEnabled: false,
8
+ subscribeMouse: () => () => undefined,
9
+ copyText: () => undefined,
10
+ });
11
+ export const TerminalProvider = ({ children, enableMouse = true }) => {
12
+ const { stdin, isRawModeSupported } = useStdin();
13
+ const { stdout } = useStdout();
14
+ const listeners = useRef(new Set());
15
+ const mouseEnabled = Boolean(enableMouse && isRawModeSupported && stdout.isTTY);
16
+ const subscribeMouse = useCallback((listener) => {
17
+ listeners.current.add(listener);
18
+ return () => {
19
+ listeners.current.delete(listener);
20
+ };
21
+ }, []);
22
+ const copyText = useCallback((value) => {
23
+ writeOsc52(stdout, value);
24
+ }, [stdout]);
25
+ useEffect(() => {
26
+ if (!mouseEnabled)
27
+ return;
28
+ stdout.write(ENABLE_MOUSE);
29
+ const decoder = new SgrMouseDecoder();
30
+ const handleData = (chunk) => {
31
+ for (const event of decoder.feed(chunk.toString())) {
32
+ for (const listener of listeners.current)
33
+ listener(event);
34
+ }
35
+ };
36
+ stdin.on('data', handleData);
37
+ return () => {
38
+ stdin.off('data', handleData);
39
+ decoder.reset();
40
+ stdout.write(DISABLE_MOUSE);
41
+ };
42
+ }, [mouseEnabled, stdin, stdout]);
43
+ const value = useMemo(() => ({ mouseEnabled, subscribeMouse, copyText }), [copyText, mouseEnabled, subscribeMouse]);
44
+ return _jsx(TerminalContext.Provider, { value: value, children: children });
45
+ };
46
+ export const useTerminalController = () => useContext(TerminalContext);
47
+ //# sourceMappingURL=terminal-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-provider.js","sourceRoot":"","sources":["../../../src/libs/terminal/terminal-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAiB,MAAM,OAAO,CAAC;AACzG,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,KAAK,CAAC;AACxC,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,qBAAqB,CAAC;AAUlG,MAAM,eAAe,GAAG,aAAa,CAAc;IAClD,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS;IACrC,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,EAA+C,EAAE,EAAE;IAChH,MAAM,EAAC,KAAK,EAAE,kBAAkB,EAAC,GAAG,QAAQ,EAAE,CAAC;IAC/C,MAAM,EAAC,MAAM,EAA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AAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7B,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAElC,MAAM,KAAK,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,CAAC,EAAC,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAC,CAAC,EAChD,CAAC,QAAQ,EAAE,YAAY,EAAE,cAAc,CAAC,CACxC,CAAC;IAEF,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA4B,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAgB,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ export type RowTone = 'text' | 'muted' | 'subtle' | 'accent' | 'user' | 'tool' | 'permission' | 'success' | 'warning' | 'error' | 'code' | 'addition' | 'deletion';
2
+ export declare const theme: {
3
+ readonly text: '#d6d6d6';
4
+ readonly muted: '#8a8a8a';
5
+ readonly subtle: '#626262';
6
+ readonly accent: '#f2f2f2';
7
+ readonly user: '#d6d6d6';
8
+ readonly tool: '#b8b8b8';
9
+ readonly permission: '#a3a3a3';
10
+ readonly success: '#b8b8b8';
11
+ readonly warning: '#b0b0b0';
12
+ readonly error: '#eeeeee';
13
+ readonly code: '#c9c9c9';
14
+ readonly addition: '#c2c2c2';
15
+ readonly deletion: '#9c9c9c';
16
+ readonly userBackground: '#2b2b2b';
17
+ readonly codeBackground: '#222222';
18
+ readonly selectionBackground: '#454545';
19
+ readonly hoverBackground: '#343434';
20
+ readonly promptBorder: '#777777';
21
+ readonly provider: '#e5c07b';
22
+ };
23
+ export declare const toneColor: (tone: RowTone | undefined) => string;
24
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/libs/terminal/theme.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAChB,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,YAAY,GACZ,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,UAAU,GACV,UAAU,CAAC;AAEd,eAAO,MAAM,KAAK;aACjB,IAAI,EAAE,SAAS;aACf,KAAK,EAAE,SAAS;aAChB,MAAM,EAAE,SAAS;aACjB,MAAM,EAAE,SAAS;aACjB,IAAI,EAAE,SAAS;aACf,IAAI,EAAE,SAAS;aACf,UAAU,EAAE,SAAS;aACrB,OAAO,EAAE,SAAS;aAClB,OAAO,EAAE,SAAS;aAClB,KAAK,EAAE,SAAS;aAChB,IAAI,EAAE,SAAS;aACf,QAAQ,EAAE,SAAS;aACnB,QAAQ,EAAE,SAAS;aACnB,cAAc,EAAE,SAAS;aACzB,cAAc,EAAE,SAAS;aACzB,mBAAmB,EAAE,SAAS;aAC9B,eAAe,EAAE,SAAS;aAC1B,YAAY,EAAE,SAAS;aACvB,QAAQ,EAAE,SAAS;CACV,CAAC;AAEX,eAAO,MAAM,SAAS,SAAU,OAAO,GAAG,SAAS,KAAG,MAA+B,CAAC"}
@@ -0,0 +1,23 @@
1
+ export const theme = {
2
+ text: '#d6d6d6',
3
+ muted: '#8a8a8a',
4
+ subtle: '#626262',
5
+ accent: '#f2f2f2',
6
+ user: '#d6d6d6',
7
+ tool: '#b8b8b8',
8
+ permission: '#a3a3a3',
9
+ success: '#b8b8b8',
10
+ warning: '#b0b0b0',
11
+ error: '#eeeeee',
12
+ code: '#c9c9c9',
13
+ addition: '#c2c2c2',
14
+ deletion: '#9c9c9c',
15
+ userBackground: '#2b2b2b',
16
+ codeBackground: '#222222',
17
+ selectionBackground: '#454545',
18
+ hoverBackground: '#343434',
19
+ promptBorder: '#777777',
20
+ provider: '#e5c07b',
21
+ };
22
+ export const toneColor = (tone) => theme[tone ?? 'text'];
23
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/libs/terminal/theme.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,cAAc,EAAE,SAAS;IACzB,cAAc,EAAE,SAAS;IACzB,mBAAmB,EAAE,SAAS;IAC9B,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAyB,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { UiMessage } from '../conversation/index.js';
2
+ import type { ProjectSessionSummary } from '../sessions/index.js';
3
+ import type { ProviderCredentials, ProviderId } from '../providers/index.js';
4
+ import type { RuntimeEvent } from './types.js';
5
+ import type { SubmitRequest } from './types.js';
6
+ import type { ConfigurableAgentRuntime, ConnectionState, ModelStatus, ProjectSessionRuntime, ProjectSessionSwitch, ProviderStatus } from './types.js';
7
+ import { ConfigStore } from '../../libs/config/index.js';
8
+ import { type ProviderFactory } from '../../libs/provider-clients/index.js';
9
+ import { type PtyRunner } from '../../libs/pty/index.js';
10
+ import { SessionCatalog } from '../../libs/session-storage/index.js';
11
+ export type { ProviderConnection, ProviderFactory } from '../../libs/provider-clients/index.js';
12
+ export { MissingProviderKeyError } from '../providers/index.js';
13
+ export type AnviaRuntimeOptions = {
14
+ configStore?: ConfigStore;
15
+ memoryPath?: string;
16
+ ptyRunner?: PtyRunner;
17
+ providerFactory?: ProviderFactory;
18
+ projectRoot?: string;
19
+ sessionCatalog?: SessionCatalog;
20
+ };
21
+ export declare class AnviaAgentRuntime implements ConfigurableAgentRuntime, ProjectSessionRuntime {
22
+ #private;
23
+ constructor(options?: AnviaRuntimeOptions);
24
+ getProjectRoot(): string;
25
+ getActiveSession(): ProjectSessionSummary;
26
+ initializeSessions(): Promise<void>;
27
+ listSessions(): Promise<ProjectSessionSummary[]>;
28
+ startNewSession(): ProjectSessionSummary;
29
+ switchSession(sessionId: string): Promise<ProjectSessionSwitch>;
30
+ getConnection(): ConnectionState;
31
+ providerStatuses(): Promise<ProviderStatus[]>;
32
+ modelStatuses(): Promise<ModelStatus[]>;
33
+ restore(): Promise<ConnectionState>;
34
+ connect(provider: ProviderId): Promise<ConnectionState>;
35
+ setup(provider: ProviderId, credentials: ProviderCredentials): Promise<ConnectionState>;
36
+ selectModel(model: string): Promise<ConnectionState>;
37
+ loadHistory(): Promise<UiMessage[]>;
38
+ run(request: SubmitRequest, signal: AbortSignal): AsyncIterable<RuntimeEvent>;
39
+ dispose(): void;
40
+ }
41
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/modules/agent/core.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EACX,wBAAwB,EACxB,eAAe,EACf,WAAW,EACX,qBAAqB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