nstbrowser-ai-agent 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.
Files changed (119) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1321 -0
  3. package/bin/nstbrowser-ai-agent-darwin-arm64 +0 -0
  4. package/bin/nstbrowser-ai-agent-darwin-x64 +0 -0
  5. package/bin/nstbrowser-ai-agent-linux-arm64 +0 -0
  6. package/bin/nstbrowser-ai-agent-linux-x64 +0 -0
  7. package/bin/nstbrowser-ai-agent-win32-x64.exe +0 -0
  8. package/bin/nstbrowser-ai-agent.js +109 -0
  9. package/dist/action-policy.d.ts +14 -0
  10. package/dist/action-policy.d.ts.map +1 -0
  11. package/dist/action-policy.js +253 -0
  12. package/dist/action-policy.js.map +1 -0
  13. package/dist/actions.d.ts +18 -0
  14. package/dist/actions.d.ts.map +1 -0
  15. package/dist/actions.js +2037 -0
  16. package/dist/actions.js.map +1 -0
  17. package/dist/auth-cli.d.ts +2 -0
  18. package/dist/auth-cli.d.ts.map +1 -0
  19. package/dist/auth-cli.js +97 -0
  20. package/dist/auth-cli.js.map +1 -0
  21. package/dist/auth-vault.d.ts +36 -0
  22. package/dist/auth-vault.d.ts.map +1 -0
  23. package/dist/auth-vault.js +125 -0
  24. package/dist/auth-vault.js.map +1 -0
  25. package/dist/browser.d.ts +573 -0
  26. package/dist/browser.d.ts.map +1 -0
  27. package/dist/browser.js +2036 -0
  28. package/dist/browser.js.map +1 -0
  29. package/dist/confirmation.d.ts +8 -0
  30. package/dist/confirmation.d.ts.map +1 -0
  31. package/dist/confirmation.js +30 -0
  32. package/dist/confirmation.js.map +1 -0
  33. package/dist/daemon.d.ts +65 -0
  34. package/dist/daemon.d.ts.map +1 -0
  35. package/dist/daemon.js +589 -0
  36. package/dist/daemon.js.map +1 -0
  37. package/dist/diff.d.ts +18 -0
  38. package/dist/diff.d.ts.map +1 -0
  39. package/dist/diff.js +271 -0
  40. package/dist/diff.js.map +1 -0
  41. package/dist/domain-filter.d.ts +28 -0
  42. package/dist/domain-filter.d.ts.map +1 -0
  43. package/dist/domain-filter.js +149 -0
  44. package/dist/domain-filter.js.map +1 -0
  45. package/dist/encryption.d.ts +73 -0
  46. package/dist/encryption.d.ts.map +1 -0
  47. package/dist/encryption.js +171 -0
  48. package/dist/encryption.js.map +1 -0
  49. package/dist/ios-actions.d.ts +11 -0
  50. package/dist/ios-actions.d.ts.map +1 -0
  51. package/dist/ios-actions.js +228 -0
  52. package/dist/ios-actions.js.map +1 -0
  53. package/dist/ios-manager.d.ts +266 -0
  54. package/dist/ios-manager.d.ts.map +1 -0
  55. package/dist/ios-manager.js +1073 -0
  56. package/dist/ios-manager.js.map +1 -0
  57. package/dist/nstbrowser-actions.d.ts +10 -0
  58. package/dist/nstbrowser-actions.d.ts.map +1 -0
  59. package/dist/nstbrowser-actions.js +277 -0
  60. package/dist/nstbrowser-actions.js.map +1 -0
  61. package/dist/nstbrowser-client.d.ts +197 -0
  62. package/dist/nstbrowser-client.d.ts.map +1 -0
  63. package/dist/nstbrowser-client.js +454 -0
  64. package/dist/nstbrowser-client.js.map +1 -0
  65. package/dist/nstbrowser-errors.d.ts +28 -0
  66. package/dist/nstbrowser-errors.d.ts.map +1 -0
  67. package/dist/nstbrowser-errors.js +59 -0
  68. package/dist/nstbrowser-errors.js.map +1 -0
  69. package/dist/nstbrowser-profile-resolver.d.ts +89 -0
  70. package/dist/nstbrowser-profile-resolver.d.ts.map +1 -0
  71. package/dist/nstbrowser-profile-resolver.js +227 -0
  72. package/dist/nstbrowser-profile-resolver.js.map +1 -0
  73. package/dist/nstbrowser-types.d.ts +151 -0
  74. package/dist/nstbrowser-types.d.ts.map +1 -0
  75. package/dist/nstbrowser-types.js +5 -0
  76. package/dist/nstbrowser-types.js.map +1 -0
  77. package/dist/nstbrowser-utils.d.ts +71 -0
  78. package/dist/nstbrowser-utils.d.ts.map +1 -0
  79. package/dist/nstbrowser-utils.js +174 -0
  80. package/dist/nstbrowser-utils.js.map +1 -0
  81. package/dist/protocol.d.ts +26 -0
  82. package/dist/protocol.d.ts.map +1 -0
  83. package/dist/protocol.js +1245 -0
  84. package/dist/protocol.js.map +1 -0
  85. package/dist/snapshot.d.ts +67 -0
  86. package/dist/snapshot.d.ts.map +1 -0
  87. package/dist/snapshot.js +514 -0
  88. package/dist/snapshot.js.map +1 -0
  89. package/dist/state-utils.d.ts +77 -0
  90. package/dist/state-utils.d.ts.map +1 -0
  91. package/dist/state-utils.js +178 -0
  92. package/dist/state-utils.js.map +1 -0
  93. package/dist/stream-server.d.ts +117 -0
  94. package/dist/stream-server.d.ts.map +1 -0
  95. package/dist/stream-server.js +309 -0
  96. package/dist/stream-server.js.map +1 -0
  97. package/dist/types.d.ts +1121 -0
  98. package/dist/types.d.ts.map +1 -0
  99. package/dist/types.js +2 -0
  100. package/dist/types.js.map +1 -0
  101. package/package.json +83 -0
  102. package/scripts/analyze-api-coverage.js +205 -0
  103. package/scripts/analyze-cli-coverage.js +239 -0
  104. package/scripts/build-all-platforms.sh +68 -0
  105. package/scripts/check-version-sync.js +39 -0
  106. package/scripts/copy-native.js +36 -0
  107. package/scripts/download-nstbrowser-docs.js +152 -0
  108. package/scripts/generate-skills.sh +218 -0
  109. package/scripts/postinstall.js +231 -0
  110. package/scripts/sync-version.js +69 -0
  111. package/skills/nstbrowser-ai-agent/SKILL.md +759 -0
  112. package/skills/nstbrowser-ai-agent/references/batch-operations.md +414 -0
  113. package/skills/nstbrowser-ai-agent/references/nst-api-reference.md +960 -0
  114. package/skills/nstbrowser-ai-agent/references/profile-management.md +672 -0
  115. package/skills/nstbrowser-ai-agent/references/proxy-configuration.md +460 -0
  116. package/skills/nstbrowser-ai-agent/references/troubleshooting.md +773 -0
  117. package/skills/nstbrowser-ai-agent/templates/automated-workflow.sh +248 -0
  118. package/skills/nstbrowser-ai-agent/templates/batch-proxy-update.sh +257 -0
  119. package/skills/nstbrowser-ai-agent/templates/profile-setup.sh +248 -0
@@ -0,0 +1,460 @@
1
+ # Proxy Configuration Guide
2
+
3
+ Detailed guide for configuring and managing proxies in Nstbrowser profiles.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Proxy Types](#proxy-types)
8
+ - [Proxy Configuration](#proxy-configuration)
9
+ - [Proxy Testing](#proxy-testing)
10
+ - [Rotating Proxies](#rotating-proxies)
11
+ - [Common Issues](#common-issues)
12
+
13
+ ## Proxy Types
14
+
15
+ ### HTTP Proxies
16
+
17
+ HTTP proxies are the most common type, suitable for web browsing.
18
+
19
+ **Characteristics:**
20
+ - Protocol: HTTP/1.1
21
+ - Port: Usually 8080, 3128, or 80
22
+ - Authentication: Basic auth (username/password)
23
+ - Encryption: No (traffic is not encrypted)
24
+ - Use case: General web browsing, scraping
25
+
26
+ **Example:**
27
+ ```bash
28
+ nstbrowser-ai-agent profile proxy update my-profile \
29
+ --host proxy.example.com \
30
+ --port 8080 \
31
+ --type http \
32
+ --username user \
33
+ --password pass
34
+ ```
35
+
36
+ ### HTTPS Proxies
37
+
38
+ HTTPS proxies provide encrypted connections.
39
+
40
+ **Characteristics:**
41
+ - Protocol: HTTP/1.1 over TLS
42
+ - Port: Usually 443 or 8443
43
+ - Authentication: Basic auth (username/password)
44
+ - Encryption: Yes (traffic is encrypted)
45
+ - Use case: Secure browsing, sensitive data
46
+
47
+ **Example:**
48
+ ```bash
49
+ nstbrowser-ai-agent profile proxy update my-profile \
50
+ --host secure-proxy.example.com \
51
+ --port 443 \
52
+ --type https \
53
+ --username user \
54
+ --password pass
55
+ ```
56
+
57
+ ### SOCKS5 Proxies
58
+
59
+ SOCKS5 proxies support any protocol (HTTP, HTTPS, FTP, etc.).
60
+
61
+ **Characteristics:**
62
+ - Protocol: SOCKS5
63
+ - Port: Usually 1080
64
+ - Authentication: Username/password or no auth
65
+ - Encryption: Optional (depends on implementation)
66
+ - Use case: Advanced use cases, UDP support
67
+
68
+ **Example:**
69
+ ```bash
70
+ nstbrowser-ai-agent profile proxy update my-profile \
71
+ --host socks-proxy.example.com \
72
+ --port 1080 \
73
+ --type socks5 \
74
+ --username user \
75
+ --password pass
76
+ ```
77
+
78
+ ## Proxy Configuration
79
+
80
+ ### Setting Proxy for Single Profile
81
+
82
+ Update proxy configuration for one profile:
83
+
84
+ ```bash
85
+ nstbrowser-ai-agent profile proxy update <name-or-id> \
86
+ --host proxy.example.com \
87
+ --port 8080 \
88
+ --type http \
89
+ --username user \
90
+ --password pass
91
+ ```
92
+
93
+ **Parameters:**
94
+ - `--host`: Proxy server hostname or IP address (required)
95
+ - `--port`: Proxy server port (required)
96
+ - `--type`: Proxy type - http, https, or socks5 (required)
97
+ - `--username`: Authentication username (optional)
98
+ - `--password`: Authentication password (optional)
99
+
100
+ ### Batch Proxy Updates
101
+
102
+ Update proxy for multiple profiles at once:
103
+
104
+ ```bash
105
+ nstbrowser-ai-agent profile proxy batch-update id-1 id-2 id-3 \
106
+ --host proxy.example.com \
107
+ --port 8080 \
108
+ --type http \
109
+ --username user \
110
+ --password pass
111
+ ```
112
+
113
+ **Benefits:**
114
+ - Faster than updating profiles individually
115
+ - Consistent configuration across profiles
116
+ - Atomic operation (all or nothing)
117
+
118
+ ### Proxy Authentication
119
+
120
+ #### With Username and Password
121
+
122
+ ```bash
123
+ nstbrowser-ai-agent profile proxy update my-profile \
124
+ --host proxy.example.com \
125
+ --port 8080 \
126
+ --type http \
127
+ --username myuser \
128
+ --password mypass
129
+ ```
130
+
131
+ #### Without Authentication
132
+
133
+ ```bash
134
+ nstbrowser-ai-agent profile proxy update my-profile \
135
+ --host proxy.example.com \
136
+ --port 8080 \
137
+ --type http
138
+ ```
139
+
140
+ #### Using Environment Variables
141
+
142
+ Store credentials securely:
143
+
144
+ ```bash
145
+ # Set environment variables
146
+ export PROXY_USERNAME="myuser"
147
+ export PROXY_PASSWORD="mypass"
148
+
149
+ # Use in command
150
+ nstbrowser-ai-agent profile proxy update my-profile \
151
+ --host proxy.example.com \
152
+ --port 8080 \
153
+ --type http \
154
+ --username "$PROXY_USERNAME" \
155
+ --password "$PROXY_PASSWORD"
156
+ ```
157
+
158
+ ### Resetting Proxy
159
+
160
+ Remove proxy configuration from profiles:
161
+
162
+ ```bash
163
+ # Reset single profile
164
+ nstbrowser-ai-agent profile proxy reset profile-id
165
+
166
+ # Reset multiple profiles (batch)
167
+ nstbrowser-ai-agent profile proxy batch-reset id-1 id-2 id-3
168
+ ```
169
+
170
+ ## Proxy Testing
171
+
172
+ ### Viewing Proxy Configuration
173
+
174
+ Check current proxy settings:
175
+
176
+ ```bash
177
+ nstbrowser-ai-agent profile proxy show my-profile --json
178
+ ```
179
+
180
+ **Response includes:**
181
+ - Proxy configuration (type, host, port, credentials)
182
+ - Proxy check result (IP, location, timezone)
183
+
184
+ ### Verifying Proxy Connection
185
+
186
+ The `proxy show` command automatically tests the proxy:
187
+
188
+ ```json
189
+ {
190
+ "success": true,
191
+ "data": {
192
+ "proxy": {
193
+ "type": "http",
194
+ "host": "proxy.example.com",
195
+ "port": 8080,
196
+ "username": "user",
197
+ "enabled": true
198
+ },
199
+ "proxyCheck": {
200
+ "ip": "203.0.113.1",
201
+ "location": "United States",
202
+ "timezone": "America/New_York"
203
+ }
204
+ }
205
+ }
206
+ ```
207
+
208
+ ### Manual Proxy Testing
209
+
210
+ Test proxy manually before assigning to profile:
211
+
212
+ ```bash
213
+ # Test HTTP proxy
214
+ curl -x http://user:pass@proxy.example.com:8080 https://api.ipify.org
215
+
216
+ # Test HTTPS proxy
217
+ curl -x https://user:pass@proxy.example.com:443 https://api.ipify.org
218
+
219
+ # Test SOCKS5 proxy
220
+ curl --socks5 user:pass@proxy.example.com:1080 https://api.ipify.org
221
+ ```
222
+
223
+ ### Checking IP and Location
224
+
225
+ Verify the proxy is working correctly:
226
+
227
+ ```bash
228
+ # Launch browser with profile
229
+ nstbrowser-ai-agent --profile my-profile open https://api.ipify.org
230
+
231
+ # Get the displayed IP
232
+ nstbrowser-ai-agent get text body
233
+
234
+ # Should show proxy IP, not your real IP
235
+ ```
236
+
237
+ ## Rotating Proxies
238
+
239
+ ### Strategy 1: Profile-Based Rotation
240
+
241
+ Use different profiles with different proxies:
242
+
243
+ ```bash
244
+ # Create profiles with different proxies
245
+ nstbrowser-ai-agent profile create profile-1
246
+ nstbrowser-ai-agent profile proxy update profile-1 --host proxy1.com --port 8080 --type http
247
+
248
+ nstbrowser-ai-agent profile create profile-2
249
+ nstbrowser-ai-agent profile proxy update profile-2 --host proxy2.com --port 8080 --type http
250
+
251
+ nstbrowser-ai-agent profile create profile-3
252
+ nstbrowser-ai-agent profile proxy update profile-3 --host proxy3.com --port 8080 --type http
253
+
254
+ # Rotate by switching profiles
255
+ nstbrowser-ai-agent --profile profile-1 open https://example.com
256
+ nstbrowser-ai-agent close
257
+
258
+ nstbrowser-ai-agent --profile profile-2 open https://example.com
259
+ nstbrowser-ai-agent close
260
+
261
+ nstbrowser-ai-agent --profile profile-3 open https://example.com
262
+ nstbrowser-ai-agent close
263
+ ```
264
+
265
+ ### Strategy 2: Batch Update Rotation
266
+
267
+ Update proxies for multiple profiles:
268
+
269
+ ```bash
270
+ # Get profile IDs
271
+ PROFILE_IDS=$(nstbrowser-ai-agent profile list --json | jq -r '.data.profiles | map(.profileId) | join(" ")')
272
+
273
+ # Update all profiles to proxy 1
274
+ nstbrowser-ai-agent profile proxy batch-update $PROFILE_IDS \
275
+ --host proxy1.com --port 8080 --type http
276
+
277
+ # Later, update all profiles to proxy 2
278
+ nstbrowser-ai-agent profile proxy batch-update $PROFILE_IDS \
279
+ --host proxy2.com --port 8080 --type http
280
+ ```
281
+
282
+ ### Strategy 3: Script-Based Rotation
283
+
284
+ Automate proxy rotation with a script:
285
+
286
+ ```bash
287
+ #!/bin/bash
288
+
289
+ PROXIES=(
290
+ "proxy1.com:8080"
291
+ "proxy2.com:8080"
292
+ "proxy3.com:8080"
293
+ )
294
+
295
+ PROFILES=(
296
+ "profile-id-1"
297
+ "profile-id-2"
298
+ "profile-id-3"
299
+ )
300
+
301
+ # Assign proxies to profiles in round-robin
302
+ for i in "${!PROFILES[@]}"; do
303
+ PROXY="${PROXIES[$i % ${#PROXIES[@]}]}"
304
+ HOST="${PROXY%:*}"
305
+ PORT="${PROXY#*:}"
306
+
307
+ nstbrowser-ai-agent profile proxy update "${PROFILES[$i]}" \
308
+ --host "$HOST" \
309
+ --port "$PORT" \
310
+ --type http
311
+ done
312
+ ```
313
+
314
+ ### Performance Considerations
315
+
316
+ **Batch Operations:**
317
+ - Use batch commands for multiple profiles
318
+ - Reduces API calls and improves speed
319
+ - Atomic operations ensure consistency
320
+
321
+ **Proxy Pool Size:**
322
+ - Larger pool = better distribution
323
+ - Smaller pool = easier management
324
+ - Balance based on your needs
325
+
326
+ **Rotation Frequency:**
327
+ - Rotate per request (most aggressive)
328
+ - Rotate per session (balanced)
329
+ - Rotate per day (conservative)
330
+
331
+ ## Common Issues
332
+
333
+ ### Connection Failures
334
+
335
+ **Symptom:** Cannot connect to proxy server
336
+
337
+ **Causes:**
338
+ - Incorrect host or port
339
+ - Proxy server is down
340
+ - Firewall blocking connection
341
+ - Network connectivity issues
342
+
343
+ **Solutions:**
344
+ ```bash
345
+ # Test proxy manually
346
+ curl -x http://proxy.example.com:8080 https://api.ipify.org
347
+
348
+ # Check proxy status
349
+ ping proxy.example.com
350
+
351
+ # Verify port is open
352
+ nc -zv proxy.example.com 8080
353
+
354
+ # Try different proxy
355
+ nstbrowser-ai-agent profile proxy update my-profile \
356
+ --host backup-proxy.com --port 8080 --type http
357
+ ```
358
+
359
+ ### Authentication Errors
360
+
361
+ **Symptom:** 407 Proxy Authentication Required
362
+
363
+ **Causes:**
364
+ - Incorrect username or password
365
+ - Credentials not provided
366
+ - Proxy requires different auth method
367
+
368
+ **Solutions:**
369
+ ```bash
370
+ # Verify credentials
371
+ nstbrowser-ai-agent profile proxy show my-profile --json
372
+
373
+ # Update with correct credentials
374
+ nstbrowser-ai-agent profile proxy update my-profile \
375
+ --host proxy.example.com \
376
+ --port 8080 \
377
+ --type http \
378
+ --username correct-user \
379
+ --password correct-pass
380
+
381
+ # Test manually
382
+ curl -x http://user:pass@proxy.example.com:8080 https://api.ipify.org
383
+ ```
384
+
385
+ ### Timeout Issues
386
+
387
+ **Symptom:** Proxy connection times out
388
+
389
+ **Causes:**
390
+ - Slow proxy server
391
+ - Network latency
392
+ - Proxy overloaded
393
+ - Default timeout too short
394
+
395
+ **Solutions:**
396
+ ```bash
397
+ # Increase timeout
398
+ export NSTBROWSER_AI_AGENT_DEFAULT_TIMEOUT=45000
399
+
400
+ # Test proxy speed
401
+ time curl -x http://proxy.example.com:8080 https://api.ipify.org
402
+
403
+ # Try faster proxy
404
+ nstbrowser-ai-agent profile proxy update my-profile \
405
+ --host faster-proxy.com --port 8080 --type http
406
+ ```
407
+
408
+ ### IP Leaks
409
+
410
+ **Symptom:** Real IP is exposed instead of proxy IP
411
+
412
+ **Causes:**
413
+ - WebRTC leak
414
+ - DNS leak
415
+ - Proxy not properly configured
416
+ - Browser fingerprint mismatch
417
+
418
+ **Solutions:**
419
+ ```bash
420
+ # Verify proxy is working
421
+ nstbrowser-ai-agent --profile my-profile open https://api.ipify.org
422
+ nstbrowser-ai-agent get text body
423
+
424
+ # Check for leaks
425
+ nstbrowser-ai-agent --profile my-profile open https://browserleaks.com/ip
426
+
427
+ # Verify proxy configuration
428
+ nstbrowser-ai-agent profile proxy show my-profile --json
429
+ ```
430
+
431
+ ### Proxy Blocked
432
+
433
+ **Symptom:** Target website blocks proxy IP
434
+
435
+ **Causes:**
436
+ - Proxy IP is blacklisted
437
+ - Too many requests from proxy
438
+ - Proxy is known datacenter IP
439
+ - Website has strict anti-bot measures
440
+
441
+ **Solutions:**
442
+ ```bash
443
+ # Rotate to different proxy
444
+ nstbrowser-ai-agent profile proxy update my-profile \
445
+ --host different-proxy.com --port 8080 --type http
446
+
447
+ # Use residential proxy instead of datacenter
448
+ nstbrowser-ai-agent profile proxy update my-profile \
449
+ --host residential-proxy.com --port 8080 --type http
450
+
451
+ # Reduce request rate
452
+ # Add delays between requests in your automation script
453
+ ```
454
+
455
+ ## See Also
456
+
457
+ - [NST API Reference](nst-api-reference.md)
458
+ - [Profile Management Guide](profile-management.md)
459
+ - [Batch Operations Guide](batch-operations.md)
460
+ - [Troubleshooting Guide](troubleshooting.md)