agent-recorder 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 (477) hide show
  1. package/README.md +133 -0
  2. package/dist/bundle.d.ts +8 -0
  3. package/dist/bundle.d.ts.map +1 -0
  4. package/dist/bundle.js +131 -0
  5. package/dist/bundle.js.map +1 -0
  6. package/dist/index.d.ts +10 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +31 -0
  9. package/dist/index.js.map +1 -0
  10. package/package.json +53 -0
  11. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics 2.js +205 -0
  12. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d 2.ts +50 -0
  13. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts +50 -0
  14. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts 2.map +1 -0
  15. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts.map +1 -0
  16. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js +205 -0
  17. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js 2.map +1 -0
  18. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js.map +1 -0
  19. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test 2.js +253 -0
  20. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d 2.ts +5 -0
  21. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts +5 -0
  22. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts 2.map +1 -0
  23. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts.map +1 -0
  24. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js +253 -0
  25. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js 2.map +1 -0
  26. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js.map +1 -0
  27. package/vendor/node_modules/@agent-recorder/cli/commands/configure 2.js +144 -0
  28. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d 2.ts +17 -0
  29. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts +17 -0
  30. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts 2.map +1 -0
  31. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts.map +1 -0
  32. package/vendor/node_modules/@agent-recorder/cli/commands/configure.js +144 -0
  33. package/vendor/node_modules/@agent-recorder/cli/commands/configure.js 2.map +1 -0
  34. package/vendor/node_modules/@agent-recorder/cli/commands/configure.js.map +1 -0
  35. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose 2.js +141 -0
  36. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d 2.ts +5 -0
  37. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts +5 -0
  38. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts 2.map +1 -0
  39. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts.map +1 -0
  40. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js +141 -0
  41. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js 2.map +1 -0
  42. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js.map +1 -0
  43. package/vendor/node_modules/@agent-recorder/cli/commands/doctor 2.js +253 -0
  44. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d 2.ts +5 -0
  45. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts +5 -0
  46. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts 2.map +1 -0
  47. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts.map +1 -0
  48. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js +253 -0
  49. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js 2.map +1 -0
  50. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js.map +1 -0
  51. package/vendor/node_modules/@agent-recorder/cli/commands/export 2.js +56 -0
  52. package/vendor/node_modules/@agent-recorder/cli/commands/export.d 2.ts +12 -0
  53. package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts +12 -0
  54. package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts 2.map +1 -0
  55. package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts.map +1 -0
  56. package/vendor/node_modules/@agent-recorder/cli/commands/export.js +56 -0
  57. package/vendor/node_modules/@agent-recorder/cli/commands/export.js 2.map +1 -0
  58. package/vendor/node_modules/@agent-recorder/cli/commands/export.js.map +1 -0
  59. package/vendor/node_modules/@agent-recorder/cli/commands/install 2.js +77 -0
  60. package/vendor/node_modules/@agent-recorder/cli/commands/install.d 2.ts +13 -0
  61. package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts +13 -0
  62. package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts 2.map +1 -0
  63. package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts.map +1 -0
  64. package/vendor/node_modules/@agent-recorder/cli/commands/install.js +77 -0
  65. package/vendor/node_modules/@agent-recorder/cli/commands/install.js 2.map +1 -0
  66. package/vendor/node_modules/@agent-recorder/cli/commands/install.js.map +1 -0
  67. package/vendor/node_modules/@agent-recorder/cli/commands/logs 2.js +40 -0
  68. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d 2.ts +8 -0
  69. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts +8 -0
  70. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts 2.map +1 -0
  71. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts.map +1 -0
  72. package/vendor/node_modules/@agent-recorder/cli/commands/logs.js +40 -0
  73. package/vendor/node_modules/@agent-recorder/cli/commands/logs.js 2.map +1 -0
  74. package/vendor/node_modules/@agent-recorder/cli/commands/logs.js.map +1 -0
  75. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp 2.js +188 -0
  76. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d 2.ts +10 -0
  77. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts +10 -0
  78. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts 2.map +1 -0
  79. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts.map +1 -0
  80. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js +188 -0
  81. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js 2.map +1 -0
  82. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js.map +1 -0
  83. package/vendor/node_modules/@agent-recorder/cli/commands/restart 2.js +67 -0
  84. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d 2.ts +9 -0
  85. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts +9 -0
  86. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts 2.map +1 -0
  87. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts.map +1 -0
  88. package/vendor/node_modules/@agent-recorder/cli/commands/restart.js +67 -0
  89. package/vendor/node_modules/@agent-recorder/cli/commands/restart.js 2.map +1 -0
  90. package/vendor/node_modules/@agent-recorder/cli/commands/restart.js.map +1 -0
  91. package/vendor/node_modules/@agent-recorder/cli/commands/sessions 2.js +333 -0
  92. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d 2.ts +52 -0
  93. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts +52 -0
  94. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts 2.map +1 -0
  95. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts.map +1 -0
  96. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js +333 -0
  97. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js 2.map +1 -0
  98. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js.map +1 -0
  99. package/vendor/node_modules/@agent-recorder/cli/commands/start 2.js +174 -0
  100. package/vendor/node_modules/@agent-recorder/cli/commands/start.d 2.ts +10 -0
  101. package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts +10 -0
  102. package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts 2.map +1 -0
  103. package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts.map +1 -0
  104. package/vendor/node_modules/@agent-recorder/cli/commands/start.js +174 -0
  105. package/vendor/node_modules/@agent-recorder/cli/commands/start.js 2.map +1 -0
  106. package/vendor/node_modules/@agent-recorder/cli/commands/start.js.map +1 -0
  107. package/vendor/node_modules/@agent-recorder/cli/commands/status 2.js +104 -0
  108. package/vendor/node_modules/@agent-recorder/cli/commands/status.d 2.ts +5 -0
  109. package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts +5 -0
  110. package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts 2.map +1 -0
  111. package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts.map +1 -0
  112. package/vendor/node_modules/@agent-recorder/cli/commands/status.js +104 -0
  113. package/vendor/node_modules/@agent-recorder/cli/commands/status.js 2.map +1 -0
  114. package/vendor/node_modules/@agent-recorder/cli/commands/status.js.map +1 -0
  115. package/vendor/node_modules/@agent-recorder/cli/commands/stop 2.js +89 -0
  116. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d 2.ts +8 -0
  117. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts +8 -0
  118. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts 2.map +1 -0
  119. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts.map +1 -0
  120. package/vendor/node_modules/@agent-recorder/cli/commands/stop.js +89 -0
  121. package/vendor/node_modules/@agent-recorder/cli/commands/stop.js 2.map +1 -0
  122. package/vendor/node_modules/@agent-recorder/cli/commands/stop.js.map +1 -0
  123. package/vendor/node_modules/@agent-recorder/cli/commands/tui 2.js +14 -0
  124. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d 2.ts +5 -0
  125. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts +5 -0
  126. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts 2.map +1 -0
  127. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts.map +1 -0
  128. package/vendor/node_modules/@agent-recorder/cli/commands/tui.js +14 -0
  129. package/vendor/node_modules/@agent-recorder/cli/commands/tui.js 2.map +1 -0
  130. package/vendor/node_modules/@agent-recorder/cli/commands/tui.js.map +1 -0
  131. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths 2.js +117 -0
  132. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d 2.ts +55 -0
  133. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts +55 -0
  134. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts 2.map +1 -0
  135. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts.map +1 -0
  136. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js +117 -0
  137. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js 2.map +1 -0
  138. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js.map +1 -0
  139. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test 2.js +152 -0
  140. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d 2.ts +5 -0
  141. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts +5 -0
  142. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts 2.map +1 -0
  143. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts.map +1 -0
  144. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js +152 -0
  145. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js 2.map +1 -0
  146. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js.map +1 -0
  147. package/vendor/node_modules/@agent-recorder/cli/index 2.js +194 -0
  148. package/vendor/node_modules/@agent-recorder/cli/index.d 2.ts +10 -0
  149. package/vendor/node_modules/@agent-recorder/cli/index.d.ts +10 -0
  150. package/vendor/node_modules/@agent-recorder/cli/index.d.ts 2.map +1 -0
  151. package/vendor/node_modules/@agent-recorder/cli/index.d.ts.map +1 -0
  152. package/vendor/node_modules/@agent-recorder/cli/index.js +194 -0
  153. package/vendor/node_modules/@agent-recorder/cli/index.js 2.map +1 -0
  154. package/vendor/node_modules/@agent-recorder/cli/index.js.map +1 -0
  155. package/vendor/node_modules/@agent-recorder/cli/package 2.json +17 -0
  156. package/vendor/node_modules/@agent-recorder/cli/package.json +17 -0
  157. package/vendor/node_modules/@agent-recorder/cli/tui/App 2.js +84 -0
  158. package/vendor/node_modules/@agent-recorder/cli/tui/App.d 2.ts +6 -0
  159. package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts +6 -0
  160. package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts 2.map +1 -0
  161. package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts.map +1 -0
  162. package/vendor/node_modules/@agent-recorder/cli/tui/App.js +84 -0
  163. package/vendor/node_modules/@agent-recorder/cli/tui/App.js 2.map +1 -0
  164. package/vendor/node_modules/@agent-recorder/cli/tui/App.js.map +1 -0
  165. package/vendor/node_modules/@agent-recorder/cli/tui/api 2.js +105 -0
  166. package/vendor/node_modules/@agent-recorder/cli/tui/api.d 2.ts +31 -0
  167. package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts +31 -0
  168. package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts 2.map +1 -0
  169. package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts.map +1 -0
  170. package/vendor/node_modules/@agent-recorder/cli/tui/api.js +105 -0
  171. package/vendor/node_modules/@agent-recorder/cli/tui/api.js 2.map +1 -0
  172. package/vendor/node_modules/@agent-recorder/cli/tui/api.js.map +1 -0
  173. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel 2.js +45 -0
  174. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d 2.ts +11 -0
  175. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts +11 -0
  176. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts 2.map +1 -0
  177. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts.map +1 -0
  178. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js +45 -0
  179. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js 2.map +1 -0
  180. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js.map +1 -0
  181. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header 2.js +13 -0
  182. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d 2.ts +17 -0
  183. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts +17 -0
  184. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts 2.map +1 -0
  185. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts.map +1 -0
  186. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js +13 -0
  187. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js 2.map +1 -0
  188. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js.map +1 -0
  189. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner 2.js +21 -0
  190. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d 2.ts +12 -0
  191. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts +12 -0
  192. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts 2.map +1 -0
  193. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts.map +1 -0
  194. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js +21 -0
  195. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js 2.map +1 -0
  196. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js.map +1 -0
  197. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge 2.js +50 -0
  198. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d 2.ts +16 -0
  199. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts +16 -0
  200. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts 2.map +1 -0
  201. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts.map +1 -0
  202. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js +50 -0
  203. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js 2.map +1 -0
  204. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js.map +1 -0
  205. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table 2.js +20 -0
  206. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d 2.ts +21 -0
  207. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts +21 -0
  208. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts 2.map +1 -0
  209. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts.map +1 -0
  210. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js +20 -0
  211. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js 2.map +1 -0
  212. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js.map +1 -0
  213. package/vendor/node_modules/@agent-recorder/cli/tui/components/index 2.js +8 -0
  214. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d 2.ts +8 -0
  215. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts +8 -0
  216. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts 2.map +1 -0
  217. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts.map +1 -0
  218. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js +8 -0
  219. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js 2.map +1 -0
  220. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js.map +1 -0
  221. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream 2.js +75 -0
  222. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d 2.ts +22 -0
  223. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts +22 -0
  224. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts 2.map +1 -0
  225. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts.map +1 -0
  226. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js +75 -0
  227. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js 2.map +1 -0
  228. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js.map +1 -0
  229. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen 2.js +190 -0
  230. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d 2.ts +13 -0
  231. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts +13 -0
  232. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts 2.map +1 -0
  233. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts.map +1 -0
  234. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js +190 -0
  235. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js 2.map +1 -0
  236. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js.map +1 -0
  237. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen 2.js +166 -0
  238. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d 2.ts +10 -0
  239. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts +10 -0
  240. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts 2.map +1 -0
  241. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts.map +1 -0
  242. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js +166 -0
  243. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js 2.map +1 -0
  244. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js.map +1 -0
  245. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index 2.js +6 -0
  246. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d 2.ts +6 -0
  247. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts +6 -0
  248. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts 2.map +1 -0
  249. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts.map +1 -0
  250. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js +6 -0
  251. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js 2.map +1 -0
  252. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js.map +1 -0
  253. package/vendor/node_modules/@agent-recorder/core/config 2.js +44 -0
  254. package/vendor/node_modules/@agent-recorder/core/config.d 2.ts +25 -0
  255. package/vendor/node_modules/@agent-recorder/core/config.d.ts +25 -0
  256. package/vendor/node_modules/@agent-recorder/core/config.d.ts 2.map +1 -0
  257. package/vendor/node_modules/@agent-recorder/core/config.d.ts.map +1 -0
  258. package/vendor/node_modules/@agent-recorder/core/config.js +44 -0
  259. package/vendor/node_modules/@agent-recorder/core/config.js.map +1 -0
  260. package/vendor/node_modules/@agent-recorder/core/config.test.d.ts +5 -0
  261. package/vendor/node_modules/@agent-recorder/core/config.test.d.ts.map +1 -0
  262. package/vendor/node_modules/@agent-recorder/core/config.test.js +78 -0
  263. package/vendor/node_modules/@agent-recorder/core/config.test.js.map +1 -0
  264. package/vendor/node_modules/@agent-recorder/core/daemon-paths.d.ts +50 -0
  265. package/vendor/node_modules/@agent-recorder/core/daemon-paths.d.ts.map +1 -0
  266. package/vendor/node_modules/@agent-recorder/core/daemon-paths.js +113 -0
  267. package/vendor/node_modules/@agent-recorder/core/daemon-paths.js.map +1 -0
  268. package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.d.ts +5 -0
  269. package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.d.ts.map +1 -0
  270. package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.js +143 -0
  271. package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.js.map +1 -0
  272. package/vendor/node_modules/@agent-recorder/core/db/connection.d 2.ts +15 -0
  273. package/vendor/node_modules/@agent-recorder/core/db/connection.d.ts +15 -0
  274. package/vendor/node_modules/@agent-recorder/core/db/connection.d.ts.map +1 -0
  275. package/vendor/node_modules/@agent-recorder/core/db/connection.js +30 -0
  276. package/vendor/node_modules/@agent-recorder/core/db/connection.js.map +1 -0
  277. package/vendor/node_modules/@agent-recorder/core/db/events.d.ts +65 -0
  278. package/vendor/node_modules/@agent-recorder/core/db/events.d.ts.map +1 -0
  279. package/vendor/node_modules/@agent-recorder/core/db/events.js +117 -0
  280. package/vendor/node_modules/@agent-recorder/core/db/events.js.map +1 -0
  281. package/vendor/node_modules/@agent-recorder/core/db/events.test.d.ts +5 -0
  282. package/vendor/node_modules/@agent-recorder/core/db/events.test.d.ts.map +1 -0
  283. package/vendor/node_modules/@agent-recorder/core/db/events.test.js +72 -0
  284. package/vendor/node_modules/@agent-recorder/core/db/events.test.js.map +1 -0
  285. package/vendor/node_modules/@agent-recorder/core/db/index.d.ts +9 -0
  286. package/vendor/node_modules/@agent-recorder/core/db/index.d.ts.map +1 -0
  287. package/vendor/node_modules/@agent-recorder/core/db/index.js +9 -0
  288. package/vendor/node_modules/@agent-recorder/core/db/index.js.map +1 -0
  289. package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts +17 -0
  290. package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts.map +1 -0
  291. package/vendor/node_modules/@agent-recorder/core/db/migrations.js +56 -0
  292. package/vendor/node_modules/@agent-recorder/core/db/migrations.js.map +1 -0
  293. package/vendor/node_modules/@agent-recorder/core/db/sequences.d.ts +17 -0
  294. package/vendor/node_modules/@agent-recorder/core/db/sequences.d.ts.map +1 -0
  295. package/vendor/node_modules/@agent-recorder/core/db/sequences.js +41 -0
  296. package/vendor/node_modules/@agent-recorder/core/db/sequences.js.map +1 -0
  297. package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts +17 -0
  298. package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts.map +1 -0
  299. package/vendor/node_modules/@agent-recorder/core/db/sessions.js +61 -0
  300. package/vendor/node_modules/@agent-recorder/core/db/sessions.js.map +1 -0
  301. package/vendor/node_modules/@agent-recorder/core/index.d.ts +13 -0
  302. package/vendor/node_modules/@agent-recorder/core/index.d.ts.map +1 -0
  303. package/vendor/node_modules/@agent-recorder/core/index.js +13 -0
  304. package/vendor/node_modules/@agent-recorder/core/index.js.map +1 -0
  305. package/vendor/node_modules/@agent-recorder/core/lockfile.d.ts +42 -0
  306. package/vendor/node_modules/@agent-recorder/core/lockfile.d.ts.map +1 -0
  307. package/vendor/node_modules/@agent-recorder/core/lockfile.js +122 -0
  308. package/vendor/node_modules/@agent-recorder/core/lockfile.js.map +1 -0
  309. package/vendor/node_modules/@agent-recorder/core/lockfile.test.d.ts +5 -0
  310. package/vendor/node_modules/@agent-recorder/core/lockfile.test.d.ts.map +1 -0
  311. package/vendor/node_modules/@agent-recorder/core/lockfile.test.js +136 -0
  312. package/vendor/node_modules/@agent-recorder/core/lockfile.test.js.map +1 -0
  313. package/vendor/node_modules/@agent-recorder/core/migrations/001_initial 2.sql +40 -0
  314. package/vendor/node_modules/@agent-recorder/core/migrations/001_initial.sql +40 -0
  315. package/vendor/node_modules/@agent-recorder/core/migrations/002_session_sequences 2.sql +8 -0
  316. package/vendor/node_modules/@agent-recorder/core/migrations/002_session_sequences.sql +8 -0
  317. package/vendor/node_modules/@agent-recorder/core/migrations/003_add_tool_columns 2.sql +9 -0
  318. package/vendor/node_modules/@agent-recorder/core/migrations/003_add_tool_columns.sql +9 -0
  319. package/vendor/node_modules/@agent-recorder/core/migrations/004_add_cancelled_status 2.sql +23 -0
  320. package/vendor/node_modules/@agent-recorder/core/migrations/004_add_cancelled_status.sql +23 -0
  321. package/vendor/node_modules/@agent-recorder/core/migrations/005_add_error_category 2.sql +6 -0
  322. package/vendor/node_modules/@agent-recorder/core/migrations/005_add_error_category.sql +6 -0
  323. package/vendor/node_modules/@agent-recorder/core/package 2.json +18 -0
  324. package/vendor/node_modules/@agent-recorder/core/package.json +18 -0
  325. package/vendor/node_modules/@agent-recorder/core/types/events.d 2.ts +69 -0
  326. package/vendor/node_modules/@agent-recorder/core/types/events.d.ts +69 -0
  327. package/vendor/node_modules/@agent-recorder/core/types/events.d.ts.map +1 -0
  328. package/vendor/node_modules/@agent-recorder/core/types/events.js +6 -0
  329. package/vendor/node_modules/@agent-recorder/core/types/events.js.map +1 -0
  330. package/vendor/node_modules/@agent-recorder/core/types/index 2.js +2 -0
  331. package/vendor/node_modules/@agent-recorder/core/types/index.d.ts +3 -0
  332. package/vendor/node_modules/@agent-recorder/core/types/index.d.ts.map +1 -0
  333. package/vendor/node_modules/@agent-recorder/core/types/index.js +2 -0
  334. package/vendor/node_modules/@agent-recorder/core/types/index.js 2.map +1 -0
  335. package/vendor/node_modules/@agent-recorder/core/types/index.js.map +1 -0
  336. package/vendor/node_modules/@agent-recorder/core/types/session 2.js +6 -0
  337. package/vendor/node_modules/@agent-recorder/core/types/session.d 2.ts +22 -0
  338. package/vendor/node_modules/@agent-recorder/core/types/session.d.ts +22 -0
  339. package/vendor/node_modules/@agent-recorder/core/types/session.d.ts 2.map +1 -0
  340. package/vendor/node_modules/@agent-recorder/core/types/session.d.ts.map +1 -0
  341. package/vendor/node_modules/@agent-recorder/core/types/session.js +6 -0
  342. package/vendor/node_modules/@agent-recorder/core/types/session.js 2.map +1 -0
  343. package/vendor/node_modules/@agent-recorder/core/types/session.js.map +1 -0
  344. package/vendor/node_modules/@agent-recorder/core/utils/error-category 2.js +58 -0
  345. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d 2.ts +22 -0
  346. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts +22 -0
  347. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts 2.map +1 -0
  348. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts.map +1 -0
  349. package/vendor/node_modules/@agent-recorder/core/utils/error-category.js +58 -0
  350. package/vendor/node_modules/@agent-recorder/core/utils/error-category.js 2.map +1 -0
  351. package/vendor/node_modules/@agent-recorder/core/utils/error-category.js.map +1 -0
  352. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d 2.ts +5 -0
  353. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts +5 -0
  354. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts 2.map +1 -0
  355. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts.map +1 -0
  356. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js +89 -0
  357. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js 2.map +1 -0
  358. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js.map +1 -0
  359. package/vendor/node_modules/@agent-recorder/core/utils/index 2.js +6 -0
  360. package/vendor/node_modules/@agent-recorder/core/utils/index.d 2.ts +6 -0
  361. package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts +6 -0
  362. package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts 2.map +1 -0
  363. package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts.map +1 -0
  364. package/vendor/node_modules/@agent-recorder/core/utils/index.js +6 -0
  365. package/vendor/node_modules/@agent-recorder/core/utils/index.js 2.map +1 -0
  366. package/vendor/node_modules/@agent-recorder/core/utils/index.js.map +1 -0
  367. package/vendor/node_modules/@agent-recorder/core/utils/redact.d 2.ts +19 -0
  368. package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts +19 -0
  369. package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts 2.map +1 -0
  370. package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts.map +1 -0
  371. package/vendor/node_modules/@agent-recorder/core/utils/redact.js +52 -0
  372. package/vendor/node_modules/@agent-recorder/core/utils/redact.js 2.map +1 -0
  373. package/vendor/node_modules/@agent-recorder/core/utils/redact.js.map +1 -0
  374. package/vendor/node_modules/@agent-recorder/service/index 2.js +128 -0
  375. package/vendor/node_modules/@agent-recorder/service/index.d 2.ts +36 -0
  376. package/vendor/node_modules/@agent-recorder/service/index.d.ts +36 -0
  377. package/vendor/node_modules/@agent-recorder/service/index.d.ts 2.map +1 -0
  378. package/vendor/node_modules/@agent-recorder/service/index.d.ts.map +1 -0
  379. package/vendor/node_modules/@agent-recorder/service/index.js +128 -0
  380. package/vendor/node_modules/@agent-recorder/service/index.js 2.map +1 -0
  381. package/vendor/node_modules/@agent-recorder/service/index.js.map +1 -0
  382. package/vendor/node_modules/@agent-recorder/service/mcp/index 2.js +7 -0
  383. package/vendor/node_modules/@agent-recorder/service/mcp/index.d 2.ts +7 -0
  384. package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts +7 -0
  385. package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts 2.map +1 -0
  386. package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts.map +1 -0
  387. package/vendor/node_modules/@agent-recorder/service/mcp/index.js +7 -0
  388. package/vendor/node_modules/@agent-recorder/service/mcp/index.js 2.map +1 -0
  389. package/vendor/node_modules/@agent-recorder/service/mcp/index.js.map +1 -0
  390. package/vendor/node_modules/@agent-recorder/service/mcp/proxy 2.js +223 -0
  391. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d 2.ts +26 -0
  392. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts +26 -0
  393. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts 2.map +1 -0
  394. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts.map +1 -0
  395. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js +223 -0
  396. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js 2.map +1 -0
  397. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js.map +1 -0
  398. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d 2.ts +5 -0
  399. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts +5 -0
  400. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts 2.map +1 -0
  401. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts.map +1 -0
  402. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js +367 -0
  403. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js 2.map +1 -0
  404. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js.map +1 -0
  405. package/vendor/node_modules/@agent-recorder/service/mcp/recorder 2.js +62 -0
  406. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d 2.ts +31 -0
  407. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts +31 -0
  408. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts 2.map +1 -0
  409. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts.map +1 -0
  410. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js +62 -0
  411. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js 2.map +1 -0
  412. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js.map +1 -0
  413. package/vendor/node_modules/@agent-recorder/service/mcp/types 2.js +15 -0
  414. package/vendor/node_modules/@agent-recorder/service/mcp/types.d 2.ts +40 -0
  415. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts +40 -0
  416. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts 2.map +1 -0
  417. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts.map +1 -0
  418. package/vendor/node_modules/@agent-recorder/service/mcp/types.js +15 -0
  419. package/vendor/node_modules/@agent-recorder/service/mcp/types.js 2.map +1 -0
  420. package/vendor/node_modules/@agent-recorder/service/mcp/types.js.map +1 -0
  421. package/vendor/node_modules/@agent-recorder/service/package 2.json +15 -0
  422. package/vendor/node_modules/@agent-recorder/service/package.json +15 -0
  423. package/vendor/node_modules/@agent-recorder/service/routes/events 2.js +71 -0
  424. package/vendor/node_modules/@agent-recorder/service/routes/events.d 2.ts +11 -0
  425. package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts +11 -0
  426. package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts 2.map +1 -0
  427. package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts.map +1 -0
  428. package/vendor/node_modules/@agent-recorder/service/routes/events.js +71 -0
  429. package/vendor/node_modules/@agent-recorder/service/routes/events.js 2.map +1 -0
  430. package/vendor/node_modules/@agent-recorder/service/routes/events.js.map +1 -0
  431. package/vendor/node_modules/@agent-recorder/service/routes/health 2.js +18 -0
  432. package/vendor/node_modules/@agent-recorder/service/routes/health.d 2.ts +6 -0
  433. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts +6 -0
  434. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts 2.map +1 -0
  435. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts.map +1 -0
  436. package/vendor/node_modules/@agent-recorder/service/routes/health.js +18 -0
  437. package/vendor/node_modules/@agent-recorder/service/routes/health.js 2.map +1 -0
  438. package/vendor/node_modules/@agent-recorder/service/routes/health.js.map +1 -0
  439. package/vendor/node_modules/@agent-recorder/service/routes/sessions 2.js +80 -0
  440. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d 2.ts +12 -0
  441. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts +12 -0
  442. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts 2.map +1 -0
  443. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts.map +1 -0
  444. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js +80 -0
  445. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js 2.map +1 -0
  446. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js.map +1 -0
  447. package/vendor/node_modules/@agent-recorder/service/server 2.js +36 -0
  448. package/vendor/node_modules/@agent-recorder/service/server.d 2.ts +19 -0
  449. package/vendor/node_modules/@agent-recorder/service/server.d.ts +19 -0
  450. package/vendor/node_modules/@agent-recorder/service/server.d.ts 2.map +1 -0
  451. package/vendor/node_modules/@agent-recorder/service/server.d.ts.map +1 -0
  452. package/vendor/node_modules/@agent-recorder/service/server.js +36 -0
  453. package/vendor/node_modules/@agent-recorder/service/server.js 2.map +1 -0
  454. package/vendor/node_modules/@agent-recorder/service/server.js.map +1 -0
  455. package/vendor/node_modules/@agent-recorder/service/server.test 2.js +296 -0
  456. package/vendor/node_modules/@agent-recorder/service/server.test.d 2.ts +5 -0
  457. package/vendor/node_modules/@agent-recorder/service/server.test.d.ts +5 -0
  458. package/vendor/node_modules/@agent-recorder/service/server.test.d.ts 2.map +1 -0
  459. package/vendor/node_modules/@agent-recorder/service/server.test.d.ts.map +1 -0
  460. package/vendor/node_modules/@agent-recorder/service/server.test.js +296 -0
  461. package/vendor/node_modules/@agent-recorder/service/server.test.js.map +1 -0
  462. package/vendor/node_modules/@agent-recorder/service/session-manager 2.js +22 -0
  463. package/vendor/node_modules/@agent-recorder/service/session-manager.d 2.ts +16 -0
  464. package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts +16 -0
  465. package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts 2.map +1 -0
  466. package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts.map +1 -0
  467. package/vendor/node_modules/@agent-recorder/service/session-manager.js +22 -0
  468. package/vendor/node_modules/@agent-recorder/service/session-manager.js 2.map +1 -0
  469. package/vendor/node_modules/@agent-recorder/service/session-manager.js.map +1 -0
  470. package/vendor/node_modules/@agent-recorder/service/session-manager.test 2.js +61 -0
  471. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d 2.ts +5 -0
  472. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts +5 -0
  473. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts 2.map +1 -0
  474. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts.map +1 -0
  475. package/vendor/node_modules/@agent-recorder/service/session-manager.test.js +61 -0
  476. package/vendor/node_modules/@agent-recorder/service/session-manager.test.js 2.map +1 -0
  477. package/vendor/node_modules/@agent-recorder/service/session-manager.test.js.map +1 -0
@@ -0,0 +1,333 @@
1
+ /**
2
+ * Sessions commands - list, show, current, tail, view, stats, grep, summarize.
3
+ */
4
+ import { loadConfig } from "@agent-recorder/core";
5
+ import { computeSessionSummary, formatStatsText, formatConciseSummary, } from "../analytics/session-analytics.js";
6
+ async function fetchJson(url) {
7
+ const response = await fetch(url);
8
+ if (!response.ok) {
9
+ throw new Error(`HTTP ${response.status}`);
10
+ }
11
+ return response.json();
12
+ }
13
+ async function getEventCount(baseUrl, sessionId) {
14
+ try {
15
+ const result = await fetchJson(`${baseUrl}/api/sessions/${sessionId}/events/count`);
16
+ return result.count;
17
+ }
18
+ catch {
19
+ return 0;
20
+ }
21
+ }
22
+ function formatTable(sessions) {
23
+ if (sessions.length === 0) {
24
+ console.log("No sessions found.");
25
+ return;
26
+ }
27
+ // Header
28
+ console.log("ID".padEnd(38) + "STATUS".padEnd(12) + "STARTED".padEnd(25) + "EVENTS");
29
+ console.log("-".repeat(80));
30
+ // Rows
31
+ for (const session of sessions) {
32
+ const id = session.id.padEnd(38);
33
+ const status = session.status.padEnd(12);
34
+ const started = session.startedAt.padEnd(25);
35
+ const events = String(session.eventCount);
36
+ console.log(`${id}${status}${started}${events}`);
37
+ }
38
+ }
39
+ export async function sessionsListCommand(options) {
40
+ const config = loadConfig();
41
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
42
+ try {
43
+ // Fetch sessions
44
+ let url = `${baseUrl}/api/sessions`;
45
+ if (options.status) {
46
+ url += `?status=${options.status}`;
47
+ }
48
+ const sessions = await fetchJson(url);
49
+ // Fetch event counts for each session
50
+ const sessionsWithCounts = await Promise.all(sessions.map(async (session) => ({
51
+ ...session,
52
+ eventCount: await getEventCount(baseUrl, session.id),
53
+ })));
54
+ formatTable(sessionsWithCounts);
55
+ }
56
+ catch {
57
+ console.error("Failed to fetch sessions. Is the daemon running?");
58
+ process.exit(1);
59
+ }
60
+ }
61
+ export async function sessionsShowCommand(id) {
62
+ const config = loadConfig();
63
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
64
+ try {
65
+ // Fetch session details
66
+ const session = await fetchJson(`${baseUrl}/api/sessions/${id}`);
67
+ // Fetch event count
68
+ const eventCount = await getEventCount(baseUrl, id);
69
+ console.log("Session Details");
70
+ console.log("===============");
71
+ console.log(`ID: ${session.id}`);
72
+ console.log(`Status: ${session.status}`);
73
+ console.log(`Started: ${session.startedAt}`);
74
+ console.log(`Ended: ${session.endedAt ?? "N/A"}`);
75
+ console.log(`Events: ${eventCount}`);
76
+ }
77
+ catch {
78
+ console.error(`Session not found: ${id}`);
79
+ process.exit(1);
80
+ }
81
+ }
82
+ /**
83
+ * Get the current active session ID.
84
+ */
85
+ export async function sessionsCurrentCommand() {
86
+ const config = loadConfig();
87
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
88
+ try {
89
+ const current = await fetchJson(`${baseUrl}/api/sessions/current`);
90
+ console.log(current.id);
91
+ }
92
+ catch {
93
+ console.error("No active session (daemon may not be running)");
94
+ process.exit(1);
95
+ }
96
+ }
97
+ /**
98
+ * Format and print a single event for tail output.
99
+ */
100
+ function printEvent(event) {
101
+ const duration = event.endedAt && event.startedAt
102
+ ? new Date(event.endedAt).getTime() - new Date(event.startedAt).getTime()
103
+ : null;
104
+ const durationStr = duration !== null ? `${duration}ms` : "...";
105
+ const name = event.toolName ?? event.skillName ?? "-";
106
+ console.log(`[${event.sequence}] ${event.eventType} ${name} ${event.status} ${durationStr}`);
107
+ }
108
+ /**
109
+ * Tail session events (like tail -f).
110
+ * Runs indefinitely until Ctrl+C.
111
+ */
112
+ export async function sessionsTailCommand(id, options) {
113
+ const config = loadConfig();
114
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
115
+ const intervalMs = parseInt(options.interval ?? "1000", 10);
116
+ const initialLimit = parseInt(options.n ?? "50", 10);
117
+ let lastSequence = 0;
118
+ console.log(`Tailing session ${id} (Ctrl+C to stop)...\n`);
119
+ /**
120
+ * Fetch events after lastSequence.
121
+ * For initial fetch, we get last N events by fetching all and slicing.
122
+ */
123
+ const fetchEvents = async (after, limit) => {
124
+ const url = `${baseUrl}/api/sessions/${id}/events?after=${after}&limit=${limit}`;
125
+ try {
126
+ return await fetchJson(url);
127
+ }
128
+ catch {
129
+ return [];
130
+ }
131
+ };
132
+ // Initial fetch: get last N events
133
+ const initialEvents = await fetchEvents(0, 1000); // Get up to 1000 events
134
+ const startIndex = Math.max(0, initialEvents.length - initialLimit);
135
+ const recentEvents = initialEvents.slice(startIndex);
136
+ for (const event of recentEvents) {
137
+ printEvent(event);
138
+ lastSequence = Math.max(lastSequence, event.sequence);
139
+ }
140
+ // Poll for new events
141
+ const poll = async () => {
142
+ const events = await fetchEvents(lastSequence, 200);
143
+ for (const event of events) {
144
+ printEvent(event);
145
+ lastSequence = Math.max(lastSequence, event.sequence);
146
+ }
147
+ };
148
+ const timer = setInterval(poll, intervalMs);
149
+ // Handle Ctrl+C
150
+ process.on("SIGINT", () => {
151
+ clearInterval(timer);
152
+ console.log("\nStopped tailing.");
153
+ process.exit(0);
154
+ });
155
+ // Keep process alive
156
+ await new Promise(() => {
157
+ // Never resolves - runs until SIGINT
158
+ });
159
+ }
160
+ /**
161
+ * Print a detailed event row for view/grep output.
162
+ */
163
+ function printEventDetailed(event) {
164
+ const duration = event.endedAt && event.startedAt
165
+ ? new Date(event.endedAt).getTime() - new Date(event.startedAt).getTime()
166
+ : null;
167
+ const durationStr = duration !== null ? `${duration}ms` : "...";
168
+ const name = event.toolName ?? event.skillName ?? "-";
169
+ const errorInfo = event.errorCategory ? ` [${event.errorCategory}]` : "";
170
+ console.log(`[${String(event.sequence).padStart(4)}] ${event.eventType.padEnd(12)} ${name.padEnd(30)} ${event.status.padEnd(8)} ${durationStr.padEnd(10)}${errorInfo}`);
171
+ }
172
+ /**
173
+ * View session events with optional tail and follow mode.
174
+ */
175
+ export async function sessionsViewCommand(id, options) {
176
+ const config = loadConfig();
177
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
178
+ const tailCount = options.tail ? parseInt(options.tail, 10) : 200;
179
+ const intervalMs = parseInt(options.interval ?? "1000", 10);
180
+ try {
181
+ // Fetch session info
182
+ const session = await fetchJson(`${baseUrl}/api/sessions/${id}`);
183
+ // Fetch all events
184
+ const events = await fetchJson(`${baseUrl}/api/sessions/${id}/events`);
185
+ // Compute summary for header
186
+ const summary = computeSessionSummary(events);
187
+ // Print header
188
+ console.log("Session View");
189
+ console.log("=".repeat(80));
190
+ console.log(`ID: ${session.id}`);
191
+ console.log(`Status: ${session.status}`);
192
+ console.log(`Started: ${session.startedAt}`);
193
+ console.log(`Ended: ${session.endedAt ?? "N/A"}`);
194
+ console.log("");
195
+ console.log(`Events: ${summary.totalEvents} | Success: ${summary.successCount} | Error: ${summary.errorCount} | Timeout: ${summary.timeoutCount}`);
196
+ console.log(`Top Tools: ${summary.topTools.map((t) => `${t.name}(${t.count})`).join(", ") || "none"}`);
197
+ console.log("=".repeat(80));
198
+ console.log("");
199
+ // Print column header
200
+ console.log(`${"SEQ".padStart(6)} ${"TYPE".padEnd(12)} ${"NAME".padEnd(30)} ${"STATUS".padEnd(8)} ${"DURATION".padEnd(10)} ERROR`);
201
+ console.log("-".repeat(80));
202
+ // Show tail events
203
+ const startIndex = Math.max(0, events.length - tailCount);
204
+ const displayEvents = events.slice(startIndex);
205
+ for (const event of displayEvents) {
206
+ printEventDetailed(event);
207
+ }
208
+ // If follow mode, poll for new events
209
+ if (options.follow) {
210
+ let lastSequence = events.length > 0 ? events[events.length - 1].sequence : 0;
211
+ console.log("\n-- Following new events (Ctrl+C to stop) --\n");
212
+ const poll = async () => {
213
+ try {
214
+ const newEvents = await fetchJson(`${baseUrl}/api/sessions/${id}/events?after=${lastSequence}&limit=200`);
215
+ for (const event of newEvents) {
216
+ printEventDetailed(event);
217
+ lastSequence = Math.max(lastSequence, event.sequence);
218
+ }
219
+ }
220
+ catch {
221
+ // Silently ignore polling errors
222
+ }
223
+ };
224
+ const timer = setInterval(poll, intervalMs);
225
+ process.on("SIGINT", () => {
226
+ clearInterval(timer);
227
+ console.log("\nStopped following.");
228
+ process.exit(0);
229
+ });
230
+ await new Promise(() => { });
231
+ }
232
+ }
233
+ catch {
234
+ console.error(`Failed to view session: ${id}`);
235
+ process.exit(1);
236
+ }
237
+ }
238
+ /**
239
+ * Show session statistics.
240
+ */
241
+ export async function sessionsStatsCommand(id) {
242
+ const config = loadConfig();
243
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
244
+ try {
245
+ const events = await fetchJson(`${baseUrl}/api/sessions/${id}/events`);
246
+ if (events.length === 0) {
247
+ console.log("No events in this session.");
248
+ return;
249
+ }
250
+ const summary = computeSessionSummary(events);
251
+ console.log(formatStatsText(summary));
252
+ }
253
+ catch {
254
+ console.error(`Failed to get stats for session: ${id}`);
255
+ process.exit(1);
256
+ }
257
+ }
258
+ /**
259
+ * Search/filter session events.
260
+ */
261
+ export async function sessionsGrepCommand(id, options) {
262
+ const config = loadConfig();
263
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
264
+ try {
265
+ // Fetch all events
266
+ const events = await fetchJson(`${baseUrl}/api/sessions/${id}/events`);
267
+ // Filter client-side (per spec: no new REST endpoints for grep)
268
+ let filtered = events;
269
+ if (options.tool) {
270
+ filtered = filtered.filter((e) => e.toolName === options.tool);
271
+ }
272
+ if (options.status) {
273
+ filtered = filtered.filter((e) => e.status === options.status);
274
+ }
275
+ if (options.error) {
276
+ filtered = filtered.filter((e) => e.errorCategory === options.error);
277
+ }
278
+ if (options.sinceSeq) {
279
+ const sinceSeq = parseInt(options.sinceSeq, 10);
280
+ filtered = filtered.filter((e) => e.sequence > sinceSeq);
281
+ }
282
+ if (options.json) {
283
+ console.log(JSON.stringify(filtered, null, 2));
284
+ }
285
+ else {
286
+ if (filtered.length === 0) {
287
+ console.log("No matching events found.");
288
+ return;
289
+ }
290
+ // Print header
291
+ console.log(`${"SEQ".padStart(6)} ${"TYPE".padEnd(12)} ${"NAME".padEnd(30)} ${"STATUS".padEnd(8)} ${"DURATION".padEnd(10)} ERROR`);
292
+ console.log("-".repeat(80));
293
+ for (const event of filtered) {
294
+ printEventDetailed(event);
295
+ }
296
+ console.log("");
297
+ console.log(`Found ${filtered.length} matching event(s).`);
298
+ }
299
+ }
300
+ catch {
301
+ console.error(`Failed to search session: ${id}`);
302
+ process.exit(1);
303
+ }
304
+ }
305
+ /**
306
+ * Summarize session with safe metadata-only summary.
307
+ */
308
+ export async function sessionsSummarizeCommand(id, options) {
309
+ const config = loadConfig();
310
+ const baseUrl = `http://127.0.0.1:${config.listenPort}`;
311
+ const format = options.format ?? "text";
312
+ try {
313
+ const session = await fetchJson(`${baseUrl}/api/sessions/${id}`);
314
+ const events = await fetchJson(`${baseUrl}/api/sessions/${id}/events`);
315
+ const summary = computeSessionSummary(events);
316
+ if (format === "json") {
317
+ console.log(JSON.stringify({ session, summary }, null, 2));
318
+ }
319
+ else {
320
+ console.log(`Session: ${session.id}`);
321
+ console.log(`Status: ${session.status}`);
322
+ console.log(`Started: ${session.startedAt}`);
323
+ console.log(`Ended: ${session.endedAt ?? "N/A"}`);
324
+ console.log("");
325
+ console.log(formatConciseSummary(events, summary));
326
+ }
327
+ }
328
+ catch {
329
+ console.error(`Failed to summarize session: ${id}`);
330
+ process.exit(1);
331
+ }
332
+ }
333
+ //# sourceMappingUR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MAAM,OAAO,GAAG,MAAM,SAAS,CAAU,GAAG,OAAO,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B,GAAG,OAAO,iBAAiB,EAAE,SAAS,CACvC,CAAC;QACF,MAAM,OAAO,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Start command - runs the daemon in foreground or background.
3
+ */
4
+ import { existsSync, readFileSync, openSync, constants } from "node:fs";
5
+ import { spawn } from "node:child_process";
6
+ import { fileURLToPath } from "node:url";
7
+ import { dirname, join } from "node:path";
8
+ import { loadConfig, getDaemonPaths, acquireLockWithCleanup, isProcessRunning, readPidFile, } from "@agent-recorder/core";
9
+ import { startDaemon } from "@agent-recorder/service";
10
+ /**
11
+ * Load environment variables from a file.
12
+ * Parses KEY=VALUE lines, ignoring comments and empty lines.
13
+ */
14
+ function loadEnvFile(filePath) {
15
+ if (!existsSync(filePath)) {
16
+ console.error(`Env file not found: ${filePath}`);
17
+ process.exit(1);
18
+ }
19
+ const content = readFileSync(filePath, "utf-8");
20
+ const lines = content.split("\n");
21
+ for (const line of lines) {
22
+ const trimmed = line.trim();
23
+ // Skip empty lines and comments
24
+ if (!trimmed || trimmed.startsWith("#")) {
25
+ continue;
26
+ }
27
+ const eqIndex = trimmed.indexOf("=");
28
+ if (eqIndex > 0) {
29
+ const key = trimmed.slice(0, eqIndex).trim();
30
+ let value = trimmed.slice(eqIndex + 1).trim();
31
+ // Remove surrounding quotes if present
32
+ if ((value.startsWith('"') && value.endsWith('"')) ||
33
+ (value.startsWith("'") && value.endsWith("'"))) {
34
+ value = value.slice(1, -1);
35
+ }
36
+ // Only set if not already defined (preserve existing env)
37
+ if (process.env[key] === undefined) {
38
+ process.env[key] = value;
39
+ }
40
+ }
41
+ }
42
+ }
43
+ function printStartupBanner(mcpProxyPort) {
44
+ console.log(`
45
+ Agent Recorder
46
+ ==============
47
+
48
+ Claude Code v2 (recommended):
49
+ Add to ~/.claude/settings.json:
50
+
51
+ {
52
+ "mcpServers": {
53
+ "agent-recorder": {
54
+ "url": "http://127.0.0.1:${mcpProxyPort}/"
55
+ }
56
+ }
57
+ }
58
+
59
+ Legacy clients (~/.config/claude/mcp.json):
60
+ Same JSON structure, different location.
61
+
62
+ Then restart Claude Code.
63
+ `);
64
+ }
65
+ /**
66
+ * Send SIGTERM to a process and wait for it to exit.
67
+ */
68
+ async function stopProcess(pid, timeoutMs = 5000) {
69
+ try {
70
+ process.kill(pid, "SIGTERM");
71
+ }
72
+ catch {
73
+ // Process already dead
74
+ return true;
75
+ }
76
+ const startTime = Date.now();
77
+ while (Date.now() - startTime < timeoutMs) {
78
+ await new Promise((resolve) => setTimeout(resolve, 100));
79
+ if (!isProcessRunning(pid)) {
80
+ return true;
81
+ }
82
+ }
83
+ return false;
84
+ }
85
+ export async function startCommand(options = {}) {
86
+ // Load env file before anything else if specified
87
+ if (options.envFile) {
88
+ loadEnvFile(options.envFile);
89
+ }
90
+ const config = loadConfig();
91
+ const paths = getDaemonPaths();
92
+ // Check for existing daemon
93
+ const existingPid = readPidFile();
94
+ if (existingPid && isProcessRunning(existingPid)) {
95
+ if (options.force) {
96
+ console.log(`Stopping existing daemon (PID ${existingPid})...`);
97
+ const stopped = await stopProcess(existingPid);
98
+ if (!stopped) {
99
+ console.error("Failed to stop existing daemon. Try: agent-recorder stop --force");
100
+ process.exit(1);
101
+ }
102
+ console.log("Existing daemon stopped.");
103
+ }
104
+ else {
105
+ console.error(`Daemon is already running (PID ${existingPid}).\n` +
106
+ "Use --force to restart, or run: agent-recorder stop");
107
+ process.exit(1);
108
+ }
109
+ }
110
+ // Try to acquire lock
111
+ const lockResult = acquireLockWithCleanup(paths.lockFile, paths.pidFile);
112
+ if (!lockResult.acquired) {
113
+ if (lockResult.existingPid) {
114
+ console.error(`Another instance is running (PID ${lockResult.existingPid}).\n` +
115
+ "Use --force to restart, or run: agent-recorder stop");
116
+ }
117
+ else {
118
+ console.error(`Failed to acquire lock: ${lockResult.error}`);
119
+ }
120
+ process.exit(1);
121
+ }
122
+ if (options.daemon) {
123
+ // Daemon mode: fork and exit parent
124
+ console.log("Starting daemon in background...");
125
+ // Find the service entry point
126
+ const __filename = fileURLToPath(import.meta.url);
127
+ const __dirname = dirname(__filename);
128
+ const serviceEntry = join(__dirname, "..", "..", "..", "service", "dist", "index.js");
129
+ // Open log file for daemon output
130
+ const logFd = openSync(paths.logFile, constants.O_WRONLY | constants.O_CREAT | constants.O_APPEND);
131
+ // Build args for child process
132
+ const args = [serviceEntry, "--daemon"];
133
+ if (options.envFile) {
134
+ args.push("--env-file", options.envFile);
135
+ }
136
+ // Spawn detached child process
137
+ const child = spawn(process.execPath, args, {
138
+ detached: true,
139
+ stdio: ["ignore", logFd, logFd],
140
+ env: {
141
+ ...process.env,
142
+ AR_DAEMON_MODE: "1",
143
+ },
144
+ });
145
+ child.unref();
146
+ // Wait for daemon to start (poll for PID file up to 5 seconds)
147
+ let newPid = null;
148
+ const maxAttempts = 10;
149
+ for (let i = 0; i < maxAttempts; i++) {
150
+ await new Promise((resolve) => setTimeout(resolve, 500));
151
+ newPid = readPidFile();
152
+ if (newPid && isProcessRunning(newPid)) {
153
+ break;
154
+ }
155
+ }
156
+ // Check if daemon started successfully
157
+ if (newPid && isProcessRunning(newPid)) {
158
+ console.log(`Daemon started (PID ${newPid})`);
159
+ console.log(`Log file: ${paths.logFile}`);
160
+ console.log(`\nRun 'agent-recorder status' to check status.`);
161
+ }
162
+ else {
163
+ console.error("Failed to start daemon. Check log file for details:");
164
+ console.error(` ${paths.logFile}`);
165
+ process.exit(1);
166
+ }
167
+ }
168
+ else {
169
+ // Foreground mode: run directly
170
+ printStartupBanner(config.mcpProxyPort);
171
+ await startDaemon({ daemon: false });
172
+ }
173
+ }
174
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Start command - runs the daemon in foreground or background.
3
+ */
4
+ export interface StartCommandOptions {
5
+ envFile?: string;
6
+ daemon?: boolean;
7
+ force?: boolean;
8
+ }
9
+ export declare function startCommand(options?: StartCommandOptions): Promise<void>;
10
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Start command - runs the daemon in foreground or background.
3
+ */
4
+ export interface StartCommandOptions {
5
+ envFile?: string;
6
+ daemon?: boolean;
7
+ force?: boolean;
8
+ }
9
+ export declare function startCommand(options?: StartCommandOptions): Promise<void>;
10
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6EH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAuBD,wBAAsB,YAAY,CAChC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAgHf"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6EH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAuBD,wBAAsB,YAAY,CAChC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAgHf"}