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,56 +0,0 @@
1
- /**
2
- * Export command - export session events to JSON or JSONL format.
3
- */
4
- import { writeFileSync } from "node:fs";
5
- import { loadConfig } from "@agent-recorder/core";
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
- /**
14
- * Export a session's events to JSON or JSONL format.
15
- */
16
- export async function exportCommand(id, options) {
17
- const config = loadConfig();
18
- const baseUrl = `http://127.0.0.1:${config.listenPort}`;
19
- const format = options.format ?? "jsonl";
20
- // Validate format
21
- if (format !== "json" && format !== "jsonl") {
22
- console.error('Invalid format. Use "json" or "jsonl".');
23
- process.exit(1);
24
- }
25
- try {
26
- // Fetch session and events
27
- const session = await fetchJson(`${baseUrl}/api/sessions/${id}`);
28
- const events = await fetchJson(`${baseUrl}/api/sessions/${id}/events`);
29
- let output;
30
- if (format === "jsonl") {
31
- // JSONL format: each line is an object with "type" field
32
- const lines = [];
33
- lines.push(JSON.stringify({ type: "session", ...session }));
34
- for (const event of events) {
35
- lines.push(JSON.stringify({ type: "event", ...event }));
36
- }
37
- output = lines.join("\n") + "\n";
38
- }
39
- else {
40
- // JSON format: object with session and events arrays
41
- output = JSON.stringify({ session, events }, null, 2) + "\n";
42
- }
43
- if (options.out) {
44
- writeFileSync(options.out, output);
45
- console.log(`Exported to ${options.out}`);
46
- }
47
- else {
48
- process.stdout.write(output);
49
- }
50
- }
51
- catch {
52
- console.error(`Failed to export session: ${id}`);
53
- process.exit(1);
54
- }
55
- }
56
- //# sourceMappingURL=export.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * Export command - export session events to JSON or JSONL format.
3
- */
4
- export interface ExportCommandOptions {
5
- format?: string;
6
- out?: string;
7
- }
8
- /**
9
- * Export a session's events to JSON or JSONL format.
10
- */
11
- export declare function exportCommand(id: string, options: ExportCommandOptions): Promise<void>;
12
- //# sourceMappingURL=export.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,UAAU,EAAgC,MAAM,sBAAsB,CAAC;AAEhF,KAAK,UAAU,SAAS,CAAI,GAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;AACvC,CAAC;AAOD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,EAAU,EACV,OAA6B;IAE7B,MAAM,MAAM,GAAG,UAAU,EAAE,CAA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C;YAChB,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,eAAe,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -1,77 +0,0 @@
1
- /**
2
- * Install command - set up ~/.agent-recorder/ and print configuration.
3
- * This command is idempotent - it won't overwrite existing files.
4
- */
5
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
6
- import { homedir } from "node:os";
7
- import { join } from "node:path";
8
- import { loadConfig } from "@agent-recorder/core";
9
- /** Default .env file template */
10
- const ENV_TEMPLATE = `# Agent Recorder Configuration
11
- # See docs/bootstrap.md for more options
12
-
13
- # Ports
14
- AR_LISTEN_PORT=8787
15
- AR_MCP_PROXY_PORT=8788
16
-
17
- # Database path (default is ~/.agent-recorder/agent-recorder.sqlite)
18
- # AR_DB_PATH=
19
-
20
- # Downstream MCP server (optional)
21
- # AR_DOWNSTREAM_MCP_URL=http://127.0.0.1:9999
22
-
23
- # Debug logging for MCP proxy (1 to enable)
24
- # AR_DEBUG_PROXY=1
25
- `;
26
- /**
27
- * Install Agent Recorder - create data directory and env file template.
28
- * This command is idempotent:
29
- * - Creates ~/.agent-recorder/ if it doesn't exist
30
- * - Creates ~/.agent-recorder/.env ONLY if it doesn't exist
31
- * - Never overwrites user files
32
- */
33
- export async function installCommand() {
34
- const config = loadConfig();
35
- const dataDir = join(homedir(), ".agent-recorder");
36
- const envFile = join(dataDir, ".env");
37
- // Create data directory if missing
38
- if (!existsSync(dataDir)) {
39
- mkdirSync(dataDir, { recursive: true });
40
- console.log(`Created: ${dataDir}`);
41
- }
42
- else {
43
- console.log(`Already exists: ${dataDir}`);
44
- }
45
- // Create .env file ONLY if it doesn't exist
46
- if (!existsSync(envFile)) {
47
- writeFileSync(envFile, ENV_TEMPLATE);
48
- console.log(`Created: ${envFile}`);
49
- }
50
- else {
51
- console.log(`Already exists: ${envFile}`);
52
- }
53
- // Print next steps
54
- console.log(`
55
- Agent Recorder installed!
56
-
57
- Data directory: ${dataDir}
58
- Env file: ${envFile}
59
-
60
- Claude Code v2 (recommended):
61
- Add to ~/.claude/settings.json:
62
-
63
- {
64
- "mcpServers": {
65
- "agent-recorder": {
66
- "url": "http://127.0.0.1:${config.mcpProxyPort}/"
67
- }
68
- }
69
- }
70
-
71
- Next steps:
72
- 1. Edit ${envFile} if needed
73
- 2. Start the daemon: agent-recorder start --env-file ${envFile}
74
- 3. Restart Claude Code to connect
75
- `);
76
- }
77
- //# sourceMappingURL=install.js.map
@@ -1,13 +0,0 @@
1
- /**
2
- * Install command - set up ~/.agent-recorder/ and print configuration.
3
- * This command is idempotent - it won't overwrite existing files.
4
- */
5
- /**
6
- * Install Agent Recorder - create data directory and env file template.
7
- * This command is idempotent:
8
- * - Creates ~/.agent-recorder/ if it doesn't exist
9
- * - Creates ~/.agent-recorder/.env ONLY if it doesn't exist
10
- * - Never overwrites user files
11
- */
12
- export declare function installCommand(): Promise<void>;
13
- //# sourceMappingURL=install.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH;;;;;;GAMG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA4CpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAA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Logs command - display daemon log file content.
3
- */
4
- import { existsSync, readFileSync } from "node:fs";
5
- import { getDaemonPaths } from "@agent-recorder/core";
6
- /**
7
- * Get last N lines from a file.
8
- */
9
- function tailLines(content, n) {
10
- const lines = content.split("\n");
11
- // Remove trailing empty line if present
12
- if (lines.length > 0 && lines[lines.length - 1] === "") {
13
- lines.pop();
14
- }
15
- return lines.slice(-n);
16
- }
17
- export async function logsCommand(options = {}) {
18
- const paths = getDaemonPaths();
19
- const tailCount = options.tail ? parseInt(options.tail, 10) : 50;
20
- if (!existsSync(paths.logFile)) {
21
- console.error(`Log file not found: ${paths.logFile}`);
22
- console.error("");
23
- console.error("The daemon may not have been started in daemon mode yet.");
24
- console.error("Run 'agent-recorder start --daemon' to start the daemon.");
25
- process.exit(1);
26
- }
27
- const content = readFileSync(paths.logFile, "utf-8");
28
- const lines = tailLines(content, tailCount);
29
- if (lines.length === 0) {
30
- console.log("Log file is empty.");
31
- return;
32
- }
33
- console.log(`Last ${lines.length} lines from ${paths.logFile}:`);
34
- console.log("=".repeat(60));
35
- console.log("");
36
- for (const line of lines) {
37
- console.log(line);
38
- }
39
- }
40
- //# sourceMappingURL=logs.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Logs command - display daemon log file content.
3
- */
4
- export interface LogsCommandOptions {
5
- tail?: string;
6
- }
7
- export declare function logsCommand(options?: LogsCommandOptions): Promise<void>;
8
- //# sourceMappingURL=logs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAcD,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings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,CAAC;IAE5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,CAAC,MAAM,eAAe,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -1,188 +0,0 @@
1
- /**
2
- * Mock MCP Server - minimal MCP server for end-to-end testing.
3
- * Implements JSON-RPC 2.0 over Streamable HTTP.
4
- */
5
- import * as http from "node:http";
6
- /**
7
- * Echo tool input schema.
8
- */
9
- const echoToolSchema = {
10
- name: "echo",
11
- description: "Echoes back the provided text",
12
- inputSchema: {
13
- type: "object",
14
- properties: {
15
- text: {
16
- type: "string",
17
- description: "Text to echo back",
18
- },
19
- },
20
- required: ["text"],
21
- },
22
- };
23
- /**
24
- * Handle JSON-RPC request.
25
- */
26
- function handleRpcRequest(request) {
27
- const { id, method, params } = request;
28
- switch (method) {
29
- case "initialize":
30
- return {
31
- jsonrpc: "2.0",
32
- id,
33
- result: {
34
- protocolVersion: "2024-11-05",
35
- capabilities: {
36
- tools: {},
37
- },
38
- serverInfo: {
39
- name: "agent-recorder-mock-mcp",
40
- version: "1.0.0",
41
- },
42
- },
43
- };
44
- case "tools/list":
45
- return {
46
- jsonrpc: "2.0",
47
- id,
48
- result: {
49
- tools: [echoToolSchema],
50
- },
51
- };
52
- case "tools/call": {
53
- const toolName = params?.name;
54
- const args = params?.arguments;
55
- if (toolName !== "echo") {
56
- return {
57
- jsonrpc: "2.0",
58
- id,
59
- error: {
60
- code: -32602,
61
- message: `Unknown tool: ${toolName}`,
62
- },
63
- };
64
- }
65
- const text = args?.text;
66
- return {
67
- jsonrpc: "2.0",
68
- id,
69
- result: {
70
- content: [
71
- {
72
- type: "text",
73
- text: text ?? "",
74
- },
75
- ],
76
- },
77
- };
78
- }
79
- case "notifications/initialized":
80
- // Notification - no response needed but we return success
81
- return {
82
- jsonrpc: "2.0",
83
- id,
84
- result: {},
85
- };
86
- default:
87
- return {
88
- jsonrpc: "2.0",
89
- id,
90
- error: {
91
- code: -32601,
92
- message: `Method not found: ${method}`,
93
- },
94
- };
95
- }
96
- }
97
- /**
98
- * Create and start mock MCP server.
99
- */
100
- function startMockServer(port) {
101
- const server = http.createServer((req, res) => {
102
- // Handle CORS preflight
103
- if (req.method === "OPTIONS") {
104
- res.writeHead(204, {
105
- "Access-Control-Allow-Origin": "*",
106
- "Access-Control-Allow-Methods": "POST, OPTIONS",
107
- "Access-Control-Allow-Headers": "Content-Type",
108
- });
109
- res.end();
110
- return;
111
- }
112
- // Only accept POST
113
- if (req.method !== "POST") {
114
- res.writeHead(405, { "Content-Type": "application/json" });
115
- res.end(JSON.stringify({ error: "Method not allowed" }));
116
- return;
117
- }
118
- let body = "";
119
- req.on("data", (chunk) => {
120
- body += chunk;
121
- });
122
- req.on("end", () => {
123
- try {
124
- const request = JSON.parse(body);
125
- // Validate JSON-RPC format
126
- if (request.jsonrpc !== "2.0" || !request.method) {
127
- res.writeHead(400, { "Content-Type": "application/json" });
128
- res.end(JSON.stringify({
129
- jsonrpc: "2.0",
130
- id: request.id ?? null,
131
- error: { code: -32600, message: "Invalid Request" },
132
- }));
133
- return;
134
- }
135
- const response = handleRpcRequest(request);
136
- res.writeHead(200, {
137
- "Content-Type": "application/json",
138
- "Access-Control-Allow-Origin": "*",
139
- });
140
- res.end(JSON.stringify(response));
141
- }
142
- catch {
143
- res.writeHead(400, { "Content-Type": "application/json" });
144
- res.end(JSON.stringify({
145
- jsonrpc: "2.0",
146
- id: null,
147
- error: { code: -32700, message: "Parse error" },
148
- }));
149
- }
150
- });
151
- });
152
- server.listen(port, "127.0.0.1", () => {
153
- console.log(`Mock MCP server listening on http://127.0.0.1:${port}/`);
154
- console.log("");
155
- console.log("Available tools:");
156
- console.log(" - echo(text: string): Echoes back the provided text");
157
- console.log("");
158
- console.log("Press Ctrl+C to stop.");
159
- });
160
- return server;
161
- }
162
- export async function mockMcpCommand(options = {}) {
163
- const port = parseInt(options.port ?? "9999", 10);
164
- if (options.printEnv) {
165
- console.log(`export AR_DOWNSTREAM_MCP_URL="http://127.0.0.1:${port}/"`);
166
- return;
167
- }
168
- // Validate port
169
- if (isNaN(port) || port < 1 || port > 65535) {
170
- console.error(`Invalid port: ${options.port}`);
171
- process.exit(1);
172
- }
173
- const server = startMockServer(port);
174
- // Handle shutdown
175
- process.on("SIGINT", () => {
176
- console.log("\nShutting down mock MCP server...");
177
- server.close(() => {
178
- console.log("Server stopped.");
179
- process.exit(0);
180
- });
181
- });
182
- process.on("SIGTERM", () => {
183
- server.close(() => {
184
- process.exit(0);
185
- });
186
- });
187
- }
188
- //# sourceMappingURL=mock-mcp.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Mock MCP Server - minimal MCP server for end-to-end testing.
3
- * Implements JSON-RPC 2.0 over Streamable HTTP.
4
- */
5
- export interface MockMcpOptions {
6
- port?: string;
7
- printEnv?: boolean;
8
- }
9
- export declare function mockMcpCommand(options?: MockMcpOptions): Promise<void>;
10
- //# sourceMappingURL=mock-mcp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock-mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mock-mcp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmMH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,cAAc,CAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CA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,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAErC,kBAAkB;IAClB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;YAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,67 +0,0 @@
1
- /**
2
- * Restart command - stops and starts the daemon.
3
- */
4
- import { getDaemonPaths, readPidFile, removePidFile, isProcessRunning, releaseLock, } from "@agent-recorder/core";
5
- import { startCommand } from "./start.js";
6
- /**
7
- * Wait for a process to exit.
8
- */
9
- async function waitForExit(pid, timeoutMs) {
10
- const startTime = Date.now();
11
- while (Date.now() - startTime < timeoutMs) {
12
- await new Promise((resolve) => setTimeout(resolve, 100));
13
- if (!isProcessRunning(pid)) {
14
- return true;
15
- }
16
- }
17
- return false;
18
- }
19
- export async function restartCommand(options = {}) {
20
- const paths = getDaemonPaths();
21
- // Check if daemon is running
22
- const pid = readPidFile();
23
- if (pid !== null && isProcessRunning(pid)) {
24
- // Stop the running daemon
25
- console.log(`Stopping daemon (PID ${pid})...`);
26
- try {
27
- process.kill(pid, "SIGTERM");
28
- }
29
- catch {
30
- // Process may have exited
31
- }
32
- // Wait for process to exit (5 seconds)
33
- const exited = await waitForExit(pid, 5000);
34
- if (!exited) {
35
- if (options.force) {
36
- console.log("Process did not exit, sending SIGKILL...");
37
- try {
38
- process.kill(pid, "SIGKILL");
39
- }
40
- catch {
41
- // Process may have exited
42
- }
43
- await new Promise((resolve) => setTimeout(resolve, 500));
44
- }
45
- else {
46
- console.error("Daemon did not stop within 5 seconds.\n" +
47
- "Use --force to kill and restart.");
48
- process.exit(1);
49
- }
50
- }
51
- console.log("Daemon stopped.");
52
- }
53
- else if (pid !== null) {
54
- // Stale PID file
55
- console.log("Cleaning up stale files...");
56
- }
57
- // Clean up files
58
- removePidFile();
59
- releaseLock(paths.lockFile);
60
- // Start daemon in background
61
- console.log("Starting daemon...");
62
- await startCommand({
63
- daemon: true,
64
- ...(options.envFile ? { envFile: options.envFile } : {}),
65
- });
66
- }
67
- //# sourceMappingURL=restart.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Restart command - stops and starts the daemon.
3
- */
4
- export interface RestartCommandOptions {
5
- envFile?: string;
6
- force?: boolean;
7
- }
8
- export declare function restartCommand(options?: RestartCommandOptions): Promise<void>;
9
- //# sourceMappingURL=restart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"restart.d.ts","sourceRoot":"","sources":["../../src/commands/restart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAgBD,wBAAsB,cAAc,CAClC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAoDf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"restart.js","sourceRoot":"","sources":["../../src/commands/restart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO1C;;GAEG;AACH,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,SAAiB;IACvD,MAA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