96 Commits

Author SHA1 Message Date
zhouxiao.shaw
999c6a5449 fix: lint error 2025-07-04 15:17:28 +08:00
zhouxiao.shaw
bdf61309a1 chore: fix error formt 2025-07-04 15:12:41 +08:00
Leyang
5e9eb72924
fix(web-integration): reserve the visible nodes of invisible elements (#840) 2025-06-16 20:38:22 +08:00
Leyang
32f503f69e
fix(shared): reduce null element node (#827)
* fix(shared): reduce null element node

* feat(web-integration): delete content and locator, support visible-only for domIncluded

* feat(web-integration): remove logScreenshot documentation and update tests to use treeToList for content extraction

* feat(web-integration): add trimContextByViewport function to filter execution tasks by visible elements

* release: v0.18.1

* fix(workflow): update default release version to 'prepatch'

* fix(web-integration): node detect empty

* release: v0.18.2

* fix(evaluation): restore generateExtractData

* fix(web-integration): reporter export

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-13 11:25:31 +08:00
Leyang
3510a8c736
feat(web-integration): support unstableLogContent api for agent (#826)
* feat(web-integration): support unstableLogContent api for agent

* fix(web-integration): use sync mehtod

* docs(core): update API doc

* fix(web-integration): playwright

* docs(site): update

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-06-11 16:50:11 +08:00
github-actions[bot]
67590d3273 release: v0.18.0 2025-06-09 03:04:12 +00:00
Leyang
37ae71241e
feat(web-integration): support logScreenshot api for agent (#813)
* feat(web-integration): support logScreenshot api for agent

* docs(core): update api description

* docs(site): fix error

* feat(web-integration): title is also optional

* docs(site): fix

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-06-06 18:58:49 +08:00
0acb5af6eb
fix(cache): allow cache files to be stored in nested folders (#798)
* fix(cache): allow cache files to be stored in folders to enhance the cache

* refactor(task-cache): reorder import statements for improved readability

* feat(task-cache): add cache ID sanitization and custom path handling

* fix: lint error
2025-06-03 15:33:02 +08:00
github-actions[bot]
14b9200236 release: v0.17.4 2025-05-30 06:31:25 +00:00
Leyang
fd48cbd8c9
docs(core): add query right click and query from html docs (#787)
* docs(site): add right click docs

* docs(site): add ai query opts docs

* fix(web-integration): test

* docs(core): update api doc

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-05-30 14:25:53 +08:00
yuyutaotao
98cebe523c
feat(core,web-integration): support right-click action (#762) (#780)
* feat(core,web-integration): support right-click action (#762)

* feat(core,web-integration): support right click (solve #558)

* feat(web-integration): add aiRightClick action to PlaywrightAiFixture

* fix(core): ci

* fix(core): ci

* feat(web-integration): chrome extension suppport right click

---------

Co-authored-by: xnmeet <144585181+xnmeet@users.noreply.github.com>
Co-authored-by: quanruzhuoxiu <quanruzhuoxiu@gmail.com>
2025-05-30 11:24:10 +08:00
Leyang
ca8edcd328
ai query support query from html dom (#782)
* feat(web-integration): query from all dom element

* test(web-integration): add tests

* fix(cli): tests

* fix(shared): tests

* fix(core): tests

* feat(evaluation): update data

* refactor(web-integration): update var

* Revert "feat(evaluation): update data"

This reverts commit d882bddd38f3ce3a24d14a345c71aaf3bd725aab.

* test(web-integration): fix tests
2025-05-30 11:23:00 +08:00
Leyang
56cfbd9125
fix(web-integration): output opt is invalid in yaml (#777)
* fix(web-integration): output opt is invalid in yaml

* test(cli): fix

* fix(cli): tests
2025-05-29 10:26:18 +08:00
github-actions[bot]
0dd38c2537 release: v0.17.3 2025-05-26 06:36:57 +00:00
Leyang
d07c6a78e3
feat(web-integration): support full xpath for cache (#754)
* feat(web-integration): support full xpath for cache

* refactor(web-integration): simplify getElementXPath to improve clarity and performance

* feat(web-integration): add support for 'A' node type and related extraction logic

* feat(web-integration): merge children rects of button

* feat(web-integration): enhance caching documentation and tests

* test(web-integration): update snapshot

* docs(core): update caching

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-05-23 17:51:04 +08:00
github-actions[bot]
3b4671b0be release: v0.17.2 2025-05-23 06:18:49 +00:00
yutao
fd6703c6d5 chore(core): add test cases 2025-05-22 07:31:55 +08:00
Leyang
4c8d881614
fix(web-integration): handle undefined aiInput case in ScriptPlayer (#743)
* fix(web-integration): handle undefined aiInput case in ScriptPlayer

* fix(workflow): version

* fix(core): yaml player

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-05-21 19:18:29 +08:00
github-actions[bot]
049d9f6565 release: v0.17.1 2025-05-20 09:11:17 +00:00
Leyang
fb2580616c
fix cache bugs(scroll instant, text node info, cache hit condition) (#732)
* fix(web-integration): cache hit when element.id exist and scroll element instantly

* fix(web-integration): use parent xpath for text node

* fix(web-integration): only scroll in to view when element is not completly visible

* fix(shared): distinct text node

* test(web-integration): getElementInfoByXpath

* test(web-integration): rename desc

* test(web-integration): fix

* test(web-integration): snapshot attributes only

* test(web-integration): fix test
2025-05-20 13:19:32 +08:00
github-actions[bot]
39ddc57df3 release: v0.17.0 2025-05-16 14:32:01 +00:00
yuyutaotao
b261ed7f2a
feat(web): use xpath and yaml as cache (#711)
* feat(web-integration): use xpath for cache instead of id

* feat(web-integration): enhance TaskCache to support xpaths for cache matching and add new test cases

* feat(web-integration): add debug log for unknown page types in TaskCache

* feat(web-integration): update caching logic and cache hit conditions for Plan and Locate tasks

* chore(core): update debug log

* feat(web-integration): update rspress.config and enhance TaskCache structure with new properties

* feat(web-integration): recalculate id when hit cache

* fix(web-integration): update mock implementation in task-cache test to use evaluate method

* feat(web-integration): enhance element caching by adding XPath support and improving cache hit logic

* chore(core): lint

* feat(web-integration): improve XPath handling in web-extractor

* test(web-integration): fix tests

* feat(core, web-integration): add attributes to LocateResultElement and enhance element handling

* fix(core): lint

* feat(web-integration): add midsceneVersion to TaskCache and update cache validation logic

* fix(core): test

* fix(web-integration): update cache validation logic to prevent reading outdated midscene cache files

* feat(web-integration): enhance TaskCache to track used cache items and improve cache retrieval logic

* fix(core): xpath logic (#710)

* feat(core): resue context for locate

* feat(core): build yamlFlow from aiAction

* feat(core): refine task-cache

* feat(core): update cache

* feat(core): refine task-cache

* feat(core): refine task-cache

* feat(core): remove unused checkElementExistsByXPath

* feat(core): use yaml file as cache

* chore(core): fix lint

* chore(core): print warning for previous cache

* refactor(core): remove quickAnswer references and improve element matching logic

* fix(core): update import path for buildYamlFlowFromPlans

* chore(web-integration): update output image and skip task error test

* fix(web-integration): update test snapshots to handle beta versions

* fix(web-integration): adjust test snapshots for version consistency

* fix(web-integration): track original cache length and adjust matching logic in tests

* fix(web-integration): update test URLs to reflect new target site and enable previously skipped test

* chore(core): update cache docs

* fix(core): test

* feat(core): try to match element from plan

* fix(web-integration): cache id stable when retry in palywright

* fix(web-integration): typo

* style(web-integration): lint

* fix(web-integration): stable cacheid in tests

* fix(web-integration): cache id

---------

Co-authored-by: quanruzhuoxiu <quanruzhuoxiu@gmail.com>
2025-05-16 17:16:56 +08:00
yuyutaotao
80b4e7b609
fix(mcp): mcp error connection (#676)
* fix(mcp): mcp error connection

* fix(mcp): lint

* fix(core): add kill signal for server

* chore(core): force close conflict port in bridge

---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>

* chore(core): merge main
2025-04-30 16:07:59 +08:00
Leyang
4718066bb1
feat(web-integration): add support for new agent method(aiBoolean, aiString, aiNumber, aiLocate) (#658)
* feat(web-integration): add support for new agent method(aiBoolean, aiString, aiNumber, aiLocate)

* fix(core, web-integration): update data extraction logic and refine return types for agent methods

* feat(site): add detailed descriptions and examples

* fix(web-integration): remove unused properties from aiLocate return type and update UI titles

* fix(core): enhance agent methods for better extraction and querying

* fix(core): update test scripts and refine data extraction prompts

* fix(core): refine return type in ExecutionTaskApply and remove unused import in inspect

* fix(core): update data extraction logic and enhance type handling in Insight class

* fix(web-integration): update import path for puppeteerAgentForTarget in player test file

* fix(core): tests fix

* fix(core): fix tests

* fix(shared): enhance imageInfo tests by validating individual properties and updating snapshots

* fix(site): remove waitForNavigationTimeout from Playwright integration examples

* fix(site): update timeout configuration examples in FAQ for clarity

* test(web-integration): remove unused client-extractor test and related snapshots

* chore(core): fix query implementation

* fix(report): improve data handling in DetailSide component and enhance output display

* fix(core): refine data extraction prompts and improve error handling in PageTaskExecutor

* fix(core): update data extraction prompt for clarity and type validation

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-04-29 13:36:49 +08:00
yuyutaotao
667fb59474
refactor(bridge): enhance error handling and connection logic in BridgeClient and BridgeServer (#653)
---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2025-04-27 16:27:42 +08:00
yuyutaotao
e1f708740f
refactor(bridge): update connection handling and server close logic (#646)
---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2025-04-27 13:30:46 +08:00
github-actions[bot]
0a3bc1e230 release: v0.15.0 2025-04-18 11:26:30 +00:00
Zhou Xiao
bc5b6e2121
ci(workflow): add commit msg check (#587)
* ci(workflow): add commit check

* docs(workflow): add commit check to CONTRIBUTING

* chore(workflow): optimize lint error
2025-04-18 12:50:52 +08:00
Leyang
b76211bd5d
feat: android playground (#542)
* refactor: android api

* refactor: enhance Android agent to accept options for device connection

* fix: type error

* fix: click after clearInput

* fix: click before clearInput

* feat: android playground

* feat: support npx package name

* feat: android playground joint

* fix: git ignore conflicts

* feat: ensure adb server is running before initializing adb client

* fix: deps consistency

* ci: add android playground

* feat: integrate shared constants and improve server configuration in android playground

* feat: android playground style

* feat: style opt

* feat: add @rsbuild/plugin-svgr dependency and improve URI handling in adb

* feat: remove unused water flow scripts and update comments to English

* feat: download report file

* feat: standalone android playground

* feat: use dynamic import

* feat: migrate CSS to LESS and remove unused styles in chrome extension and report

* feat: enhance Android playground with ScrcpyPlayer ref integration and device management improvements

* feat: optimize styles and layout in Android playground and visualizer components

* chore: add bin back

* chore: update build script to exclude documentation generation

* feat: add not ready message to PlaygroundResult for improved user guidance

* feat: add error handling for screenshot capture in Android page

* docs: update readme

* feat: add PNG validation for screenshot buffer in Android page

* feat: enhance UI components with improved styling and tooltips in ScrcpyPlayer and PromptInput

* docs: update uri parameter description in integrate-with-android documentation and improve uri handling in launch function

* style: update primary color to #2B83FF across multiple components and adjust margin in App.less

* refactor: replace userConfig with globalConfig for environment configuration management and update related functions

* feat: integrate server validation logic in App, AdbDevice, and ScrcpyPlayer components for improved connection handling

* style: enhance player component layout with overflow handling and margin adjustments

* style: refine player component layout with flex adjustments and improved spacing

* feat: add midscene model name display and improve layout in EnvConfig component

* feat: integrate ShinyText component for enhanced loading progress display in PlaygroundResult

* test: add test for isValidPNGImageBuffer

* style: remove background color from App.less and adjust AI config override behavior in env.ts

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-04-17 17:44:11 +08:00
Leyang
0ca9fda7ae
feat: android yaml support (#551)
* feat: android yaml support

* feat: enhance ScriptPlayer to support web and android environments

* chore: update error message

* refactor: unify environment interfaces for YAML scripts

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-04-11 09:36:41 +08:00
yuyutaotao
adc3fd9e0d
feat: use aiTap(prompt, opt) style interface (#512) 2025-04-01 10:41:31 +08:00
Leyang
934a1e2b5d
use adb instead of appium (#483)
* feat: enable search area for locate

* fix: update evaluation

* fix: locator

* feat: show searchArea in report

* chore: add yaml support for aiTap

* feat: use adb instead appium

* feat: Adds debugging information and reconstructs input text capabilities

* feat: refactoring Android related functions and adding android modules

* feat: update the image scaling algorithm, adjust the Android page class to support device scaling, and remove test files that are no longer needed

* feat: adjust the Android page class to support device scaling, and remove test files that are no longer needed

* feat: use appium-adb instead of bare command

* fix: update entry for @midscene/android

* feat: optimize the screenshot processing logic, add a backup mechanism when screenshots fail, and update test cases to accommodate new features

* fix: rethrow error

* feat: add Android debug configuration options and update documentation

* chore: fix code style in #483 (#492)

* fix: remove try for error handle by outside

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
Co-authored-by: linyibing <linyibing@bytedance.com>
Co-authored-by: yuyutaotao <167746126+yuyutaotao@users.noreply.github.com>
2025-03-25 22:45:05 +08:00
yuyutaotao
649aeceb43
feat: enable search area for locate (#473)
* feat: enable search area for locate

* fix: update evaluation

* fix: build error

* fix: ci

* fix: locator

* feat: show searchArea in report

* chore: add yaml support for aiTap

* feat: update status tip

* fix: #473 (#484)

* chore: optimize unit test list

---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2025-03-24 09:50:27 +08:00
yuyutaotao
8e1ba565d0
feat: optimize locator (#456)
---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2025-03-17 19:19:54 +08:00
github-actions[bot]
9dad7f3e7f release: v0.12.5 2025-03-10 08:56:47 +00:00
Zhou Xiao
5d63ef9151
refactor: switch bundle type to bundleless (#437) 2025-03-07 17:20:18 +08:00
Zhou Xiao
8e69f8d151
fix(keybord): resolve selectAll/Copy/Paste event (#384)
* fix(keybord): resolve selectAll/Copy/Paste event

* chore: fix e2e test

* chore: upgrade deps

* chore: add keybord commands  ref
2025-02-13 15:53:53 +08:00
github-actions[bot]
f7c583cdf5 release: v0.11.1 2025-02-13 06:50:24 +00:00
yuyutaotao
2f2400dffa
fix: correctly collect elements in absolute container (#373) 2025-02-10 20:51:43 +08:00
github-actions[bot]
d1e2e2b560 release: v0.11.0 2025-02-10 10:35:13 +00:00
yuyutaotao
2a28472fa5
feat: use different color for annotations (#366) 2025-02-10 16:36:12 +08:00
yuyutaotao
9d5f2fbcac
feat(web-extract): extract web content as a tree (#337)
* feat: extract web content as a tree

* chore: update test data

* chore: update test data

* feat: update answer of evaluation

* chore: update test cases

* chore: remove focusing on cases

* fix: ci

* fix: put rect in html tree

* fix: CI

* fix: AI test

* fix: lint

* fix: CI

* fix: static-page compatibility

* fix: CI

* fix: map by markerId

* fix: llm planning prompt

* chore: update hash length

* chore: ignore writing dump file

* fix: lint

* fix: ci snapshot

* chore: snapshot tree in web extractor

* chore: export tree utils in core

* chore: export tree utils in core

* fix: CI

* fix: update test case and evaluation

* chore: remove unused file

* refactor(extract): modify dependencies (#358)

* refactor(extract): modify dependencies

* chore: modify files config

* chore: add indexId as key for map

---------

Co-authored-by: Zhou Xiao <zhouxiao.shaw@bytedance.com>
2025-02-07 14:55:52 +08:00
github-actions[bot]
8eacc354a7 release: v0.10.3 2025-01-27 08:21:33 +00:00
Zhou Xiao
02ad84cf6f
chore: fix ai test (#332) 2025-01-27 10:22:56 +08:00
github-actions[bot]
e6fc69eb81 release: v0.10.2 2025-01-26 12:39:17 +00:00
yuyutaotao
6d924e267f
feat(puppeteer): allow tracking new tab in puppeteer agent (#310) 2025-01-26 16:49:32 +08:00
Zhou xiao
4c82eff526
chore: fix e2e test (#316)
* chore: fix e2e test

* chore: ignore todo test

* chore: fix e2e test

* chore: upgrade gpt api version

* chore: fix e2e test

* chore: fix e2e test

* chore: fix direction

* chore: fix direction

* chore: split test

* chore: split test

* chore: modify input info

* fix: scroll param in ci

* fix: lint

* fix: ai test

* fix: ai test

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
2025-01-24 15:02:50 +08:00
github-actions[bot]
0f92941f54 release: v0.10.1 2025-01-23 07:15:56 +00:00
yuyutaotao
57f6786628
feat(extract-data): extract data from same-origin iframe (#258)
* feat: extract data from same-origin iframe

* fix: ci snapshot

* fix: extracting timeout error

* fix: ci timeout

* fix: update assets

* feat: set default size of yaml as 1920x1080

* chore: update default viewport size

---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2025-01-22 20:52:11 +08:00
yuyutaotao
3d95460f44
docs(ai-model): update docs for ui-tars (#305)
* feat: update docs for ui-tars

* doc: update

* doc: update

* doc: update

* chore: update readme

* fix: ci

* docs: upgrade video

* chore: modify huagging face icon

---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2025-01-22 09:24:29 +08:00