Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
684cf00
init - helloworld
zTgx Sep 25, 2025
19b0fed
add README
zTgx Sep 25, 2025
2c0a7de
add x help documents
jingleizhang Sep 25, 2025
9a9a7a7
Merge pull request #26 from WyseOS/crawler
jingleizhang Sep 25, 2025
4e9c6bc
complete: register url/visit method
zTgx Oct 1, 2025
ddf1198
refactor register
zTgx Oct 1, 2025
a3f3401
remove dup files
zTgx Oct 1, 2025
6a5b554
add tools
zTgx Oct 1, 2025
2160b73
make fmt
zTgx Oct 1, 2025
79a15da
register all 32 tools
zTgx Oct 1, 2025
6b6aae5
add docker file
zTgx Oct 2, 2025
ae61938
feat: add proxy and profile
linda8134 Oct 11, 2025
0deb843
bugfix createProxy
jingleizhang Oct 11, 2025
6b08ad6
feat: add proxy and profile update and delete
linda8134 Oct 11, 2025
2b4421d
Merge pull request #27 from WyseOS/create-proxy-and-profile
jingleizhang Oct 13, 2025
779e737
Update README.md
zTgx Oct 15, 2025
f180b84
feat: add style for profile and proxy
linda8134 Oct 24, 2025
2fd9c35
Merge pull request #28 from WyseOS/create-proxy-and-profile
jingleizhang Oct 24, 2025
6558768
Merge pull request #29 from WyseOS/dev
jingleizhang Oct 24, 2025
e40b305
add proxy support via congfigs
jingleizhang Nov 14, 2025
229ad13
Merge pull request #31 from WyseOS/proxy
jingleizhang Nov 14, 2025
cced59c
Merge pull request #32 from WyseOS/dev
jingleizhang Nov 14, 2025
df23414
update mcp pnpm
jingleizhang Nov 14, 2025
0ee521c
Merge origin/dev into mcp
jingleizhang Nov 14, 2025
93831a6
Merge pull request #34 from WyseOS/mcp
jingleizhang Nov 14, 2025
c4b79bb
Merge pull request #35 from WyseOS/dev
jingleizhang Nov 14, 2025
61c8cb6
add Apache License
jingleizhang Nov 14, 2025
72a8c19
Merge pull request #37 from WyseOS/dev
jingleizhang Nov 14, 2025
2e88bb9
update version
jingleizhang Nov 24, 2025
765a121
support downloading as OSS files within session
jingleizhang Nov 25, 2025
d600d14
add API_REFERENCE.md
jingleizhang Nov 26, 2025
c3b075b
add session-download-files
jingleizhang Nov 27, 2025
9b02bb2
Merge pull request #39 from WyseOS/oss-files
jingleizhang Nov 27, 2025
b43bf4b
feat: Introduce MCP server as a new module and update documentation
jingleizhang Nov 27, 2025
1346eaa
add mcp-server
jingleizhang Nov 27, 2025
a223c45
Merge pull request #40 from WyseOS/oss-files
jingleizhang Nov 27, 2025
11bfa20
bugfix file module
jingleizhang Nov 27, 2025
57c1079
Merge pull request #41 from WyseOS/oss-files
jingleizhang Nov 27, 2025
a5a0416
bugfix: files api
jingleizhang Dec 1, 2025
51db066
Merge pull request #42 from WyseOS/oss-files
jingleizhang Dec 1, 2025
160d67f
Create dependabot.yml
jingleizhang Dec 9, 2025
9ed3201
chore: add .gitattributes to ignore html files in language stats
jingleizhang Dec 10, 2025
6b6e279
Merge pull request #44 from WyseOS/oss-files
jingleizhang Dec 10, 2025
94fd8df
Merge pull request #45 from WyseOS/dev
jingleizhang Dec 10, 2025
f321be4
add captcha solver
cugbliwei Dec 15, 2025
d57bd3d
update file path
jingleizhang Dec 15, 2025
754afa6
Merge pull request #46 from WyseOS/oss-files
jingleizhang Dec 15, 2025
7154704
update batch_action
jingleizhang Dec 21, 2025
41f3ab0
Merge pull request #47 from WyseOS/batch_action
jingleizhang Dec 21, 2025
a331cd3
bugfix: ensure page ready
jingleizhang Dec 29, 2025
d955d3c
Merge pull request #49 from WyseOS/bugfix_page_ready
jingleizhang Dec 29, 2025
068bf4b
Merge pull request #50 from WyseOS/dev
jingleizhang Jan 17, 2026
f8087b3
add github actions scripts
cugbliwei Jan 17, 2026
5a13285
add prod config
cugbliwei Jan 17, 2026
0d50694
updating multi_profile
jingleizhang Jan 18, 2026
566a668
update config source
cugbliwei Jan 19, 2026
97e7257
bugfix multi_profile
jingleizhang Jan 19, 2026
80aa7da
update webpages
jingleizhang Jan 19, 2026
61cabf8
add button sessions
jingleizhang Jan 19, 2026
2ef36ab
add page of multiple profiles
jingleizhang Jan 20, 2026
7692bb0
Merge pull request #51 from WyseOS/multi_profile
jingleizhang Jan 20, 2026
6b94453
Merge pull request #52 from WyseOS/dev
jingleizhang Jan 20, 2026
b9e9458
Bump diff from 4.0.2 to 4.0.4 in /worklets/twitter
dependabot[bot] Jan 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
worklets/crawler/src/operations/*.html linguist-vendored
worklets/crawler/src/template/*.html linguist-vendored
web/index.html linguist-vendored

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pnpm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
51 changes: 51 additions & 0 deletions .github/scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
set -e

echo "${CONFIG_JSON}" > deploy/${ENV}/config.json

sed -i "s#{{.ALIYUN_ACCESS_KEY}}#${ALIYUN_ACCESS_KEY}#g" deploy/${ENV}/config.json
sed -i "s#{{.ALIYUN_ACCESS_SECRET}}#${ALIYUN_ACCESS_SECRET}#g" deploy/${ENV}/config.json
sed -i "s#{{.CAPTCHA_API_KEY}}#${CAPTCHA_API_KEY}#g" deploy/${ENV}/config.json
sed -i "s#{{.CAPTCHA_TMP_PROXY}}#${CAPTCHA_TMP_PROXY}#g" deploy/${ENV}/config.json

echo "${ALICLOUD_ACK_CLUSTER_CONFIG}" > deploy/${ENV}/kubeconfig.yaml

cp deploy/${ENV}/config.json configs/browser/config.json
cp deploy/${ENV}/kubeconfig.yaml configs/browser/kubeconfig.yaml

docker buildx build \
--build-arg SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" \
--build-arg ENV="${ENV}" \
--push \
-f Dockerfile -t ${IMAGE_VERSION} .

sed -i "s#{{.ENV}}#${ENV}#g" deploy/${ENV}/deployment.yaml
sed -i "s#{{.IMAGE_VERSION}}#${IMAGE_VERSION}#g" deploy/${ENV}/deployment.yaml
sed -i "s#{{.APP_NAME}}#${APP_NAME}#g" deploy/${ENV}/deployment.yaml

sed -i "s#{{.ENV}}#${ENV}#g" deploy/${ENV}/service.yaml
sed -i "s#{{.APP_NAME}}#${APP_NAME}#g" deploy/${ENV}/service.yaml

mkdir -p ~/.kube
echo "${ALICLOUD_ACK_CLUSTER_CONFIG}" > ~/.kube/config
export KUBECONFIG=~/.kube/config

if kubectl get secret acr-secret -n ${ENV} &> /dev/null; then
echo "Secret acr-secret already exists in the default namespace. Skipping creation."
else
kubectl create secret docker-registry acr-secret \
--docker-server=${ALICLOUD_ACR_REGISTRY} \
--docker-username=${ALICLOUD_USERNAME} \
--docker-password=${ALICLOUD_PASSWORD} \
--namespace=${ENV}
fi

kubectl apply -f deploy/${ENV}/deployment.yaml
kubectl apply -f deploy/${ENV}/service.yaml

echo "deployments:"
kubectl get deployments -n ${ENV}
echo "pods:"
kubectl get pods -n ${ENV}
echo "services:"
kubectl get services -n ${ENV}
61 changes: 61 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy
env:
APP_NAME: browser
run-name: Deploy [${{ github.ref }} branch] to [${{ inputs.deploy_env }} env] by ${{ github.actor }}

#on:
# push:
# branches:
# - main
on:
workflow_dispatch:
inputs:
deploy_env:
type: choice
description: which env to deploy
options:
- prod
- dev

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: echo version
run: echo "${{ inputs.deploy_env }}"

- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to ACR
uses: docker/login-action@v2
with:
registry: ${{ secrets.ALICLOUD_ACR_REGISTRY }}
username: ${{ secrets.ALICLOUD_USERNAME }}
password: ${{ secrets.ALICLOUD_PASSWORD }}

- name: Make shell file executable
run: chmod +x ./.github/scripts/deploy.sh

- name: Build and Push Docker image and Deploy to ACK
shell: bash
env:
ENV: ${{ inputs.deploy_env }}
APP_NAME: ${{ env.APP_NAME }}
ALICLOUD_ACR_REGISTRY: ${{ secrets.ALICLOUD_ACR_REGISTRY }}
ALICLOUD_ACR_NAMESPACE: ${{ secrets.ALICLOUD_ACR_NAMESPACE }}
ALICLOUD_ACR_REPOSITORY: ${{ secrets.ALICLOUD_ACR_REPOSITORY }}
ALICLOUD_USERNAME: ${{ secrets.ALICLOUD_USERNAME }}
ALICLOUD_PASSWORD: ${{ secrets.ALICLOUD_PASSWORD }}
ALICLOUD_ACK_CLUSTER_CONFIG: ${{ secrets.ALICLOUD_ACK_CLUSTER_CONFIG }}
IMAGE_VERSION: ${{ secrets.ALICLOUD_ACR_REGISTRY }}/${{ secrets.ALICLOUD_ACR_NAMESPACE }}/${{ secrets.ALICLOUD_ACR_REPOSITORY }}:${{ env.APP_NAME }}-${{ inputs.deploy_env }}-${{ github.sha }}
ALIYUN_ACCESS_KEY: ${{ secrets.ALIYUN_ACCESS_KEY }}
ALIYUN_ACCESS_SECRET: ${{ secrets.ALIYUN_ACCESS_SECRET }}
CAPTCHA_API_KEY: ${{ secrets.CAPTCHA_API_KEY }}
CAPTCHA_TMP_PROXY: ${{ secrets.CAPTCHA_TMP_PROXY }}
CONFIG_JSON: ${{ secrets.CONFIG_JSON }}
run: ./.github/scripts/deploy.sh
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,15 @@ dist
.DS_Store
*.webm

config.json
browser/config.json
configs/browser/config.json
configs/proxy/*
configs/profile/*

# crawler data
worklets/crawler/data/tools.json
worklets/crawler/data/tools.json

#skills
.agent
.shared


108 changes: 108 additions & 0 deletions API_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
### Base URL 💖

```
http://127.0.0.1:13100
```

### Health Check

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `GET` | `/api/health` | Checks if the API server is running. | _None_ |

### Metadata Management 🗃️

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `GET` | `/api/metadata/flow/:name` | Retrieves the manifest for a specific flow. | **Path**: `name` (string, required) |
| `GET` | `/api/metadata/worklet/:name` | Retrieves the manifest for a specific worklet. | **Path**: `name` (string, required) |
| `GET` | `/api/metadata/list/:type` | Lists all available metadata for a given type (`flow` or `worklet`). | **Path**: `type` (string, required) - `flow` or `worklet` |
| `POST` | `/api/metadata/save` | Saves or updates a flow manifest. | **Body**: `UpdateMetadataDto`<br>- `metadata_type` (string, required)<br>- `name` (string, required)<br>- `data` (object, required) |

### Session Management 📈

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `POST` | `/api/session/create` | Creates a new browser session. | **Body**: `CreateSessionDto`<br>- `session_context` (object, optional)<br>- `session_id` (string, optional)<br>- `user_id` (string, optional) |
| `POST` | `/api/session/:sessionId/add_init_script` | Adds an initialization script to the session. | **Path**: `sessionId` (string, required)<br>**Body**: `AddInitScriptDto`<br>- `script` (string, required) |
| `GET` | `/api/session/:sessionId` | Retrieves details for a specific session. | **Path**: `sessionId` (string, required) |
| `GET` | `/api/session/:sessionId/context` | Gets the context (cookies, local storage) of a session. | **Path**: `sessionId` (string, required) |
| `GET` | `/api/session/:sessionId/release` | Closes and cleans up a session. | **Path**: `sessionId` (string, required) |
| `GET` | `/api/sessions/list` | Lists all active sessions. | _None_ |
| `GET` | `/api/session/:sessionId/screenshot` | Takes a screenshot of the current page in a session. | **Path**: `sessionId` (string, required) |
| `GET` | `/api/fingerprint/generate` | Generates a random fingerprint. | _None_ |

### Browser Actions 🎬

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `POST` | `/api/browser/action` | Executes a single browser action (e.g., `click`, `text`). | **Body**: `BrowserActionDto`<br>- `session_id` (string, required)<br>- `page_id` (number, optional, default: 0)<br>- `action_name` (string, required)<br>- `data` (object, required) |
| `POST` | `/api/browser/batch_actions` | Executes a batch of browser actions sequentially. | **Body**: `BatchActionsDto`<br>- `session_id` (string, required)<br>- `page_id` (number, optional, default: 0)<br>- `actions` (array, required):<br> - `action_name` (string, required)<br> - `data` (object, required) |

### Page Management 📄

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `POST` | `/api/session/:sessionId/page/create` | Creates a new page (tab) in a session. | **Path**: `sessionId` (string, required) |
| `GET` | `/api/session/:sessionId/page/:pageId/switch` | Switches the active page in a session. | **Path**:<br>- `sessionId` (string, required)<br>- `pageId` (number, required) |
| `GET` | `/api/session/:sessionId/page/:pageId/release` | Closes a specific page in a session. | **Path**:<br>- `sessionId` (string, required)<br>- `pageId` (number, required) |

### Flow Management 🌊

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `POST` | `/api/flow/create` | Creates a new flow instance from a predefined manifest. | **Body**: `CreateFlowDto`<br>- `flow_name` (string, required)<br>- `session_id` (string, optional)<br>- `user_id` (string, optional)<br>- `is_save_video` (boolean, optional)<br>- `extension_names` (string[], optional) |
| `POST` | `/api/flow/deploy` | Deploys a new flow using an inline JSON definition. | **Body**: `DeployFlowDto`<br>- `flow` (object, required)<br>- `session_id` (string, optional)<br>- `user_id` (string, optional)<br>- `is_save_video` (boolean, optional)<br>- `extension_names` (string[], optional) |
| `POST` | `/api/flow/fire` | Executes an action within a running flow instance. | **Body**: `FireFlowDto`<br>- `flow_instance_id` (string, required)<br>- `action_name` (string, optional, default: `action_flow_start`)<br>- `data` (object, required) |
| `GET` | `/api/flow/list` | Lists all active flow instances. | _None_ |

### File Management 📁

| Method | Endpoint | Description | Parameters |
| :--- | :--- | :--- | :--- |
| `POST` | `/api/session/:sessionId/files` | Uploads one or more files to a session, checking against session storage limits. | **Path**: `sessionId` (string, required)<br>**Body**: `filePath` (string, optional) - target path for the file, defaults to original name. |
| `GET` | `/api/session/:sessionId/files` | Lists all files stored within a specific session. | **Path**: `sessionId` (string, required) |
| `GET` | `/api/session/:sessionId/files/*` | Downloads a specific file from a session. | **Path**:<br>- `sessionId` (string, required)<br>- `filePath` (string, required) |
| `HEAD` | `/api/session/:sessionId/files/*` | Retrieves metadata (headers) for a specific file in a session without downloading the content. | **Path**:<br>- `sessionId` (string, required)<br>- `filePath` (string, required) |
| `GET` | `/api/session/:sessionId/files.zip` | Downloads all files from a session as a ZIP archive. | **Path**: `sessionId` (string, required) |
| `DELETE` | `/api/session/:sessionId/files/*` | Deletes a specific file from a session. | **Path**:<br>- `sessionId` (string, required)<br>- `filePath` (string, required) |
| `DELETE` | `/api/session/:sessionId/files` | Deletes all files associated with a specific session. | **Path**: `sessionId` (string, required) |

## Action Space 🚀

The `BrowserAction` module provides a comprehensive set of low-level actions that can be executed on a page within a session. These actions are the fundamental building blocks for creating complex automation flows.

| Action | Description | Parameters |
| :--- | :--- | :--- |
| `url` | Gets the URL of the current page. | _None_ |
| `visit` | Navigates the page to a specified URL. | `url`: The URL to visit. |
| `history` | Navigates forward or backward in the browser history. | `num`: A positive number to go forward, a negative number to go back. |
| `search` | Performs a Google search. | `search_key`: The text to search for. |
| `refreshpage` | Reloads the current page. | _None_ |
| `click` | Clicks an element or a point on the page. | `element_id` or (`x`, `y` coordinates). |
| `clickfull` | A more comprehensive click action. | `element_id` or (`x`, `y` coordinates). Optional: `hold` (seconds), `button` ("left", "right", "middle"). |
| `doubleclick` | Double-clicks an element or a point on the page. | `element_id` or (`x`, `y` coordinates). |
| `text` | Enters text into an element or at the current cursor position. | `text`: The text to type. Optional: `element_id`, `press_enter` (boolean), `delete_existing_text` (boolean), or (`x`, `y` coordinates). |
| `scrollup` | Scrolls the page up. | _None_ |
| `scrolldown` | Scrolls the page down. | _None_ |
| `scrollelementup` | Scrolls an element\'s container up. | `element_id`, `page_number`: Number of pages to scroll. |
| `scrollelementdown` | Scrolls an element\'s container down. | `element_id`, `page_number`: Number of pages to scroll. |
| `scrollto` | Scrolls to make an element visible. | `element_id`: The ID of the element to scroll to. |
| `wait` | Pauses execution for a specified duration. | `time`: The number of seconds to wait. |
| `keypress` | Simulates key presses. | `keys`: A string or array of strings of keys to press (e.g., 'Enter', 'Control+A'). |
| `hover` | Hovers over an element or a point on the page. | `element_id` or (`x`, `y` coordinates). |
| `evaluate` | Executes a JavaScript snippet in the page context. | `script`: The JavaScript code to execute. |
| `initjs` | Injects initialization JavaScript into the page. | _None_ |
| `waitforloadstate` | Waits for the page to reach a specific load state. | _None_ |
| `content` | Gets the full HTML content of the page. | _None_ |
| `createtab` | Creates a new browser tab. | Optional: `url`: The URL to open in the new tab. |
| `switchtab` | Switches to a different tab. | `tab_index`: The index of the tab to switch to. |
| `closetab` | Closes a browser tab. | `tab_index`: The index of the tab to close. |
| `tabsinfo` | Retrieves information about all open tabs. | _None_ |
| `cleanupanimations` | Removes animations from the page to stabilize tests. | _None_ |
| `previewaction` | Highlights an element to preview an action without executing it. | `element_id`: The ID of the element to preview. |
| `setcontent` | Sets the HTML content of the page. | `content`: The HTML content to set. |
| `ensurepageready` | Ensures the page is fully loaded and ready for interaction. | _None_ |
| `selectoption` | Selects an option from a dropdown or custom select component. | `element_id` or (`x`, `y` coordinates). |
| `drag` | Performs a drag-and-drop operation. | `drag_path`: A JSON string or array of points `{x, y}` representing the drag path. |
| `screenshot` | Takes a screenshot of the current page. | _None_ |
Loading