dsh-x-core 0.1.21 → 0.1.23

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 (50) hide show
  1. package/assets/dsh-preview.png +0 -0
  2. package/assets/dsh.ico +0 -0
  3. package/assets/icon.ico +0 -0
  4. package/assets/tray.ico +0 -0
  5. package/assets/tray.png +0 -0
  6. package/core-npm.js +201 -183
  7. package/desktop-plugins.js +86 -0
  8. package/desktop.js +200 -0
  9. package/filemanager-base.js +7 -8
  10. package/filemanager-linux.js +124 -0
  11. package/filemanager.js +4 -7
  12. package/native-notify.js +74 -0
  13. package/node/node +2 -1
  14. package/package.json +1 -1
  15. package/packs/dsh-x-workbench/README.md +61 -0
  16. package/packs/dsh-x-workbench/dspack.json +4 -0
  17. package/packs/dsh-x-workbench/home/skills/agent-browser/LICENSE-APACHE-2.0.txt +202 -0
  18. package/packs/dsh-x-workbench/home/skills/agent-browser/NOTICE.md +6 -0
  19. package/packs/dsh-x-workbench/home/skills/agent-browser/SKILL.md +697 -0
  20. package/packs/dsh-x-workbench/home/skills/agent-browser/references/authentication.md +313 -0
  21. package/packs/dsh-x-workbench/home/skills/agent-browser/references/commands.md +300 -0
  22. package/packs/dsh-x-workbench/home/skills/agent-browser/references/profiling.md +120 -0
  23. package/packs/dsh-x-workbench/home/skills/agent-browser/references/proxy-support.md +194 -0
  24. package/packs/dsh-x-workbench/home/skills/agent-browser/references/session-management.md +201 -0
  25. package/packs/dsh-x-workbench/home/skills/agent-browser/references/snapshot-refs.md +229 -0
  26. package/packs/dsh-x-workbench/home/skills/agent-browser/references/video-recording.md +173 -0
  27. package/packs/dsh-x-workbench/home/skills/agent-browser/templates/authenticated-session.sh +105 -0
  28. package/packs/dsh-x-workbench/home/skills/agent-browser/templates/capture-workflow.sh +69 -0
  29. package/packs/dsh-x-workbench/home/skills/agent-browser/templates/form-automation.sh +62 -0
  30. package/packs/dsh-x-workbench/home/skills/electron/LICENSE-APACHE-2.0.txt +202 -0
  31. package/packs/dsh-x-workbench/home/skills/electron/NOTICE.md +6 -0
  32. package/packs/dsh-x-workbench/home/skills/electron/SKILL.md +243 -0
  33. package/packs/dsh-x-workbench/manifest.json +35 -0
  34. package/perf/patch-hooks.mjs +14 -1
  35. package/perf/plugin-profile.mjs +204 -0
  36. package/perf/register.mjs +4 -0
  37. package/platform.js +2 -1
  38. package/public/booting.html +475 -0
  39. package/public/favicon.ico +0 -0
  40. package/public/favicon.png +0 -0
  41. package/public/icon.png +0 -0
  42. package/public/index.html +9277 -8173
  43. package/public/internal-tabs.js +45 -41
  44. package/public/launcher.css +285 -98
  45. package/public/mascot.js +1 -1
  46. package/public/theme.css +33 -6
  47. package/public/water.js +1 -1
  48. package/registry.js +38 -3
  49. package/server.js +1060 -119
  50. package/settings.js +78 -1
@@ -0,0 +1,120 @@
1
+ # Profiling
2
+
3
+ Capture Chrome DevTools performance profiles during browser automation for performance analysis.
4
+
5
+ **Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.
6
+
7
+ ## Contents
8
+
9
+ - [Basic Profiling](#basic-profiling)
10
+ - [Profiler Commands](#profiler-commands)
11
+ - [Categories](#categories)
12
+ - [Use Cases](#use-cases)
13
+ - [Output Format](#output-format)
14
+ - [Viewing Profiles](#viewing-profiles)
15
+ - [Limitations](#limitations)
16
+
17
+ ## Basic Profiling
18
+
19
+ ```bash
20
+ # Start profiling
21
+ agent-browser profiler start
22
+
23
+ # Perform actions
24
+ agent-browser navigate https://example.com
25
+ agent-browser click "#button"
26
+ agent-browser wait 1000
27
+
28
+ # Stop and save
29
+ agent-browser profiler stop ./trace.json
30
+ ```
31
+
32
+ ## Profiler Commands
33
+
34
+ ```bash
35
+ # Start profiling with default categories
36
+ agent-browser profiler start
37
+
38
+ # Start with custom trace categories
39
+ agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
40
+
41
+ # Stop profiling and save to file
42
+ agent-browser profiler stop ./trace.json
43
+ ```
44
+
45
+ ## Categories
46
+
47
+ The `--categories` flag accepts a comma-separated list of Chrome trace categories. Default categories include:
48
+
49
+ - `devtools.timeline` -- standard DevTools performance traces
50
+ - `v8.execute` -- time spent running JavaScript
51
+ - `blink` -- renderer events
52
+ - `blink.user_timing` -- `performance.mark()` / `performance.measure()` calls
53
+ - `latencyInfo` -- input-to-latency tracking
54
+ - `renderer.scheduler` -- task scheduling and execution
55
+ - `toplevel` -- broad-spectrum basic events
56
+
57
+ Several `disabled-by-default-*` categories are also included for detailed timeline, call stack, and V8 CPU profiling data.
58
+
59
+ ## Use Cases
60
+
61
+ ### Diagnosing Slow Page Loads
62
+
63
+ ```bash
64
+ agent-browser profiler start
65
+ agent-browser navigate https://app.example.com
66
+ agent-browser wait --load networkidle
67
+ agent-browser profiler stop ./page-load-profile.json
68
+ ```
69
+
70
+ ### Profiling User Interactions
71
+
72
+ ```bash
73
+ agent-browser navigate https://app.example.com
74
+ agent-browser profiler start
75
+ agent-browser click "#submit"
76
+ agent-browser wait 2000
77
+ agent-browser profiler stop ./interaction-profile.json
78
+ ```
79
+
80
+ ### CI Performance Regression Checks
81
+
82
+ ```bash
83
+ #!/bin/bash
84
+ agent-browser profiler start
85
+ agent-browser navigate https://app.example.com
86
+ agent-browser wait --load networkidle
87
+ agent-browser profiler stop "./profiles/build-${BUILD_ID}.json"
88
+ ```
89
+
90
+ ## Output Format
91
+
92
+ The output is a JSON file in Chrome Trace Event format:
93
+
94
+ ```json
95
+ {
96
+ "traceEvents": [
97
+ { "cat": "devtools.timeline", "name": "RunTask", "ph": "X", "ts": 12345, "dur": 100, ... },
98
+ ...
99
+ ],
100
+ "metadata": {
101
+ "clock-domain": "LINUX_CLOCK_MONOTONIC"
102
+ }
103
+ }
104
+ ```
105
+
106
+ The `metadata.clock-domain` field is set based on the host platform (Linux or macOS). On Windows it is omitted.
107
+
108
+ ## Viewing Profiles
109
+
110
+ Load the output JSON file in any of these tools:
111
+
112
+ - **Chrome DevTools**: Performance panel > Load profile (Ctrl+Shift+I > Performance)
113
+ - **Perfetto UI**: https://ui.perfetto.dev/ -- drag and drop the JSON file
114
+ - **Trace Viewer**: `chrome://tracing` in any Chromium browser
115
+
116
+ ## Limitations
117
+
118
+ - Only works with Chromium-based browsers (Chrome, Edge). Not supported on Firefox or WebKit.
119
+ - Trace data accumulates in memory while profiling is active (capped at 5 million events). Stop profiling promptly after the area of interest.
120
+ - Data collection on stop has a 30-second timeout. If the browser is unresponsive, the stop command may fail.
@@ -0,0 +1,194 @@
1
+ # Proxy Support
2
+
3
+ Proxy configuration for geo-testing, rate limiting avoidance, and corporate environments.
4
+
5
+ **Related**: [commands.md](commands.md) for global options, [SKILL.md](../SKILL.md) for quick start.
6
+
7
+ ## Contents
8
+
9
+ - [Basic Proxy Configuration](#basic-proxy-configuration)
10
+ - [Authenticated Proxy](#authenticated-proxy)
11
+ - [SOCKS Proxy](#socks-proxy)
12
+ - [Proxy Bypass](#proxy-bypass)
13
+ - [Common Use Cases](#common-use-cases)
14
+ - [Verifying Proxy Connection](#verifying-proxy-connection)
15
+ - [Troubleshooting](#troubleshooting)
16
+ - [Best Practices](#best-practices)
17
+
18
+ ## Basic Proxy Configuration
19
+
20
+ Use the `--proxy` flag or set proxy via environment variable:
21
+
22
+ ```bash
23
+ # Via CLI flag
24
+ agent-browser --proxy "http://proxy.example.com:8080" open https://example.com
25
+
26
+ # Via environment variable
27
+ export HTTP_PROXY="http://proxy.example.com:8080"
28
+ agent-browser open https://example.com
29
+
30
+ # HTTPS proxy
31
+ export HTTPS_PROXY="https://proxy.example.com:8080"
32
+ agent-browser open https://example.com
33
+
34
+ # Both
35
+ export HTTP_PROXY="http://proxy.example.com:8080"
36
+ export HTTPS_PROXY="http://proxy.example.com:8080"
37
+ agent-browser open https://example.com
38
+ ```
39
+
40
+ ## Authenticated Proxy
41
+
42
+ For proxies requiring authentication:
43
+
44
+ ```bash
45
+ # Include credentials in URL
46
+ export HTTP_PROXY="http://username:password@proxy.example.com:8080"
47
+ agent-browser open https://example.com
48
+ ```
49
+
50
+ ## SOCKS Proxy
51
+
52
+ ```bash
53
+ # SOCKS5 proxy
54
+ export ALL_PROXY="socks5://proxy.example.com:1080"
55
+ agent-browser open https://example.com
56
+
57
+ # SOCKS5 with auth
58
+ export ALL_PROXY="socks5://user:pass@proxy.example.com:1080"
59
+ agent-browser open https://example.com
60
+ ```
61
+
62
+ ## Proxy Bypass
63
+
64
+ Skip proxy for specific domains using `--proxy-bypass` or `NO_PROXY`:
65
+
66
+ ```bash
67
+ # Via CLI flag
68
+ agent-browser --proxy "http://proxy.example.com:8080" --proxy-bypass "localhost,*.internal.com" open https://example.com
69
+
70
+ # Via environment variable
71
+ export NO_PROXY="localhost,127.0.0.1,.internal.company.com"
72
+ agent-browser open https://internal.company.com # Direct connection
73
+ agent-browser open https://external.com # Via proxy
74
+ ```
75
+
76
+ ## Common Use Cases
77
+
78
+ ### Geo-Location Testing
79
+
80
+ ```bash
81
+ #!/bin/bash
82
+ # Test site from different regions using geo-located proxies
83
+
84
+ PROXIES=(
85
+ "http://us-proxy.example.com:8080"
86
+ "http://eu-proxy.example.com:8080"
87
+ "http://asia-proxy.example.com:8080"
88
+ )
89
+
90
+ for proxy in "${PROXIES[@]}"; do
91
+ export HTTP_PROXY="$proxy"
92
+ export HTTPS_PROXY="$proxy"
93
+
94
+ region=$(echo "$proxy" | grep -oP '^\w+-\w+')
95
+ echo "Testing from: $region"
96
+
97
+ agent-browser --session "$region" open https://example.com
98
+ agent-browser --session "$region" screenshot "./screenshots/$region.png"
99
+ agent-browser --session "$region" close
100
+ done
101
+ ```
102
+
103
+ ### Rotating Proxies for Scraping
104
+
105
+ ```bash
106
+ #!/bin/bash
107
+ # Rotate through proxy list to avoid rate limiting
108
+
109
+ PROXY_LIST=(
110
+ "http://proxy1.example.com:8080"
111
+ "http://proxy2.example.com:8080"
112
+ "http://proxy3.example.com:8080"
113
+ )
114
+
115
+ URLS=(
116
+ "https://site.com/page1"
117
+ "https://site.com/page2"
118
+ "https://site.com/page3"
119
+ )
120
+
121
+ for i in "${!URLS[@]}"; do
122
+ proxy_index=$((i % ${#PROXY_LIST[@]}))
123
+ export HTTP_PROXY="${PROXY_LIST[$proxy_index]}"
124
+ export HTTPS_PROXY="${PROXY_LIST[$proxy_index]}"
125
+
126
+ agent-browser open "${URLS[$i]}"
127
+ agent-browser get text body > "output-$i.txt"
128
+ agent-browser close
129
+
130
+ sleep 1 # Polite delay
131
+ done
132
+ ```
133
+
134
+ ### Corporate Network Access
135
+
136
+ ```bash
137
+ #!/bin/bash
138
+ # Access internal sites via corporate proxy
139
+
140
+ export HTTP_PROXY="http://corpproxy.company.com:8080"
141
+ export HTTPS_PROXY="http://corpproxy.company.com:8080"
142
+ export NO_PROXY="localhost,127.0.0.1,.company.com"
143
+
144
+ # External sites go through proxy
145
+ agent-browser open https://external-vendor.com
146
+
147
+ # Internal sites bypass proxy
148
+ agent-browser open https://intranet.company.com
149
+ ```
150
+
151
+ ## Verifying Proxy Connection
152
+
153
+ ```bash
154
+ # Check your apparent IP
155
+ agent-browser open https://httpbin.org/ip
156
+ agent-browser get text body
157
+ # Should show proxy's IP, not your real IP
158
+ ```
159
+
160
+ ## Troubleshooting
161
+
162
+ ### Proxy Connection Failed
163
+
164
+ ```bash
165
+ # Test proxy connectivity first
166
+ curl -x http://proxy.example.com:8080 https://httpbin.org/ip
167
+
168
+ # Check if proxy requires auth
169
+ export HTTP_PROXY="http://user:pass@proxy.example.com:8080"
170
+ ```
171
+
172
+ ### SSL/TLS Errors Through Proxy
173
+
174
+ Some proxies perform SSL inspection. If you encounter certificate errors:
175
+
176
+ ```bash
177
+ # For testing only - not recommended for production
178
+ agent-browser open https://example.com --ignore-https-errors
179
+ ```
180
+
181
+ ### Slow Performance
182
+
183
+ ```bash
184
+ # Use proxy only when necessary
185
+ export NO_PROXY="*.cdn.com,*.static.com" # Direct CDN access
186
+ ```
187
+
188
+ ## Best Practices
189
+
190
+ 1. **Use environment variables** - Don't hardcode proxy credentials
191
+ 2. **Set NO_PROXY appropriately** - Avoid routing local traffic through proxy
192
+ 3. **Test proxy before automation** - Verify connectivity with simple requests
193
+ 4. **Handle proxy failures gracefully** - Implement retry logic for unstable proxies
194
+ 5. **Rotate proxies for large scraping jobs** - Distribute load and avoid bans
@@ -0,0 +1,201 @@
1
+ <!--
2
+ Derived from vercel-labs/agent-browser (skills/agent-browser/references/session-management.md).
3
+ Copyright 2025 Vercel Inc. Licensed under Apache-2.0.
4
+ Modified by ZCode: local integration, formatting and adaptations.
5
+ See THIRD-PARTY-NOTICES.md in the repository root for license and provenance.
6
+ -->
7
+
8
+ # Session Management
9
+
10
+ Multiple isolated browser sessions with state persistence and concurrent browsing.
11
+
12
+ **Related**: [authentication.md](authentication.md) for login patterns, [SKILL.md](../SKILL.md) for quick start.
13
+
14
+ ## Contents
15
+
16
+ - [Named Sessions](#named-sessions)
17
+ - [Session Isolation Properties](#session-isolation-properties)
18
+ - [Session State Persistence](#session-state-persistence)
19
+ - [Common Patterns](#common-patterns)
20
+ - [Default Session](#default-session)
21
+ - [Session Cleanup](#session-cleanup)
22
+ - [Best Practices](#best-practices)
23
+
24
+ ## Named Sessions
25
+
26
+ Use `--session` flag to isolate browser contexts:
27
+
28
+ ```bash
29
+ # Session 1: Authentication flow
30
+ agent-browser --session auth open https://app.example.com/login
31
+
32
+ # Session 2: Public browsing (separate cookies, storage)
33
+ agent-browser --session public open https://example.com
34
+
35
+ # Commands are isolated by session
36
+ agent-browser --session auth fill @e1 "user@example.com"
37
+ agent-browser --session public get text body
38
+ ```
39
+
40
+ ## Session Isolation Properties
41
+
42
+ Each session has independent:
43
+
44
+ - Cookies
45
+ - LocalStorage / SessionStorage
46
+ - IndexedDB
47
+ - Cache
48
+ - Browsing history
49
+ - Open tabs
50
+
51
+ ## Session State Persistence
52
+
53
+ ### Save Session State
54
+
55
+ ```bash
56
+ # Save cookies, storage, and auth state
57
+ agent-browser state save /path/to/auth-state.json
58
+ ```
59
+
60
+ ### Load Session State
61
+
62
+ ```bash
63
+ # Restore saved state
64
+ agent-browser state load /path/to/auth-state.json
65
+
66
+ # Continue with authenticated session
67
+ agent-browser open https://app.example.com/dashboard
68
+ ```
69
+
70
+ ### State File Contents
71
+
72
+ ```json
73
+ {
74
+ "cookies": [...],
75
+ "localStorage": {...},
76
+ "sessionStorage": {...},
77
+ "origins": [...]
78
+ }
79
+ ```
80
+
81
+ ## Common Patterns
82
+
83
+ ### Authenticated Session Reuse
84
+
85
+ ```bash
86
+ #!/bin/bash
87
+ # Save login state once, reuse many times
88
+
89
+ STATE_FILE="/tmp/auth-state.json"
90
+
91
+ # Check if we have saved state
92
+ if [[ -f "$STATE_FILE" ]]; then
93
+ agent-browser state load "$STATE_FILE"
94
+ agent-browser open https://app.example.com/dashboard
95
+ else
96
+ # Perform login
97
+ agent-browser open https://app.example.com/login
98
+ agent-browser snapshot -i
99
+ agent-browser fill @e1 "$USERNAME"
100
+ agent-browser fill @e2 "$PASSWORD"
101
+ agent-browser click @e3
102
+ agent-browser wait --load networkidle
103
+
104
+ # Save for future use
105
+ agent-browser state save "$STATE_FILE"
106
+ fi
107
+ ```
108
+
109
+ ### Concurrent Scraping
110
+
111
+ ```bash
112
+ #!/bin/bash
113
+ # Scrape multiple sites concurrently
114
+
115
+ # Start all sessions
116
+ agent-browser --session site1 open https://site1.com &
117
+ agent-browser --session site2 open https://site2.com &
118
+ agent-browser --session site3 open https://site3.com &
119
+ wait
120
+
121
+ # Extract from each
122
+ agent-browser --session site1 get text body > site1.txt
123
+ agent-browser --session site2 get text body > site2.txt
124
+ agent-browser --session site3 get text body > site3.txt
125
+
126
+ # Cleanup
127
+ agent-browser --session site1 close
128
+ agent-browser --session site2 close
129
+ agent-browser --session site3 close
130
+ ```
131
+
132
+ ### A/B Testing Sessions
133
+
134
+ ```bash
135
+ # Test different user experiences
136
+ agent-browser --session variant-a open "https://app.com?variant=a"
137
+ agent-browser --session variant-b open "https://app.com?variant=b"
138
+
139
+ # Compare
140
+ agent-browser --session variant-a screenshot /tmp/variant-a.png
141
+ agent-browser --session variant-b screenshot /tmp/variant-b.png
142
+ ```
143
+
144
+ ## Default Session
145
+
146
+ When `--session` is omitted, commands use the default session:
147
+
148
+ ```bash
149
+ # These use the same default session
150
+ agent-browser open https://example.com
151
+ agent-browser snapshot -i
152
+ agent-browser close # Closes default session
153
+ ```
154
+
155
+ ## Session Cleanup
156
+
157
+ ```bash
158
+ # Close specific session
159
+ agent-browser --session auth close
160
+
161
+ # List active sessions
162
+ agent-browser session list
163
+ ```
164
+
165
+ ## Best Practices
166
+
167
+ ### 1. Name Sessions Semantically
168
+
169
+ ```bash
170
+ # GOOD: Clear purpose
171
+ agent-browser --session github-auth open https://github.com
172
+ agent-browser --session docs-scrape open https://docs.example.com
173
+
174
+ # AVOID: Generic names
175
+ agent-browser --session s1 open https://github.com
176
+ ```
177
+
178
+ ### 2. Always Clean Up
179
+
180
+ ```bash
181
+ # Close sessions when done
182
+ agent-browser --session auth close
183
+ agent-browser --session scrape close
184
+ ```
185
+
186
+ ### 3. Handle State Files Securely
187
+
188
+ ```bash
189
+ # Don't commit state files (contain auth tokens!)
190
+ echo "*.auth-state.json" >> .gitignore
191
+
192
+ # Delete after use
193
+ rm /tmp/auth-state.json
194
+ ```
195
+
196
+ ### 4. Timeout Long Sessions
197
+
198
+ ```bash
199
+ # Set timeout for automated scripts
200
+ timeout 60 agent-browser --session long-task get text body
201
+ ```