agent-recorder 0.0.1 → 0.0.9

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 (245) hide show
  1. package/package.json +2 -2
  2. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js +1 -0
  3. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js.map +1 -1
  4. package/vendor/node_modules/@agent-recorder/cli/commands/configure-wrap.d.ts +15 -0
  5. package/vendor/node_modules/@agent-recorder/cli/commands/configure-wrap.d.ts.map +1 -0
  6. package/vendor/node_modules/@agent-recorder/cli/commands/configure-wrap.js +233 -0
  7. package/vendor/node_modules/@agent-recorder/cli/commands/configure-wrap.js.map +1 -0
  8. package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts.map +1 -1
  9. package/vendor/node_modules/@agent-recorder/cli/commands/install.js +9 -0
  10. package/vendor/node_modules/@agent-recorder/cli/commands/install.js.map +1 -1
  11. package/vendor/node_modules/@agent-recorder/cli/index.js +11 -0
  12. package/vendor/node_modules/@agent-recorder/cli/index.js.map +1 -1
  13. package/vendor/node_modules/@agent-recorder/core/config.d.ts +4 -0
  14. package/vendor/node_modules/@agent-recorder/core/config.d.ts.map +1 -1
  15. package/vendor/node_modules/@agent-recorder/core/config.js +6 -0
  16. package/vendor/node_modules/@agent-recorder/core/config.js.map +1 -1
  17. package/vendor/node_modules/@agent-recorder/core/db/events.d.ts +3 -0
  18. package/vendor/node_modules/@agent-recorder/core/db/events.d.ts.map +1 -1
  19. package/vendor/node_modules/@agent-recorder/core/db/events.js +8 -3
  20. package/vendor/node_modules/@agent-recorder/core/db/events.js.map +1 -1
  21. package/vendor/node_modules/@agent-recorder/core/db/events.test.js +34 -0
  22. package/vendor/node_modules/@agent-recorder/core/db/events.test.js.map +1 -1
  23. package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts +2 -2
  24. package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts.map +1 -1
  25. package/vendor/node_modules/@agent-recorder/core/db/migrations.js +14 -6
  26. package/vendor/node_modules/@agent-recorder/core/db/migrations.js.map +1 -1
  27. package/vendor/node_modules/@agent-recorder/core/index.d.ts +1 -1
  28. package/vendor/node_modules/@agent-recorder/core/index.d.ts.map +1 -1
  29. package/vendor/node_modules/@agent-recorder/core/index.js +1 -1
  30. package/vendor/node_modules/@agent-recorder/core/index.js.map +1 -1
  31. package/vendor/node_modules/@agent-recorder/core/migrations/006_add_upstream_key.sql +7 -0
  32. package/vendor/node_modules/@agent-recorder/core/types/events.d.ts +2 -0
  33. package/vendor/node_modules/@agent-recorder/core/types/events.d.ts.map +1 -1
  34. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts.map +1 -1
  35. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js +49 -4
  36. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js.map +1 -1
  37. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js +165 -0
  38. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js.map +1 -1
  39. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts +1 -0
  40. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts.map +1 -1
  41. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js +5 -2
  42. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js.map +1 -1
  43. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics 2.js +0 -205
  44. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d 2.ts +0 -50
  45. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts 2.map +0 -1
  46. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js 2.map +0 -1
  47. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test 2.js +0 -253
  48. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d 2.ts +0 -5
  49. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts 2.map +0 -1
  50. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js 2.map +0 -1
  51. package/vendor/node_modules/@agent-recorder/cli/commands/configure 2.js +0 -144
  52. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d 2.ts +0 -17
  53. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts 2.map +0 -1
  54. package/vendor/node_modules/@agent-recorder/cli/commands/configure.js 2.map +0 -1
  55. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose 2.js +0 -141
  56. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d 2.ts +0 -5
  57. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts 2.map +0 -1
  58. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js 2.map +0 -1
  59. package/vendor/node_modules/@agent-recorder/cli/commands/doctor 2.js +0 -253
  60. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d 2.ts +0 -5
  61. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts 2.map +0 -1
  62. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js 2.map +0 -1
  63. package/vendor/node_modules/@agent-recorder/cli/commands/export 2.js +0 -56
  64. package/vendor/node_modules/@agent-recorder/cli/commands/export.d 2.ts +0 -12
  65. package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts 2.map +0 -1
  66. package/vendor/node_modules/@agent-recorder/cli/commands/export.js 2.map +0 -1
  67. package/vendor/node_modules/@agent-recorder/cli/commands/install 2.js +0 -77
  68. package/vendor/node_modules/@agent-recorder/cli/commands/install.d 2.ts +0 -13
  69. package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts 2.map +0 -1
  70. package/vendor/node_modules/@agent-recorder/cli/commands/install.js 2.map +0 -1
  71. package/vendor/node_modules/@agent-recorder/cli/commands/logs 2.js +0 -40
  72. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d 2.ts +0 -8
  73. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts 2.map +0 -1
  74. package/vendor/node_modules/@agent-recorder/cli/commands/logs.js 2.map +0 -1
  75. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp 2.js +0 -188
  76. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d 2.ts +0 -10
  77. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts 2.map +0 -1
  78. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js 2.map +0 -1
  79. package/vendor/node_modules/@agent-recorder/cli/commands/restart 2.js +0 -67
  80. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d 2.ts +0 -9
  81. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts 2.map +0 -1
  82. package/vendor/node_modules/@agent-recorder/cli/commands/restart.js 2.map +0 -1
  83. package/vendor/node_modules/@agent-recorder/cli/commands/sessions 2.js +0 -333
  84. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d 2.ts +0 -52
  85. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts 2.map +0 -1
  86. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js 2.map +0 -1
  87. package/vendor/node_modules/@agent-recorder/cli/commands/start 2.js +0 -174
  88. package/vendor/node_modules/@agent-recorder/cli/commands/start.d 2.ts +0 -10
  89. package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts 2.map +0 -1
  90. package/vendor/node_modules/@agent-recorder/cli/commands/start.js 2.map +0 -1
  91. package/vendor/node_modules/@agent-recorder/cli/commands/status 2.js +0 -104
  92. package/vendor/node_modules/@agent-recorder/cli/commands/status.d 2.ts +0 -5
  93. package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts 2.map +0 -1
  94. package/vendor/node_modules/@agent-recorder/cli/commands/status.js 2.map +0 -1
  95. package/vendor/node_modules/@agent-recorder/cli/commands/stop 2.js +0 -89
  96. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d 2.ts +0 -8
  97. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts 2.map +0 -1
  98. package/vendor/node_modules/@agent-recorder/cli/commands/stop.js 2.map +0 -1
  99. package/vendor/node_modules/@agent-recorder/cli/commands/tui 2.js +0 -14
  100. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d 2.ts +0 -5
  101. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts 2.map +0 -1
  102. package/vendor/node_modules/@agent-recorder/cli/commands/tui.js 2.map +0 -1
  103. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths 2.js +0 -117
  104. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d 2.ts +0 -55
  105. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts 2.map +0 -1
  106. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js 2.map +0 -1
  107. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test 2.js +0 -152
  108. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d 2.ts +0 -5
  109. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts 2.map +0 -1
  110. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js 2.map +0 -1
  111. package/vendor/node_modules/@agent-recorder/cli/index 2.js +0 -194
  112. package/vendor/node_modules/@agent-recorder/cli/index.d 2.ts +0 -10
  113. package/vendor/node_modules/@agent-recorder/cli/index.d.ts 2.map +0 -1
  114. package/vendor/node_modules/@agent-recorder/cli/index.js 2.map +0 -1
  115. package/vendor/node_modules/@agent-recorder/cli/package 2.json +0 -17
  116. package/vendor/node_modules/@agent-recorder/cli/tui/App 2.js +0 -84
  117. package/vendor/node_modules/@agent-recorder/cli/tui/App.d 2.ts +0 -6
  118. package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts 2.map +0 -1
  119. package/vendor/node_modules/@agent-recorder/cli/tui/App.js 2.map +0 -1
  120. package/vendor/node_modules/@agent-recorder/cli/tui/api 2.js +0 -105
  121. package/vendor/node_modules/@agent-recorder/cli/tui/api.d 2.ts +0 -31
  122. package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts 2.map +0 -1
  123. package/vendor/node_modules/@agent-recorder/cli/tui/api.js 2.map +0 -1
  124. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel 2.js +0 -45
  125. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d 2.ts +0 -11
  126. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts 2.map +0 -1
  127. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js 2.map +0 -1
  128. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header 2.js +0 -13
  129. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d 2.ts +0 -17
  130. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts 2.map +0 -1
  131. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js 2.map +0 -1
  132. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner 2.js +0 -21
  133. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d 2.ts +0 -12
  134. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts 2.map +0 -1
  135. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js 2.map +0 -1
  136. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge 2.js +0 -50
  137. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d 2.ts +0 -16
  138. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts 2.map +0 -1
  139. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js 2.map +0 -1
  140. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table 2.js +0 -20
  141. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d 2.ts +0 -21
  142. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts 2.map +0 -1
  143. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js 2.map +0 -1
  144. package/vendor/node_modules/@agent-recorder/cli/tui/components/index 2.js +0 -8
  145. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d 2.ts +0 -8
  146. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts 2.map +0 -1
  147. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js 2.map +0 -1
  148. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream 2.js +0 -75
  149. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d 2.ts +0 -22
  150. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts 2.map +0 -1
  151. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js 2.map +0 -1
  152. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen 2.js +0 -190
  153. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d 2.ts +0 -13
  154. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts 2.map +0 -1
  155. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js 2.map +0 -1
  156. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen 2.js +0 -166
  157. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d 2.ts +0 -10
  158. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts 2.map +0 -1
  159. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js 2.map +0 -1
  160. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index 2.js +0 -6
  161. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d 2.ts +0 -6
  162. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts 2.map +0 -1
  163. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js 2.map +0 -1
  164. package/vendor/node_modules/@agent-recorder/core/config 2.js +0 -44
  165. package/vendor/node_modules/@agent-recorder/core/config.d 2.ts +0 -25
  166. package/vendor/node_modules/@agent-recorder/core/config.d.ts 2.map +0 -1
  167. package/vendor/node_modules/@agent-recorder/core/db/connection.d 2.ts +0 -15
  168. package/vendor/node_modules/@agent-recorder/core/migrations/001_initial 2.sql +0 -40
  169. package/vendor/node_modules/@agent-recorder/core/migrations/002_session_sequences 2.sql +0 -8
  170. package/vendor/node_modules/@agent-recorder/core/migrations/003_add_tool_columns 2.sql +0 -9
  171. package/vendor/node_modules/@agent-recorder/core/migrations/004_add_cancelled_status 2.sql +0 -23
  172. package/vendor/node_modules/@agent-recorder/core/migrations/005_add_error_category 2.sql +0 -6
  173. package/vendor/node_modules/@agent-recorder/core/package 2.json +0 -18
  174. package/vendor/node_modules/@agent-recorder/core/types/events.d 2.ts +0 -69
  175. package/vendor/node_modules/@agent-recorder/core/types/index 2.js +0 -2
  176. package/vendor/node_modules/@agent-recorder/core/types/index.js 2.map +0 -1
  177. package/vendor/node_modules/@agent-recorder/core/types/session 2.js +0 -6
  178. package/vendor/node_modules/@agent-recorder/core/types/session.d 2.ts +0 -22
  179. package/vendor/node_modules/@agent-recorder/core/types/session.d.ts 2.map +0 -1
  180. package/vendor/node_modules/@agent-recorder/core/types/session.js 2.map +0 -1
  181. package/vendor/node_modules/@agent-recorder/core/utils/error-category 2.js +0 -58
  182. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d 2.ts +0 -22
  183. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts 2.map +0 -1
  184. package/vendor/node_modules/@agent-recorder/core/utils/error-category.js 2.map +0 -1
  185. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d 2.ts +0 -5
  186. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts 2.map +0 -1
  187. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js 2.map +0 -1
  188. package/vendor/node_modules/@agent-recorder/core/utils/index 2.js +0 -6
  189. package/vendor/node_modules/@agent-recorder/core/utils/index.d 2.ts +0 -6
  190. package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts 2.map +0 -1
  191. package/vendor/node_modules/@agent-recorder/core/utils/index.js 2.map +0 -1
  192. package/vendor/node_modules/@agent-recorder/core/utils/redact.d 2.ts +0 -19
  193. package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts 2.map +0 -1
  194. package/vendor/node_modules/@agent-recorder/core/utils/redact.js 2.map +0 -1
  195. package/vendor/node_modules/@agent-recorder/service/index 2.js +0 -128
  196. package/vendor/node_modules/@agent-recorder/service/index.d 2.ts +0 -36
  197. package/vendor/node_modules/@agent-recorder/service/index.d.ts 2.map +0 -1
  198. package/vendor/node_modules/@agent-recorder/service/index.js 2.map +0 -1
  199. package/vendor/node_modules/@agent-recorder/service/mcp/index 2.js +0 -7
  200. package/vendor/node_modules/@agent-recorder/service/mcp/index.d 2.ts +0 -7
  201. package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts 2.map +0 -1
  202. package/vendor/node_modules/@agent-recorder/service/mcp/index.js 2.map +0 -1
  203. package/vendor/node_modules/@agent-recorder/service/mcp/proxy 2.js +0 -223
  204. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d 2.ts +0 -26
  205. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts 2.map +0 -1
  206. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js 2.map +0 -1
  207. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d 2.ts +0 -5
  208. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts 2.map +0 -1
  209. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js 2.map +0 -1
  210. package/vendor/node_modules/@agent-recorder/service/mcp/recorder 2.js +0 -62
  211. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d 2.ts +0 -31
  212. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts 2.map +0 -1
  213. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js 2.map +0 -1
  214. package/vendor/node_modules/@agent-recorder/service/mcp/types 2.js +0 -15
  215. package/vendor/node_modules/@agent-recorder/service/mcp/types.d 2.ts +0 -40
  216. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts 2.map +0 -1
  217. package/vendor/node_modules/@agent-recorder/service/mcp/types.js 2.map +0 -1
  218. package/vendor/node_modules/@agent-recorder/service/package 2.json +0 -15
  219. package/vendor/node_modules/@agent-recorder/service/routes/events 2.js +0 -71
  220. package/vendor/node_modules/@agent-recorder/service/routes/events.d 2.ts +0 -11
  221. package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts 2.map +0 -1
  222. package/vendor/node_modules/@agent-recorder/service/routes/events.js 2.map +0 -1
  223. package/vendor/node_modules/@agent-recorder/service/routes/health 2.js +0 -18
  224. package/vendor/node_modules/@agent-recorder/service/routes/health.d 2.ts +0 -6
  225. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts 2.map +0 -1
  226. package/vendor/node_modules/@agent-recorder/service/routes/health.js 2.map +0 -1
  227. package/vendor/node_modules/@agent-recorder/service/routes/sessions 2.js +0 -80
  228. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d 2.ts +0 -12
  229. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts 2.map +0 -1
  230. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js 2.map +0 -1
  231. package/vendor/node_modules/@agent-recorder/service/server 2.js +0 -36
  232. package/vendor/node_modules/@agent-recorder/service/server.d 2.ts +0 -19
  233. package/vendor/node_modules/@agent-recorder/service/server.d.ts 2.map +0 -1
  234. package/vendor/node_modules/@agent-recorder/service/server.js 2.map +0 -1
  235. package/vendor/node_modules/@agent-recorder/service/server.test 2.js +0 -296
  236. package/vendor/node_modules/@agent-recorder/service/server.test.d 2.ts +0 -5
  237. package/vendor/node_modules/@agent-recorder/service/server.test.d.ts 2.map +0 -1
  238. package/vendor/node_modules/@agent-recorder/service/session-manager 2.js +0 -22
  239. package/vendor/node_modules/@agent-recorder/service/session-manager.d 2.ts +0 -16
  240. package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts 2.map +0 -1
  241. package/vendor/node_modules/@agent-recorder/service/session-manager.js 2.map +0 -1
  242. package/vendor/node_modules/@agent-recorder/service/session-manager.test 2.js +0 -61
  243. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d 2.ts +0 -5
  244. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts 2.map +0 -1
  245. package/vendor/node_modules/@agent-recorder/service/session-manager.test.js 2.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-category.test.js","sourceRoot":"","sources":["../../src/utils/error-category.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;QAC9C,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACzC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACzC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,oEAAoE,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EAAE,sBAAsB,EAAE,CAAC,CAAC;YACjE,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACtD,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;gBAC5B,IAAI,EAAE,CAAC,KAAK;gBACZ,OAAO,EAAE,mBAAmB;aAC7B,CAAC,CAAC;YACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAC/C,wBAAwB,CACzB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Utility module exports.
3
- */
4
- export { redactJson, truncateJson, redactAndTruncate } from "./redact.js";
5
- export { deriveErrorCategory } from "./error-category.js";
6
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- /**
2
- * Utility module exports.
3
- */
4
- export { redactJson, truncateJson, redactAndTruncate } from "./redact.js";
5
- export { deriveErrorCategory } from "./error-category.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Redaction and truncation utilities for sensitive data.
3
- */
4
- /**
5
- * Recursively redact sensitive keys from a JSON value.
6
- * Keys are matched case-insensitively.
7
- */
8
- export declare function redactJson(value: unknown, keys: string[]): unknown;
9
- /**
10
- * Stringify and truncate JSON to a maximum length.
11
- * If truncated, appends "...[TRUNCATED]" indicator.
12
- */
13
- export declare function truncateJson(value: unknown, maxLength?: number): string;
14
- /**
15
- * Redact and truncate JSON in one step.
16
- * Convenience function that combines redactJson and truncateJson.
17
- */
18
- export declare function redactAndTruncate(value: unknown, keys: string[], maxLength?: number): string;
19
- //# sourceMappingURL=redact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAwBlE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,OAAO,EACd,SAAS,GAAE,MAA2B,GACrC,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,GAAE,MAA2B,GACrC,MAAM,CAGR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,cAAc,GAAG,YAAY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AAI,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,SAAS,GAAG,EAAE,CAAC,CAAC,6BAA6B;IACrE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,gBAAgB,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,IAAc,EACd,YAAoB,kBAAkB;IAEtC,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzC,OAAO,YAAY,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC"}
@@ -1,128 +0,0 @@
1
- /**
2
- * @agent-recorder/service
3
- *
4
- * Local daemon for Agent Recorder.
5
- * Runs SQLite persistence + REST API on localhost.
6
- * Always runs MCP proxy (returns 503 if downstream not configured).
7
- */
8
- import { loadConfig, openDatabase, runMigrations, getDefaultMigrationsDir, getDaemonPaths, writePidFile, removePidFile, releaseLock, } from "@agent-recorder/core";
9
- import { createServer, startServer } from "./server.js";
10
- import { createMcpProxy } from "./mcp/index.js";
11
- import { createSessionManager } from "./session-manager.js";
12
- export { createServer, startServer } from "./server.js";
13
- export { createMcpProxy } from "./mcp/index.js";
14
- export { createSessionManager } from "./session-manager.js";
15
- // Track daemon state for health endpoint
16
- let daemonMode = false;
17
- let daemonSessionId = null;
18
- let daemonStartedAt = null;
19
- /**
20
- * Get daemon runtime info for health endpoint.
21
- */
22
- export function getDaemonInfo() {
23
- return {
24
- mode: daemonMode ? "daemon" : "foreground",
25
- sessionId: daemonSessionId,
26
- startedAt: daemonStartedAt,
27
- };
28
- }
29
- /**
30
- * Start the daemon with default configuration.
31
- * Used by CLI and for direct execution.
32
- *
33
- * @param options - Daemon options (daemon mode, etc.)
34
- */
35
- export async function startDaemon(options = {}) {
36
- const config = loadConfig();
37
- const paths = getDaemonPaths();
38
- daemonMode = options.daemon ?? false;
39
- console.log("Starting Agent Recorder daemon...");
40
- console.log(`Mode: ${daemonMode ? "daemon" : "foreground"}`);
41
- console.log(`Database: ${config.dbPath}`);
42
- console.log(`REST API port: ${config.listenPort}`);
43
- // Open database
44
- const db = openDatabase(config.dbPath);
45
- // Run migrations
46
- const migrationsDir = getDefaultMigrationsDir();
47
- runMigrations(db, migrationsDir);
48
- // Create session manager (core generates ID)
49
- const sessionManager = createSessionManager(db);
50
- const startedAt = new Date().toISOString();
51
- // Store for health endpoint
52
- daemonSessionId = sessionManager.sessionId;
53
- daemonStartedAt = startedAt;
54
- // Create and start REST API server (pass currentSessionId for /api/sessions/current)
55
- const app = await createServer({
56
- db,
57
- currentSessionId: sessionManager.sessionId,
58
- });
59
- await startServer(app, config.listenPort);
60
- // Always start MCP proxy (handles missing downstream with 503)
61
- console.log(`MCP proxy port: ${config.mcpProxyPort}`);
62
- if (config.downstreamMcpUrl) {
63
- console.log(`Downstream MCP: ${config.downstreamMcpUrl}`);
64
- }
65
- else {
66
- console.log("Downstream MCP: not configured (POST / will return 503)");
67
- }
68
- const proxy = await createMcpProxy({
69
- db,
70
- config,
71
- sessionId: sessionManager.sessionId,
72
- });
73
- await proxy.start();
74
- // Write PID file only in daemon mode
75
- if (daemonMode) {
76
- writePidFile(process.pid);
77
- console.log(`PID file: ${paths.pidFile}`);
78
- }
79
- console.log("Agent Recorder daemon started.");
80
- // Track if we're already shutting down to prevent double shutdown
81
- let isShuttingDown = false;
82
- // Graceful shutdown function
83
- const shutdown = async (status = "cancelled") => {
84
- if (isShuttingDown) {
85
- return;
86
- }
87
- isShuttingDown = true;
88
- console.log(`\nShutting down (status: ${status})...`);
89
- sessionManager.shutdown(status);
90
- await proxy.close();
91
- await app.close();
92
- db.close();
93
- // Clean up PID file and lock in daemon mode
94
- if (daemonMode) {
95
- removePidFile();
96
- releaseLock(paths.lockFile);
97
- }
98
- console.log("Shutdown complete.");
99
- };
100
- // Signal handlers:
101
- // SIGINT (Ctrl+C) → completed (user intentionally stopped)
102
- // SIGTERM → cancelled (external termination)
103
- process.on("SIGINT", () => shutdown("completed").then(() => process.exit(0)));
104
- process.on("SIGTERM", () => shutdown("cancelled").then(() => process.exit(0)));
105
- // Ignore SIGHUP (no reload needed)
106
- process.on("SIGHUP", () => {
107
- console.log("Received SIGHUP, ignoring.");
108
- });
109
- return {
110
- shutdown,
111
- sessionId: sessionManager.sessionId,
112
- startedAt,
113
- };
114
- }
115
- // Run if executed directly
116
- // Note: pathToFileURL handles spaces and special characters correctly
117
- import { pathToFileURL } from "node:url";
118
- const isMainModule = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
119
- if (isMainModule) {
120
- // Parse command line arguments
121
- const args = process.argv.slice(2);
122
- const isDaemon = args.includes("--daemon");
123
- startDaemon({ daemon: isDaemon }).catch((error) => {
124
- console.error("Failed to start daemon:", error);
125
- process.exit(1);
126
- });
127
- }
128
- //# sourceMappingURL=index.js.map
@@ -1,36 +0,0 @@
1
- /**
2
- * @agent-recorder/service
3
- *
4
- * Local daemon for Agent Recorder.
5
- * Runs SQLite persistence + REST API on localhost.
6
- * Always runs MCP proxy (returns 503 if downstream not configured).
7
- */
8
- import { type SessionStatus } from "@agent-recorder/core";
9
- export { createServer, startServer } from "./server.js";
10
- export { createMcpProxy } from "./mcp/index.js";
11
- export { createSessionManager } from "./session-manager.js";
12
- export interface DaemonHandle {
13
- shutdown: (status?: SessionStatus) => Promise<void>;
14
- sessionId: string;
15
- startedAt: string;
16
- }
17
- export interface DaemonOptions {
18
- /** Run in daemon mode (writes PID file, different shutdown behavior) */
19
- daemon?: boolean;
20
- }
21
- /**
22
- * Get daemon runtime info for health endpoint.
23
- */
24
- export declare function getDaemonInfo(): {
25
- mode: "daemon" | "foreground";
26
- sessionId: string | null;
27
- startedAt: string | null;
28
- };
29
- /**
30
- * Start the daemon with default configuration.
31
- * Used by CLI and for direct execution.
32
- *
33
- * @param options - Daemon options (daemon mode, etc.)
34
- */
35
- export declare function startDaemon(options?: DaemonOptions): Promise<DaemonHandle>;
36
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EASL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAOD;;GAEG;AACH,wBAAgB,aAAa,IAAI;IAC/B,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAMA;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAkGvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,WAAW,GAEZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAA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AAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,MAAM,YAAY,GAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,IAAI,YAAY,EAAE,CAAC;IACjB,+BAA+B;IAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE3C,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAChD,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * MCP proxy module exports.
3
- */
4
- export { createMcpProxy } from "./proxy.js";
5
- export { recordToolCall } from "./recorder.js";
6
- export * from "./types.js";
7
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * MCP proxy module exports.
3
- */
4
- export { createMcpProxy, type McpProxyOptions } from "./proxy.js";
5
- export { recordToolCall, type RecordToolCallOptions } from "./recorder.js";
6
- export * from "./types.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,cAAc,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAC3E,cAAc,YAAY,CAAC"}
@@ -1,223 +0,0 @@
1
- /**
2
- * MCP Proxy using Streamable HTTP transport.
3
- * Handles POST requests only, returns application/json responses.
4
- * Records tools/call events to the database.
5
- */
6
- import Fastify, {} from "fastify";
7
- import { isToolsCallRequest, isErrorResponse, } from "./types.js";
8
- import { recordToolCall } from "./recorder.js";
9
- /** Default request timeout in milliseconds */
10
- const DEFAULT_TIMEOUT_MS = 60_000;
11
- /** Hop-by-hop headers that should not be forwarded */
12
- const HOP_BY_HOP_HEADERS = new Set([
13
- "host",
14
- "connection",
15
- "content-length",
16
- "transfer-encoding",
17
- "keep-alive",
18
- "upgrade",
19
- "proxy-connection",
20
- "proxy-authenticate",
21
- "proxy-authorization",
22
- "te",
23
- "trailer",
24
- ]);
25
- /**
26
- * Validate minimal JSON-RPC 2.0 request shape.
27
- * Returns error message if invalid, null if valid.
28
- */
29
- function validateJsonRpcRequest(body) {
30
- if (body === null || typeof body !== "object" || Array.isArray(body)) {
31
- return "Request body must be an object";
32
- }
33
- const obj = body;
34
- if (obj.jsonrpc !== "2.0") {
35
- return "Invalid JSON-RPC version (expected 2.0)";
36
- }
37
- if (typeof obj.method !== "string" || obj.method.length === 0) {
38
- return "Missing or invalid method";
39
- }
40
- return null;
41
- }
42
- /**
43
- * Build headers to forward to downstream, preserving safe headers.
44
- */
45
- function buildForwardHeaders(requestHeaders) {
46
- const headers = {
47
- "Content-Type": "application/json",
48
- Accept: "application/json",
49
- };
50
- for (const [key, value] of Object.entries(requestHeaders)) {
51
- const lowerKey = key.toLowerCase();
52
- // Skip hop-by-hop headers
53
- if (HOP_BY_HOP_HEADERS.has(lowerKey)) {
54
- continue;
55
- }
56
- // Skip content-type and accept (we set our own)
57
- if (lowerKey === "content-type" || lowerKey === "accept") {
58
- continue;
59
- }
60
- // Preserve authorization and other safe headers
61
- if (value !== undefined) {
62
- headers[key] = Array.isArray(value) ? value.join(", ") : value;
63
- }
64
- }
65
- return headers;
66
- }
67
- /**
68
- * Create an MCP proxy server.
69
- */
70
- export async function createMcpProxy(options) {
71
- const { db, config, sessionId, timeoutMs = DEFAULT_TIMEOUT_MS } = options;
72
- const { downstreamMcpUrl, redactKeys, mcpProxyPort, debugProxy } = config;
73
- const app = Fastify({ logger: false });
74
- // Health check endpoint
75
- app.get("/health", async () => {
76
- return { status: "ok", proxy: true };
77
- });
78
- // MCP POST handler
79
- app.post("/", async (request, reply) => {
80
- // Validate downstream URL is configured
81
- if (!downstreamMcpUrl) {
82
- return reply.code(503).send({
83
- jsonrpc: "2.0",
84
- error: {
85
- code: -32000,
86
- message: "Downstream MCP server not configured",
87
- },
88
- id: null,
89
- });
90
- }
91
- // Validate minimal JSON-RPC shape
92
- const validationError = validateJsonRpcRequest(request.body);
93
- if (validationError) {
94
- return reply.code(400).send({
95
- jsonrpc: "2.0",
96
- error: {
97
- code: -32600,
98
- message: validationError,
99
- },
100
- id: null,
101
- });
102
- }
103
- const body = request.body;
104
- // Check if this is a tools/call request
105
- const isToolCall = isToolsCallRequest(body);
106
- const startedAt = new Date().toISOString();
107
- let toolName = null;
108
- let toolInput = null;
109
- if (isToolCall) {
110
- const params = body.params;
111
- toolName = params.name;
112
- toolInput = params.arguments ?? {};
113
- }
114
- // Build headers to forward
115
- const forwardHeaders = buildForwardHeaders(request.headers);
116
- // Create abort controller for timeout
117
- const controller = new AbortController();
118
- const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
119
- // Forward request to downstream
120
- let downstreamResponse;
121
- try {
122
- downstreamResponse = await fetch(downstreamMcpUrl, {
123
- method: "POST",
124
- headers: forwardHeaders,
125
- body: JSON.stringify(body),
126
- signal: controller.signal,
127
- });
128
- }
129
- catch (error) {
130
- clearTimeout(timeoutId);
131
- // Check if this was a timeout
132
- if (error instanceof Error && error.name === "AbortError") {
133
- const endedAt = new Date().toISOString();
134
- // Record timeout if this was a tools/call
135
- if (isToolCall && toolName && sessionId) {
136
- recordToolCall({
137
- db,
138
- sessionId,
139
- toolName,
140
- mcpMethod: "tools/call",
141
- input: toolInput,
142
- output: { error: "Request timeout" },
143
- status: "timeout",
144
- startedAt,
145
- endedAt,
146
- redactKeys,
147
- debugProxy,
148
- });
149
- }
150
- return reply.code(504).send({
151
- jsonrpc: "2.0",
152
- error: {
153
- code: -32000,
154
- message: "Request timeout",
155
- data: { category: "timeout" },
156
- },
157
- id: body.id ?? null,
158
- });
159
- }
160
- // Log without potentially sensitive data
161
- console.error("Failed to forward request to downstream");
162
- return reply.code(502).send({
163
- jsonrpc: "2.0",
164
- error: {
165
- code: -32000,
166
- message: "Failed to connect to downstream MCP server",
167
- },
168
- id: body.id ?? null,
169
- });
170
- }
171
- clearTimeout(timeoutId);
172
- // Parse downstream response
173
- let responseBody;
174
- try {
175
- responseBody = (await downstreamResponse.json());
176
- }
177
- catch {
178
- console.error("Failed to parse downstream response");
179
- return reply.code(502).send({
180
- jsonrpc: "2.0",
181
- error: {
182
- code: -32000,
183
- message: "Invalid response from downstream MCP server",
184
- },
185
- id: body.id ?? null,
186
- });
187
- }
188
- const endedAt = new Date().toISOString();
189
- // Record tool call event if this was a tools/call request and we have a session
190
- if (isToolCall && toolName && sessionId) {
191
- const status = isErrorResponse(responseBody) ? "error" : "success";
192
- const output = isErrorResponse(responseBody)
193
- ? responseBody.error
194
- : responseBody.result;
195
- recordToolCall({
196
- db,
197
- sessionId,
198
- toolName,
199
- mcpMethod: "tools/call",
200
- input: toolInput,
201
- output,
202
- status,
203
- startedAt,
204
- endedAt,
205
- redactKeys,
206
- debugProxy,
207
- });
208
- }
209
- // Preserve downstream HTTP status code and return response unchanged
210
- reply.code(downstreamResponse.status);
211
- reply.header("Content-Type", "application/json");
212
- return reply.send(responseBody);
213
- });
214
- const start = async () => {
215
- await app.listen({ port: mcpProxyPort, host: "127.0.0.1" });
216
- console.log(`MCP proxy listening on http://127.0.0.1:${mcpProxyPort}`);
217
- };
218
- const close = async () => {
219
- await app.close();
220
- };
221
- return { app, start, close };
222
- }
223
- //# sourceMappingURL=proxy.js.map
@@ -1,26 +0,0 @@
1
- /**
2
- * MCP Proxy using Streamable HTTP transport.
3
- * Handles POST requests only, returns application/json responses.
4
- * Records tools/call events to the database.
5
- */
6
- import { type FastifyInstance } from "fastify";
7
- import type Database from "better-sqlite3";
8
- import type { Config } from "@agent-recorder/core";
9
- export interface McpProxyOptions {
10
- db: Database.Database;
11
- config: Config;
12
- /** Session ID to use for recording events. If null, events won't be recorded. */
13
- sessionId: string | null;
14
- /** Request timeout in milliseconds (default: 60000) */
15
- timeoutMs?: number;
16
- }
17
- export interface CreateMcpProxyResult {
18
- app: FastifyInstance;
19
- start: () => Promise<void>;
20
- close: () => Promise<void>;
21
- }
22
- /**
23
- * Create an MCP proxy server.
24
- */
25
- export declare function createMcpProxy(options: McpProxyOptions): Promise<CreateMcpProxyResult>;
26
- //# sourceMappingURL=proxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/mcp/proxy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA2BnD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MA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AC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YACnE,MAAM,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC;gBAC1C,CAAC,CAAC,YAAY,CAAC,KAAK;gBACpB,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC;YAExB,cAAc,CAAC;gBACb,EAAE;gBACF,SAAS;gBACT,QAAQ;gBACR,SAAS,EAAE,YAAY;gBACvB,KAAK,EAAE,SAAS;gBAChB,MAAM;gBACN,MAAM;gBACN,SAAS;gBACT,OAAO;gBACP,UAAU;gBACV,UAAU;aACX,CAAC,CAAC;QACL,CAAC;QAED,qEAAqE;QACrE,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QACjD,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,KAAK,IAAI,EAAE;QACvB,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,2CAA2C,YAAY,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,KAAK,IAAI,EAAE;QACvB,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Integration tests for MCP proxy.
3
- */
4
- export {};
5
- //# sourceMappingURL=proxy.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy.test.d.ts","sourceRoot":"","sources":["../../src/mcp/proxy.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1 +0,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AG,EAAE,GAAG;YACR,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SACnB,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE1D,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Tool call recorder.
3
- * Records tool_call events to the database with atomic sequence allocation.
4
- * Implements fail-open pattern: errors are logged but don't block proxy forwarding.
5
- */
6
- import { randomUUID } from "node:crypto";
7
- import { allocateSequence, deriveErrorCategory, insertEvent, redactAndTruncate, } from "@agent-recorder/core";
8
- /**
9
- * Record a tool call event to the database.
10
- * Uses atomic sequence allocation from session_sequences table.
11
- * Fails open: catches errors, logs them, and continues.
12
- *
13
- * @returns The event ID if successful, null if recording failed
14
- */
15
- export function recordToolCall(options) {
16
- const { db, sessionId, parentEventId, toolName, mcpMethod, input, output, status, startedAt, endedAt, redactKeys, debugProxy, } = options;
17
- try {
18
- // Allocate sequence atomically
19
- const sequence = allocateSequence(db, sessionId);
20
- // Redact and truncate input/output
21
- const inputJson = redactAndTruncate(input, redactKeys);
22
- const outputJson = redactAndTruncate(output, redactKeys);
23
- // Derive error category from status and redacted output (no content logging)
24
- const errorCategory = deriveErrorCategory(status, outputJson);
25
- // Generate event ID
26
- const eventId = randomUUID();
27
- // Insert event with proper column mapping:
28
- // - agentName = "claude-code" (stable identifier for the agent)
29
- // - toolName = actual tool name from params.name
30
- // - mcpMethod = "tools/call" (or whatever MCP method was invoked)
31
- insertEvent(db, {
32
- id: eventId,
33
- sessionId,
34
- parentEventId: parentEventId ?? null,
35
- sequence,
36
- eventType: "tool_call",
37
- agentRole: "assistant",
38
- agentName: "claude-code",
39
- skillName: null,
40
- toolName,
41
- mcpMethod: mcpMethod ?? "tools/call",
42
- startedAt,
43
- endedAt,
44
- status,
45
- inputJson,
46
- outputJson,
47
- errorCategory,
48
- });
49
- // Debug logging: metadata only, no payloads
50
- if (debugProxy) {
51
- const durationMs = new Date(endedAt).getTime() - new Date(startedAt).getTime();
52
- console.log(`[DEBUG] tool_call: session=${sessionId} seq=${sequence} tool=${toolName} status=${status} duration=${durationMs}ms`);
53
- }
54
- return eventId;
55
- }
56
- catch (error) {
57
- // Fail-open: log error but don't throw
58
- console.error("Failed to record tool call:", error);
59
- return null;
60
- }
61
- }
62
- //# sourceMappingURL=recorder.js.map