agent-recorder 0.0.1 → 0.0.8

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 (208) hide show
  1. package/package.json +2 -2
  2. package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts +2 -2
  3. package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts.map +1 -1
  4. package/vendor/node_modules/@agent-recorder/core/db/migrations.js +14 -6
  5. package/vendor/node_modules/@agent-recorder/core/db/migrations.js.map +1 -1
  6. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics 2.js +0 -205
  7. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d 2.ts +0 -50
  8. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts 2.map +0 -1
  9. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js 2.map +0 -1
  10. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test 2.js +0 -253
  11. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d 2.ts +0 -5
  12. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts 2.map +0 -1
  13. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js 2.map +0 -1
  14. package/vendor/node_modules/@agent-recorder/cli/commands/configure 2.js +0 -144
  15. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d 2.ts +0 -17
  16. package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts 2.map +0 -1
  17. package/vendor/node_modules/@agent-recorder/cli/commands/configure.js 2.map +0 -1
  18. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose 2.js +0 -141
  19. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d 2.ts +0 -5
  20. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts 2.map +0 -1
  21. package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js 2.map +0 -1
  22. package/vendor/node_modules/@agent-recorder/cli/commands/doctor 2.js +0 -253
  23. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d 2.ts +0 -5
  24. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts 2.map +0 -1
  25. package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js 2.map +0 -1
  26. package/vendor/node_modules/@agent-recorder/cli/commands/export 2.js +0 -56
  27. package/vendor/node_modules/@agent-recorder/cli/commands/export.d 2.ts +0 -12
  28. package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts 2.map +0 -1
  29. package/vendor/node_modules/@agent-recorder/cli/commands/export.js 2.map +0 -1
  30. package/vendor/node_modules/@agent-recorder/cli/commands/install 2.js +0 -77
  31. package/vendor/node_modules/@agent-recorder/cli/commands/install.d 2.ts +0 -13
  32. package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts 2.map +0 -1
  33. package/vendor/node_modules/@agent-recorder/cli/commands/install.js 2.map +0 -1
  34. package/vendor/node_modules/@agent-recorder/cli/commands/logs 2.js +0 -40
  35. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d 2.ts +0 -8
  36. package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts 2.map +0 -1
  37. package/vendor/node_modules/@agent-recorder/cli/commands/logs.js 2.map +0 -1
  38. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp 2.js +0 -188
  39. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d 2.ts +0 -10
  40. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts 2.map +0 -1
  41. package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js 2.map +0 -1
  42. package/vendor/node_modules/@agent-recorder/cli/commands/restart 2.js +0 -67
  43. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d 2.ts +0 -9
  44. package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts 2.map +0 -1
  45. package/vendor/node_modules/@agent-recorder/cli/commands/restart.js 2.map +0 -1
  46. package/vendor/node_modules/@agent-recorder/cli/commands/sessions 2.js +0 -333
  47. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d 2.ts +0 -52
  48. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts 2.map +0 -1
  49. package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js 2.map +0 -1
  50. package/vendor/node_modules/@agent-recorder/cli/commands/start 2.js +0 -174
  51. package/vendor/node_modules/@agent-recorder/cli/commands/start.d 2.ts +0 -10
  52. package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts 2.map +0 -1
  53. package/vendor/node_modules/@agent-recorder/cli/commands/start.js 2.map +0 -1
  54. package/vendor/node_modules/@agent-recorder/cli/commands/status 2.js +0 -104
  55. package/vendor/node_modules/@agent-recorder/cli/commands/status.d 2.ts +0 -5
  56. package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts 2.map +0 -1
  57. package/vendor/node_modules/@agent-recorder/cli/commands/status.js 2.map +0 -1
  58. package/vendor/node_modules/@agent-recorder/cli/commands/stop 2.js +0 -89
  59. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d 2.ts +0 -8
  60. package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts 2.map +0 -1
  61. package/vendor/node_modules/@agent-recorder/cli/commands/stop.js 2.map +0 -1
  62. package/vendor/node_modules/@agent-recorder/cli/commands/tui 2.js +0 -14
  63. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d 2.ts +0 -5
  64. package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts 2.map +0 -1
  65. package/vendor/node_modules/@agent-recorder/cli/commands/tui.js 2.map +0 -1
  66. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths 2.js +0 -117
  67. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d 2.ts +0 -55
  68. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts 2.map +0 -1
  69. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js 2.map +0 -1
  70. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test 2.js +0 -152
  71. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d 2.ts +0 -5
  72. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts 2.map +0 -1
  73. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js 2.map +0 -1
  74. package/vendor/node_modules/@agent-recorder/cli/index 2.js +0 -194
  75. package/vendor/node_modules/@agent-recorder/cli/index.d 2.ts +0 -10
  76. package/vendor/node_modules/@agent-recorder/cli/index.d.ts 2.map +0 -1
  77. package/vendor/node_modules/@agent-recorder/cli/index.js 2.map +0 -1
  78. package/vendor/node_modules/@agent-recorder/cli/package 2.json +0 -17
  79. package/vendor/node_modules/@agent-recorder/cli/tui/App 2.js +0 -84
  80. package/vendor/node_modules/@agent-recorder/cli/tui/App.d 2.ts +0 -6
  81. package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts 2.map +0 -1
  82. package/vendor/node_modules/@agent-recorder/cli/tui/App.js 2.map +0 -1
  83. package/vendor/node_modules/@agent-recorder/cli/tui/api 2.js +0 -105
  84. package/vendor/node_modules/@agent-recorder/cli/tui/api.d 2.ts +0 -31
  85. package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts 2.map +0 -1
  86. package/vendor/node_modules/@agent-recorder/cli/tui/api.js 2.map +0 -1
  87. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel 2.js +0 -45
  88. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d 2.ts +0 -11
  89. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts 2.map +0 -1
  90. package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js 2.map +0 -1
  91. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header 2.js +0 -13
  92. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d 2.ts +0 -17
  93. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts 2.map +0 -1
  94. package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js 2.map +0 -1
  95. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner 2.js +0 -21
  96. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d 2.ts +0 -12
  97. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts 2.map +0 -1
  98. package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js 2.map +0 -1
  99. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge 2.js +0 -50
  100. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d 2.ts +0 -16
  101. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts 2.map +0 -1
  102. package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js 2.map +0 -1
  103. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table 2.js +0 -20
  104. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d 2.ts +0 -21
  105. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts 2.map +0 -1
  106. package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js 2.map +0 -1
  107. package/vendor/node_modules/@agent-recorder/cli/tui/components/index 2.js +0 -8
  108. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d 2.ts +0 -8
  109. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts 2.map +0 -1
  110. package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js 2.map +0 -1
  111. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream 2.js +0 -75
  112. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d 2.ts +0 -22
  113. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts 2.map +0 -1
  114. package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js 2.map +0 -1
  115. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen 2.js +0 -190
  116. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d 2.ts +0 -13
  117. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts 2.map +0 -1
  118. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js 2.map +0 -1
  119. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen 2.js +0 -166
  120. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d 2.ts +0 -10
  121. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts 2.map +0 -1
  122. package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js 2.map +0 -1
  123. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index 2.js +0 -6
  124. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d 2.ts +0 -6
  125. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts 2.map +0 -1
  126. package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js 2.map +0 -1
  127. package/vendor/node_modules/@agent-recorder/core/config 2.js +0 -44
  128. package/vendor/node_modules/@agent-recorder/core/config.d 2.ts +0 -25
  129. package/vendor/node_modules/@agent-recorder/core/config.d.ts 2.map +0 -1
  130. package/vendor/node_modules/@agent-recorder/core/db/connection.d 2.ts +0 -15
  131. package/vendor/node_modules/@agent-recorder/core/migrations/001_initial 2.sql +0 -40
  132. package/vendor/node_modules/@agent-recorder/core/migrations/002_session_sequences 2.sql +0 -8
  133. package/vendor/node_modules/@agent-recorder/core/migrations/003_add_tool_columns 2.sql +0 -9
  134. package/vendor/node_modules/@agent-recorder/core/migrations/004_add_cancelled_status 2.sql +0 -23
  135. package/vendor/node_modules/@agent-recorder/core/migrations/005_add_error_category 2.sql +0 -6
  136. package/vendor/node_modules/@agent-recorder/core/package 2.json +0 -18
  137. package/vendor/node_modules/@agent-recorder/core/types/events.d 2.ts +0 -69
  138. package/vendor/node_modules/@agent-recorder/core/types/index 2.js +0 -2
  139. package/vendor/node_modules/@agent-recorder/core/types/index.js 2.map +0 -1
  140. package/vendor/node_modules/@agent-recorder/core/types/session 2.js +0 -6
  141. package/vendor/node_modules/@agent-recorder/core/types/session.d 2.ts +0 -22
  142. package/vendor/node_modules/@agent-recorder/core/types/session.d.ts 2.map +0 -1
  143. package/vendor/node_modules/@agent-recorder/core/types/session.js 2.map +0 -1
  144. package/vendor/node_modules/@agent-recorder/core/utils/error-category 2.js +0 -58
  145. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d 2.ts +0 -22
  146. package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts 2.map +0 -1
  147. package/vendor/node_modules/@agent-recorder/core/utils/error-category.js 2.map +0 -1
  148. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d 2.ts +0 -5
  149. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts 2.map +0 -1
  150. package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js 2.map +0 -1
  151. package/vendor/node_modules/@agent-recorder/core/utils/index 2.js +0 -6
  152. package/vendor/node_modules/@agent-recorder/core/utils/index.d 2.ts +0 -6
  153. package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts 2.map +0 -1
  154. package/vendor/node_modules/@agent-recorder/core/utils/index.js 2.map +0 -1
  155. package/vendor/node_modules/@agent-recorder/core/utils/redact.d 2.ts +0 -19
  156. package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts 2.map +0 -1
  157. package/vendor/node_modules/@agent-recorder/core/utils/redact.js 2.map +0 -1
  158. package/vendor/node_modules/@agent-recorder/service/index 2.js +0 -128
  159. package/vendor/node_modules/@agent-recorder/service/index.d 2.ts +0 -36
  160. package/vendor/node_modules/@agent-recorder/service/index.d.ts 2.map +0 -1
  161. package/vendor/node_modules/@agent-recorder/service/index.js 2.map +0 -1
  162. package/vendor/node_modules/@agent-recorder/service/mcp/index 2.js +0 -7
  163. package/vendor/node_modules/@agent-recorder/service/mcp/index.d 2.ts +0 -7
  164. package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts 2.map +0 -1
  165. package/vendor/node_modules/@agent-recorder/service/mcp/index.js 2.map +0 -1
  166. package/vendor/node_modules/@agent-recorder/service/mcp/proxy 2.js +0 -223
  167. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d 2.ts +0 -26
  168. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts 2.map +0 -1
  169. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js 2.map +0 -1
  170. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d 2.ts +0 -5
  171. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts 2.map +0 -1
  172. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js 2.map +0 -1
  173. package/vendor/node_modules/@agent-recorder/service/mcp/recorder 2.js +0 -62
  174. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d 2.ts +0 -31
  175. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts 2.map +0 -1
  176. package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js 2.map +0 -1
  177. package/vendor/node_modules/@agent-recorder/service/mcp/types 2.js +0 -15
  178. package/vendor/node_modules/@agent-recorder/service/mcp/types.d 2.ts +0 -40
  179. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts 2.map +0 -1
  180. package/vendor/node_modules/@agent-recorder/service/mcp/types.js 2.map +0 -1
  181. package/vendor/node_modules/@agent-recorder/service/package 2.json +0 -15
  182. package/vendor/node_modules/@agent-recorder/service/routes/events 2.js +0 -71
  183. package/vendor/node_modules/@agent-recorder/service/routes/events.d 2.ts +0 -11
  184. package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts 2.map +0 -1
  185. package/vendor/node_modules/@agent-recorder/service/routes/events.js 2.map +0 -1
  186. package/vendor/node_modules/@agent-recorder/service/routes/health 2.js +0 -18
  187. package/vendor/node_modules/@agent-recorder/service/routes/health.d 2.ts +0 -6
  188. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts 2.map +0 -1
  189. package/vendor/node_modules/@agent-recorder/service/routes/health.js 2.map +0 -1
  190. package/vendor/node_modules/@agent-recorder/service/routes/sessions 2.js +0 -80
  191. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d 2.ts +0 -12
  192. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts 2.map +0 -1
  193. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js 2.map +0 -1
  194. package/vendor/node_modules/@agent-recorder/service/server 2.js +0 -36
  195. package/vendor/node_modules/@agent-recorder/service/server.d 2.ts +0 -19
  196. package/vendor/node_modules/@agent-recorder/service/server.d.ts 2.map +0 -1
  197. package/vendor/node_modules/@agent-recorder/service/server.js 2.map +0 -1
  198. package/vendor/node_modules/@agent-recorder/service/server.test 2.js +0 -296
  199. package/vendor/node_modules/@agent-recorder/service/server.test.d 2.ts +0 -5
  200. package/vendor/node_modules/@agent-recorder/service/server.test.d.ts 2.map +0 -1
  201. package/vendor/node_modules/@agent-recorder/service/session-manager 2.js +0 -22
  202. package/vendor/node_modules/@agent-recorder/service/session-manager.d 2.ts +0 -16
  203. package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts 2.map +0 -1
  204. package/vendor/node_modules/@agent-recorder/service/session-manager.js 2.map +0 -1
  205. package/vendor/node_modules/@agent-recorder/service/session-manager.test 2.js +0 -61
  206. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d 2.ts +0 -5
  207. package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts 2.map +0 -1
  208. package/vendor/node_modules/@agent-recorder/service/session-manager.test.js 2.map +0 -1
@@ -1,144 +0,0 @@
1
- /**
2
- * Configure commands - manage Claude Code integration.
3
- */
4
- import { loadConfig } from "@agent-recorder/core";
5
- import { detectClaudeConfig, getV2ConfigPath, getLegacyConfigPath, readJsonFile, writeJsonFileAtomic, createBackup, getMcpServerEntry, setMcpServerEntry, formatPath, } from "../config/claude-paths.js";
6
- /**
7
- * Configure Claude Code to use Agent Recorder.
8
- */
9
- export async function configureClaudeCommand(options = {}) {
10
- const config = loadConfig();
11
- const expectedUrl = `http://127.0.0.1:${config.mcpProxyPort}/`;
12
- // Determine which config file to use
13
- let configPath;
14
- let configKind;
15
- if (options.path) {
16
- configPath = options.path;
17
- configKind = "v2"; // Assume v2 format for custom paths
18
- }
19
- else if (options.legacy) {
20
- configPath = getLegacyConfigPath();
21
- configKind = "legacy";
22
- }
23
- else {
24
- // Auto-detect or default to v2
25
- const detected = detectClaudeConfig();
26
- if (detected.kind !== "none" && detected.path) {
27
- configPath = detected.path;
28
- configKind = detected.kind;
29
- }
30
- else {
31
- // Default to v2 if no config exists
32
- configPath = getV2ConfigPath();
33
- configKind = "v2";
34
- }
35
- }
36
- // Read existing config or start fresh
37
- let existingConfig = readJsonFile(configPath);
38
- const isNewFile = existingConfig === null;
39
- if (existingConfig === null) {
40
- existingConfig = {};
41
- }
42
- // Check current state
43
- const currentEntry = getMcpServerEntry(existingConfig);
44
- const currentUrl = currentEntry?.url;
45
- // Create new config with updated URL
46
- const newConfig = setMcpServerEntry(existingConfig, expectedUrl);
47
- // Determine what changed
48
- const urlChanged = currentUrl !== expectedUrl;
49
- if (options.dryRun) {
50
- console.log("Dry run - no changes will be made\n");
51
- console.log(`Config file: ${formatPath(configPath)} (${configKind})`);
52
- console.log(`File exists: ${!isNewFile}`);
53
- console.log("");
54
- if (isNewFile) {
55
- console.log("Would create new file with:");
56
- }
57
- else if (urlChanged) {
58
- console.log("Would update:");
59
- if (currentUrl) {
60
- console.log(` - mcpServers.agent-recorder.url: ${currentUrl}`);
61
- }
62
- console.log(` + mcpServers.agent-recorder.url: ${expectedUrl}`);
63
- }
64
- else {
65
- console.log("No changes needed - URL already correct.");
66
- }
67
- return;
68
- }
69
- // Create backup if file exists
70
- let backupPath = null;
71
- if (!isNewFile) {
72
- backupPath = createBackup(configPath);
73
- }
74
- // Write the config
75
- writeJsonFileAtomic(configPath, newConfig);
76
- // Report results
77
- if (isNewFile) {
78
- console.log(`Created: ${formatPath(configPath)} (${configKind})`);
79
- }
80
- else {
81
- console.log(`Found: ${formatPath(configPath)} (${configKind})`);
82
- console.log(`Backup: ${formatPath(backupPath)}`);
83
- }
84
- console.log(`Set: mcpServers.agent-recorder.url = ${expectedUrl}`);
85
- console.log("");
86
- console.log("Restart Claude Code to apply changes.");
87
- }
88
- /**
89
- * Show current Claude Code configuration status.
90
- */
91
- export async function configureShowCommand() {
92
- const config = loadConfig();
93
- const expectedUrl = `http://127.0.0.1:${config.mcpProxyPort}/`;
94
- console.log("Claude Code Configuration");
95
- console.log("=========================");
96
- console.log("");
97
- // Detect config
98
- const detected = detectClaudeConfig();
99
- if (detected.kind === "none") {
100
- console.log("Config file: not found");
101
- console.log("Checked:");
102
- console.log(` - ${formatPath(getV2ConfigPath())} (v2)`);
103
- console.log(` - ${formatPath(getLegacyConfigPath())} (legacy)`);
104
- console.log("");
105
- console.log("Run 'agent-recorder configure claude' to create config.");
106
- return;
107
- }
108
- console.log(`Config file: ${formatPath(detected.path)} (${detected.kind})`);
109
- // Read and check config
110
- const configData = readJsonFile(detected.path);
111
- if (configData === null) {
112
- console.log("Status: error reading file");
113
- return;
114
- }
115
- const entry = getMcpServerEntry(configData);
116
- if (entry === null) {
117
- console.log("MCP entry: not present");
118
- console.log("");
119
- console.log("Run 'agent-recorder configure claude' to add entry.");
120
- return;
121
- }
122
- console.log("MCP entry: present");
123
- if (entry.url) {
124
- const matches = entry.url === expectedUrl;
125
- const symbol = matches ? "\u2713" : "\u2717";
126
- console.log(`URL: ${entry.url}`);
127
- if (matches) {
128
- console.log(` (${symbol} matches expected port ${config.mcpProxyPort})`);
129
- }
130
- else {
131
- console.log(` (${symbol} expected ${expectedUrl})`);
132
- console.log("");
133
- console.log("Run 'agent-recorder configure claude' to fix URL.");
134
- }
135
- }
136
- else if (entry.command) {
137
- console.log(`Command: ${entry.command}`);
138
- if (entry.args) {
139
- console.log(`Args: ${entry.args.join(" ")}`);
140
- }
141
- console.log(" (stdio mode - not managed by agent-recorder)");
142
- }
143
- }
144
- //# sourceMappingURL=configure.js.map
@@ -1,17 +0,0 @@
1
- /**
2
- * Configure commands - manage Claude Code integration.
3
- */
4
- export interface ConfigureClaudeOptions {
5
- path?: string;
6
- legacy?: boolean;
7
- dryRun?: boolean;
8
- }
9
- /**
10
- * Configure Claude Code to use Agent Recorder.
11
- */
12
- export declare function configureClaudeCommand(options?: ConfigureClaudeOptions): Promise<void>;
13
- /**
14
- * Show current Claude Code configuration status.
15
- */
16
- export declare function configureShowCommand(): Promise<void>;
17
- //# sourceMappingURL=configure.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeH,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CAoFf;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8D1D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AAQnC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAAkC,EAAE;IAEpC,MAAM,MAAM,GAAG,UAA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AAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
@@ -1,141 +0,0 @@
1
- /**
2
- * Diagnose commands - focused diagnostic tools.
3
- */
4
- import { loadConfig } from "@agent-recorder/core";
5
- /**
6
- * Send a JSON-RPC request and get the response.
7
- */
8
- async function sendJsonRpc(url, method, params = {}) {
9
- try {
10
- const response = await fetch(url, {
11
- method: "POST",
12
- headers: { "Content-Type": "application/json" },
13
- body: JSON.stringify({
14
- jsonrpc: "2.0",
15
- id: 1,
16
- method,
17
- params,
18
- }),
19
- signal: AbortSignal.timeout(5000),
20
- });
21
- if (!response.ok) {
22
- return null;
23
- }
24
- return (await response.json());
25
- }
26
- catch {
27
- return null;
28
- }
29
- }
30
- /**
31
- * Categorize connection error.
32
- */
33
- async function categorizeError(url) {
34
- try {
35
- await fetch(url, {
36
- method: "GET",
37
- signal: AbortSignal.timeout(3000),
38
- });
39
- return { ok: true };
40
- }
41
- catch (error) {
42
- const err = error;
43
- if (err.name === "TimeoutError") {
44
- return { ok: false, error: "timeout" };
45
- }
46
- if (err.cause?.code === "ECONNREFUSED") {
47
- return { ok: false, error: "connection refused" };
48
- }
49
- if (err.cause?.code === "ENOTFOUND") {
50
- return { ok: false, error: "host not found" };
51
- }
52
- return { ok: false, error: "unreachable" };
53
- }
54
- }
55
- /**
56
- * Check if port accepts any connection.
57
- */
58
- async function checkPortReachable(url) {
59
- try {
60
- await fetch(url, {
61
- method: "GET",
62
- signal: AbortSignal.timeout(3000),
63
- });
64
- return true;
65
- }
66
- catch {
67
- return false;
68
- }
69
- }
70
- export async function diagnoseMcpCommand() {
71
- const config = loadConfig();
72
- const proxyUrl = `http://127.0.0.1:${config.mcpProxyPort}/`;
73
- console.log("MCP Diagnostics");
74
- console.log("===============");
75
- console.log("");
76
- let allPassed = true;
77
- // Check 1: Proxy listening
78
- const proxyReachable = await checkPortReachable(proxyUrl);
79
- if (proxyReachable) {
80
- console.log(`[\u2713] Proxy listening on :${config.mcpProxyPort}`);
81
- }
82
- else {
83
- console.log(`[\u2717] Proxy not listening on :${config.mcpProxyPort}`);
84
- console.log(" \u2192 Start daemon: agent-recorder start --daemon");
85
- allPassed = false;
86
- }
87
- // Check 2: Downstream configured
88
- if (!config.downstreamMcpUrl) {
89
- console.log("[\u2717] Downstream not configured");
90
- console.log(" \u2192 Set AR_DOWNSTREAM_MCP_URL environment variable");
91
- console.log(" \u2192 Or test with: agent-recorder mock-mcp --port 9999");
92
- allPassed = false;
93
- }
94
- else {
95
- console.log(`[\u2713] Downstream configured: ${config.downstreamMcpUrl}`);
96
- // Check 3: Downstream reachable
97
- const downstreamCheck = await categorizeError(config.downstreamMcpUrl);
98
- if (downstreamCheck.ok) {
99
- console.log("[\u2713] Downstream reachable");
100
- // Check 4: tools/list via proxy works
101
- if (proxyReachable) {
102
- const rpcResponse = await sendJsonRpc(proxyUrl, "tools/list");
103
- if (rpcResponse === null) {
104
- console.log("[\u2717] tools/list via proxy: failed to connect");
105
- allPassed = false;
106
- }
107
- else if (rpcResponse.error) {
108
- console.log(`[\u2717] tools/list via proxy: JSON-RPC error (${rpcResponse.error.code})`);
109
- console.log(` Message: ${rpcResponse.error.message}`);
110
- allPassed = false;
111
- }
112
- else if (rpcResponse.result) {
113
- const result = rpcResponse.result;
114
- const toolCount = result.tools?.length ?? 0;
115
- console.log(`[\u2713] tools/list via proxy: ${toolCount} tools`);
116
- }
117
- else {
118
- console.log("[\u2717] tools/list via proxy: unexpected response");
119
- allPassed = false;
120
- }
121
- }
122
- }
123
- else {
124
- console.log(`[\u2717] Downstream reachable: ${downstreamCheck.error}`);
125
- console.log(" \u2192 Check if downstream MCP server is running");
126
- if (downstreamCheck.error === "connection refused") {
127
- console.log(" \u2192 Test with: agent-recorder mock-mcp --port 9999");
128
- }
129
- allPassed = false;
130
- }
131
- }
132
- console.log("");
133
- if (allPassed) {
134
- console.log("All checks passed.");
135
- }
136
- else {
137
- console.log("Some checks failed. See suggestions above.");
138
- process.exit(1);
139
- }
140
- }
141
- //# sourceMappingURL=diagnose.js.map
@@ -1,5 +0,0 @@
1
- /**
2
- * Diagnose commands - focused diagnostic tools.
3
- */
4
- export declare function diagnoseMcpCommand(): Promise<void>;
5
- //# sourceMappingURL=diagnose.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwFH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CA4ExD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAalD;;GAEG;AACH,KAAK,UAAU,WAAW,CACxB,GAAW,EACX,MAAc,EACd,SAAkC,EAAE;IAEpC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,OAAO,EAAE,KAAK;gBACd,EAAE,EAAE,CAAC;gBACL,MAAM;gBACN,MAAM;aACP,CAAC;YACF,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SAClC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,OA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I,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -1,253 +0,0 @@
1
- /**
2
- * Doctor command - comprehensive health check and configuration diagnostics.
3
- */
4
- import { loadConfig, readPidFile, isProcessRunning, } from "@agent-recorder/core";
5
- import { detectClaudeConfig, readJsonFile, getMcpServerEntry, formatPath, getV2ConfigPath, getLegacyConfigPath, } from "../config/claude-paths.js";
6
- /**
7
- * Format uptime in human-readable form.
8
- */
9
- function formatUptime(seconds) {
10
- if (seconds < 60) {
11
- return `${Math.floor(seconds)}s`;
12
- }
13
- if (seconds < 3600) {
14
- const minutes = Math.floor(seconds / 60);
15
- const secs = Math.floor(seconds % 60);
16
- return `${minutes}m ${secs}s`;
17
- }
18
- const hours = Math.floor(seconds / 3600);
19
- const minutes = Math.floor((seconds % 3600) / 60);
20
- return `${hours}h ${minutes}m`;
21
- }
22
- /**
23
- * Format time ago.
24
- */
25
- function formatTimeAgo(isoDate) {
26
- const then = new Date(isoDate).getTime();
27
- const now = Date.now();
28
- const seconds = Math.floor((now - then) / 1000);
29
- if (seconds < 60) {
30
- return `${seconds}s ago`;
31
- }
32
- if (seconds < 3600) {
33
- return `${Math.floor(seconds / 60)}m ${seconds % 60}s ago`;
34
- }
35
- if (seconds < 86400) {
36
- return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m ago`;
37
- }
38
- return `${Math.floor(seconds / 86400)}d ago`;
39
- }
40
- /**
41
- * Check if a URL is reachable and optionally parse JSON response.
42
- */
43
- async function fetchJson(url) {
44
- try {
45
- const response = await fetch(url, {
46
- signal: AbortSignal.timeout(3000),
47
- });
48
- if (!response.ok)
49
- return null;
50
- return (await response.json());
51
- }
52
- catch {
53
- return null;
54
- }
55
- }
56
- /**
57
- * Check if a port is reachable (any response).
58
- */
59
- async function checkPort(url) {
60
- try {
61
- await fetch(url, {
62
- signal: AbortSignal.timeout(3000),
63
- });
64
- return true;
65
- }
66
- catch {
67
- return false;
68
- }
69
- }
70
- /**
71
- * Categorize connection error.
72
- */
73
- async function categorizeError(url) {
74
- try {
75
- await fetch(url, {
76
- signal: AbortSignal.timeout(3000),
77
- });
78
- return "ok";
79
- }
80
- catch (error) {
81
- const err = error;
82
- if (err.name === "TimeoutError") {
83
- return "timeout";
84
- }
85
- if (err.cause?.code === "ECONNREFUSED") {
86
- return "connection refused";
87
- }
88
- if (err.cause?.code === "ENOTFOUND") {
89
- return "host not found";
90
- }
91
- return "unreachable";
92
- }
93
- }
94
- export async function doctorCommand() {
95
- const config = loadConfig();
96
- const restBaseUrl = `http://127.0.0.1:${config.listenPort}`;
97
- const proxyBaseUrl = `http://127.0.0.1:${config.mcpProxyPort}`;
98
- const suggestions = [];
99
- let hasErrors = false;
100
- // === DAEMON STATUS ===
101
- console.log("Daemon");
102
- console.log("======");
103
- const pid = readPidFile();
104
- const processRunning = pid !== null && isProcessRunning(pid);
105
- if (!processRunning) {
106
- console.log("State: stopped");
107
- if (pid === null) {
108
- console.log("Reason: No PID file found");
109
- }
110
- else {
111
- console.log(`Reason: Stale PID file (${pid} not running)`);
112
- }
113
- hasErrors = true;
114
- suggestions.push("Run: agent-recorder start --daemon");
115
- console.log("");
116
- }
117
- else {
118
- // Get health info
119
- const health = await fetchJson(`${restBaseUrl}/api/health`);
120
- console.log("State: running");
121
- console.log(`PID: ${pid}`);
122
- console.log(`Mode: ${health?.mode ?? "unknown"}`);
123
- if (health?.uptime !== undefined) {
124
- console.log(`Uptime: ${formatUptime(health.uptime)}`);
125
- }
126
- // Check REST API
127
- const restOk = health !== null;
128
- console.log(`REST API: ${restBaseUrl} ${restOk ? "(\u2713)" : "(\u2717)"}`);
129
- if (!restOk)
130
- hasErrors = true;
131
- // Check MCP Proxy
132
- const proxyOk = await checkPort(`${proxyBaseUrl}/`);
133
- console.log(`MCP Proxy: ${proxyBaseUrl} ${proxyOk ? "(\u2713)" : "(\u2717)"}`);
134
- if (!proxyOk)
135
- hasErrors = true;
136
- console.log("");
137
- }
138
- // === CONFIGURATION ===
139
- console.log("Configuration");
140
- console.log("=============");
141
- const claudeConfig = detectClaudeConfig();
142
- const expectedUrl = `http://127.0.0.1:${config.mcpProxyPort}/`;
143
- if (claudeConfig.kind === "none") {
144
- console.log("Claude Config: not found");
145
- console.log(` Checked: ${formatPath(getV2ConfigPath())}`);
146
- console.log(` ${formatPath(getLegacyConfigPath())}`);
147
- suggestions.push("Run: agent-recorder configure claude");
148
- }
149
- else {
150
- console.log(`Claude Config: ${formatPath(claudeConfig.path)} (${claudeConfig.kind})`);
151
- const configData = readJsonFile(claudeConfig.path);
152
- if (configData === null) {
153
- console.log("MCP Entry: error reading file");
154
- hasErrors = true;
155
- }
156
- else {
157
- const entry = getMcpServerEntry(configData);
158
- if (entry === null) {
159
- console.log("MCP Entry: not present");
160
- suggestions.push("Run: agent-recorder configure claude");
161
- }
162
- else {
163
- console.log("MCP Entry: present");
164
- if (entry.url) {
165
- const matches = entry.url === expectedUrl;
166
- const symbol = matches
167
- ? "\u2713 matches"
168
- : `\u2717 expected ${expectedUrl}`;
169
- console.log(`URL: ${entry.url} (${symbol})`);
170
- if (!matches) {
171
- suggestions.push("Run: agent-recorder configure claude");
172
- }
173
- }
174
- else if (entry.command) {
175
- console.log(`Command: ${entry.command} (stdio mode)`);
176
- }
177
- }
178
- }
179
- }
180
- console.log("");
181
- // === DOWNSTREAM MCP ===
182
- console.log("Downstream MCP");
183
- console.log("==============");
184
- if (!config.downstreamMcpUrl) {
185
- console.log("Configured: not set");
186
- console.log(" (proxy will return 503 for MCP requests)");
187
- suggestions.push("Set AR_DOWNSTREAM_MCP_URL environment variable");
188
- suggestions.push("Or test with: agent-recorder mock-mcp --port 9999");
189
- }
190
- else {
191
- console.log(`Configured: ${config.downstreamMcpUrl}`);
192
- const errorType = await categorizeError(config.downstreamMcpUrl);
193
- if (errorType === "ok") {
194
- console.log("Reachable: \u2713");
195
- }
196
- else {
197
- console.log(`Reachable: \u2717 (${errorType})`);
198
- hasErrors = true;
199
- if (errorType === "connection refused") {
200
- suggestions.push("Check if downstream MCP server is running");
201
- }
202
- }
203
- }
204
- console.log("");
205
- // === RECORDING HEALTH ===
206
- console.log("Recording");
207
- console.log("=========");
208
- if (processRunning) {
209
- // Get current session
210
- const currentSession = await fetchJson(`${restBaseUrl}/api/sessions/current`);
211
- if (currentSession) {
212
- console.log(`Session: ${currentSession.id.slice(0, 12)}... (${currentSession.status})`);
213
- // Get event count
214
- const countResponse = await fetchJson(`${restBaseUrl}/api/sessions/${currentSession.id}/events/count`);
215
- if (countResponse) {
216
- console.log(`Events: ${countResponse.count}`);
217
- }
218
- // Get latest tool_call
219
- const latestEvent = await fetchJson(`${restBaseUrl}/api/sessions/${currentSession.id}/events/latest-tool-call`);
220
- if (latestEvent) {
221
- const name = latestEvent.mcpMethod || latestEvent.toolName || "unknown";
222
- console.log(`Last tool_call: ${formatTimeAgo(latestEvent.startedAt)} (${name})`);
223
- }
224
- else {
225
- console.log("Last tool_call: none recorded");
226
- }
227
- }
228
- else {
229
- console.log("Session: none active");
230
- }
231
- }
232
- else {
233
- console.log("Session: (daemon not running)");
234
- }
235
- console.log("");
236
- // === SUGGESTED ACTIONS ===
237
- if (suggestions.length > 0) {
238
- console.log("Suggested Actions");
239
- console.log("=================");
240
- for (const suggestion of suggestions) {
241
- console.log(`\u2192 ${suggestion}`);
242
- }
243
- if (claudeConfig.kind !== "none") {
244
- console.log("\u2192 Restart Claude Code to apply config changes");
245
- }
246
- console.log("");
247
- }
248
- // Exit with error code if issues found
249
- if (hasErrors) {
250
- process.exit(1);
251
- }
252
- }
253
- //# sourceMappingURL=doctor.js.map
@@ -1,5 +0,0 @@
1
- /**
2
- * Doctor command - comprehensive health check and configuration diagnostics.
3
- */
4
- export declare function doctorCommand(): Promise<void>;
5
- //# sourceMappingURL=doctor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0HH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAyLnD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,GAEjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAiBnC;;GAEG;AACH,SAAS,YAAY,CAAC,OAAe;IACnC,IAAI,OAAO,GAAG,EAAE,EAAE,CAAC;QACjB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IACnC,CAAC;IACD,IAAI,OAAO,GAAG,IAAI,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACtC,OAAO,GAAG,OAAO,KAAK,IAAI,GAAG,CAAC;IAChC,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAClD,OAAO,GAAG,KAAK,KAAK,OAAO,GAAG,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,OAAe;IACpC,MAAM,IAAI,GAA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