dashcam 0.8.4 → 1.0.1-beta.2

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 (55) hide show
  1. package/.dashcam/cli-config.json +3 -0
  2. package/.dashcam/recording.log +135 -0
  3. package/.dashcam/web-config.json +11 -0
  4. package/.github/RELEASE.md +59 -0
  5. package/.github/workflows/build.yml +103 -0
  6. package/.github/workflows/publish.yml +43 -0
  7. package/.github/workflows/release.yml +107 -0
  8. package/LOG_TRACKING_GUIDE.md +225 -0
  9. package/README.md +709 -155
  10. package/bin/dashcam.cjs +8 -0
  11. package/bin/dashcam.js +542 -0
  12. package/bin/index.js +63 -0
  13. package/examples/execute-script.js +152 -0
  14. package/examples/simple-test.js +37 -0
  15. package/lib/applicationTracker.js +311 -0
  16. package/lib/auth.js +222 -0
  17. package/lib/binaries.js +21 -0
  18. package/lib/config.js +34 -0
  19. package/lib/extension-logs/helpers.js +182 -0
  20. package/lib/extension-logs/index.js +347 -0
  21. package/lib/extension-logs/manager.js +344 -0
  22. package/lib/ffmpeg.js +156 -0
  23. package/lib/logTracker.js +23 -0
  24. package/lib/logger.js +118 -0
  25. package/lib/logs/index.js +432 -0
  26. package/lib/permissions.js +85 -0
  27. package/lib/processManager.js +255 -0
  28. package/lib/recorder.js +675 -0
  29. package/lib/store.js +58 -0
  30. package/lib/tracking/FileTracker.js +98 -0
  31. package/lib/tracking/FileTrackerManager.js +62 -0
  32. package/lib/tracking/LogsTracker.js +147 -0
  33. package/lib/tracking/active-win.js +212 -0
  34. package/lib/tracking/icons/darwin.js +39 -0
  35. package/lib/tracking/icons/index.js +167 -0
  36. package/lib/tracking/icons/windows.js +27 -0
  37. package/lib/tracking/idle.js +82 -0
  38. package/lib/tracking.js +23 -0
  39. package/lib/uploader.js +449 -0
  40. package/lib/utilities/jsonl.js +77 -0
  41. package/lib/webLogsDaemon.js +234 -0
  42. package/lib/websocket/server.js +223 -0
  43. package/package.json +50 -21
  44. package/recording.log +814 -0
  45. package/sea-bundle.mjs +34595 -0
  46. package/test-page.html +15 -0
  47. package/test.log +1 -0
  48. package/test_run.log +48 -0
  49. package/test_workflow.sh +80 -0
  50. package/examples/crash-test.js +0 -11
  51. package/examples/github-issue.sh +0 -1
  52. package/examples/protocol.html +0 -22
  53. package/index.js +0 -158
  54. package/lib.js +0 -199
  55. package/recorder.js +0 -85
@@ -0,0 +1,3 @@
1
+ {
2
+ "/tmp/test-cli-log.txt": true
3
+ }
@@ -0,0 +1,135 @@
1
+ 23:53:59.852 [info] Started tracking logs for /tmp/test-cli-log.txt
2
+ 23:53:59.940 [info] Generated temp file path
3
+ 23:53:59.941 [info] Wrote temp file info to disk
4
+ 23:53:59.941 [info] Starting recording with options:
5
+ 23:53:59.961 [info] FFmpeg process spawned
6
+ Background recording started
7
+ Background recording started
8
+ 23:53:59.987 [info] Started tracking logs for /tmp/test-cli-log.txt
9
+ 23:53:59.987 [info] Started new logs tracker instance
10
+ 23:53:59.988 [info] Recording process started successfully
11
+ 23:53:59.988 [info] Background recording signal handlers registered
12
+ 23:53:59.995 [info] FFmpeg output: ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
13
+ built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
14
+ configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libvmaf --enable-libbluray --enable-libopenjpeg --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libwebp --enable-libass --enable-libfreetype --enable-fontconfig --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-libzimg --enable-libsvtav1 --enable-libkvazaar --enable-version3 --pkg-config-flags=--static --enable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
15
+ libavutil 58. 2.100 / 58. 2.100
16
+ libavcodec 60. 3.100 / 60. 3.100
17
+ libavformat 60. 3.100 / 60. 3.100
18
+ libavdevice 60. 1.100 / 60. 1.100
19
+ libavfilter 9. 3.100 / 9. 3.100
20
+ libswscale 7. 1.100 / 7. 1.100
21
+ libswresample 4. 10.100 / 4. 10.100
22
+ libpostproc 57. 1.100 / 57. 1.100
23
+ 23:54:00.583 [info] FFmpeg output: objc[43042]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
24
+ objc[43042]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
25
+ objc[43042]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
26
+ [AVFoundation indev @ 0x15bf04e90] Configuration of video device failed, falling back to default.
27
+ 23:54:00.584 [error] PERMISSION ISSUE DETECTED: Screen recording failed. This happens because the Node.js subprocess doesn't inherit VS Code's screen recording permissions.
28
+ 23:54:00.585 [error] SOLUTION: Add Node.js to screen recording permissions:
29
+ 23:54:00.585 [error] 1. Open System Preferences > Security & Privacy > Privacy > Screen Recording
30
+ 23:54:00.585 [error] 2. Click the lock to unlock
31
+ 23:54:00.585 [error] 3. Click the + button and add: /usr/local/bin/node (or your Node.js installation path)
32
+ 23:54:00.585 [error] 4. Alternatively, find node with: which node
33
+ 23:54:00.585 [error] 5. Restart the terminal after adding permissions
34
+ 23:54:02.962 [warn] Temp file not created yet
35
+ 23:54:05.323 [info] === STOP SIGNAL FILE DETECTED ===
36
+ 23:54:05.324 [info] === SHUTDOWN SIGNAL RECEIVED ===
37
+ Stopping background recording...
38
+ 23:54:05.325 [info] Background recording shutdown initiated
39
+ 23:54:05.325 [info] Stopping recording
40
+ 23:54:11.594 [info] Looking for temp file
41
+ DEBUG: Looking for temp file {
42
+ inMemory: '/Users/ianjennings/Development/dashcam-cli-minimal/tmp/recordings/temp-1761713639939.webm',
43
+ infoFileExists: true,
44
+ infoPath: '/Users/ianjennings/Development/dashcam-cli-minimal/.dashcam/temp-file.json'
45
+ }
46
+ 23:54:11.601 [info] Debug: temp file check
47
+ 23:54:11.606 [info] Enhanced application tracking stopped
48
+ 23:54:11.608 [error] Error in background recording: Recording file is empty or missing
49
+ Error in background recording: Recording file is empty or missing
50
+ 23:54:11.608 [info] Cleaning up background recording process
51
+ 23:54:36.456 [info] Started tracking logs for /tmp/test-cli-log.txt
52
+ 23:54:36.554 [info] Generated temp file path
53
+ 23:54:36.555 [info] Wrote temp file info to disk
54
+ 23:54:36.555 [info] Starting recording with options:
55
+ 23:54:36.578 [info] FFmpeg process spawned
56
+ Background recording started
57
+ Background recording started
58
+ 23:54:36.660 [info] Started tracking logs for /tmp/test-cli-log.txt
59
+ 23:54:36.661 [info] Started new logs tracker instance
60
+ 23:54:36.661 [info] Recording process started successfully
61
+ 23:54:36.661 [info] Background recording signal handlers registered
62
+ 23:54:36.673 [info] FFmpeg output: ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
63
+ built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
64
+ configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libvmaf --enable-libbluray --enable-libopenjpeg --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libwebp --enable-libass --enable-libfreetype --enable-fontconfig --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-libzimg --enable-libsvtav1 --enable-libkvazaar --enable-version3 --pkg-config-flags=--static --enable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
65
+ libavutil 58. 2.100 / 58. 2.100
66
+ libavcodec 60. 3.100 / 60. 3.100
67
+ libavformat 60. 3.100 / 60. 3.100
68
+ libavdevice 60. 1.100 / 60. 1.100
69
+ libavfilter 9. 3.100 / 9. 3.100
70
+ libswscale 7. 1.100 / 7. 1.100
71
+ libswresample 4. 10.100 / 4. 10.100
72
+ libpostproc 57. 1.100 / 57. 1.100
73
+ 23:54:37.202 [info] FFmpeg output: objc[43240]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
74
+ objc[43240]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
75
+ objc[43240]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
76
+ [AVFoundation indev @ 0x150904880] Configuration of video device failed, falling back to default.
77
+ 23:54:37.203 [error] PERMISSION ISSUE DETECTED: Screen recording failed. This happens because the Node.js subprocess doesn't inherit VS Code's screen recording permissions.
78
+ 23:54:37.204 [error] SOLUTION: Add Node.js to screen recording permissions:
79
+ 23:54:37.205 [error] 1. Open System Preferences > Security & Privacy > Privacy > Screen Recording
80
+ 23:54:37.205 [error] 2. Click the lock to unlock
81
+ 23:54:37.205 [error] 3. Click the + button and add: /usr/local/bin/node (or your Node.js installation path)
82
+ 23:54:37.205 [error] 4. Alternatively, find node with: which node
83
+ 23:54:37.240 [error] 5. Restart the terminal after adding permissions
84
+ 23:54:39.580 [warn] Temp file not created yet
85
+ 23:55:03.729 [warn] Failed to get active window
86
+ 23:55:07.654 [info] Started tracking logs for /tmp/test-cli-log.txt
87
+ 23:55:07.783 [info] Generated temp file path
88
+ 23:55:07.783 [info] Wrote temp file info to disk
89
+ 23:55:07.784 [info] Starting recording with options:
90
+ 23:55:07.801 [info] FFmpeg process spawned
91
+ Background recording started
92
+ Background recording started
93
+ 23:55:07.825 [info] Started tracking logs for /tmp/test-cli-log.txt
94
+ 23:55:07.825 [info] Started new logs tracker instance
95
+ 23:55:07.825 [info] Recording process started successfully
96
+ 23:55:07.826 [info] Background recording signal handlers registered
97
+ 23:55:07.835 [info] FFmpeg output: ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
98
+ built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
99
+ configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libvmaf --enable-libbluray --enable-libopenjpeg --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libwebp --enable-libass --enable-libfreetype --enable-fontconfig --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-libzimg --enable-libsvtav1 --enable-libkvazaar --enable-version3 --pkg-config-flags=--static --enable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
100
+ libavutil 58. 2.100 / 58. 2.100
101
+ libavcodec 60. 3.100 / 60. 3.100
102
+ libavformat 60. 3.100 / 60. 3.100
103
+ libavdevice 60. 1.100 / 60. 1.100
104
+ libavfilter 9. 3.100 / 9. 3.100
105
+ libswscale 7. 1.100 / 7. 1.100
106
+ libswresample 4. 10.100 / 4. 10.100
107
+ libpostproc 57. 1.100 / 57. 1.100
108
+ 23:55:08.365 [info] FFmpeg output: objc[43507]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
109
+ 23:55:08.367 [info] FFmpeg output: objc[43507]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
110
+ objc[43507]: class `NSKVONotifying_AVCaptureScreenInput' not linked into application
111
+ [AVFoundation indev @ 0x1522047a0] Configuration of video device failed, falling back to default.
112
+ 23:55:08.367 [error] PERMISSION ISSUE DETECTED: Screen recording failed. This happens because the Node.js subprocess doesn't inherit VS Code's screen recording permissions.
113
+ 23:55:08.367 [error] SOLUTION: Add Node.js to screen recording permissions:
114
+ 23:55:08.367 [error] 1. Open System Preferences > Security & Privacy > Privacy > Screen Recording
115
+ 23:55:08.368 [error] 2. Click the lock to unlock
116
+ 23:55:08.368 [error] 3. Click the + button and add: /usr/local/bin/node (or your Node.js installation path)
117
+ 23:55:08.368 [error] 4. Alternatively, find node with: which node
118
+ 23:55:08.368 [error] 5. Restart the terminal after adding permissions
119
+ 23:55:10.803 [warn] Temp file not created yet
120
+ 23:55:17.645 [info] === STOP SIGNAL FILE DETECTED ===
121
+ 23:55:17.646 [info] === SHUTDOWN SIGNAL RECEIVED ===
122
+ Stopping background recording...
123
+ 23:55:17.647 [info] Background recording shutdown initiated
124
+ 23:55:17.648 [info] Stopping recording
125
+ 23:55:23.673 [info] Looking for temp file
126
+ DEBUG: Looking for temp file {
127
+ inMemory: '/Users/ianjennings/Development/dashcam-cli-minimal/tmp/recordings/temp-1761713707782.webm',
128
+ infoFileExists: true,
129
+ infoPath: '/Users/ianjennings/Development/dashcam-cli-minimal/.dashcam/temp-file.json'
130
+ }
131
+ 23:55:23.676 [info] Debug: temp file check
132
+ 23:55:23.678 [info] Enhanced application tracking stopped
133
+ 23:55:23.679 [error] Error in background recording: Recording file is empty or missing
134
+ Error in background recording: Recording file is empty or missing
135
+ 23:55:23.680 [info] Cleaning up background recording process
@@ -0,0 +1,11 @@
1
+ {
2
+ "testdriver-tracking": {
3
+ "id": "testdriver-tracking",
4
+ "name": "testdriver-tracking",
5
+ "type": "web",
6
+ "enabled": true,
7
+ "patterns": [
8
+ "*testdriver.ai*"
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,59 @@
1
+ # Release Workflow
2
+
3
+ ## How It Works
4
+
5
+ ### Pull Requests
6
+ - When you create a PR, the build workflow runs automatically
7
+ - Binaries are built for all platforms but **NOT released**
8
+ - Artifacts are uploaded to the PR for testing
9
+
10
+ ### Pushes to Main
11
+ - When code is pushed to `main`, the release workflow automatically:
12
+ 1. **Bumps the version** (creates a git tag)
13
+ 2. **Builds binaries** for all platforms
14
+ 3. **Creates a GitHub release** with all binaries attached
15
+
16
+ ## Version Bumping
17
+
18
+ The version is automatically bumped based on your commit messages:
19
+
20
+ ### Default: Patch Version (1.0.0 → 1.0.1)
21
+ ```bash
22
+ git commit -m "fix: bug fix"
23
+ git commit -m "docs: update documentation"
24
+ ```
25
+
26
+ ### Minor Version (1.0.0 → 1.1.0)
27
+ Include `#minor` or `#feature` in your commit message:
28
+ ```bash
29
+ git commit -m "feat: add new feature #minor"
30
+ git commit -m "new feature #feature"
31
+ ```
32
+
33
+ ### Major Version (1.0.0 → 2.0.0)
34
+ Include `#major` in your commit message:
35
+ ```bash
36
+ git commit -m "breaking: major API change #major"
37
+ git commit -m "refactor: complete rewrite #major"
38
+ ```
39
+
40
+ ### Skip Release
41
+ Include `#none` or `[skip ci]` to skip the release:
42
+ ```bash
43
+ git commit -m "chore: update README #none"
44
+ git commit -m "docs: typo fix [skip ci]"
45
+ ```
46
+
47
+ ## Manual Release
48
+
49
+ You can trigger a release manually from the GitHub Actions tab:
50
+ 1. Go to Actions → Release workflow
51
+ 2. Click "Run workflow"
52
+ 3. Select the branch and run
53
+
54
+ ## Supported Platforms
55
+
56
+ Each release includes binaries for:
57
+ - **macOS**: x64 (Intel) and ARM64 (Apple Silicon)
58
+ - **Linux**: x64 and ARM64
59
+ - **Windows**: x64 and ARM64
@@ -0,0 +1,103 @@
1
+ name: Build Binaries
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ workflow_call:
6
+ inputs:
7
+ upload_artifacts:
8
+ description: 'Whether to upload artifacts'
9
+ required: false
10
+ type: boolean
11
+ default: true
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ matrix:
18
+ os: [ubuntu-latest, macos-latest, windows-latest]
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Setup Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: '20'
28
+ cache: 'npm'
29
+
30
+ - name: Setup Python (Windows)
31
+ if: matrix.os == 'windows-latest'
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: '3.11'
35
+
36
+ - name: Install dependencies
37
+ run: npm ci
38
+
39
+ - name: Build bundle
40
+ run: npm run bundle
41
+
42
+ - name: Verify bundle created
43
+ run: |
44
+ ls -la dist/ || dir dist\
45
+ shell: bash
46
+
47
+ - name: Build binaries (macOS)
48
+ if: matrix.os == 'macos-latest'
49
+ run: npm run build:macos
50
+
51
+ - name: Build binaries (Linux)
52
+ if: matrix.os == 'ubuntu-latest'
53
+ run: npm run build:linux
54
+
55
+ - name: Build binaries (Windows)
56
+ if: matrix.os == 'windows-latest'
57
+ run: npm run build:windows
58
+ continue-on-error: true
59
+
60
+ - name: Check Windows build
61
+ if: matrix.os == 'windows-latest'
62
+ run: |
63
+ if (Test-Path dist/bundle-x64.exe) {
64
+ Write-Host "Windows build successful"
65
+ exit 0
66
+ } else {
67
+ Write-Host "Windows build failed, but continuing..."
68
+ exit 0
69
+ }
70
+ shell: pwsh
71
+
72
+ - name: List built files
73
+ run: |
74
+ ls -la dist/ || dir dist\
75
+ shell: bash
76
+
77
+ - name: Upload artifacts (macOS)
78
+ if: matrix.os == 'macos-latest' && (inputs.upload_artifacts || github.event_name == 'pull_request')
79
+ uses: actions/upload-artifact@v4
80
+ with:
81
+ name: dashcam-macos
82
+ path: |
83
+ dist/bundle-arm64
84
+ dist/bundle-x64
85
+
86
+ - name: Upload artifacts (Linux)
87
+ if: matrix.os == 'ubuntu-latest' && (inputs.upload_artifacts || github.event_name == 'pull_request')
88
+ uses: actions/upload-artifact@v4
89
+ with:
90
+ name: dashcam-linux
91
+ path: |
92
+ dist/bundle-arm64
93
+ dist/bundle-x64
94
+
95
+ - name: Upload artifacts (Windows)
96
+ if: (matrix.os == 'windows-latest' && hashFiles('dist/bundle-x64.exe') != '') && (inputs.upload_artifacts || github.event_name == 'pull_request')
97
+ uses: actions/upload-artifact@v4
98
+ with:
99
+ name: dashcam-windows
100
+ path: |
101
+ dist/bundle-x64.exe
102
+ dist/bundle-arm64.exe
103
+ if-no-files-found: warn
@@ -0,0 +1,43 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ id-token: write
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+ token: ${{ secrets.GITHUB_TOKEN }}
20
+
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '20'
25
+ registry-url: 'https://registry.npmjs.org'
26
+
27
+ - name: Configure Git
28
+ run: |
29
+ git config user.name "github-actions[bot]"
30
+ git config user.email "github-actions[bot]@users.noreply.github.com"
31
+
32
+ - name: Bump version
33
+ run: |
34
+ npm version prerelease --preid=beta -m "chore: bump version to %s [skip ci]"
35
+
36
+ - name: Push changes
37
+ run: |
38
+ git push --follow-tags
39
+
40
+ - name: Publish to npm
41
+ run: npm publish --access public --tag beta
42
+ env:
43
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,107 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: write
8
+
9
+ jobs:
10
+ bump-version:
11
+ runs-on: ubuntu-latest
12
+ # Skip if commit message contains [skip ci] or [skip release]
13
+ if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip release]') }}
14
+ outputs:
15
+ new_tag: ${{ steps.bump.outputs.new_tag }}
16
+ version: ${{ steps.bump.outputs.tag }}
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+ token: ${{ secrets.GITHUB_TOKEN }}
23
+
24
+ - name: Bump version and create tag
25
+ id: bump
26
+ uses: anothrNick/github-tag-action@1.67.0
27
+ env:
28
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
+ WITH_V: true
30
+ DEFAULT_BUMP: patch
31
+ INITIAL_VERSION: 1.0.0
32
+ RELEASE_BRANCHES: main,master
33
+
34
+ build:
35
+ needs: bump-version
36
+ uses: ./.github/workflows/build.yml
37
+ with:
38
+ upload_artifacts: true
39
+
40
+ release:
41
+ needs: [bump-version, build]
42
+ runs-on: ubuntu-latest
43
+ if: needs.bump-version.outputs.new_tag != ''
44
+
45
+ steps:
46
+ - name: Download all artifacts
47
+ uses: actions/download-artifact@v4
48
+ continue-on-error: true
49
+
50
+ - name: List downloaded artifacts
51
+ run: |
52
+ echo "Downloaded artifacts:"
53
+ ls -R
54
+
55
+ - name: Prepare release files
56
+ run: |
57
+ mkdir -p release
58
+ # macOS binaries
59
+ if [ -f dashcam-macos/bundle-arm64 ]; then
60
+ cp dashcam-macos/bundle-arm64 release/dashcam-macos-arm64
61
+ chmod +x release/dashcam-macos-arm64
62
+ fi
63
+ if [ -f dashcam-macos/bundle-x64 ]; then
64
+ cp dashcam-macos/bundle-x64 release/dashcam-macos-x64
65
+ chmod +x release/dashcam-macos-x64
66
+ fi
67
+ # Linux binaries
68
+ if [ -f dashcam-linux/bundle-arm64 ]; then
69
+ cp dashcam-linux/bundle-arm64 release/dashcam-linux-arm64
70
+ chmod +x release/dashcam-linux-arm64
71
+ fi
72
+ if [ -f dashcam-linux/bundle-x64 ]; then
73
+ cp dashcam-linux/bundle-x64 release/dashcam-linux-x64
74
+ chmod +x release/dashcam-linux-x64
75
+ fi
76
+ # Windows binaries
77
+ if [ -f dashcam-windows/bundle-x64.exe ]; then
78
+ cp dashcam-windows/bundle-x64.exe release/dashcam-windows-x64.exe
79
+ fi
80
+ if [ -f dashcam-windows/bundle-arm64.exe ]; then
81
+ cp dashcam-windows/bundle-arm64.exe release/dashcam-windows-arm64.exe
82
+ fi
83
+ ls -la release/
84
+
85
+ - name: Create Release
86
+ uses: softprops/action-gh-release@v1
87
+ with:
88
+ tag_name: ${{ needs.bump-version.outputs.new_tag }}
89
+ name: Release ${{ needs.bump-version.outputs.new_tag }}
90
+ body: |
91
+ ## Dashcam CLI Release ${{ needs.bump-version.outputs.new_tag }}
92
+
93
+ Automated release with binaries for macOS (x64, ARM64), Linux (x64, ARM64), and Windows (x64, ARM64).
94
+
95
+ ### Download Instructions
96
+ - **macOS Intel**: `dashcam-macos-x64`
97
+ - **macOS Apple Silicon**: `dashcam-macos-arm64`
98
+ - **Linux x64**: `dashcam-linux-x64`
99
+ - **Linux ARM64**: `dashcam-linux-arm64`
100
+ - **Windows x64**: `dashcam-windows-x64.exe`
101
+ - **Windows ARM64**: `dashcam-windows-arm64.exe`
102
+ files: release/*
103
+ draft: false
104
+ prerelease: false
105
+ fail_on_unmatched_files: false
106
+ env:
107
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,225 @@
1
+ # Dashcam CLI - Log Tracking Guide
2
+
3
+ The Dashcam CLI can track both **file-based logs** (from CLI applications) and **web browser logs** (from browser extensions). This guide explains how to use the log tracking features.
4
+
5
+ ## File Log Tracking (CLI Applications)
6
+
7
+ ### Adding Log Files to Track
8
+
9
+ Track log files during recordings:
10
+
11
+ ```bash
12
+ # Add a single log file
13
+ dashcam logs --add /var/log/myapp.log
14
+
15
+ # Add multiple log files
16
+ dashcam logs --add /tmp/debug.log
17
+ dashcam logs --add ~/.npm/_logs/npm.log
18
+ dashcam logs --add /var/log/nginx/access.log
19
+ ```
20
+
21
+ ### Removing Log Files
22
+
23
+ ```bash
24
+ # Remove a log file from tracking
25
+ dashcam logs --remove /var/log/myapp.log
26
+ ```
27
+
28
+ ### Viewing Tracked Files
29
+
30
+ ```bash
31
+ # List all currently tracked log files
32
+ dashcam logs --list
33
+
34
+ # Show detailed tracking status
35
+ dashcam logs --status
36
+ ```
37
+
38
+ ## Web Browser Log Tracking
39
+
40
+ ### Setting Up Web App Tracking
41
+
42
+ Web log tracking requires configuring patterns for URLs you want to monitor:
43
+
44
+ ```bash
45
+ # Create a config file for web apps (web-logs.json)
46
+ cat > web-logs.json << 'EOF'
47
+ [
48
+ {
49
+ "id": "my-web-app",
50
+ "type": "web",
51
+ "name": "My Web Application",
52
+ "enabled": true,
53
+ "patterns": [
54
+ "*localhost:3000*",
55
+ "*myapp.com*",
56
+ "*staging.myapp.com*"
57
+ ]
58
+ },
59
+ {
60
+ "id": "github",
61
+ "type": "web",
62
+ "name": "GitHub",
63
+ "enabled": true,
64
+ "patterns": [
65
+ "*github.com*"
66
+ ]
67
+ }
68
+ ]
69
+ EOF
70
+ ```
71
+
72
+ ### Updating Web Log Configuration
73
+
74
+ ```javascript
75
+ // In your Node.js script or through the API
76
+ import { logsTrackerManager } from './lib/logs/index.js';
77
+
78
+ const webConfig = [
79
+ {
80
+ id: 'my-app',
81
+ type: 'web',
82
+ name: 'My Application',
83
+ enabled: true,
84
+ patterns: ['*localhost:3000*', '*myapp.com*']
85
+ }
86
+ ];
87
+
88
+ logsTrackerManager.updateLogsConfig(webConfig);
89
+ ```
90
+
91
+ ## Recording with Log Tracking
92
+
93
+ ### Start a Recording with Logs
94
+
95
+ ```bash
96
+ # Start recording (logs are automatically included if configured)
97
+ dashcam record --duration 30
98
+
99
+ # The recording will include:
100
+ # - All tracked log files (--add files above)
101
+ # - Web browser events (if browser extension is installed)
102
+ ```
103
+
104
+ ### Browser Extension Setup
105
+
106
+ 1. **Install the Dashcam browser extension** (Chrome/Firefox)
107
+ 2. **The CLI automatically starts a WebSocket server** on ports: 10368, 16240, 21855, 24301, or 25928
108
+ 3. **Extension connects automatically** when CLI is running
109
+ 4. **Web events are captured** based on your URL patterns
110
+
111
+ ## Log Event Types
112
+
113
+ ### File Logs
114
+ - **Line events**: Each new line written to tracked files
115
+ - **Timestamps**: Precise timing for synchronization with video
116
+ - **Error detection**: Automatic highlighting of error lines
117
+
118
+ ### Web Logs
119
+ - **Console logs**: `console.log()`, `console.error()`, etc.
120
+ - **Network requests**: HTTP requests and responses
121
+ - **Navigation events**: Page loads and URL changes
122
+ - **Tab management**: Tab switches and window focus
123
+
124
+ ## Example Workflow
125
+
126
+ ```bash
127
+ # 1. Add log files to track
128
+ dashcam logs --add /var/log/myapp.log
129
+ dashcam logs --add /tmp/debug.log
130
+
131
+ # 2. Check status
132
+ dashcam logs --status
133
+ # Output:
134
+ # Log tracking status:
135
+ # Active recording instances: 0
136
+ # Configured CLI log files: 2
137
+ # Total recent events: 15
138
+ # File tracker details:
139
+ # /var/log/myapp.log: 8 events (last minute)
140
+ # /tmp/debug.log: 7 events (last minute)
141
+
142
+ # 3. Start recording
143
+ dashcam record --duration 60
144
+
145
+ # 4. During recording:
146
+ # - CLI monitors all tracked log files in real-time
147
+ # - Browser extension sends web events via WebSocket
148
+ # - All events are timestamped and synchronized
149
+
150
+ # 5. After recording:
151
+ # - Logs are automatically trimmed to match video duration
152
+ # - Events are saved in JSONL format alongside video
153
+ # - Logs can be replayed in sync with video
154
+ ```
155
+
156
+ ## Advanced Configuration
157
+
158
+ ### Custom WebSocket Port
159
+
160
+ ```javascript
161
+ // If you need to use specific ports
162
+ import { server } from './lib/websocket/server.js';
163
+ await server.start(); // Uses predefined port list
164
+ ```
165
+
166
+ ### Pattern Matching for Web Apps
167
+
168
+ Patterns support wildcards:
169
+ - `*example.com*` - Matches any URL containing "example.com"
170
+ - `*localhost:3000*` - Matches local development server
171
+ - `*github.com/myuser/*` - Matches specific GitHub paths
172
+
173
+ ### Log File Requirements
174
+
175
+ - **Files must exist** before adding to tracking
176
+ - **Files must be readable** by the CLI process
177
+ - **Real-time writes** are monitored (uses `tail` library)
178
+ - **Log rotation** is automatically handled
179
+
180
+ ## Troubleshooting
181
+
182
+ ### Common Issues
183
+
184
+ 1. **"Log file does not exist"**
185
+ ```bash
186
+ # Ensure file exists first
187
+ touch /var/log/myapp.log
188
+ dashcam logs --add /var/log/myapp.log
189
+ ```
190
+
191
+ 2. **"WebSocket connection failed"**
192
+ - Check that browser extension is installed
193
+ - Verify no firewall blocking local ports
194
+ - Ensure CLI is running when opening browser
195
+
196
+ 3. **"No events captured"**
197
+ ```bash
198
+ # Check if files are being written to
199
+ tail -f /var/log/myapp.log
200
+
201
+ # Verify tracking status
202
+ dashcam logs --status
203
+ ```
204
+
205
+ ### Getting Help
206
+
207
+ ```bash
208
+ # Show all log tracking options
209
+ dashcam logs --help
210
+
211
+ # Show general CLI help
212
+ dashcam --help
213
+ ```
214
+
215
+ ## Integration with Recordings
216
+
217
+ When you create a recording, all configured logs are:
218
+
219
+ 1. **Automatically included** in the recording
220
+ 2. **Synchronized** with video timestamps
221
+ 3. **Trimmed** to match video start/end times
222
+ 4. **Saved** in JSON Lines format for replay
223
+ 5. **Uploaded** along with video files
224
+
225
+ The result is a complete recording with both visual and log context, making debugging and analysis much more effective.