fastbrowser_cli 1.0.37 → 1.0.40

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 (98) hide show
  1. package/dist/contribs/_shared/fastbrowser_helper.d.ts +13 -0
  2. package/dist/contribs/_shared/fastbrowser_helper.d.ts.map +1 -0
  3. package/dist/contribs/_shared/fastbrowser_helper.js +44 -0
  4. package/dist/contribs/_shared/fastbrowser_helper.js.map +1 -0
  5. package/dist/contribs/linkedin_cli/src/cli.d.ts +3 -0
  6. package/dist/contribs/linkedin_cli/src/cli.d.ts.map +1 -0
  7. package/dist/contribs/linkedin_cli/src/cli.js +299 -0
  8. package/dist/contribs/linkedin_cli/src/cli.js.map +1 -0
  9. package/dist/contribs/linkedin_cli/src/libs/linkedin_profile_helper.d.ts +73 -0
  10. package/dist/contribs/linkedin_cli/src/libs/linkedin_profile_helper.d.ts.map +1 -0
  11. package/dist/contribs/linkedin_cli/src/libs/linkedin_profile_helper.js +866 -0
  12. package/dist/contribs/linkedin_cli/src/libs/linkedin_profile_helper.js.map +1 -0
  13. package/dist/contribs/linkedin_cli/src/libs/linkedin_recent_posts_helper.d.ts +61 -0
  14. package/dist/contribs/linkedin_cli/src/libs/linkedin_recent_posts_helper.d.ts.map +1 -0
  15. package/dist/contribs/linkedin_cli/src/libs/linkedin_recent_posts_helper.js +885 -0
  16. package/dist/contribs/linkedin_cli/src/libs/linkedin_recent_posts_helper.js.map +1 -0
  17. package/dist/contribs/linkedin_cli/src/libs/linkedin_thread_helper.d.ts +11 -0
  18. package/dist/contribs/linkedin_cli/src/libs/linkedin_thread_helper.d.ts.map +1 -0
  19. package/dist/contribs/linkedin_cli/src/libs/linkedin_thread_helper.js +145 -0
  20. package/dist/contribs/linkedin_cli/src/libs/linkedin_thread_helper.js.map +1 -0
  21. package/dist/contribs/twitter_cli/src/cli.d.ts +3 -0
  22. package/dist/contribs/twitter_cli/src/cli.d.ts.map +1 -0
  23. package/dist/contribs/twitter_cli/src/cli.js +273 -0
  24. package/dist/contribs/twitter_cli/src/cli.js.map +1 -0
  25. package/dist/contribs/twitter_cli/src/libs/twitter_profile_helper.d.ts +28 -0
  26. package/dist/contribs/twitter_cli/src/libs/twitter_profile_helper.d.ts.map +1 -0
  27. package/dist/contribs/twitter_cli/src/libs/twitter_profile_helper.js +274 -0
  28. package/dist/contribs/twitter_cli/src/libs/twitter_profile_helper.js.map +1 -0
  29. package/dist/contribs/twitter_cli/src/libs/twitter_recent_posts_helper.d.ts +43 -0
  30. package/dist/contribs/twitter_cli/src/libs/twitter_recent_posts_helper.d.ts.map +1 -0
  31. package/dist/contribs/twitter_cli/src/libs/twitter_recent_posts_helper.js +519 -0
  32. package/dist/contribs/twitter_cli/src/libs/twitter_recent_posts_helper.js.map +1 -0
  33. package/dist/contribs/twitter_cli/src/libs/twitter_thread_helper.d.ts +11 -0
  34. package/dist/contribs/twitter_cli/src/libs/twitter_thread_helper.d.ts.map +1 -0
  35. package/dist/contribs/twitter_cli/src/libs/twitter_thread_helper.js +213 -0
  36. package/dist/contribs/twitter_cli/src/libs/twitter_thread_helper.js.map +1 -0
  37. package/dist/fastbrowser_cli/fastbrowser_cli.js +43 -0
  38. package/dist/fastbrowser_cli/fastbrowser_cli.js.map +1 -1
  39. package/dist/fastbrowser_httpd/libs/tool-schemas.d.ts +4 -0
  40. package/dist/fastbrowser_httpd/libs/tool-schemas.d.ts.map +1 -1
  41. package/dist/fastbrowser_httpd/libs/tool-schemas.js +4 -0
  42. package/dist/fastbrowser_httpd/libs/tool-schemas.js.map +1 -1
  43. package/dist/fastbrowser_mcp/fastbrowser_mcp.js +36 -2
  44. package/dist/fastbrowser_mcp/fastbrowser_mcp.js.map +1 -1
  45. package/dist/fastbrowser_mcp/libs/mcp_target_helper.d.ts +2 -0
  46. package/dist/fastbrowser_mcp/libs/mcp_target_helper.d.ts.map +1 -1
  47. package/dist/fastbrowser_mcp/libs/mcp_target_helper.js +12 -0
  48. package/dist/fastbrowser_mcp/libs/mcp_target_helper.js.map +1 -1
  49. package/dist/fastbrowser_mcp/libs/response_formatter.d.ts +1 -0
  50. package/dist/fastbrowser_mcp/libs/response_formatter.d.ts.map +1 -1
  51. package/dist/fastbrowser_mcp/libs/response_formatter.js +27 -0
  52. package/dist/fastbrowser_mcp/libs/response_formatter.js.map +1 -1
  53. package/dist/shared/fastbrowser_helper.d.ts +13 -0
  54. package/dist/shared/fastbrowser_helper.d.ts.map +1 -0
  55. package/dist/shared/fastbrowser_helper.js +39 -0
  56. package/dist/shared/fastbrowser_helper.js.map +1 -0
  57. package/examples/linkedin_cli_TOREMOVE/README.md +7 -0
  58. package/examples/{linkedin_cli → linkedin_cli_TOREMOVE}/linkedin_dm.sh +8 -4
  59. package/examples/linkedin_cli_TOREMOVE/linkedin_dm.ts +326 -0
  60. package/examples/linkedin_cli_TOREMOVE/linkedin_dm_messages.ts +279 -0
  61. package/examples/linkedin_cli_TOREMOVE/linkedin_full_cycle.sh +5 -0
  62. package/examples/{linkedin_cli → linkedin_cli_TOREMOVE}/linkedin_post.sh +3 -0
  63. package/examples/linkedin_cli_TOREMOVE/message_thread.a11y.txt +252 -0
  64. package/listitem +4 -0
  65. package/package.json +7 -3
  66. package/skills/fastbrowser/SKILL.md +33 -25
  67. package/src/contribs/_shared/fastbrowser_helper.ts +54 -0
  68. package/src/contribs/linkedin_cli/README.md +80 -0
  69. package/src/contribs/linkedin_cli/data/linkedin_posts_jeromeetienne.a11y.txt +2364 -0
  70. package/src/contribs/linkedin_cli/data/linkedin_posts_jontwigge.a11y.txt +2740 -0
  71. package/src/contribs/linkedin_cli/data/linkedin_posts_julien_guezennec.a11y.txt +2073 -0
  72. package/src/contribs/linkedin_cli/data/linkedin_profile_jeromeetienne.a11y.txt +1863 -0
  73. package/src/contribs/linkedin_cli/data/linkedin_profile_jontwigge.a11y.txt +1738 -0
  74. package/src/contribs/linkedin_cli/data/linkedin_profile_julien_guezennec.a11y.txt +2182 -0
  75. package/src/contribs/linkedin_cli/src/cli.ts +345 -0
  76. package/src/contribs/linkedin_cli/src/libs/linkedin_profile_helper.ts +964 -0
  77. package/src/contribs/linkedin_cli/src/libs/linkedin_recent_posts_helper.ts +982 -0
  78. package/src/contribs/linkedin_cli/src/libs/linkedin_thread_helper.ts +171 -0
  79. package/src/contribs/twitter_cli/README.md +79 -0
  80. package/src/contribs/twitter_cli/data/twitter_chat.a11y.txt +215 -0
  81. package/src/contribs/twitter_cli/data/twitter_home.a11y.txt +467 -0
  82. package/src/contribs/twitter_cli/data/twitter_profile.a11y.txt +418 -0
  83. package/src/contribs/twitter_cli/data/twitter_profile_jontwigge.a11y.txt +484 -0
  84. package/src/contribs/twitter_cli/data/twitter_profile_molokoloco.a11y.txt +483 -0
  85. package/src/contribs/twitter_cli/src/cli.ts +315 -0
  86. package/src/contribs/twitter_cli/src/libs/twitter_profile_helper.ts +328 -0
  87. package/src/contribs/twitter_cli/src/libs/twitter_recent_posts_helper.ts +607 -0
  88. package/src/contribs/twitter_cli/src/libs/twitter_thread_helper.ts +240 -0
  89. package/src/fastbrowser_cli/fastbrowser_cli.ts +51 -0
  90. package/src/fastbrowser_httpd/libs/tool-schemas.ts +6 -0
  91. package/src/fastbrowser_mcp/fastbrowser_mcp.ts +46 -3
  92. package/src/fastbrowser_mcp/libs/mcp_target_helper.ts +11 -0
  93. package/src/fastbrowser_mcp/libs/response_formatter.ts +29 -0
  94. package/src/shared/fastbrowser_helper.ts +49 -0
  95. package/tsconfig.json +1 -1
  96. package/examples/mcp_client_playwright.ts +0 -34
  97. /package/examples/{linkedin_cli → linkedin_cli_TOREMOVE}/linkedin.snapshot.txt +0 -0
  98. /package/examples/{twitter_cli → twitter_cli_TOREMOVE}/twitter_post.sh +0 -0
@@ -15,7 +15,7 @@ maps 1-to-1 to a FastBrowser tool and returns the tool's response on stdout.
15
15
  Run the CLI directly via `tsx`:
16
16
 
17
17
  ```bash
18
- npx fastbrowser_cli <command> [flags]
18
+ npx fastbrowser_cli@latest <command> [flags]
19
19
  ```
20
20
 
21
21
  ## Typical Workflow
@@ -35,20 +35,20 @@ uid=1_0 RootWebArea "Example Domain" url="https://example.com/"
35
35
 
36
36
  ```bash
37
37
  # List all open browser pages
38
- npx fastbrowser_cli list_pages
38
+ npx fastbrowser_cli@latest list_pages
39
39
 
40
40
  # Open a new page at a URL
41
- npx fastbrowser_cli new_page --url https://example.com
41
+ npx fastbrowser_cli@latest new_page --url https://example.com
42
42
 
43
43
  # Close a page by its numeric id
44
- npx fastbrowser_cli close_page --page-id 1
44
+ npx fastbrowser_cli@latest close_page --page-id 1
45
45
 
46
46
  # Navigate the current page to a URL
47
- npx fastbrowser_cli navigate_page --url https://example.com
47
+ npx fastbrowser_cli@latest navigate_page --url https://example.com
48
48
 
49
49
  # Restart the daemon - run this if pages opened by the bridge were closed manually
50
50
  # and the MCP connection has broken
51
- npx fastbrowser_cli server restart
51
+ npx fastbrowser_cli@latest server restart
52
52
  ```
53
53
 
54
54
 
@@ -66,10 +66,10 @@ The daemon binds to one backend at startup. If it is already running with a diff
66
66
 
67
67
  ```bash
68
68
  # Use chrome-devtools-mcp for one command
69
- npx fastbrowser_cli --mcp-target chrome_devtools list_pages
69
+ npx fastbrowser_cli@latest --mcp-target chrome_devtools list_pages
70
70
 
71
71
  # Switch the running daemon to a different backend
72
- npx fastbrowser_cli --mcp-target chrome_devtools server restart
72
+ npx fastbrowser_cli@latest --mcp-target chrome_devtools server restart
73
73
  ```
74
74
 
75
75
 
@@ -224,47 +224,54 @@ Example queries on it:
224
224
 
225
225
  ```bash
226
226
  # Query the accessibility tree returning the FIRST match per selector (--selector is repeatable)
227
- npx fastbrowser_cli query_selectors --selector "button" --selector "link"
227
+ npx fastbrowser_cli@latest query_selectors --selector "button" --selector "link"
228
228
 
229
229
  # Include ancestor nodes in the result
230
- npx fastbrowser_cli query_selectors --selector 'heading[level="1"]' --with-ancestors
230
+ npx fastbrowser_cli@latest query_selectors --selector 'heading[level="1"]' --with-ancestors
231
231
 
232
232
  # Include the descendant subtree of each match
233
- npx fastbrowser_cli query_selectors --selector 'main' --with-children
233
+ npx fastbrowser_cli@latest query_selectors --selector 'main' --with-children
234
234
 
235
235
  # Per-selector control over withAncestors / withChildren via JSON
236
- npx fastbrowser_cli query_selectors \
236
+ npx fastbrowser_cli@latest query_selectors \
237
237
  --selectors-json '[{"selector":"button","withAncestors":true},{"selector":"link","withChildren":true}]'
238
238
 
239
239
  # Pass --all to return every match per selector; --limit caps results per selector (0 = unlimited)
240
- npx fastbrowser_cli query_selectors --all --selector "button" --selector "link" --limit 5
240
+ npx fastbrowser_cli@latest query_selectors --all --selector "button" --selector "link" --limit 5
241
241
 
242
242
  # Include ancestor nodes in the result
243
- npx fastbrowser_cli query_selectors --all --selector 'heading[level="1"]' --with-ancestors
243
+ npx fastbrowser_cli@latest query_selectors --all --selector 'heading[level="1"]' --with-ancestors
244
244
 
245
245
  # Per-selector control over limit / withAncestors / withChildren via JSON (with --all)
246
- npx fastbrowser_cli query_selectors --all \
246
+ npx fastbrowser_cli@latest query_selectors --all \
247
247
  --selectors-json '[{"selector":"button","limit":3,"withAncestors":true},{"selector":"link","limit":0,"withChildren":true}]'
248
248
 
249
249
  # Take an accessibility-tree full page snapshot of the current page - very expensive, prefer targeted queries when possible
250
- npx fastbrowser_cli take_snapshot
250
+ npx fastbrowser_cli@latest take_snapshot
251
251
  ```
252
252
 
253
253
  ## Interaction
254
254
 
255
255
  ```bash
256
256
  # Click by a direct uid reference (fast path - no accessibility-tree lookup)
257
- npx fastbrowser_cli click --selector "#1_42"
257
+ npx fastbrowser_cli@latest click --selector "#1_42"
258
258
 
259
259
  # Click by any CSS-like selector - resolved to a uid internally
260
- npx fastbrowser_cli click -s 'button[name="Submit"]'
260
+ npx fastbrowser_cli@latest click -s 'button[name="Submit"]'
261
261
 
262
262
  # Fill a single form field - selector can be a uid (#1_7) or any CSS-like selector
263
- npx fastbrowser_cli fill_form -s 'textbox[name="Email"]' -v "hello@example.com"
263
+ npx fastbrowser_cli@latest fill_form -s 'textbox[name="Email"]' -v "hello@example.com"
264
264
 
265
265
  # Press a comma-separated sequence of keys (literals and named keys both work)
266
- npx fastbrowser_cli press_keys --keys "Tab, Tab, Enter"
267
- npx fastbrowser_cli press_keys --keys "Hello, Tab, Enter"
266
+ npx fastbrowser_cli@latest press_keys --keys "Tab, Tab, Enter"
267
+ npx fastbrowser_cli@latest press_keys --keys "Hello, Tab, Enter"
268
+
269
+ # Evaluate a JS function in the page context and get its JSON-able return value
270
+ npx fastbrowser_cli@latest evaluate_script --script 'function() { return { title: document.title, url: location.href }; }'
271
+
272
+ # Same, reading the function from a file or piped stdin
273
+ npx fastbrowser_cli@latest evaluate_script ./my_script.js
274
+ echo 'function() { return document.querySelectorAll("a").length; }' | npx fastbrowser_cli@latest evaluate_script
268
275
  ```
269
276
 
270
277
  ## Batch Execution
@@ -281,16 +288,16 @@ By default, the batch stops at the first failing line (shell `set -e` semantics)
281
288
 
282
289
  ```bash
283
290
  # From a file
284
- npx fastbrowser_cli batch ./demo.fbs
291
+ npx fastbrowser_cli@latest batch ./demo.fbs
285
292
 
286
293
  # Piped on stdin
287
- cat demo.fbs | npx fastbrowser_cli batch
294
+ cat demo.fbs | npx fastbrowser_cli@latest batch
288
295
 
289
296
  # Inline script
290
- npx fastbrowser_cli batch --script $'press_keys --keys "Enter"\nclick -s \'button[name^="Tout effacer"]\''
297
+ npx fastbrowser_cli@latest batch --script $'press_keys --keys "Enter"\nclick -s \'button[name^="Tout effacer"]\''
291
298
 
292
299
  # Continue through failures
293
- npx fastbrowser_cli batch --no-stop-on-error ./demo.fbs
300
+ npx fastbrowser_cli@latest batch --no-stop-on-error ./demo.fbs
294
301
  ```
295
302
 
296
303
  Example `demo.fbs`:
@@ -315,6 +322,7 @@ press_keys --keys "Tab, Enter"
315
322
  | `click` | Click an element by accessibility selector | `--selector` / `-s` |
316
323
  | `fill_form` | Fill a form field by accessibility selector | `--selector` / `-s`, `--value` |
317
324
  | `press_keys` | Press a comma-separated key sequence | `--keys` |
325
+ | `evaluate_script` | Run a JS function in the page context and return its JSON-able result | one of: `<file>`, `--script`, or piped stdin |
318
326
  | `batch` | Run multiple commands from a file, piped stdin, or `--script` inline | one of: `<file>`, `--script`, or piped stdin |
319
327
  | `install [skill-folder]` | Install bundled skills into `<skill-folder>/skills/` (default: `.`) | — |
320
328
  | `server start` | Start the HTTP server daemon | — |
@@ -0,0 +1,54 @@
1
+ import { execSync } from 'node:child_process';
2
+
3
+ const __dirname = new URL('.', import.meta.url).pathname;
4
+ const __filename = new URL(import.meta.url).pathname;
5
+
6
+ export class FastBrowserHelper {
7
+ static async run(command: string): Promise<string> {
8
+ const duringDev = __filename.endsWith('.ts') ? true : false;
9
+ const baseCommand = duringDev
10
+ ? `npx tsx ${__dirname}../../fastbrowser_cli/fastbrowser_cli.ts`
11
+ : `node ${__dirname}../../fastbrowser_cli/fastbrowser_cli.js`;
12
+ const fullCommand = `${baseCommand} ${command}`;
13
+ // console.log(`FastBrowserHelper: meta.url: ${import.meta.url}`);
14
+ // console.error(`FastBrowserHelper: Running command: ${fullCommand}`);
15
+ return execSync(fullCommand, { encoding: 'utf8' });
16
+ }
17
+
18
+ static async navigatePage(url: string): Promise<void> {
19
+ await FastBrowserHelper.run(`navigate_page --url '${url}'`);
20
+ }
21
+
22
+ static async fillForm(selector: string, value: string): Promise<void> {
23
+ await FastBrowserHelper.run(`fill_form --selector '${selector}' --value '${value}'`);
24
+ }
25
+
26
+ static async pressKeys(keys: string): Promise<void> {
27
+ await FastBrowserHelper.run(`press_keys --keys '${keys}'`);
28
+ }
29
+
30
+ static async click(selector: string): Promise<void> {
31
+ await FastBrowserHelper.run(`click -s '${selector}'`);
32
+ }
33
+
34
+ static async querySelectorsAll(selector: string, limit: number): Promise<string> {
35
+ return await FastBrowserHelper.run(`query_selectors --all --selector '${selector}' --limit ${limit}`);
36
+ }
37
+
38
+ static async querySelectorsAllWithChildren(selector: string, limit: number): Promise<string> {
39
+ return await FastBrowserHelper.run(`query_selectors --all --selector '${selector}' --limit ${limit} --with-ancestors --with-children`);
40
+ }
41
+
42
+ static async takeSnapshot(): Promise<string> {
43
+ return await FastBrowserHelper.run('take_snapshot');
44
+ }
45
+
46
+ static async querySelectors(selector: string, withAncestors = true): Promise<string> {
47
+ const flag = withAncestors === false ? ' --no-with-ancestors' : '';
48
+ return await FastBrowserHelper.run(`query_selectors --selector '${selector}'${flag}`);
49
+ }
50
+
51
+ static async evaluateScript(functionText: string): Promise<string> {
52
+ return await FastBrowserHelper.run(`evaluate_script --script "${functionText}"`);
53
+ }
54
+ }
@@ -0,0 +1,80 @@
1
+ # linkedin_cli
2
+
3
+ Command-line tool to interact with LinkedIn through a real browser session, driven by `fastbrowser_cli`.
4
+
5
+ It lets you create posts on the feed and manage direct-message conversations (list, read, send) from the terminal.
6
+
7
+ ## Requirements
8
+
9
+ - A running `fastbrowser_cli` session already authenticated on `linkedin.com`.
10
+ - The `_shared/fastbrowser_helper.ts` wrapper located in the sibling `contribs/_shared/` folder.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ npx tsx ./src/cli.ts <command> [args]
16
+ ```
17
+
18
+ ### Commands
19
+
20
+ | Command | Description |
21
+ |---------|-------------|
22
+ | `post <content>` | Create a post on the LinkedIn feed. |
23
+ | `dm_page` | Navigate to the LinkedIn messaging page. Run this first before any `dm_*` command. |
24
+ | `dm_list` | List the names of people you have conversations with. |
25
+ | `dm_send <target_user> <message>` | Send a message in an existing conversation with `target_user`. |
26
+ | `dm_thread <target_user>` | Print the message thread of a conversation with `target_user`. |
27
+ | `profile <slug>` | Export a LinkedIn profile by slug (the path component of `/in/<slug>/`). Use `-f json` for JSON output. |
28
+
29
+ `target_user` is matched against the conversation heading via a prefix match (e.g. `"Jerome"` matches `"Jerome Etienne"`).
30
+
31
+ ### Examples
32
+
33
+ Create a post:
34
+
35
+ ```bash
36
+ npx tsx ./src/cli.ts post "Hello LinkedIn from the CLI"
37
+ ```
38
+
39
+ List your conversations:
40
+
41
+ ```bash
42
+ npx tsx ./src/cli.ts dm_page
43
+ npx tsx ./src/cli.ts dm_list
44
+ ```
45
+
46
+ Read a thread:
47
+
48
+ ```bash
49
+ npx tsx ./src/cli.ts dm_thread "Jerome Etienne"
50
+ ```
51
+
52
+ Output is one message per line in the form:
53
+
54
+ ```
55
+ 2026-05-03T14:32:00:Jerome Etienne: hey, are you free this week?
56
+ ```
57
+
58
+ Send a reply:
59
+
60
+ ```bash
61
+ npx tsx ./src/cli.ts dm_send "Jerome Etienne" "Sure, Thursday afternoon works."
62
+ ```
63
+
64
+ Export a profile as markdown (default):
65
+
66
+ ```bash
67
+ npx tsx ./src/cli.ts profile jeromeetienne
68
+ ```
69
+
70
+ Export the same profile as JSON:
71
+
72
+ ```bash
73
+ npx tsx ./src/cli.ts profile jeromeetienne -f json
74
+ ```
75
+
76
+ ## Layout
77
+
78
+ - [src/cli.ts](src/cli.ts) — Commander entry point, defines the commands and orchestrates browser actions through `FastBrowserHelper`.
79
+ - [src/libs/linkedin_thread_helper.ts](src/libs/linkedin_thread_helper.ts) — Parses the LinkedIn message thread from an accessibility tree snapshot into timestamped lines.
80
+ - [src/libs/linkedin_profile_helper.ts](src/libs/linkedin_profile_helper.ts) — Parses a LinkedIn profile snapshot into a typed `LinkedinProfile` (header, About, Experience, Education) with markdown rendering.