Skip to content

Add browser script bridge workflow example#356

Open
Excellencedev wants to merge 13 commits into
mediar-ai:mainfrom
Excellencedev:fix-353
Open

Add browser script bridge workflow example#356
Excellencedev wants to merge 13 commits into
mediar-ai:mainfrom
Excellencedev:fix-353

Conversation

@Excellencedev

@Excellencedev Excellencedev commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

Description

Added a comprehensive TypeScript workflow example that tests the Terminator browser script bridge functionality across various scenarios including basic execution, error handling, and retry logic.

What it covers

  • Chrome extension bridge initialization and connection
  • Inline scripts, function execution, and file-based scripts
  • Promise rejections and structured failure handling
  • Environment variable injection and retry/reset capabilities

Usage

cargo run --bin terminator -- mcp run examples/browser_script_bridge_workflow

This serves as both documentation and integration testing for the browser script bridge, ensuring reliable Chrome extension functionality.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other:

Video Demo (Recommended)

2025-11-13.03-10-32.mp4

AI Review & Code Quality

  • I asked AI to critique my PR and incorporated feedback
  • I formatted my code properly
  • I tested my changes locally

Checklist

  • Code follows project style guidelines
  • Added video demo (recommended)
  • Updated documentation if needed

Additional Notes

/fixes #353
/claim #353

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 please review and comment so I can know changes to make

@louis030195

Copy link
Copy Markdown
Contributor

provide a video in the .md (not a zip)

@Excellencedev

Copy link
Copy Markdown
Contributor Author

provide a video in the .md (not a zip)

@louis030195 the file is >10mb and i am on github free will not allow that

@Excellencedev

Copy link
Copy Markdown
Contributor Author

provide a video in the .md (not a zip)

@louis030195 done

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 also chrome actually opened in the video but the video does not show it because o how windows game bar works

@louis030195

Copy link
Copy Markdown
Contributor

i dont see any browser in ur video

@louis030195

louis030195 commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

https://github.com/mediar-ai/terminator/actions

i partially did the task actually

using rust

https://github.com/mediar-ai/terminator/blob/main/crates/terminator/tests/browser_script_edge_cases_test.rs

if you can make this work - somehow the github action fails, idk why

need to make sure

  1. chrome install in gh action
  2. chrome extension installs
  3. test runs

but it would be much better to have this as a TS workflow using our SDK, which would give us a good base to increase coverage of our whole ecosystem using our own product

PS: you can just drop the mp4 in the markdown ui github and it will embed the video (or click the button at the bottom to select a file when creating a comment)

@tribhuwan-kumar

Copy link
Copy Markdown
Contributor
image image

https://github.com/tribhuwan-kumar/terminator/actions/runs/19317760270/job/55252595215
even tho the extension gets install in chrome, but the websockets doesn't connect to each other

          # swtich to bun instead of node
          npm install -g bun
          cd packages/terminator-nodejs
          bun "../../.github/scripts/test-extension-bridge.js"

also we should switch to bun instead of node cause node sometimes fails to load packages and throws the MODULE_NOT_FOUND error

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@tribhuwan-kumar can u approve workflow so i can see my own ci too

@Excellencedev

Copy link
Copy Markdown
Contributor Author
2025-11-13.03-10-32.mp4

@louis030195 here is updated video

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 also can u please approve workflow also ?

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 please re-review

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 any updates ?

@louis030195

Copy link
Copy Markdown
Contributor

is it workijg in gh action?

chec kthis tool

https://github.com/nektos/act

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 when running the github action, I will have to disable Node js tests because it is failing currently and won't allow the browser script to run

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195 it did not work unfortunately
C:\Users\USER\3D Objects\terminator>act ci.yml
time="2025-11-15T03:22:34+01:00" level=warning msg="Couldn't get a valid docker connection: no DOCKER_HOST and an invalid container socket ''"
? Please choose the default image you want to use with act:

  • Large size image: ca. 17GB download + 53.1GB storage, you will need 75GB of free disk space, snapshots of GitHub Hosted Runners without snap and pulled docker images
  • Medium size image: ~500MB, includes only necessary tools to bootstrap actions and aims to be compatible with most actions
  • Micro size image: <200MB, contains only NodeJS required to bootstrap actions, doesn't work with all actions

Default image and other options can be changed manually in C:\Users\USER\AppData\Local\act\actrc (please refer to https://nektosact.com/usage/index.html?highlight=configur#configuration-file for additional information about file structure) Medium
Error: Could not find any stages to run. View the valid jobs with act --list. Use act --help to find how to filter by Job ID/Workflow/Event Name

i will create a pr to make the checks pass so mey browserscript can run

@tribhuwan-kumar

Copy link
Copy Markdown
Contributor

@louis030195 when running the github action, I will have to disable Node js tests because it is failing currently and won't allow the browser script to run

there are some issue in browser script that need to be addressed, i've tried it yesterday, its keeps failing cause the issues in browser script workflow

@Excellencedev

Excellencedev commented Nov 15, 2025

Copy link
Copy Markdown
Contributor Author

@louis030195 when running the github action, I will have to disable Node js tests because it is failing currently and won't allow the browser script to run

there are some issue in browser script that need to be addressed, i've tried it yesterday, its keeps failing cause the issues in browser script workflow

@tribhuwan-kumar please give me more details because it runs successfully locally

@Excellencedev
Excellencedev force-pushed the fix-353 branch 3 times, most recently from 9b3c093 to bfb9cf2 Compare November 16, 2025 05:33
@Excellencedev
Excellencedev force-pushed the fix-353 branch 2 times, most recently from c9aa51e to 7c8eea7 Compare November 16, 2025 12:41
@Excellencedev

Excellencedev commented Nov 16, 2025

Copy link
Copy Markdown
Contributor Author

@louis030195 it runs in the CI but fails due to missing extension (unrelated changes)
That is for another PR. I will do it myself
For this PR, it is ready to merge
It works locally

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@louis030195
Screenshot 2025-11-16 141537

@Excellencedev

Copy link
Copy Markdown
Contributor Author

definition of done:

  • uses workflow sdk, terminator sdk, can be ran one liner using terminator cli
  • test different edge cases of the rust bridge using UI (executeBrowserScript function)
  • PR with video showing it runs
  • make it run in our github action

All of this is done

Comment thread .github/workflows/ci.yml
@Excellencedev

Excellencedev commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

@louis030195 please re-review
Left some comments, it works on ci

@Excellencedev

Copy link
Copy Markdown
Contributor Author
2025-11-13.03-10-32.mp4

@louis030195 here is updated video

also image in ci
Screenshot 2025-11-16 141537

@Excellencedev

Copy link
Copy Markdown
Contributor Author

@m13v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create a typescript workflow that test the browser script bridge

3 participants