agent-recorder 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -0
- package/dist/bundle.d.ts +8 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +131 -0
- package/dist/bundle.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics 2.js +205 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d 2.ts +50 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts +50 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js +205 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test 2.js +253 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js +253 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure 2.js +144 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.d 2.ts +17 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts +17 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.js +144 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/configure.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose 2.js +141 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js +141 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/diagnose.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor 2.js +253 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js +253 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/doctor.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export 2.js +56 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.d 2.ts +12 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts +12 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.js +56 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/export.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install 2.js +77 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.d 2.ts +13 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts +13 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.js +77 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/install.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs 2.js +40 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.d 2.ts +8 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts +8 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.js +40 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/logs.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp 2.js +188 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d 2.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js +188 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mock-mcp.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart 2.js +67 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.d 2.ts +9 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts +9 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.js +67 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/restart.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions 2.js +333 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d 2.ts +52 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts +52 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js +333 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start 2.js +174 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.d 2.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.js +174 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/start.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status 2.js +104 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.js +104 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/status.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop 2.js +89 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.d 2.ts +8 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts +8 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.js +89 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/stop.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui 2.js +14 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.js +14 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/tui.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths 2.js +117 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d 2.ts +55 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts +55 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js +117 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test 2.js +152 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js +152 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/index 2.js +194 -0
- package/vendor/node_modules/@agent-recorder/cli/index.d 2.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/index.d.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/index.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/index.js +194 -0
- package/vendor/node_modules/@agent-recorder/cli/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/package 2.json +17 -0
- package/vendor/node_modules/@agent-recorder/cli/package.json +17 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App 2.js +84 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.d 2.ts +6 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts +6 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.js +84 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/App.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api 2.js +105 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.d 2.ts +31 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts +31 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.js +105 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/api.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel 2.js +45 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d 2.ts +11 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts +11 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js +45 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header 2.js +13 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d 2.ts +17 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts +17 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js +13 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Header.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner 2.js +21 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d 2.ts +12 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts +12 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js +21 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Spinner.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge 2.js +50 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d 2.ts +16 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts +16 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js +50 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/StatusBadge.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table 2.js +20 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d 2.ts +21 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts +21 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js +20 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/Table.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index 2.js +8 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d 2.ts +8 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts +8 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js +8 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/components/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream 2.js +75 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d 2.ts +22 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts +22 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js +75 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/hooks/useEventStream.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen 2.js +190 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d 2.ts +13 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts +13 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js +190 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionDetailScreen.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen 2.js +166 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d 2.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts +10 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js +166 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/SessionsScreen.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index 2.js +6 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d 2.ts +6 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts +6 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js +6 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/tui/screens/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/config 2.js +44 -0
- package/vendor/node_modules/@agent-recorder/core/config.d 2.ts +25 -0
- package/vendor/node_modules/@agent-recorder/core/config.d.ts +25 -0
- package/vendor/node_modules/@agent-recorder/core/config.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/config.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/config.js +44 -0
- package/vendor/node_modules/@agent-recorder/core/config.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/config.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/config.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/config.test.js +78 -0
- package/vendor/node_modules/@agent-recorder/core/config.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.d.ts +50 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.js +113 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.js +143 -0
- package/vendor/node_modules/@agent-recorder/core/daemon-paths.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/connection.d 2.ts +15 -0
- package/vendor/node_modules/@agent-recorder/core/db/connection.d.ts +15 -0
- package/vendor/node_modules/@agent-recorder/core/db/connection.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/connection.js +30 -0
- package/vendor/node_modules/@agent-recorder/core/db/connection.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.d.ts +65 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.js +117 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.test.js +72 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/index.d.ts +9 -0
- package/vendor/node_modules/@agent-recorder/core/db/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/index.js +9 -0
- package/vendor/node_modules/@agent-recorder/core/db/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts +17 -0
- package/vendor/node_modules/@agent-recorder/core/db/migrations.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/migrations.js +56 -0
- package/vendor/node_modules/@agent-recorder/core/db/migrations.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/sequences.d.ts +17 -0
- package/vendor/node_modules/@agent-recorder/core/db/sequences.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/sequences.js +41 -0
- package/vendor/node_modules/@agent-recorder/core/db/sequences.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts +17 -0
- package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/sessions.js +61 -0
- package/vendor/node_modules/@agent-recorder/core/db/sessions.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/index.d.ts +13 -0
- package/vendor/node_modules/@agent-recorder/core/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/index.js +13 -0
- package/vendor/node_modules/@agent-recorder/core/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.d.ts +42 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.js +122 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.test.js +136 -0
- package/vendor/node_modules/@agent-recorder/core/lockfile.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/001_initial 2.sql +40 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/001_initial.sql +40 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/002_session_sequences 2.sql +8 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/002_session_sequences.sql +8 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/003_add_tool_columns 2.sql +9 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/003_add_tool_columns.sql +9 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/004_add_cancelled_status 2.sql +23 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/004_add_cancelled_status.sql +23 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/005_add_error_category 2.sql +6 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/005_add_error_category.sql +6 -0
- package/vendor/node_modules/@agent-recorder/core/package 2.json +18 -0
- package/vendor/node_modules/@agent-recorder/core/package.json +18 -0
- package/vendor/node_modules/@agent-recorder/core/types/events.d 2.ts +69 -0
- package/vendor/node_modules/@agent-recorder/core/types/events.d.ts +69 -0
- package/vendor/node_modules/@agent-recorder/core/types/events.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/events.js +6 -0
- package/vendor/node_modules/@agent-recorder/core/types/events.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/index 2.js +2 -0
- package/vendor/node_modules/@agent-recorder/core/types/index.d.ts +3 -0
- package/vendor/node_modules/@agent-recorder/core/types/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/index.js +2 -0
- package/vendor/node_modules/@agent-recorder/core/types/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/session 2.js +6 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.d 2.ts +22 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.d.ts +22 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.js +6 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/session.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category 2.js +58 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.d 2.ts +22 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts +22 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.js +58 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js +89 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/error-category.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index 2.js +6 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.d 2.ts +6 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts +6 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.js +6 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.d 2.ts +19 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts +19 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.js +52 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/index 2.js +128 -0
- package/vendor/node_modules/@agent-recorder/service/index.d 2.ts +36 -0
- package/vendor/node_modules/@agent-recorder/service/index.d.ts +36 -0
- package/vendor/node_modules/@agent-recorder/service/index.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/index.js +128 -0
- package/vendor/node_modules/@agent-recorder/service/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index 2.js +7 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.d 2.ts +7 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts +7 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.js +7 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy 2.js +223 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d 2.ts +26 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts +26 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js +223 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js +367 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder 2.js +62 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d 2.ts +31 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts +31 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js +62 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types 2.js +15 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.d 2.ts +40 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts +40 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.js +15 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/package 2.json +15 -0
- package/vendor/node_modules/@agent-recorder/service/package.json +15 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events 2.js +71 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.d 2.ts +11 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts +11 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.js +71 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/events.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health 2.js +18 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.d 2.ts +6 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts +6 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.js +18 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/health.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions 2.js +80 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.d 2.ts +12 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts +12 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.js +80 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server 2.js +36 -0
- package/vendor/node_modules/@agent-recorder/service/server.d 2.ts +19 -0
- package/vendor/node_modules/@agent-recorder/service/server.d.ts +19 -0
- package/vendor/node_modules/@agent-recorder/service/server.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.js +36 -0
- package/vendor/node_modules/@agent-recorder/service/server.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.test 2.js +296 -0
- package/vendor/node_modules/@agent-recorder/service/server.test.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/server.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/server.test.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.test.js +296 -0
- package/vendor/node_modules/@agent-recorder/service/server.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager 2.js +22 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.d 2.ts +16 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts +16 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.js +22 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test 2.js +61 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.d 2.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.js +61 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.js 2.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/session-manager.test.js.map +1 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start command - runs the daemon in foreground or background.
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, readFileSync, openSync, constants } from "node:fs";
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
import { loadConfig, getDaemonPaths, acquireLockWithCleanup, isProcessRunning, readPidFile, } from "@agent-recorder/core";
|
|
9
|
+
import { startDaemon } from "@agent-recorder/service";
|
|
10
|
+
/**
|
|
11
|
+
* Load environment variables from a file.
|
|
12
|
+
* Parses KEY=VALUE lines, ignoring comments and empty lines.
|
|
13
|
+
*/
|
|
14
|
+
function loadEnvFile(filePath) {
|
|
15
|
+
if (!existsSync(filePath)) {
|
|
16
|
+
console.error(`Env file not found: ${filePath}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const content = readFileSync(filePath, "utf-8");
|
|
20
|
+
const lines = content.split("\n");
|
|
21
|
+
for (const line of lines) {
|
|
22
|
+
const trimmed = line.trim();
|
|
23
|
+
// Skip empty lines and comments
|
|
24
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const eqIndex = trimmed.indexOf("=");
|
|
28
|
+
if (eqIndex > 0) {
|
|
29
|
+
const key = trimmed.slice(0, eqIndex).trim();
|
|
30
|
+
let value = trimmed.slice(eqIndex + 1).trim();
|
|
31
|
+
// Remove surrounding quotes if present
|
|
32
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
33
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
34
|
+
value = value.slice(1, -1);
|
|
35
|
+
}
|
|
36
|
+
// Only set if not already defined (preserve existing env)
|
|
37
|
+
if (process.env[key] === undefined) {
|
|
38
|
+
process.env[key] = value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function printStartupBanner(mcpProxyPort) {
|
|
44
|
+
console.log(`
|
|
45
|
+
Agent Recorder
|
|
46
|
+
==============
|
|
47
|
+
|
|
48
|
+
Claude Code v2 (recommended):
|
|
49
|
+
Add to ~/.claude/settings.json:
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"agent-recorder": {
|
|
54
|
+
"url": "http://127.0.0.1:${mcpProxyPort}/"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Legacy clients (~/.config/claude/mcp.json):
|
|
60
|
+
Same JSON structure, different location.
|
|
61
|
+
|
|
62
|
+
Then restart Claude Code.
|
|
63
|
+
`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Send SIGTERM to a process and wait for it to exit.
|
|
67
|
+
*/
|
|
68
|
+
async function stopProcess(pid, timeoutMs = 5000) {
|
|
69
|
+
try {
|
|
70
|
+
process.kill(pid, "SIGTERM");
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Process already dead
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
const startTime = Date.now();
|
|
77
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
78
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
79
|
+
if (!isProcessRunning(pid)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
export async function startCommand(options = {}) {
|
|
86
|
+
// Load env file before anything else if specified
|
|
87
|
+
if (options.envFile) {
|
|
88
|
+
loadEnvFile(options.envFile);
|
|
89
|
+
}
|
|
90
|
+
const config = loadConfig();
|
|
91
|
+
const paths = getDaemonPaths();
|
|
92
|
+
// Check for existing daemon
|
|
93
|
+
const existingPid = readPidFile();
|
|
94
|
+
if (existingPid && isProcessRunning(existingPid)) {
|
|
95
|
+
if (options.force) {
|
|
96
|
+
console.log(`Stopping existing daemon (PID ${existingPid})...`);
|
|
97
|
+
const stopped = await stopProcess(existingPid);
|
|
98
|
+
if (!stopped) {
|
|
99
|
+
console.error("Failed to stop existing daemon. Try: agent-recorder stop --force");
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
console.log("Existing daemon stopped.");
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
console.error(`Daemon is already running (PID ${existingPid}).\n` +
|
|
106
|
+
"Use --force to restart, or run: agent-recorder stop");
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Try to acquire lock
|
|
111
|
+
const lockResult = acquireLockWithCleanup(paths.lockFile, paths.pidFile);
|
|
112
|
+
if (!lockResult.acquired) {
|
|
113
|
+
if (lockResult.existingPid) {
|
|
114
|
+
console.error(`Another instance is running (PID ${lockResult.existingPid}).\n` +
|
|
115
|
+
"Use --force to restart, or run: agent-recorder stop");
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
console.error(`Failed to acquire lock: ${lockResult.error}`);
|
|
119
|
+
}
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
if (options.daemon) {
|
|
123
|
+
// Daemon mode: fork and exit parent
|
|
124
|
+
console.log("Starting daemon in background...");
|
|
125
|
+
// Find the service entry point
|
|
126
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
127
|
+
const __dirname = dirname(__filename);
|
|
128
|
+
const serviceEntry = join(__dirname, "..", "..", "..", "service", "dist", "index.js");
|
|
129
|
+
// Open log file for daemon output
|
|
130
|
+
const logFd = openSync(paths.logFile, constants.O_WRONLY | constants.O_CREAT | constants.O_APPEND);
|
|
131
|
+
// Build args for child process
|
|
132
|
+
const args = [serviceEntry, "--daemon"];
|
|
133
|
+
if (options.envFile) {
|
|
134
|
+
args.push("--env-file", options.envFile);
|
|
135
|
+
}
|
|
136
|
+
// Spawn detached child process
|
|
137
|
+
const child = spawn(process.execPath, args, {
|
|
138
|
+
detached: true,
|
|
139
|
+
stdio: ["ignore", logFd, logFd],
|
|
140
|
+
env: {
|
|
141
|
+
...process.env,
|
|
142
|
+
AR_DAEMON_MODE: "1",
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
child.unref();
|
|
146
|
+
// Wait for daemon to start (poll for PID file up to 5 seconds)
|
|
147
|
+
let newPid = null;
|
|
148
|
+
const maxAttempts = 10;
|
|
149
|
+
for (let i = 0; i < maxAttempts; i++) {
|
|
150
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
151
|
+
newPid = readPidFile();
|
|
152
|
+
if (newPid && isProcessRunning(newPid)) {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Check if daemon started successfully
|
|
157
|
+
if (newPid && isProcessRunning(newPid)) {
|
|
158
|
+
console.log(`Daemon started (PID ${newPid})`);
|
|
159
|
+
console.log(`Log file: ${paths.logFile}`);
|
|
160
|
+
console.log(`\nRun 'agent-recorder status' to check status.`);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
console.error("Failed to start daemon. Check log file for details:");
|
|
164
|
+
console.error(` ${paths.logFile}`);
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
// Foreground mode: run directly
|
|
170
|
+
printStartupBanner(config.mcpProxyPort);
|
|
171
|
+
await startDaemon({ daemon: false });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;GAGG;AACH,SAAS,WAAW,CAAC,QAAgB;IACnC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,KAAK,CAAC,uBAAuB,QAAQ,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,gCAAgC;QAChC,IAAI,CAAC,OAAO,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AAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACxC,MAAM,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status command - comprehensive daemon status display.
|
|
3
|
+
*/
|
|
4
|
+
import { loadConfig, getDaemonPaths, readPidFile, isProcessRunning, } from "@agent-recorder/core";
|
|
5
|
+
/**
|
|
6
|
+
* Format uptime in human-readable form.
|
|
7
|
+
*/
|
|
8
|
+
function formatUptime(seconds) {
|
|
9
|
+
if (seconds < 60) {
|
|
10
|
+
return `${Math.floor(seconds)}s`;
|
|
11
|
+
}
|
|
12
|
+
if (seconds < 3600) {
|
|
13
|
+
const minutes = Math.floor(seconds / 60);
|
|
14
|
+
const secs = Math.floor(seconds % 60);
|
|
15
|
+
return `${minutes}m ${secs}s`;
|
|
16
|
+
}
|
|
17
|
+
const hours = Math.floor(seconds / 3600);
|
|
18
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
|
19
|
+
return `${hours}h ${minutes}m`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if a port is reachable via HTTP.
|
|
23
|
+
* For MCP proxy, we accept any response (including 404/503) as "reachable".
|
|
24
|
+
*/
|
|
25
|
+
async function checkPort(port, path, acceptAnyResponse = false) {
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(`http://127.0.0.1:${port}${path}`, {
|
|
28
|
+
method: "GET",
|
|
29
|
+
signal: AbortSignal.timeout(2000),
|
|
30
|
+
});
|
|
31
|
+
// For REST API, require 2xx. For MCP proxy, any response means reachable.
|
|
32
|
+
return acceptAnyResponse || response.ok;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export async function statusCommand() {
|
|
39
|
+
const config = loadConfig();
|
|
40
|
+
const paths = getDaemonPaths();
|
|
41
|
+
console.log("Agent Recorder Status");
|
|
42
|
+
console.log("=====================");
|
|
43
|
+
// Check PID file
|
|
44
|
+
const pid = readPidFile();
|
|
45
|
+
const processRunning = pid !== null && isProcessRunning(pid);
|
|
46
|
+
if (!processRunning) {
|
|
47
|
+
// Determine why not running
|
|
48
|
+
if (pid === null) {
|
|
49
|
+
console.log("State: stopped");
|
|
50
|
+
console.log("Reason: No PID file found");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
console.log("State: stopped");
|
|
54
|
+
console.log(`Reason: Stale PID file (${pid} not running)`);
|
|
55
|
+
}
|
|
56
|
+
console.log("");
|
|
57
|
+
console.log(`DB Path: ${paths.dbFile}`);
|
|
58
|
+
console.log("");
|
|
59
|
+
console.log("Run 'agent-recorder start --daemon' to start.");
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
// Process is running, try to get health info
|
|
63
|
+
let health = null;
|
|
64
|
+
try {
|
|
65
|
+
const response = await fetch(`http://127.0.0.1:${config.listenPort}/api/health`, { signal: AbortSignal.timeout(2000) });
|
|
66
|
+
if (response.ok) {
|
|
67
|
+
health = (await response.json());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Health endpoint not reachable
|
|
72
|
+
}
|
|
73
|
+
// Check port availability
|
|
74
|
+
const restApiReachable = await checkPort(config.listenPort, "/api/health");
|
|
75
|
+
const mcpProxyReachable = await checkPort(config.mcpProxyPort, "/", true);
|
|
76
|
+
// Display status
|
|
77
|
+
console.log("State: running");
|
|
78
|
+
console.log(`Mode: ${health?.mode ?? "unknown"}`);
|
|
79
|
+
console.log(`PID: ${pid}`);
|
|
80
|
+
if (health?.uptime !== undefined) {
|
|
81
|
+
console.log(`Uptime: ${formatUptime(health.uptime)}`);
|
|
82
|
+
}
|
|
83
|
+
console.log(`REST API: http://127.0.0.1:${config.listenPort} ${restApiReachable ? "(✓)" : "(✗)"}`);
|
|
84
|
+
console.log(`MCP Proxy: http://127.0.0.1:${config.mcpProxyPort} ${mcpProxyReachable ? "(✓)" : "(✗)"}`);
|
|
85
|
+
if (health?.sessionId) {
|
|
86
|
+
console.log(`Session: active (id: ${health.sessionId.slice(0, 8)}...)`);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
console.log("Session: unknown");
|
|
90
|
+
}
|
|
91
|
+
console.log(`DB Path: ${paths.dbFile}`);
|
|
92
|
+
// Show warnings
|
|
93
|
+
if (!restApiReachable) {
|
|
94
|
+
console.log("");
|
|
95
|
+
console.log("⚠ REST API is not reachable. Check the log file:");
|
|
96
|
+
console.log(` ${paths.logFile}`);
|
|
97
|
+
}
|
|
98
|
+
if (!mcpProxyReachable) {
|
|
99
|
+
console.log("");
|
|
100
|
+
console.log("⚠ MCP Proxy is not reachable. Check the log file:");
|
|
101
|
+
console.log(` ${paths.logFile}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwDH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAkFnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwDH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAkFnD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status command - comprehensive daemon status display.
|
|
3
|
+
*/
|
|
4
|
+
import { loadConfig, getDaemonPaths, readPidFile, isProcessRunning, } from "@agent-recorder/core";
|
|
5
|
+
/**
|
|
6
|
+
* Format uptime in human-readable form.
|
|
7
|
+
*/
|
|
8
|
+
function formatUptime(seconds) {
|
|
9
|
+
if (seconds < 60) {
|
|
10
|
+
return `${Math.floor(seconds)}s`;
|
|
11
|
+
}
|
|
12
|
+
if (seconds < 3600) {
|
|
13
|
+
const minutes = Math.floor(seconds / 60);
|
|
14
|
+
const secs = Math.floor(seconds % 60);
|
|
15
|
+
return `${minutes}m ${secs}s`;
|
|
16
|
+
}
|
|
17
|
+
const hours = Math.floor(seconds / 3600);
|
|
18
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
|
19
|
+
return `${hours}h ${minutes}m`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if a port is reachable via HTTP.
|
|
23
|
+
* For MCP proxy, we accept any response (including 404/503) as "reachable".
|
|
24
|
+
*/
|
|
25
|
+
async function checkPort(port, path, acceptAnyResponse = false) {
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(`http://127.0.0.1:${port}${path}`, {
|
|
28
|
+
method: "GET",
|
|
29
|
+
signal: AbortSignal.timeout(2000),
|
|
30
|
+
});
|
|
31
|
+
// For REST API, require 2xx. For MCP proxy, any response means reachable.
|
|
32
|
+
return acceptAnyResponse || response.ok;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export async function statusCommand() {
|
|
39
|
+
const config = loadConfig();
|
|
40
|
+
const paths = getDaemonPaths();
|
|
41
|
+
console.log("Agent Recorder Status");
|
|
42
|
+
console.log("=====================");
|
|
43
|
+
// Check PID file
|
|
44
|
+
const pid = readPidFile();
|
|
45
|
+
const processRunning = pid !== null && isProcessRunning(pid);
|
|
46
|
+
if (!processRunning) {
|
|
47
|
+
// Determine why not running
|
|
48
|
+
if (pid === null) {
|
|
49
|
+
console.log("State: stopped");
|
|
50
|
+
console.log("Reason: No PID file found");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
console.log("State: stopped");
|
|
54
|
+
console.log(`Reason: Stale PID file (${pid} not running)`);
|
|
55
|
+
}
|
|
56
|
+
console.log("");
|
|
57
|
+
console.log(`DB Path: ${paths.dbFile}`);
|
|
58
|
+
console.log("");
|
|
59
|
+
console.log("Run 'agent-recorder start --daemon' to start.");
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
// Process is running, try to get health info
|
|
63
|
+
let health = null;
|
|
64
|
+
try {
|
|
65
|
+
const response = await fetch(`http://127.0.0.1:${config.listenPort}/api/health`, { signal: AbortSignal.timeout(2000) });
|
|
66
|
+
if (response.ok) {
|
|
67
|
+
health = (await response.json());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Health endpoint not reachable
|
|
72
|
+
}
|
|
73
|
+
// Check port availability
|
|
74
|
+
const restApiReachable = await checkPort(config.listenPort, "/api/health");
|
|
75
|
+
const mcpProxyReachable = await checkPort(config.mcpProxyPort, "/", true);
|
|
76
|
+
// Display status
|
|
77
|
+
console.log("State: running");
|
|
78
|
+
console.log(`Mode: ${health?.mode ?? "unknown"}`);
|
|
79
|
+
console.log(`PID: ${pid}`);
|
|
80
|
+
if (health?.uptime !== undefined) {
|
|
81
|
+
console.log(`Uptime: ${formatUptime(health.uptime)}`);
|
|
82
|
+
}
|
|
83
|
+
console.log(`REST API: http://127.0.0.1:${config.listenPort} ${restApiReachable ? "(✓)" : "(✗)"}`);
|
|
84
|
+
console.log(`MCP Proxy: http://127.0.0.1:${config.mcpProxyPort} ${mcpProxyReachable ? "(✓)" : "(✗)"}`);
|
|
85
|
+
if (health?.sessionId) {
|
|
86
|
+
console.log(`Session: active (id: ${health.sessionId.slice(0, 8)}...)`);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
console.log("Session: unknown");
|
|
90
|
+
}
|
|
91
|
+
console.log(`DB Path: ${paths.dbFile}`);
|
|
92
|
+
// Show warnings
|
|
93
|
+
if (!restApiReachable) {
|
|
94
|
+
console.log("");
|
|
95
|
+
console.log("⚠ REST API is not reachable. Check the log file:");
|
|
96
|
+
console.log(` ${paths.logFile}`);
|
|
97
|
+
}
|
|
98
|
+
if (!mcpProxyReachable) {
|
|
99
|
+
console.log("");
|
|
100
|
+
console.log("⚠ MCP Proxy is not reachable. Check the log file:");
|
|
101
|
+
console.log(` ${paths.logFile}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAW9B;;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;;;GAGG;AACH,KAAK,UAAU,SAAS,CACtB,IAAY,EACZ,IAAY,EACZ,iBAAiB,GAAG,KAAK;IAEzB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,oBAAoB,IAAI,GAAG,IAAI,EAAE,EA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AC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stop command - stops a running daemon.
|
|
3
|
+
*/
|
|
4
|
+
import { getDaemonPaths, readPidFile, removePidFile, isProcessRunning, releaseLock, } from "@agent-recorder/core";
|
|
5
|
+
/**
|
|
6
|
+
* Wait for a process to exit.
|
|
7
|
+
*/
|
|
8
|
+
async function waitForExit(pid, timeoutMs) {
|
|
9
|
+
const startTime = Date.now();
|
|
10
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
11
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
12
|
+
if (!isProcessRunning(pid)) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
export async function stopCommand(options = {}) {
|
|
19
|
+
const paths = getDaemonPaths();
|
|
20
|
+
// Read PID file
|
|
21
|
+
const pid = readPidFile();
|
|
22
|
+
if (pid === null) {
|
|
23
|
+
console.log("Daemon is not running (no PID file).");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Check if process is running
|
|
27
|
+
if (!isProcessRunning(pid)) {
|
|
28
|
+
console.log(`Daemon is not running (stale PID ${pid}).`);
|
|
29
|
+
// Clean up stale files
|
|
30
|
+
removePidFile();
|
|
31
|
+
releaseLock(paths.lockFile);
|
|
32
|
+
console.log("Cleaned up stale files.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Send SIGTERM
|
|
36
|
+
console.log(`Stopping daemon (PID ${pid})...`);
|
|
37
|
+
try {
|
|
38
|
+
process.kill(pid, "SIGTERM");
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const err = error;
|
|
42
|
+
if (err.code === "ESRCH") {
|
|
43
|
+
console.log("Process already exited.");
|
|
44
|
+
removePidFile();
|
|
45
|
+
releaseLock(paths.lockFile);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (err.code === "EPERM") {
|
|
49
|
+
console.error("Permission denied. Cannot stop the daemon.");
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
// Wait for process to exit (5 seconds)
|
|
55
|
+
const exited = await waitForExit(pid, 5000);
|
|
56
|
+
if (exited) {
|
|
57
|
+
console.log("Daemon stopped successfully.");
|
|
58
|
+
// Clean up (daemon should clean up on exit, but ensure cleanup)
|
|
59
|
+
removePidFile();
|
|
60
|
+
releaseLock(paths.lockFile);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Process didn't exit in time
|
|
64
|
+
if (options.force) {
|
|
65
|
+
console.log("Process did not exit, sending SIGKILL...");
|
|
66
|
+
try {
|
|
67
|
+
process.kill(pid, "SIGKILL");
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Process may have exited between check and kill
|
|
71
|
+
}
|
|
72
|
+
// Wait a bit more
|
|
73
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
74
|
+
if (!isProcessRunning(pid)) {
|
|
75
|
+
console.log("Daemon killed.");
|
|
76
|
+
removePidFile();
|
|
77
|
+
releaseLock(paths.lockFile);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.error("Failed to kill daemon.");
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
console.error("Daemon did not stop within 5 seconds.\n" + "Use --force to send SIGKILL.");
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=stop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAgBD,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA4Ef"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAgBD,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA4Ef"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stop command - stops a running daemon.
|
|
3
|
+
*/
|
|
4
|
+
import { getDaemonPaths, readPidFile, removePidFile, isProcessRunning, releaseLock, } from "@agent-recorder/core";
|
|
5
|
+
/**
|
|
6
|
+
* Wait for a process to exit.
|
|
7
|
+
*/
|
|
8
|
+
async function waitForExit(pid, timeoutMs) {
|
|
9
|
+
const startTime = Date.now();
|
|
10
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
11
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
12
|
+
if (!isProcessRunning(pid)) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
export async function stopCommand(options = {}) {
|
|
19
|
+
const paths = getDaemonPaths();
|
|
20
|
+
// Read PID file
|
|
21
|
+
const pid = readPidFile();
|
|
22
|
+
if (pid === null) {
|
|
23
|
+
console.log("Daemon is not running (no PID file).");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Check if process is running
|
|
27
|
+
if (!isProcessRunning(pid)) {
|
|
28
|
+
console.log(`Daemon is not running (stale PID ${pid}).`);
|
|
29
|
+
// Clean up stale files
|
|
30
|
+
removePidFile();
|
|
31
|
+
releaseLock(paths.lockFile);
|
|
32
|
+
console.log("Cleaned up stale files.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Send SIGTERM
|
|
36
|
+
console.log(`Stopping daemon (PID ${pid})...`);
|
|
37
|
+
try {
|
|
38
|
+
process.kill(pid, "SIGTERM");
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const err = error;
|
|
42
|
+
if (err.code === "ESRCH") {
|
|
43
|
+
console.log("Process already exited.");
|
|
44
|
+
removePidFile();
|
|
45
|
+
releaseLock(paths.lockFile);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (err.code === "EPERM") {
|
|
49
|
+
console.error("Permission denied. Cannot stop the daemon.");
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
// Wait for process to exit (5 seconds)
|
|
55
|
+
const exited = await waitForExit(pid, 5000);
|
|
56
|
+
if (exited) {
|
|
57
|
+
console.log("Daemon stopped successfully.");
|
|
58
|
+
// Clean up (daemon should clean up on exit, but ensure cleanup)
|
|
59
|
+
removePidFile();
|
|
60
|
+
releaseLock(paths.lockFile);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Process didn't exit in time
|
|
64
|
+
if (options.force) {
|
|
65
|
+
console.log("Process did not exit, sending SIGKILL...");
|
|
66
|
+
try {
|
|
67
|
+
process.kill(pid, "SIGKILL");
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Process may have exited between check and kill
|
|
71
|
+
}
|
|
72
|
+
// Wait a bit more
|
|
73
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
74
|
+
if (!isProcessRunning(pid)) {
|
|
75
|
+
console.log("Daemon killed.");
|
|
76
|
+
removePidFile();
|
|
77
|
+
releaseLock(paths.lockFile);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.error("Failed to kill daemon.");
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
console.error("Daemon did not stop within 5 seconds.\n" + "Use --force to send SIGKILL.");
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=stop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAM9B;;GAEG;AACH,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,SAAiB;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,UAA8B,EAAE;IAEhC,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAE/B,gBAAgB;IAChB,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC;IAC1B,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO;IACT,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,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