chore: import upstream snapshot with attribution
UI-TARS E2E Test / E2E (macos-13) (push) Waiting to run
UI-TARS E2E Test / E2E (macos-latest) (push) Waiting to run
UI-TARS E2E Test / E2E (windows-latest) (push) Waiting to run
CI Test, Typecheck / Test & Typecheck (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1s
/ test (push) Failing after 0s
secretlint / Run secretlint to diff files (push) Failing after 1s
@@ -0,0 +1,8 @@
|
||||
# Changesets
|
||||
|
||||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
||||
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [
|
||||
[
|
||||
"@ui-tars/*",
|
||||
"!@ui-tars/visualizer"
|
||||
],
|
||||
[
|
||||
"@agent-infra/mcp-*"
|
||||
]
|
||||
],
|
||||
"linked": [],
|
||||
"access": "restricted",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": [
|
||||
"ui-tars-desktop",
|
||||
"ui-tars-desktop-renderer",
|
||||
"@common/*",
|
||||
"@agent-infra/mcp-benchmark"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
rules: {
|
||||
'scope-empty': [0],
|
||||
'scope-enum': [2, 'always'],
|
||||
'type-enum': [
|
||||
2,
|
||||
'always',
|
||||
[
|
||||
'feat',
|
||||
'style',
|
||||
'fix',
|
||||
'docs',
|
||||
'chore',
|
||||
'refactor',
|
||||
'ci',
|
||||
'test',
|
||||
'revert',
|
||||
'perf',
|
||||
'release',
|
||||
'tweak',
|
||||
],
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
@@ -0,0 +1,4 @@
|
||||
VLM_PROVIDER=huggingface
|
||||
VLM_BASE_URL=http://your_endpoint.aws.endpoints.huggingface.cloud/v1
|
||||
VLM_API_KEY=hf_your_api_key
|
||||
VLM_MODEL_NAME=your_model_name
|
||||
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
out
|
||||
.gitignore
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
module.exports = {
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:react/recommended',
|
||||
'plugin:react/jsx-runtime',
|
||||
'@electron-toolkit/eslint-config-ts/recommended',
|
||||
'@electron-toolkit/eslint-config-prettier',
|
||||
],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'react/display-name': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
camelcase: 'off',
|
||||
// A temporary hack related to IDE not resolving correct package.json
|
||||
'import/no-extraneous-dependencies': 'off',
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/destructuring-assignment': 'off',
|
||||
'react/jsx-filename-extension': 'off',
|
||||
'import/extensions': 'off',
|
||||
'react/require-default-props': 'off',
|
||||
'import/no-unresolved': 'off',
|
||||
'import/no-import-module-exports': 'off',
|
||||
'no-shadow': 'off',
|
||||
'react/function-component-definition': 'off',
|
||||
'react/jsx-props-no-spreading': 'off',
|
||||
'@typescript-eslint/no-shadow': 'off',
|
||||
'class-methods-use-this': 'off',
|
||||
'import/order': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'import/prefer-default-export': 'off',
|
||||
'no-restricted-syntax': 'off',
|
||||
'no-case-declarations': 'off',
|
||||
'no-await-in-loop': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'@typescript-eslint/no-namespace': 'off',
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
name: "🐞 Agent TARS Bug Report"
|
||||
description: "Report an issue with Agent TARS"
|
||||
title: "[Bug Report]: "
|
||||
type: Bug
|
||||
labels: ["Agent TARS", "Bug"]
|
||||
body:
|
||||
- type: input
|
||||
attributes:
|
||||
label: Version
|
||||
description: |
|
||||
Please specify the version of Agent TARS CLI you are using when encountering the issue.
|
||||
placeholder: e.g. 1.0.0
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Issue Type
|
||||
description: |
|
||||
Select the type of issue you are experiencing.
|
||||
options:
|
||||
- label: Select a issue type 👇
|
||||
required: false
|
||||
- label: Agent TARS Web UI (`@agent-tars/web-ui`)
|
||||
- label: Agent TARS CLI (`@agent-tars/server`)
|
||||
- label: Agent TARS Server (`@agent-tars/server`)
|
||||
- label: Agent TARS (`@agent-tars/core`)
|
||||
- label: MCP Agent (`@tarko/mcp-agent`)
|
||||
- label: Agent Kernel (`@tarko/agent`)
|
||||
- label: Other (please specify in description)
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Model Provider
|
||||
description: |
|
||||
Select the planning model provider you were using when the issue occurred.
|
||||
options:
|
||||
- label: Select a model provider 👇
|
||||
required: false
|
||||
- label: Volcengine
|
||||
- label: Anthropic
|
||||
- label: OpenAI
|
||||
- label: Azure OpenAI
|
||||
- label: Other (please specify in description)
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Problem Description
|
||||
description: |
|
||||
Please describe the issue, including both the expected behavior and the actual behavior. If possible, attach a link to relevant screenshots that illustrate the issue.
|
||||
placeholder: |
|
||||
Example:
|
||||
- Expected: The application should display search results.
|
||||
- Actual: The application shows an empty screen with no errors.
|
||||
[Attach actual screenshots here, if available.]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Error Logs
|
||||
description: |
|
||||
Please provide the error logs..
|
||||
placeholder: |
|
||||
Copy and paste the relevant logs here.
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1,56 @@
|
||||
name: "🐛 UI-TARS Desktop Bug Report"
|
||||
description: "Submit a bug report for the UI-TARS Desktop App."
|
||||
title: "[Bug]: "
|
||||
type: Bug
|
||||
labels: ["UI-TARS", "Bug"]
|
||||
body:
|
||||
- type: input
|
||||
attributes:
|
||||
label: Version
|
||||
description: "Please provide the version of UI TARS Desktop you are using."
|
||||
placeholder: "e.g., v0.1.0"
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Model
|
||||
description: "Select the VLM being used when this issue occurred."
|
||||
options:
|
||||
- UI-TARS-1.5-7B
|
||||
- Doubao-1.5-UI-TARS
|
||||
- UI-TARS-2B-SFT
|
||||
- UI-TARS-7B-SFT
|
||||
- UI-TARS-7B-DPO
|
||||
- UI-TARS-72B-SFT
|
||||
- UI-TARS-72B-DPO
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Deployment Method
|
||||
description: "Select the deployment method for UI TARS Desktop."
|
||||
options:
|
||||
- Cloud
|
||||
- Local
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Issue Description
|
||||
description: |
|
||||
Describe the issue in detail, including what you were expecting to happen, what actually happened, and any relevant screenshots (if available).
|
||||
placeholder: |
|
||||
Example:
|
||||
- Expected behavior: ...
|
||||
- Actual behavior: ...
|
||||
- Screenshots: <attach link or embed image>
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Error Logs
|
||||
description: |
|
||||
Include any relevant logs (e.g., Help -> Open Log File) that might help diagnose the issue.
|
||||
placeholder: "Paste your logs here."
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
@@ -0,0 +1,39 @@
|
||||
name: '✨ Feature Request'
|
||||
description: Submit a new feature request
|
||||
title: '[Feature]: '
|
||||
type: Feature
|
||||
labels: ['Feature']
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting a new feature request! Before submitting, please note:
|
||||
|
||||
- Make sure you've searched in the [Issues](https://github.com/bytedance/UI-TARS-desktop/issues) and haven't found the same request.
|
||||
- You can discuss the feature in the [Discussions](https://github.com/bytedance/UI-TARS-desktop/discussions) first.
|
||||
|
||||
- type: checkboxes
|
||||
id: project
|
||||
attributes:
|
||||
label: Which destkop app does this feature request relate to?
|
||||
description: Select the related project for this feature request.
|
||||
options:
|
||||
- label: Select a project 👇
|
||||
- label: Agent-TARS (cli, server, agent, tool etc.)
|
||||
- label: UI-TARS Desktop
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: What problem does this feature solve?
|
||||
description: Please describe the use case for this feature.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: api
|
||||
attributes:
|
||||
label: What does the proposed features look like?
|
||||
description: Describe the changes of agent behavior and settings, etc. or provide some specific code changes if possible.
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,35 @@
|
||||
<!--------------------------------------------------------------------------------
|
||||
Thank you for submitting a pull request!
|
||||
|
||||
We appreciate the time and effort you have invested in making these changes. Please
|
||||
ensure that you provide enough information to allow others to review your pull request
|
||||
effectively, so please DO NOT delete this template.
|
||||
|
||||
If you're new to contributing, learn more about contributing here:
|
||||
https://github.com/bytedance/UI-TARS-desktop/blob/main/CONTRIBUTING.md.
|
||||
---------------------------------------------------------------------------------->
|
||||
|
||||
## Summary
|
||||
|
||||
<!--------------------------------------------------------------------------------
|
||||
Can you explain the reasoning behind implementing this change?
|
||||
What problem or issue does this pull request resolve?
|
||||
|
||||
It would be helpful to include relevant context, such as GitHub issues
|
||||
(e.g., Close: #xxx) or related discussions.
|
||||
|
||||
If updating the UI, please include a **before/after screenshot** for visibility.
|
||||
Thank you for reading. Next, start describing your Summary on the next line
|
||||
after the comment ends. 👇🏻
|
||||
---------------------------------------------------------------------------------->
|
||||
|
||||
|
||||
|
||||
## Checklist
|
||||
|
||||
<!-- Before submitting the pull request, ensure the following items are checked: -->
|
||||
|
||||
- [ ] Added or updated necessary tests (Optional).
|
||||
- [ ] Updated documentation to align with changes (Optional).
|
||||
- [ ] Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
|
||||
- [ ] My change does not involve the above items.
|
||||
@@ -0,0 +1,46 @@
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- '**'
|
||||
paths:
|
||||
- 'multimodal/**'
|
||||
- '.github/workflows/agent_tars_build.yml'
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
attestations: read
|
||||
|
||||
name: Agent TARS Build
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-test
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
CI: true
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
HUSKY: 0
|
||||
|
||||
jobs:
|
||||
multimodal_bootstrap:
|
||||
name: Agent TARS Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: 'multimodal/pnpm-lock.yaml'
|
||||
- name: Install dependencies
|
||||
working-directory: ./multimodal
|
||||
run: pnpm install
|
||||
- name: Run Agent TARS Build
|
||||
working-directory: ./multimodal
|
||||
run: pnpm bootstrap
|
||||
- name: Run Agent TARS Test
|
||||
working-directory: ./multimodal
|
||||
run: pnpm test
|
||||
@@ -0,0 +1,55 @@
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- '**'
|
||||
paths:
|
||||
- 'packages/agent-infra/mcp-*/**'
|
||||
- '.github/workflows/benchmark.yml'
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
attestations: read
|
||||
|
||||
name: Benchmark
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-test
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
CI: true
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
HUSKY: 0
|
||||
|
||||
jobs:
|
||||
mcp_benchmark:
|
||||
name: Benchmark
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Cache turbo
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-turbo-
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3-pip
|
||||
pip3 install --upgrade pip
|
||||
pip3 install uv
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run MCP benchmark
|
||||
run: cd packages/agent-infra/mcp-benchmark && pnpm run benchmark
|
||||
@@ -0,0 +1,62 @@
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- 'packages/common/**'
|
||||
- 'packages/ui-tars/**'
|
||||
- '.github/workflows/e2e-ui-tars.yml'
|
||||
- 'apps/ui-tars/**'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
name: UI-TARS E2E Test
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-test
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
CI: e2e
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
HUSKY: 0
|
||||
UI_TARS_APP_PRIVATE_KEY_BASE64: e2e-ui-tars-test-private-key
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
attestations: read
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: E2E
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, macos-13, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Cache turbo
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-turbo-
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- name: Install Python setuptools
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: brew install python-setuptools
|
||||
- name: Install appdmg
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: npm install -g appdmg
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run e2e
|
||||
run: npm exec turbo run ui-tars-desktop#test:e2e
|
||||
@@ -0,0 +1,209 @@
|
||||
name: Release UI-TARS app
|
||||
on:
|
||||
# push:
|
||||
# branches:
|
||||
# - main
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CI: true
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
HUSKY: 0
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
attestations: write
|
||||
|
||||
jobs:
|
||||
publish_on_mac:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Show operating system info
|
||||
run: |
|
||||
echo "Operating System:"
|
||||
uname -a
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- name: Install Python setuptools
|
||||
run: brew install python-setuptools
|
||||
- name: Install appdmg
|
||||
run: npm install -g appdmg
|
||||
- name: Install the Apple certificate and provisioning profile
|
||||
env:
|
||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
run: |
|
||||
# create variables
|
||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
||||
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
|
||||
# import certificate and provisioning profile from secrets
|
||||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
|
||||
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
|
||||
|
||||
# create temporary keychain
|
||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
|
||||
# import certificate to keychain
|
||||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
|
||||
# apply provisioning profile
|
||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: publish arm64
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
UI_TARS_APP_PRIVATE_KEY_BASE64: ${{ secrets.UI_TARS_APP_PRIVATE_KEY_BASE64 }}
|
||||
run: |
|
||||
cd apps/ui-tars && pnpm run publish:mac-arm64
|
||||
- name: Save latest-mac-arm64.yml as an artifact
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: latest-mac-${{ github.sha }}-arm64
|
||||
path: apps/ui-tars/out/latest-mac-arm64.yml
|
||||
if-no-files-found: error
|
||||
|
||||
publish_on_mac_x64:
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Show operating system info
|
||||
run: |
|
||||
echo "Operating System:"
|
||||
uname -a
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- name: Install Python setuptools
|
||||
run: brew install python-setuptools
|
||||
- name: Install appdmg
|
||||
run: npm install -g appdmg
|
||||
- name: Install the Apple certificate and provisioning profile
|
||||
env:
|
||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
run: |
|
||||
# create variables
|
||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
||||
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
|
||||
# import certificate and provisioning profile from secrets
|
||||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
|
||||
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
|
||||
|
||||
# create temporary keychain
|
||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
|
||||
# import certificate to keychain
|
||||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
|
||||
# apply provisioning profile
|
||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: publish x64
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
UI_TARS_APP_PRIVATE_KEY_BASE64: ${{ secrets.UI_TARS_APP_PRIVATE_KEY_BASE64 }}
|
||||
run: |
|
||||
cd apps/ui-tars && pnpm run publish:mac-x64
|
||||
- name: Save latest-mac-x64.yml as an artifact
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: latest-mac-${{ github.sha }}-x64
|
||||
path: apps/ui-tars/out/latest-mac-x64.yml
|
||||
if-no-files-found: error
|
||||
|
||||
merge-latest-mac:
|
||||
needs:
|
||||
- publish_on_mac
|
||||
- publish_on_mac_x64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Show operating system info
|
||||
run: |
|
||||
echo "Operating System:"
|
||||
uname -a
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- name: install dependencies
|
||||
run: pnpm i tsx js-yaml -w
|
||||
- name: Download All Artifacts
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
path: scripts/merge-yml
|
||||
pattern: latest-mac-${{ github.sha }}-*
|
||||
merge-multiple: true
|
||||
- name: merge mac-yaml
|
||||
id: merge_yaml
|
||||
run: |
|
||||
npx tsx ./scripts/merge-yml/merge-yml.ts
|
||||
cat ./scripts/merge-yml/latest-mac.yml
|
||||
echo "releaseName=$(cat ./scripts/merge-yml/latest-mac.yml | grep version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
||||
with:
|
||||
fail_on_unmatched_files: true
|
||||
tag_name: v${{ steps.merge_yaml.outputs.releaseName }}
|
||||
files: ${{ github.workspace }}/scripts/merge-yml/latest-mac.yml
|
||||
|
||||
publish_on_win:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Show operating system info
|
||||
run: |
|
||||
echo "Operating System:"
|
||||
cmd /c ver
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
UI_TARS_APP_PRIVATE_KEY_BASE64: ${{ secrets.UI_TARS_APP_PRIVATE_KEY_BASE64 }}
|
||||
run: cd apps/ui-tars && pnpm run publish:win32
|
||||
@@ -0,0 +1,64 @@
|
||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
||||
# by a third-party and are governed by separate terms of service, privacy
|
||||
# policy, and support documentation.
|
||||
|
||||
name: Scorecard supply-chain security
|
||||
on:
|
||||
# For Branch-Protection check. Only the default branch is supported. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||
branch_protection_rule:
|
||||
# To guarantee Maintained check is occasionally updated. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
||||
schedule:
|
||||
- cron: '20 8 * * 1'
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
# Uncomment the permissions below if installing in a private repository.
|
||||
# contents: read
|
||||
# actions: read
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
||||
# - you want to enable the Branch-Protection check on a *public* repository, or
|
||||
# - you are installing Scorecard on a *private* repository
|
||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
|
||||
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
||||
|
||||
# Public repositories:
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
# For private repositories:
|
||||
# - `publish_results` will always be set to `false`, regardless
|
||||
# of the value entered here.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@59c2c1ca13dff455ab22ad8157d6ab220447da29 # v4
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -0,0 +1,22 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Secret Scanning
|
||||
uses: trufflesecurity/trufflehog@7dc056a193116ba8d82154bf0549381c8fb8545c # v3.88.14
|
||||
with:
|
||||
extra_args: --results=verified,unknown
|
||||
@@ -0,0 +1,36 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
name: secretlint
|
||||
|
||||
jobs:
|
||||
secretlint:
|
||||
permissions:
|
||||
contents: read
|
||||
name: "Run secretlint to diff files"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
# fetch history to get all changed files on push or pull_request event
|
||||
fetch-depth: 0
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.1
|
||||
- name: setup Node ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Show changed files
|
||||
run: echo "${{ steps.changed-files.outputs.all_changed_files }}"
|
||||
- name: Install
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: pnpm i
|
||||
- name: Run secretlint
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: npx secretlint ${{ steps.changed-files.outputs.all_changed_files }}
|
||||
@@ -0,0 +1,67 @@
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'multimodal/**'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- 'multimodal/**'
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
attestations: read
|
||||
|
||||
name: CI Test, Typecheck
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-test
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
CI: true
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
HUSKY: 0
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test & Typecheck
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Cache turbo
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-turbo-
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@9
|
||||
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
- uses: browser-actions/setup-chrome@v2
|
||||
with:
|
||||
chrome-version: 120
|
||||
install-dependencies: true
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run typecheck
|
||||
run: npm exec turbo run typecheck
|
||||
- name: Run test
|
||||
run: npm exec turbo run coverage
|
||||
- name: Upload coverage data
|
||||
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
disable_search: true
|
||||
files: ./coverage/lcov.info
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: false
|
||||
@@ -0,0 +1,15 @@
|
||||
node_modules
|
||||
dist
|
||||
out
|
||||
.tmp
|
||||
.DS_Store
|
||||
*.log*
|
||||
.eslintcache
|
||||
.env
|
||||
test-results/
|
||||
coverage/
|
||||
.turbo/
|
||||
scripts/merge-yml/*.yml
|
||||
.claude/
|
||||
.tarko
|
||||
.mcp*_token
|
||||
@@ -0,0 +1 @@
|
||||
npx --no -- commitlint --edit "$1"
|
||||
@@ -0,0 +1 @@
|
||||
npx lint-staged
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export default {
|
||||
'*': ['secretlint'],
|
||||
'**/*.{ts,tsx}': ['prettier --write'],
|
||||
'src/{main,preload}/**/*.{ts,tsx}': [() => 'npm run typecheck:node'],
|
||||
'src/renderer/**/*.{ts,tsx}': [() => 'npm run typecheck:web'],
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
stable
|
||||
@@ -0,0 +1,6 @@
|
||||
out
|
||||
dist
|
||||
pnpm-lock.yaml
|
||||
LICENSE.md
|
||||
tsconfig.json
|
||||
tsconfig.*.json
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export default {
|
||||
arrowParens: 'always',
|
||||
bracketSameLine: false,
|
||||
bracketSpacing: true,
|
||||
semi: true,
|
||||
experimentalTernaries: false,
|
||||
singleQuote: true,
|
||||
jsxSingleQuote: false,
|
||||
quoteProps: 'as-needed',
|
||||
trailingComma: 'all',
|
||||
singleAttributePerLine: false,
|
||||
htmlWhitespaceSensitivity: 'css',
|
||||
vueIndentScriptAndStyle: false,
|
||||
proseWrap: 'preserve',
|
||||
insertPragma: false,
|
||||
requirePragma: false,
|
||||
tabWidth: 2,
|
||||
useTabs: false,
|
||||
embeddedLanguageFormatting: 'auto',
|
||||
endOfLine: 'auto',
|
||||
// importOrder: [
|
||||
// '^node:(.*)$',
|
||||
// '<THIRD_PARTY_MODULES>',
|
||||
// '^@ui-tars/(.*)$',
|
||||
// '^@main/(.*)$',
|
||||
// '^@shared/(.*)$',
|
||||
// '^@renderer/(.*)$',
|
||||
// '^@resources/(.*)$',
|
||||
// '^[./]',
|
||||
// ],
|
||||
// importOrderSeparation: true,
|
||||
// importOrderSortSpecifiers: true,
|
||||
// https://github.com/trivago/prettier-plugin-sort-imports/issues/229
|
||||
// plugins: ['@trivago/prettier-plugin-sort-imports'],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
node_modules
|
||||
dist
|
||||
out
|
||||
.tmp
|
||||
.DS_Store
|
||||
*.log*
|
||||
.eslintcache
|
||||
.env
|
||||
test-results/
|
||||
coverage/
|
||||
.turbo/
|
||||
scripts/merge-yml/*.yml
|
||||
.claude
|
||||
multimodal/gui-agent/agent-sdk/src/constants.ts
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"rules": [
|
||||
{ "id": "@secretlint/secretlint-rule-1password" },
|
||||
{ "id": "@secretlint/secretlint-rule-anthropic" },
|
||||
{ "id": "@secretlint/secretlint-rule-aws" },
|
||||
{ "id": "@secretlint/secretlint-rule-azure" },
|
||||
{ "id": "@secretlint/secretlint-rule-basicauth" },
|
||||
{ "id": "@secretlint/secretlint-rule-database-connection-string" },
|
||||
{ "id": "@secretlint/secretlint-rule-filter-comments" },
|
||||
{ "id": "@secretlint/secretlint-rule-gcp" },
|
||||
{ "id": "@secretlint/secretlint-rule-github" },
|
||||
{ "id": "@secretlint/secretlint-rule-no-dotenv" },
|
||||
{ "id": "@secretlint/secretlint-rule-no-homedir" },
|
||||
{ "id": "@secretlint/secretlint-rule-no-k8s-kind-secret" },
|
||||
{
|
||||
"id": "@secretlint/secretlint-rule-npm",
|
||||
"options": {
|
||||
"allows": ["/npm_i_save_dev_types_/g"]
|
||||
}
|
||||
},
|
||||
{ "id": "@secretlint/secretlint-rule-openai" },
|
||||
{
|
||||
"id": "@secretlint/secretlint-rule-pattern",
|
||||
"options": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "key-value secret",
|
||||
"pattern": "/\\b(?<key>(?:password|pass|secret|token|apiKey)(?:[_-]\\w+)?)\\b\\s*[:=]\\s*(?<value>(?!['\"]?\\s*['\"]?$)(?!\\d+\\.\\d+(?:\\.\\d+)?(?:\\s|$))\\S.*)/i"
|
||||
}
|
||||
],
|
||||
"allows": [
|
||||
"your_api_key",
|
||||
"YOUR_API_KEY",
|
||||
"undefined",
|
||||
"test-key",
|
||||
"original-key",
|
||||
"custom-key",
|
||||
"deepseek-key",
|
||||
"azure-key",
|
||||
"kimi-api-key",
|
||||
"ollama",
|
||||
"/agentModel\\?\\.apiKey/",
|
||||
"/defaultConfig\\.apiKey/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{ "id": "@secretlint/secretlint-rule-privatekey" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["esbenp.prettier-vscode", "psioniq.psi-header"]
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"[javascript][javascriptreact][typescript][typescriptreact]": {
|
||||
"editor.formatOnSave": false,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/dist": true,
|
||||
"**/static": true,
|
||||
"**/build": true,
|
||||
"**/*.min.js": true,
|
||||
"**/*.map": true,
|
||||
"**/*.log": true,
|
||||
"**/*.cache": true,
|
||||
"**/*.bak": true,
|
||||
"**/*.tmp": true
|
||||
},
|
||||
"psi-header.config": {
|
||||
"forceToTop": true
|
||||
},
|
||||
"psi-header.changes-tracking": {
|
||||
"isActive": true,
|
||||
"excludeGlob": [
|
||||
"node_modules/**",
|
||||
"dist/**",
|
||||
"build/**",
|
||||
"out/**"
|
||||
],
|
||||
"autoHeader": "manualSave"
|
||||
},
|
||||
"psi-header.templates": [
|
||||
{
|
||||
"language": "javascript",
|
||||
"template": [
|
||||
"Copyright (c) 2025 Bytedance, Inc. and its affiliates.",
|
||||
"SPDX-License-Identifier: Apache-2.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "typescript",
|
||||
"mapTo": "javascript"
|
||||
},
|
||||
{
|
||||
"language": "typescriptreact",
|
||||
"mapTo": "javascript"
|
||||
},
|
||||
{
|
||||
"language": "javascriptreact",
|
||||
"mapTo": "javascript"
|
||||
},
|
||||
{
|
||||
"language": "*",
|
||||
"template": []
|
||||
}
|
||||
],
|
||||
"cSpell.words": [
|
||||
"DEEPSEEK",
|
||||
"rslib"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
# Contributor covenant code of conduct
|
||||
|
||||
## Our pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
@@ -0,0 +1,207 @@
|
||||
# Contributing to UI-TARS Desktop
|
||||
|
||||
First off, thanks for taking the time to contribute! ❤️
|
||||
|
||||
All types of contributions are encouraged and valued. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
|
||||
|
||||
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
|
||||
> - Star the project
|
||||
> - Tweet about it
|
||||
> - Refer this project in your project's readme
|
||||
> - Mention the project at local meetups and tell your friends/colleagues
|
||||
|
||||
|
||||
## I Have a Question / Bug Report
|
||||
|
||||
> If you want to ask a question or report a bug, we assume that you have read the available Documentation.
|
||||
|
||||
Before you ask a question, it is best to search for existing [Issues](https://github.com/bytedance/ui-tars-desktop/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
|
||||
|
||||
If you then still feel the need to ask a question and need clarification, we recommend the following:
|
||||
|
||||
- Open an [Issue](https://github.com/bytedance/ui-tars-desktop/issues/new).
|
||||
- Provide as much context as you can about what you're running into.
|
||||
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
|
||||
|
||||
We will then take care of the issue as soon as possible.
|
||||
|
||||
## I Want To Contribute
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Node.js](https://nodejs.org/en/download/) >= 20
|
||||
- [pnpm](https://pnpm.io/installation) >= 9
|
||||
|
||||
#### Technology Stack
|
||||
|
||||
This is a [Monorepo](https://pnpm.io/workspaces) project including the following technologies:
|
||||
|
||||
- Cross-platform framework: [Electron](https://www.electronjs.org/)
|
||||
- Interface:
|
||||
- [React](https://react.dev/)
|
||||
- [Vite](https://vitejs.dev/)
|
||||
- State management and communication:
|
||||
- [Zustand](https://zustand.docs.pmnd.rs/)
|
||||
- [@ui-tars/electron-ipc](https://github.com/bytedance/UI-TARS-desktop/tree/main/packages/ui-tars/electron-ipc)
|
||||
- Automation framework/toolkit:
|
||||
- [nut.js](https://nutjs.dev/)
|
||||
- Test framework
|
||||
- [Vitest](https://vitest.dev/)
|
||||
- [Playwright](https://playwright.dev/)
|
||||
|
||||
### Structure of the project
|
||||
|
||||
```bash
|
||||
.
|
||||
├── README.md
|
||||
├── apps
|
||||
│ └── ui-tars
|
||||
│ └── src
|
||||
│ ├── main
|
||||
│ ├── preload
|
||||
│ └── renderer
|
||||
│
|
||||
├── packages
|
||||
│ ├── agent-infra
|
||||
│ │ ├── browser
|
||||
│ │ ├── browser-use
|
||||
│ │ ├── logger
|
||||
│ │ ├── mcp-client
|
||||
│ │ ├── mcp-servers
|
||||
│ │ ├── search
|
||||
│ │ └── shared
|
||||
│ ├── common
|
||||
│ │ ├── configs
|
||||
│ │ └── electron-build
|
||||
│ └── ui-tars
|
||||
│ ├── action-parser
|
||||
│ ├── cli
|
||||
│ ├── electron-ipc
|
||||
│ ├── operators
|
||||
│ ├── sdk
|
||||
│ ├── shared
|
||||
│ ├── tsconfig.node.json
|
||||
│ ├── utio
|
||||
│ └── visualizer
|
||||
└── vitest.*.mts # Unit test configuration
|
||||
```
|
||||
|
||||
> **Note**: The `src` directory is located in the top-level directory instead of the `apps/{main,preload,renderer}` directories because Electron Forge previously did not support Pnpm's hoisting mechanism([electron/forge#2633](https://github.com/electron/forge/issues/2633)), requiring the `src` directory to be placed in the top-level directory.
|
||||
|
||||
|
||||
#### Clone the repository
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/bytedance/ui-tars-desktop.git
|
||||
$ cd ui-tars-desktop
|
||||
```
|
||||
|
||||
### Development
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
```bash
|
||||
$ pnpm install
|
||||
```
|
||||
|
||||
#### Run the application
|
||||
|
||||
```bash
|
||||
$ pnpm run dev:ui-tars # Start UI-TARS Desktop
|
||||
```
|
||||
|
||||
After the application starts, you can see the UI-TARS interface within the application.
|
||||
|
||||
> **Note**: On MacOS, you need to grant permissions to the app (e.g., iTerm2, Terminal) you are using to run commands.
|
||||
|
||||
#### Main process reload
|
||||
|
||||
By default, `pnpm run dev` only has frontend Hot Module Replacement (HMR) hot updates. If you need to simultaneously reload the main process during debugging, you can execute `pnpm run dev:w`.
|
||||
|
||||
```bash
|
||||
$ pnpm run dev:w
|
||||
```
|
||||
|
||||
#### Building
|
||||
|
||||
Run `pnpm run build` in current system, it will output into `out/*` directory.
|
||||
|
||||
To build the products of other systems, run:
|
||||
- Mac x64: `pnpm run publish:mac-x64`
|
||||
- Mac ARM: `pnpm run publish:mac-arm64`
|
||||
- Windows x64: `pnpm run publish:win32`
|
||||
- Windows ARM: `pnpm run publish:win32-arm64`
|
||||
|
||||
### Release
|
||||
|
||||
#### Desktop Application
|
||||
|
||||
The CI pipeline to execute is [.github/workflows/release.yml](.github/workflows/release.yml), only manual triggered by maintainers. If you're a maintainer, you can follow the steps below to release the application:
|
||||
|
||||
1. Edit the `version` in `package.json`
|
||||
2. Git commit and push to the `release/${version}` branch, create a PR targeting `main` branch, titled `release(app): ${version}`
|
||||
3. Trigger the release [workflow](https://github.com/bytedance/UI-TARS-desktop/actions/workflows/release.yml) manually after the PR is merged
|
||||
|
||||
Currently, the release workflow supports the following platforms:
|
||||
|
||||
- MacOS x64
|
||||
- MacOS arm64
|
||||
- Windows x64
|
||||
|
||||
#### Packages
|
||||
|
||||
##### Latest version
|
||||
|
||||
If you want to publish the `latest` version packages to the npm registry, you can run the following command:
|
||||
|
||||
1. `pnpm changeset` to specify the changelogs for the packages you want to publish
|
||||
2. Git commit and push to the `release-pkgs/${version}` branch, create a PR targeting `main` branch, titled `release(pkgs): ${version}`
|
||||
3. `pnpm run publish:packages` to publish the packages in latest `origin/main` branch after the PR is merged
|
||||
|
||||
##### Beta version
|
||||
|
||||
If you want to publish the `beta` version packages to the npm registry, you can run the following command:
|
||||
|
||||
1. `pnpm changeset` to specify the changelogs for the packages you want to publish
|
||||
2. Git commit and push to the branch
|
||||
3. `pnpm run publish-beta:packages` to publish the packages in current branch
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
The documents are placed in the `docs/*.md` directory, formatted in markdown. There is currently no documentation site, but the `docs/*.md` directory will be converted into a documentation site in the future.
|
||||
|
||||
## Styleguides
|
||||
|
||||
### Pre-commit Hooks
|
||||
|
||||
We use [Husky](https://typicode.github.io/husky/#/) and [lint-staged](https://github.com/okonet/lint-staged) to enforce the pre-commit hooks. The hooks include:
|
||||
|
||||
- `prettier --write` to format the code
|
||||
- `npm run typecheck` to strictly check the type
|
||||
|
||||
### Commit Messages
|
||||
|
||||
We use [Conventional Commits](https://www.conventionalcommits.org/) to standardize the commit messages.
|
||||
|
||||
### CI / Testing
|
||||
|
||||
Each PR or main branch push will trigger the CI pipeline to run the unit test and E2E test.
|
||||
|
||||
#### Unit test
|
||||
|
||||
```bash
|
||||
pnpm run test
|
||||
```
|
||||
|
||||
#### E2E test
|
||||
|
||||
```bash
|
||||
pnpm run test:e2e
|
||||
```
|
||||
|
||||
## Submitting Changes
|
||||
|
||||
* Push your changes to a feature branch in your fork of the repository.
|
||||
* Submit a pull request to this repository
|
||||
* Accept the CLA in your PR.
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,299 @@
|
||||
<picture>
|
||||
<img alt="Agent TARS Banner" src="./images/tars.png">
|
||||
</picture>
|
||||
|
||||
<br/>
|
||||
|
||||
## Introduction
|
||||
|
||||
English | [简体中文](./README.zh-CN.md)
|
||||
|
||||
[](https://trendshift.io/repositories/13584)
|
||||
|
||||
<b>TARS<sup>\*</sup></b> is a Multimodal AI Agent stack, currently shipping two projects: [Agent TARS](#agent-tars) and [UI-TARS-desktop](#ui-tars-desktop):
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%" align="center"><a href="#agent-tars">Agent TARS</a></th>
|
||||
<th width="50%" align="center"><a href="#ui-tars-desktop">UI-TARS-desktop</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/c9489936-afdc-4d12-adda-d4b90d2a869d" width="50%"></video>
|
||||
</td>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/e0914ce9-ad33-494b-bdec-0c25c1b01a27" width="50%"></video>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>Agent TARS</b> is a general multimodal AI Agent stack, it brings the power of GUI Agent and Vision into your terminal, computer, browser and product.
|
||||
<br>
|
||||
<br>
|
||||
It primarily ships with a <a href="https://agent-tars.com/guide/basic/cli.html" target="_blank">CLI</a> and <a href="https://agent-tars.com/guide/basic/web-ui.html" target="_blank">Web UI</a> for usage.
|
||||
It aims to provide a workflow that is closer to human-like task completion through cutting-edge multimodal LLMs and seamless integration with various real-world <a href="https://agent-tars.com/guide/basic/mcp.html" target="_blank">MCP</a> tools.
|
||||
</td>
|
||||
<td align="left">
|
||||
<b>UI-TARS Desktop</b> is a desktop application that provides a native GUI Agent based on the <a href="https://github.com/bytedance/UI-TARS" target="_blank">UI-TARS</a> model.
|
||||
<br>
|
||||
<br>
|
||||
It primarily ships a
|
||||
<a href="https://github.com/bytedance/UI-TARS-desktop/blob/main/docs/quick-start.md#get-model-and-run-local-operator" target="_blank">local</a> and
|
||||
<a href="https://github.com/bytedance/UI-TARS-desktop/blob/main/docs/quick-start.md#run-remote-operator" target="_blank">remote</a> computer as well as browser operators.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Table of Contents
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
- [News](#news)
|
||||
- [Agent TARS](#agent-tars)
|
||||
- [Showcase](#showcase)
|
||||
- [Core Features](#core-features)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Documentation](#documentation)
|
||||
- [UI-TARS Desktop](#ui-tars-desktop)
|
||||
- [Showcase](#showcase-1)
|
||||
- [Features](#features)
|
||||
- [Quick Start](#quick-start-1)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
- [Citation](#citation)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## News
|
||||
|
||||
- **\[2025-11-05\]** 🎉 We're excited to announce the release of [Agent TARS CLI v0.3.0](https://github.com/bytedance/UI-TARS-desktop/releases/tag/v0.3.0)! This version brings streaming support for multiple tools (shell commands, multi-file structured display), runtime settings with timing statistics for tool calls and deep thinking, Event Stream Viewer for data flow tracking and debugging. Additionally, it features exclusive support for [AIO agent Sandbox](https://github.com/agent-infra/sandbox) as isolated all-in-one tools execution environment.
|
||||
- **\[2025-06-25\]** We released an Agent TARS Beta and Agent TARS CLI - [Introducing Agent TARS Beta](https://agent-tars.com/blog/2025-06-25-introducing-agent-tars-beta.html), a multimodal AI agent that aims to explore a work form that is closer to human-like task completion through rich multimodal capabilities (such as GUI Agent, Vision) and seamless integration with various real-world tools.
|
||||
- **\[2025-06-12\]** - 🎁 We are thrilled to announce the release of UI-TARS Desktop v0.2.0! This update introduces two powerful new features: **Remote Computer Operator** and **Remote Browser Operator**—both completely free. No configuration required: simply click to remotely control any computer or browser, and experience a new level of convenience and intelligence.
|
||||
- **\[2025-04-17\]** - 🎉 We're thrilled to announce the release of new UI-TARS Desktop application v0.1.0, featuring a redesigned Agent UI. The application enhances the computer using experience, introduces new browser operation features, and supports [the advanced UI-TARS-1.5 model](https://seed-tars.com/1.5) for improved performance and precise control.
|
||||
- **\[2025-02-20\]** - 📦 Introduced [UI TARS SDK](./docs/sdk.md), is a powerful cross-platform toolkit for building GUI automation agents.
|
||||
- **\[2025-01-23\]** - 🚀 We updated the **[Cloud Deployment](./docs/deployment.md#cloud-deployment)** section in the 中文版: [GUI模型部署教程](https://bytedance.sg.larkoffice.com/docx/TCcudYwyIox5vyxiSDLlgIsTgWf#U94rdCxzBoJMLex38NPlHL21gNb) with new information related to the ModelScope platform. You can now use the ModelScope platform for deployment.
|
||||
|
||||
<br>
|
||||
|
||||
## Agent TARS
|
||||
|
||||
<p>
|
||||
<a href="https://npmjs.com/package/@agent-tars/cli?activeTab=readme"><img src="https://img.shields.io/npm/v/@agent-tars/cli?style=for-the-badge&colorA=1a1a2e&colorB=3B82F6&logo=npm&logoColor=white" alt="npm version" /></a>
|
||||
<a href="https://npmcharts.com/compare/@agent-tars/cli?minimal=true"><img src="https://img.shields.io/npm/dm/@agent-tars/cli.svg?style=for-the-badge&colorA=1a1a2e&colorB=0EA5E9&logo=npm&logoColor=white" alt="downloads" /></a>
|
||||
<a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/@agent-tars/cli.svg?style=for-the-badge&colorA=1a1a2e&colorB=06B6D4&logo=node.js&logoColor=white" alt="node version"></a>
|
||||
<a href="https://discord.gg/HnKcSBgTVx"><img src="https://img.shields.io/badge/Discord-Join%20Community-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord Community" /></a>
|
||||
<a href="https://twitter.com/agent_tars"><img src="https://img.shields.io/badge/Twitter-Follow%20%40agent__tars-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" alt="Official Twitter" /></a>
|
||||
<a href="https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=deen76f4-ea3c-4964-93a3-78f126f39651"><img src="https://img.shields.io/badge/飞书群-加入交流群-00D4AA?style=for-the-badge&logo=lark&logoColor=white" alt="飞书交流群" /></a>
|
||||
<a href="https://deepwiki.com/bytedance/UI-TARS-desktop"><img src="https://img.shields.io/badge/DeepWiki-Ask%20AI-8B5CF6?style=for-the-badge&logo=gitbook&logoColor=white" alt="Ask DeepWiki" /></a>
|
||||
</p>
|
||||
|
||||
<b>Agent TARS</b> is a general multimodal AI Agent stack, it brings the power of GUI Agent and Vision into your terminal, computer, browser and product. <br> <br>
|
||||
It primarily ships with a <a href="https://agent-tars.com/guide/basic/cli.html" target="_blank">CLI</a> and <a href="https://agent-tars.com/guide/basic/web-ui.html" target="_blank">Web UI</a> for usage.
|
||||
It aims to provide a workflow that is closer to human-like task completion through cutting-edge multimodal LLMs and seamless integration with various real-world <a href="https://agent-tars.com/guide/basic/mcp.html" target="_blank">MCP</a> tools.
|
||||
|
||||
### Showcase
|
||||
|
||||
```
|
||||
Please help me book the earliest flight from San Jose to New York on September 1st and the last return flight on September 6th on Priceline
|
||||
```
|
||||
|
||||
https://github.com/user-attachments/assets/772b0eef-aef7-4ab9-8cb0-9611820539d8
|
||||
|
||||
<br>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%" align="center">Booking Hotel</th>
|
||||
<th width="50%" align="center">Generate Chart with extra MCP Servers</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/c9489936-afdc-4d12-adda-d4b90d2a869d" width="50%"></video>
|
||||
</td>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/a9fd72d0-01bb-4233-aa27-ca95194bbce9" width="50%"></video>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>Instruction:</b> <i>I am in Los Angeles from September 1st to September 6th, with a budget of $5,000. Please help me book a Ritz-Carlton hotel closest to the airport on booking.com and compile a transportation guide for me</i>
|
||||
</td>
|
||||
<td align="left">
|
||||
<b>Instruction:</b> <i>Draw me a chart of Hangzhou's weather for one month</i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
For more use cases, please check out [#842](https://github.com/bytedance/UI-TARS-desktop/issues/842).
|
||||
|
||||
### Core Features
|
||||
|
||||
- 🖱️ **One-Click Out-of-the-box CLI** - Supports both **headful** [Web UI](https://agent-tars.com/guide/basic/web-ui.html) and **headless** [server](https://agent-tars.com/guide/advanced/server.html) [execution](https://agent-tars.com/guide/basic/cli.html).
|
||||
- 🌐 **Hybrid Browser Agent** - Control browsers using [GUI Agent](https://agent-tars.com/guide/basic/browser.html#visual-grounding), [DOM](https://agent-tars.com/guide/basic/browser.html#dom), or a hybrid strategy.
|
||||
- 🔄 **Event Stream** - Protocol-driven Event Stream drives [Context Engineering](https://agent-tars.com/beta#context-engineering) and [Agent UI](https://agent-tars.com/blog/2025-06-25-introducing-agent-tars-beta.html#easy-to-build-applications).
|
||||
- 🧰 **MCP Integration** - The kernel is built on MCP and also supports mounting [MCP Servers](https://agent-tars.com/guide/basic/mcp.html) to connect to real-world tools.
|
||||
|
||||
### Quick Start
|
||||
|
||||
<img alt="Agent TARS CLI" src="https://agent-tars.com/agent-tars-cli.png">
|
||||
|
||||
```bash
|
||||
# Launch with `npx`.
|
||||
npx @agent-tars/cli@latest
|
||||
|
||||
# Install globally, required Node.js >= 22
|
||||
npm install @agent-tars/cli@latest -g
|
||||
|
||||
# Run with your preferred model provider
|
||||
agent-tars --provider volcengine --model doubao-1-5-thinking-vision-pro-250428 --apiKey your-api-key
|
||||
agent-tars --provider anthropic --model claude-3-7-sonnet-latest --apiKey your-api-key
|
||||
```
|
||||
|
||||
Visit the comprehensive [Quick Start](https://agent-tars.com/guide/get-started/quick-start.html) guide for detailed setup instructions.
|
||||
|
||||
### Documentation
|
||||
|
||||
> 🌟 **Explore Agent TARS Universe** 🌟
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%" align="center">Category</th>
|
||||
<th width="30%" align="center">Resource Link</th>
|
||||
<th width="50%" align="left">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">🏠 <strong>Central Hub</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com">
|
||||
<img src="https://img.shields.io/badge/Visit-Website-4F46E5?style=for-the-badge&logo=globe&logoColor=white" alt="Website" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">Your gateway to Agent TARS ecosystem</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">📚 <strong>Quick Start</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/guide/get-started/quick-start.html">
|
||||
<img src="https://img.shields.io/badge/Get-Started-06B6D4?style=for-the-badge&logo=rocket&logoColor=white" alt="Quick Start" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">Zero to hero in 5 minutes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🚀 <strong>What's New</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/beta">
|
||||
<img src="https://img.shields.io/badge/Read-Blog-F59E0B?style=for-the-badge&logo=rss&logoColor=white" alt="Blog" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">Discover cutting-edge features & vision</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🛠️ <strong>Developer Zone</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/guide/get-started/introduction.html">
|
||||
<img src="https://img.shields.io/badge/View-Docs-10B981?style=for-the-badge&logo=gitbook&logoColor=white" alt="Docs" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">Master every command & features</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🎯 <strong>Showcase</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/bytedance/UI-TARS-desktop/issues/842">
|
||||
<img src="https://img.shields.io/badge/View-Examples-8B5CF6?style=for-the-badge&logo=github&logoColor=white" alt="Examples" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">View use cases built by the official and community</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🔧 <strong>Reference</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/api/">
|
||||
<img src="https://img.shields.io/badge/API-Reference-EF4444?style=for-the-badge&logo=book&logoColor=white" alt="API" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">Complete technical reference</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
## UI-TARS Desktop
|
||||
|
||||
<p align="center">
|
||||
<img alt="UI-TARS" width="260" src="./apps/ui-tars/resources/icon.png">
|
||||
</p>
|
||||
|
||||
UI-TARS Desktop is a native GUI agent for your local computer, driven by [UI-TARS](https://github.com/bytedance/UI-TARS) and Seed-1.5-VL/1.6 series models.
|
||||
|
||||
<div align="center">
|
||||
<p>
|
||||
   📑 <a href="https://arxiv.org/abs/2501.12326">Paper</a>   
|
||||
| 🤗 <a href="https://huggingface.co/ByteDance-Seed/UI-TARS-1.5-7B">Hugging Face Models</a>  
|
||||
|   🫨 <a href="https://discord.gg/pTXwYVjfcs">Discord</a>  
|
||||
|   🤖 <a href="https://www.modelscope.cn/collections/UI-TARS-bccb56fa1ef640">ModelScope</a>  
|
||||
<br>
|
||||
🖥️ Desktop Application   
|
||||
|    👓 <a href="https://github.com/web-infra-dev/midscene">Midscene (use in browser)</a>   
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
### Showcase
|
||||
|
||||
<!-- // FIXME: Choose only two demo, one local computer and one remote computer showcase. -->
|
||||
|
||||
| Instruction | Local Operator | Remote Operator |
|
||||
| :----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------: |
|
||||
| Please help me open the autosave feature of VS Code and delay AutoSave operations for 500 milliseconds in the VS Code setting. | <video src="https://github.com/user-attachments/assets/e0914ce9-ad33-494b-bdec-0c25c1b01a27" height="300" /> | <video src="https://github.com/user-attachments/assets/01e49b69-7070-46c8-b3e3-2aaaaec71800" height="300" /> |
|
||||
| Could you help me check the latest open issue of the UI-TARS-Desktop project on GitHub? | <video src="https://github.com/user-attachments/assets/3d159f54-d24a-4268-96c0-e149607e9199" height="300" /> | <video src="https://github.com/user-attachments/assets/072fb72d-7394-4bfa-95f5-4736e29f7e58" height="300" /> |
|
||||
|
||||
### Features
|
||||
|
||||
- 🤖 Natural language control powered by Vision-Language Model
|
||||
- 🖥️ Screenshot and visual recognition support
|
||||
- 🎯 Precise mouse and keyboard control
|
||||
- 💻 Cross-platform support (Windows/MacOS/Browser)
|
||||
- 🔄 Real-time feedback and status display
|
||||
- 🔐 Private and secure - fully local processing
|
||||
|
||||
### Quick Start
|
||||
|
||||
See [Quick Start](./docs/quick-start.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the Apache License 2.0.
|
||||
|
||||
## Citation
|
||||
|
||||
If you find our paper and code useful in your research, please consider giving a star :star: and citation :pencil:
|
||||
|
||||
```BibTeX
|
||||
@article{qin2025ui,
|
||||
title={UI-TARS: Pioneering Automated GUI Interaction with Native Agents},
|
||||
author={Qin, Yujia and Ye, Yining and Fang, Junjie and Wang, Haoming and Liang, Shihao and Tian, Shizuo and Zhang, Junda and Li, Jiahao and Li, Yunxin and Huang, Shijue and others},
|
||||
journal={arXiv preprint arXiv:2501.12326},
|
||||
year={2025}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
# WeHub 来源说明
|
||||
|
||||
- 原始项目:`bytedance/UI-TARS-desktop`
|
||||
- 原始仓库:https://github.com/bytedance/UI-TARS-desktop
|
||||
- 导入方式:上游默认分支的最新快照
|
||||
- 原作者、版权和许可证信息以原始仓库及本仓库 LICENSE 为准
|
||||
- 本文件仅用于记录来源,不代表 WeHub 是原项目作者
|
||||
@@ -0,0 +1,296 @@
|
||||
<picture>
|
||||
<img alt="Agent TARS Banner" src="./images/tars.png">
|
||||
</picture>
|
||||
|
||||
## Introduction
|
||||
|
||||
[English](./README.md) | 简体中文
|
||||
|
||||
[](https://trendshift.io/repositories/13584)
|
||||
|
||||
<b>TARS<sup>\*</sup></b> 是一个多模态 AI Agent Stack,目前包含两个项目:[Agent TARS](#agent-tars) 和 [UI-TARS-desktop](#ui-tars-desktop):
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%" align="center"><a href="#agent-tars">Agent TARS</a></th>
|
||||
<th width="50%" align="center"><a href="#ui-tars-desktop">UI-TARS-desktop</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/c9489936-afdc-4d12-adda-d4b90d2a869d" width="50%"></video>
|
||||
</td>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/e0914ce9-ad33-494b-bdec-0c25c1b01a27" width="50%"></video>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>Agent TARS</b> 是一个通用的多模态 AI Agent Stack,它将 GUI Agent 和 Vision 的强大功能带入你的终端、计算机、浏览器和产品中。
|
||||
<br>
|
||||
<br>
|
||||
它主要提供 <a href="https://agent-tars.com/guide/basic/cli.html" target="_blank">CLI</a> 和 <a href="https://agent-tars.com/guide/basic/web-ui.html" target="_blank">Web UI</a> 供使用。
|
||||
旨在通过前沿的多模态 LLMs 和与各种现实世界 <a href="https://agent-tars.com/guide/basic/mcp.html" target="_blank">MCP</a> 工具的无缝集成,提供更接近人类任务完成方式的工作流程。
|
||||
</td>
|
||||
<td align="left">
|
||||
<b>UI-TARS Desktop</b> 是一个桌面应用程序,基于 <a href="https://github.com/bytedance/UI-TARS" target="_blank">UI-TARS</a> 模型提供原生的 GUI Agent。
|
||||
<br>
|
||||
<br>
|
||||
它主要提供
|
||||
<a href="https://github.com/bytedance/UI-TARS-desktop/blob/docs/new-readme/docs/quick-start.md#get-model-and-run" target="_blank">本地</a>计算机以及浏览器操作器。
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Table of Contents
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
- [News](#news)
|
||||
- [Agent TARS](#agent-tars)
|
||||
- [Showcase](#showcase)
|
||||
- [Core Features](#core-features)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Documentation](#documentation)
|
||||
- [UI-TARS Desktop](#ui-tars-desktop)
|
||||
- [Showcase](#showcase-1)
|
||||
- [Features](#features)
|
||||
- [Quick Start](#quick-start-1)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
- [Citation](#citation)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## News
|
||||
|
||||
- **\[2025-11-05\]** 🎉 我们很高兴地宣布 [Agent TARS CLI v0.3.0](https://github.com/bytedance/UI-TARS-desktop/releases/tag/v0.3.0) 正式发布!此版本新增了多种工具的流式调用支持(shell 命令、多文件结构化展示)、Runtime Setting 和耗时统计、Event Stream 可视化用于数据流追踪和调试,以及 AIO Sandbox 集成、支持隔离的执行环境。
|
||||
- **\[2025-06-25\]** 我们发布了 Agent TARS Beta 和 Agent TARS CLI - [Introducing Agent TARS Beta](https://agent-tars.com/blog/2025-06-25-introducing-agent-tars-beta.html),这是一个多模态 AI agent,旨在通过丰富的多模态能力(如 GUI Agent、Vision)和与各种现实世界工具的无缝集成,探索更接近人类任务完成方式的工作形式。
|
||||
- **\[2025-06-12\]** - 🎁 我们很高兴宣布发布 UI-TARS Desktop v0.2.0!此次更新引入了两个强大的新功能:**Remote Computer Operator** 和 **Remote Browser Operator**—— 完全免费。无需配置:只需点击即可远程控制任何计算机或浏览器,体验全新的便利和智能水平。
|
||||
- **\[2025-04-17\]** - 🎉 我们很高兴宣布发布全新的 UI-TARS Desktop 应用程序 v0.1.0,具有重新设计的 Agent UI。该应用程序增强了计算机使用体验,引入了新的浏览器操作功能,并支持[先进的 UI-TARS-1.5 模型](https://seed-tars.com/1.5)以提供更好的性能和精确控制。
|
||||
- **\[2025-02-20\]** - 📦 推出了 [UI TARS SDK](./docs/sdk.md),这是一个强大的跨平台工具包,用于构建 GUI 自动化 agent。
|
||||
- **\[2025-01-23\]** - 🚀 我们更新了**[Cloud Deployment](./docs/deployment.md#cloud-deployment)**部分的中文版:[GUI模型部署教程](https://bytedance.sg.larkoffice.com/docx/TCcuNPlHL21gNb),其中包含与 ModelScope 平台相关的新信息。你现在可以使用 ModelScope 平台进行部署。
|
||||
|
||||
<br>
|
||||
|
||||
## Agent TARS
|
||||
|
||||
<p>
|
||||
<a href="https://npmjs.com/package/@agent-tars/cli?activeTab=readme"><img src="https://img.shields.io/npm/v/@agent-tars/cli?style=for-the-badge&colorA=1a1a2e&colorB=3B82F6&logo=npm&logoColor=white" alt="npm version" /></a>
|
||||
<a href="https://npmcharts.com/compare/@agent-tars/cli?minimal=true"><img src="https://img.shields.io/npm/dm/@agent-tars/cli.svg?style=for-the-badge&colorA=1a1a2e&colorB=0EA5E9&logo=npm&logoColor=white" alt="downloads" /></a>
|
||||
<a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/@agent-tars/cli.svg?style=for-the-badge&colorA=1a1a2e&colorB=06B6D4&logo=node.js&logoColor=white" alt="node version"></a>
|
||||
<a href="https://discord.gg/HnKcSBgTVx"><img src="https://img.shields.io/badge/Discord-Join%20Community-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord Community" /></a>
|
||||
<a href="https://twitter.com/agent_tars"><img src="https://img.shields.io/badge/Twitter-Follow%20%40agent__tars-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" alt="Official Twitter" /></a>
|
||||
<a href="https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=deen76f4-ea3c-4964-93a3-78f126f39651"><img src="https://img.shields.io/badge/飞书群-加入交流群-00D4AA?style=for-the-badge&logo=lark&logoColor=white" alt="飞书交流群" /></a>
|
||||
<a href="https://deepwiki.com/bytedance/UI-TARS-desktop"><img src="https://img.shields.io/badge/DeepWiki-Ask%20AI-8B5CF6?style=for-the-badge&logo=gitbook&logoColor=white" alt="Ask DeepWiki" /></a>
|
||||
</p>
|
||||
|
||||
<b>Agent TARS</b> 是一个通用的多模态 AI Agent Stack,它将 GUI Agent 和 Vision 的强大功能带入你的终端、计算机、浏览器和产品中。 <br> <br>
|
||||
它主要提供 <a href="https://agent-tars.com/guide/basic/cli.html" target="_blank">CLI</a> 和 <a href="https://agent-tars.com/guide/basic/web-ui.html" target="_blank">Web UI</a> 供使用。
|
||||
旨在通过前沿的多模态 LLMs 和与各种现实世界 <a href="https://agent-tars.com/guide/basic/mcp.html" target="_blank">MCP</a> 工具的无缝集成,提供更接近人类任务完成方式的工作流程。
|
||||
|
||||
### Showcase
|
||||
|
||||
```
|
||||
请帮我在 Priceline 上预订 9 月 1 日从圣何塞到纽约最早的航班,以及 9 月 6 日最晚的返程航班
|
||||
```
|
||||
|
||||
https://github.com/user-attachments/assets/772b0eef-aef7-4ab9-8cb0-9611820539d8
|
||||
|
||||
<br>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%" align="center">预订酒店</th>
|
||||
<th width="50%" align="center">使用额外的 MCP Servers 生成图表</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/c9489936-afdc-4d12-adda-d4b90d2a869d" width="50%"></video>
|
||||
</td>
|
||||
<td align="center">
|
||||
<video src="https://github.com/user-attachments/assets/a9fd72d0-01bb-4233-aa27-ca95194bbce9" width="50%"></video>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>指令:</b> <i>我 9 月 1 日到 9 月 6 日在洛杉矶,预算 5000 美元。请帮我在 booking.com 上预订离机场最近的丽思卡尔顿酒店,并为我编制一份交通指南</i>
|
||||
</td>
|
||||
<td align="left">
|
||||
<b>指令:</b> <i>为我绘制杭州一个月的天气图表</i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
更多用例,请查看 [#842](https://github.com/bytedance/UI-TARS-desktop/issues/842)。
|
||||
|
||||
### Core Features
|
||||
|
||||
- 🖱️ **一键开箱即用的 CLI** - 支持 **有界面** [Web UI](https://agent-tars.com/guide/basic/web-ui.html) 和 **无界面** [server](https://agent-tars.com/guide/advanced/server.html) [执行](https://agent-tars.com/guide/basic/cli.html)。
|
||||
- 🌐 **混合 Browser Agent** - 使用 [GUI Agent](https://agent-tars.com/guide/basic/browser.html#visual-grounding)、[DOM](https://agent-tars.com/guide/basic/browser.html#dom) 或混合策略控制浏览器。
|
||||
- 🔄 **Event Stream** - 协议驱动的 Event Stream 驱动 [Context Engineering](https://agent-tars.com/beta#context-engineering) 和 [Agent UI](https://agent-tars.com/blog/2025-06-25-introducing-agent-tars-beta.html#easy-to-build-applications)。
|
||||
- 🧰 **MCP Integration** - 内核构建在 MCP 之上,同时支持挂载 [MCP Servers](https://agent-tars.com/guide/basic/mcp.html) 来连接现实世界的工具。
|
||||
|
||||
### Quick Start
|
||||
|
||||
<img alt="Agent TARS CLI" src="https://agent-tars.com/agent-tars-cli.png">
|
||||
|
||||
```bash
|
||||
# 使用 `npx` 启动。
|
||||
npx @agent-tars/cli@latest
|
||||
|
||||
# 全局安装,需要 Node.js >= 22
|
||||
npm install @agent-tars/cli@latest -g
|
||||
|
||||
# 使用你喜欢的模型提供商运行
|
||||
agent-tars --provider volcengine --model doubao-1-5-thinking-vision-pro-250428 --apiKey your-api-key
|
||||
agent-tars --provider anthropic --model claude-3-7-sonnet-latest --apiKey your-api-key
|
||||
```
|
||||
|
||||
访问完整的 [Quick Start](https://agent-tars.com/guide/get-started/quick-start.html) 指南获取详细的设置说明。
|
||||
|
||||
### Documentation
|
||||
|
||||
> 🌟 **探索 Agent TARS Universe** 🌟
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%" align="center">分类</th>
|
||||
<th width="30%" align="center">资源链接</th>
|
||||
<th width="50%" align="left">描述</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">🏠 <strong>核心枢纽</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com">
|
||||
<img src="https://img.shields.io/badge/Visit-Website-4F46E5?style=for-the-badge&logo=globe&logoColor=white" alt="Website" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">进入 Agent TARS 生态系统的入口</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">📚 <strong>Quick Start</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/guide/get-started/quick-start.html">
|
||||
<img src="https://img.shields.io/badge/Get-Started-06B6D4?style=for-the-badge&logo=rocket&logoColor=white" alt="Quick Start" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">5 分钟从零快速上手</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🚀 <strong>最新动态</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/beta">
|
||||
<img src="https://img.shields.io/badge/Read-Blog-F59E0B?style=for-the-badge&logo=rss&logoColor=white" alt="Blog" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">发现前沿功能和愿景</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🛠️ <strong>开发者专区</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/guide/get-started/introduction.html">
|
||||
<img src="https://img.shields.io/badge/View-Docs-10B981?style=for-the-badge&logo=gitbook&logoColor=white" alt="Docs" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">掌握每个命令和功能</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🎯 <strong>Showcase</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/bytedance/UI-TARS-desktop/issues/842">
|
||||
<img src="https://img.shields.io/badge/View-Examples-8B5CF6?style=for-the-badge&logo=github&logoColor=white" alt="Examples" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">查看官方和社区构建的用例</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">🔧 <strong>参考文档</strong></td>
|
||||
<td align="center">
|
||||
<a href="https://agent-tars.com/api/">
|
||||
<img src="https://img.shields.io/badge/API-Reference-EF4444?style=for-the-badge&logo=book&logoColor=white" alt="API" />
|
||||
</a>
|
||||
</td>
|
||||
<td align="left">完整的技术参考</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
## UI-TARS Desktop
|
||||
|
||||
<p align="center">
|
||||
<img alt="UI-TARS" width="260" src="./apps/ui-tars/resources/icon.png">
|
||||
</p>
|
||||
|
||||
UI-TARS Desktop 是一个由 [UI-TARS](https://github.com/bytedance/UI-TARS) 和 Seed-1.5-VL/1.6 系列模型驱动的原生 GUI agent,可在你的本地计算机上使用。
|
||||
|
||||
<div align="center">
|
||||
<p>
|
||||
   📑 <a href="https://arxiv.org/abs/2501.12326">Paper</a>   
|
||||
| 🤗 <a href="https://huggingface.co/ByteDance-Seed/UI-TARS-1.5-7B">Hugging Face Models</a>  
|
||||
|   🫨 <a href="https://discord.gg/pTXwYVjfcs">Discord</a>  
|
||||
|   🤖 <a href="https://www.modelscope.cn/collections/UI-TARS-bccb56fa1ef640">ModelScope</a>  
|
||||
<br>
|
||||
🖥️ Desktop Application   
|
||||
|    👓 <a href="https://github.com/web-infra-dev/midscene">Midscene (use in browser)</a>   
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
### Showcase
|
||||
|
||||
<!-- // FIXME: Choose only two demo, one local computer and one remote computer showcase. -->
|
||||
|
||||
| 指令 | 本地操作器 | 远程操作器 |
|
||||
| :---------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------: |
|
||||
| 请帮我在 VS Code 设置中打开 VS Code 的自动保存功能,并将自动保存操作延迟设置为 500 毫秒。 | <video src="https://github.com/user-attachments/assets/e0914ce9-ad33-494b-bdec-0c25c1b01a27" height="300" /> | <video src="https://github.com/user-attachments/assets/01e49b69-7070-46c8-b3e3-2aaaaec71800" height="300" /> |
|
||||
| 你能帮我查看一下 GitHub 上 UI-TARS-Desktop 项目的最新 open issue 吗? | <video src="https://github.com/user-attachments/assets/3d159f54-d24a-4268-96c0-e149607e9199" height="300" /> | <video src="https://github.com/user-attachments/assets/072fb72d-7394-4bfa-95f5-4736e29f7e58" height="300" /> |
|
||||
|
||||
### Features
|
||||
|
||||
- 🤖 由 Vision-Language Model 驱动的自然语言控制
|
||||
- 🖥️ 截图和视觉识别支持
|
||||
- 🎯 精确的鼠标和键盘控制
|
||||
- 💻 跨平台支持 (Windows/MacOS/Browser)
|
||||
- 🔄 实时反馈和状态显示
|
||||
- 🔐 私密且安全 - 完全本地处理
|
||||
|
||||
### Quick Start
|
||||
|
||||
参见 [Quick Start](./docs/quick-start.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
参见 [CONTRIBUTING.md](./CONTRIBUTING.md)。
|
||||
|
||||
## License
|
||||
|
||||
本项目基于 Apache License 2.0 许可证。
|
||||
|
||||
## Citation
|
||||
|
||||
如果你觉得我们的论文和代码对你的研究有用,请考虑给个 star :star: 和引用 :pencil:
|
||||
|
||||
```BibTeX
|
||||
@article{qin2025ui,
|
||||
title={UI-TARS: Pioneering Automated GUI Interaction with Native Agents},
|
||||
author={Qin, Yujia and Ye, Yining and Fang, Junjie and Wang, Haoming and Liang, Shihao and Tian, Shizuo and Zhang, Junda and Li, Jiahao and Li, Yunxin and Huang, Shijue and others},
|
||||
journal={arXiv preprint arXiv:2501.12326},
|
||||
year={2025}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Here are the versions are currently being supported with security updates.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 0.0.x | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you find any vulnerability issue, please report it to https://github.com/bytedance/UI-TARS-desktop/security.
|
||||
We will get touch with you shortly.
|
||||
|
||||
## Security Advisories
|
||||
|
||||
We will publish security advisories for the latest version.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
=*
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import {
|
||||
ElectronApplication,
|
||||
Page,
|
||||
_electron as electron,
|
||||
expect,
|
||||
test,
|
||||
} from '@playwright/test';
|
||||
import { findLatestBuild, parseElectronApp } from 'electron-playwright-helpers';
|
||||
|
||||
let electronApp: ElectronApplication;
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async () => {
|
||||
const latestBuild = findLatestBuild();
|
||||
const { executable: executablePath, main } = parseElectronApp(latestBuild);
|
||||
console.log('executablePath:', executablePath, '\nmain:', main);
|
||||
process.env.CI = 'e2e';
|
||||
electronApp = await electron.launch({
|
||||
args: [main],
|
||||
executablePath,
|
||||
env: {
|
||||
...process.env,
|
||||
CI: 'e2e',
|
||||
},
|
||||
});
|
||||
|
||||
page = await electronApp.firstWindow();
|
||||
electronApp.on('window', async (page) => {
|
||||
const filename = page.url()?.split('/').pop();
|
||||
console.log(`Window opened: ${filename}`);
|
||||
|
||||
// capture errors
|
||||
page.on('pageerror', (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
// capture console messages
|
||||
page.on('console', (msg) => {
|
||||
console.log(msg.text());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
await electronApp?.close();
|
||||
});
|
||||
|
||||
test('app can launch', async () => {
|
||||
test.setTimeout(60_000);
|
||||
await page.waitForLoadState('domcontentloaded', { timeout: 0 });
|
||||
|
||||
await page.waitForSelector('button', { state: 'visible' });
|
||||
|
||||
const buttonElement = await page.$('button');
|
||||
expect(await buttonElement?.isVisible()).toBe(true);
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// import { execute } from '@main/agent/execute';
|
||||
// import { PredictionParsed } from '@ui-tars/shared/types';
|
||||
|
||||
// const screenWidth = 1310;
|
||||
// const screenHeight = 813;
|
||||
// const predictions: PredictionParsed[] = [
|
||||
// {
|
||||
// action_type: 'click',
|
||||
// action_inputs: {
|
||||
// start_box: '[0.256,0.431,0.256,0.431]',
|
||||
// },
|
||||
// reflection: 'reflection',
|
||||
// thought: 'thought',
|
||||
// },
|
||||
// {
|
||||
// action_type: 'type',
|
||||
// action_inputs: {
|
||||
// content: 'www.doubao.com',
|
||||
// },
|
||||
// reflection: 'reflection',
|
||||
// thought: 'thought',
|
||||
// },
|
||||
// ];
|
||||
|
||||
// (async () => {
|
||||
// for (const prediction of predictions) {
|
||||
// await execute({
|
||||
// prediction,
|
||||
// screenWidth,
|
||||
// screenHeight,
|
||||
// });
|
||||
// }
|
||||
// })();
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import tsconfigPath from 'vite-tsconfig-paths';
|
||||
import { defineProject } from 'vitest/config';
|
||||
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
export default defineProject({
|
||||
root: __dirname,
|
||||
test: {
|
||||
globals: true,
|
||||
setupFiles: [],
|
||||
environment: 'node',
|
||||
includeSource: [resolve(__dirname, '.')],
|
||||
testTimeout: 15 * 1000,
|
||||
},
|
||||
|
||||
plugins: [
|
||||
// @ts-ignore
|
||||
tsconfigPath({
|
||||
projects: ['../tsconfig.node.json'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -0,0 +1,45 @@
|
||||
appId: com.electron.app
|
||||
productName: UI-TARS
|
||||
directories:
|
||||
buildResources: build
|
||||
files:
|
||||
- '!**/.vscode/*'
|
||||
- '!src/*'
|
||||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
||||
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
||||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
|
||||
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
|
||||
asarUnpack:
|
||||
- resources/**
|
||||
win:
|
||||
executableName: UI-TARS
|
||||
nsis:
|
||||
artifactName: ${name}-${version}-setup.${ext}
|
||||
shortcutName: ${productName}
|
||||
uninstallDisplayName: ${productName}
|
||||
createDesktopShortcut: always
|
||||
mac:
|
||||
entitlementsInherit: build/entitlements.mac.plist
|
||||
extendInfo:
|
||||
- NSCameraUsageDescription: Application requests access to the device's camera.
|
||||
- NSAppleEventsUsageDescription: Application requests access to the user's Apple Events.
|
||||
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
|
||||
- NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
|
||||
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
|
||||
notarize: false
|
||||
dmg:
|
||||
artifactName: ${name}-${version}.${ext}
|
||||
linux:
|
||||
target:
|
||||
- AppImage
|
||||
- snap
|
||||
- deb
|
||||
maintainer: electronjs.org
|
||||
category: Utility
|
||||
appImage:
|
||||
artifactName: ${name}-${version}.${ext}
|
||||
npmRebuild: false
|
||||
publish:
|
||||
provider: generic
|
||||
url: https://example.com/auto-updates
|
||||
updaterCacheDirName: ui-tars-updater
|
||||
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import react from '@vitejs/plugin-react';
|
||||
import {
|
||||
defineConfig,
|
||||
externalizeDepsPlugin,
|
||||
bytecodePlugin,
|
||||
} from 'electron-vite';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
|
||||
import pkg from './package.json';
|
||||
import { getExternalPkgs } from './scripts/getExternalPkgs';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
define: {
|
||||
'process.env.UI_TARS_APP_PRIVATE_KEY_BASE64': JSON.stringify(
|
||||
process.env.UI_TARS_APP_PRIVATE_KEY_BASE64,
|
||||
),
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist/main',
|
||||
lib: {
|
||||
entry: './src/main/main.ts',
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id): string | void {
|
||||
// IMPORTANT: can't change the name of the chunk, avoid private key leak
|
||||
if (id.includes('app_private')) {
|
||||
return 'app_private';
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
bytecodePlugin({
|
||||
chunkAlias: 'app_private',
|
||||
protectedStrings: [process.env.UI_TARS_APP_PRIVATE_KEY_BASE64!],
|
||||
}),
|
||||
tsconfigPaths(),
|
||||
externalizeDepsPlugin({
|
||||
include: [...getExternalPkgs()],
|
||||
}),
|
||||
{
|
||||
name: 'native-node-module-path',
|
||||
enforce: 'pre',
|
||||
resolveId(source) {
|
||||
if (source.includes('screencapturepermissions.node')) {
|
||||
return {
|
||||
id: '@computer-use/mac-screen-capture-permissions/build/Release/screencapturepermissions.node',
|
||||
external: true,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
preload: {
|
||||
build: {
|
||||
outDir: 'dist/preload',
|
||||
lib: {
|
||||
entry: './src/preload/index.ts',
|
||||
},
|
||||
},
|
||||
plugins: [tsconfigPaths()],
|
||||
},
|
||||
renderer: {
|
||||
root: 'src/renderer',
|
||||
build: {
|
||||
outDir: 'dist/renderer',
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve('./src/renderer/index.html'),
|
||||
},
|
||||
},
|
||||
minify: true,
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
api: 'modern',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [react(), tsconfigPaths(), tailwindcss()],
|
||||
define: {
|
||||
APP_VERSION: JSON.stringify(pkg.version),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
crypto: resolve(__dirname, 'src/renderer/src/polyfills/crypto.ts'),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import fs, { readdirSync } from 'node:fs';
|
||||
import { cp, readdir } from 'node:fs/promises';
|
||||
import path, { resolve } from 'node:path';
|
||||
|
||||
import { MakerDMG } from '@electron-forge/maker-dmg';
|
||||
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
|
||||
import { MakerZIP } from '@electron-forge/maker-zip';
|
||||
import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives';
|
||||
import { FusesPlugin } from '@electron-forge/plugin-fuses';
|
||||
import type { ForgeConfig } from '@electron-forge/shared-types';
|
||||
import { FuseV1Options, FuseVersion } from '@electron/fuses';
|
||||
import setLanguages from 'electron-packager-languages';
|
||||
import { rimraf, rimrafSync } from 'rimraf';
|
||||
|
||||
import pkg from './package.json';
|
||||
import { getExternalPkgs } from './scripts/getExternalPkgs';
|
||||
import {
|
||||
getModuleRoot,
|
||||
getExternalPkgsDependencies,
|
||||
hooks,
|
||||
} from '@common/electron-build';
|
||||
|
||||
const keepModules = new Set([
|
||||
...getExternalPkgs(),
|
||||
'@computer-use/mac-screen-capture-permissions',
|
||||
]);
|
||||
const needSubDependencies = ['@computer-use/node-mac-permissions', 'sharp'];
|
||||
const ignorePattern = new RegExp(
|
||||
`^/node_modules/(?!${[...keepModules].join('|')})`,
|
||||
);
|
||||
const unpack = `**/node_modules/{@img,${[...keepModules].join(',')}}/**/*`;
|
||||
|
||||
console.log('keepModules', Object.keys(pkg.dependencies));
|
||||
console.log('needSubDependencies', needSubDependencies);
|
||||
const keepLanguages = new Set(['en', 'en_GB', 'en-US', 'en_US']);
|
||||
const noopAfterCopy = (
|
||||
_buildPath,
|
||||
_electronVersion,
|
||||
_platform,
|
||||
_arch,
|
||||
callback,
|
||||
) => callback();
|
||||
|
||||
const enableOsxSign =
|
||||
process.env.APPLE_ID &&
|
||||
process.env.APPLE_PASSWORD &&
|
||||
process.env.APPLE_TEAM_ID;
|
||||
|
||||
// remove folders & files not to be included in the app
|
||||
async function cleanSources(
|
||||
buildPath,
|
||||
_electronVersion,
|
||||
platform,
|
||||
_arch,
|
||||
callback,
|
||||
) {
|
||||
// folders & files to be included in the app
|
||||
const appItems = new Set([
|
||||
'dist',
|
||||
'node_modules',
|
||||
'package.json',
|
||||
'resources',
|
||||
]);
|
||||
|
||||
if (platform === 'darwin' || platform === 'mas') {
|
||||
const frameworkResourcePath = resolve(
|
||||
buildPath,
|
||||
'../../Frameworks/Electron Framework.framework/Versions/A/Resources',
|
||||
);
|
||||
|
||||
for (const file of readdirSync(frameworkResourcePath)) {
|
||||
if (file.endsWith('.lproj') && !keepLanguages.has(file.split('.')[0]!)) {
|
||||
rimrafSync(resolve(frameworkResourcePath, file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Keep only node_modules to be included in the app
|
||||
await Promise.all([
|
||||
...(await readdir(buildPath).then((items) =>
|
||||
items
|
||||
.filter((item) => !appItems.has(item))
|
||||
.map((item) => rimraf(path.join(buildPath, item))),
|
||||
)),
|
||||
...(await readdir(path.join(buildPath, 'node_modules')).then((items) =>
|
||||
items
|
||||
.filter((item) => !keepModules.has(item))
|
||||
.map((item) => rimraf(path.join(buildPath, 'node_modules', item))),
|
||||
)),
|
||||
]);
|
||||
|
||||
const projectRoot = path.resolve(__dirname, '.');
|
||||
|
||||
await Promise.all(
|
||||
Array.from(keepModules.values()).map((item) => {
|
||||
// Check is exist
|
||||
if (fs.existsSync(path.join(buildPath, 'node_modules', item))) {
|
||||
// eslint-disable-next-line array-callback-return
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const moduleRoot = getModuleRoot(projectRoot, item);
|
||||
|
||||
if (fs.existsSync(moduleRoot)) {
|
||||
return cp(moduleRoot, path.join(buildPath, 'node_modules', item), {
|
||||
recursive: true,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('copy_current_node_modules_error', error);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}),
|
||||
);
|
||||
|
||||
const subDependencies = await getExternalPkgsDependencies(
|
||||
needSubDependencies,
|
||||
projectRoot,
|
||||
);
|
||||
await Promise.all(
|
||||
Array.from(subDependencies.values()).map((subDependency) => {
|
||||
if (
|
||||
fs.existsSync(path.join(buildPath, 'node_modules', subDependency.name))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fs.existsSync(subDependency.path)) {
|
||||
return cp(
|
||||
subDependency.path,
|
||||
path.join(buildPath, 'node_modules', subDependency.name),
|
||||
{
|
||||
recursive: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
return;
|
||||
}),
|
||||
);
|
||||
|
||||
callback();
|
||||
}
|
||||
|
||||
console.log('ignorePattern', ignorePattern);
|
||||
|
||||
const config: ForgeConfig = {
|
||||
packagerConfig: {
|
||||
name: 'UI TARS',
|
||||
icon: 'resources/icon',
|
||||
extraResource: ['./resources/app-update.yml'],
|
||||
asar: {
|
||||
unpack,
|
||||
},
|
||||
ignore: [ignorePattern],
|
||||
prune: false,
|
||||
afterCopy: [
|
||||
cleanSources,
|
||||
process.platform !== 'win32'
|
||||
? noopAfterCopy
|
||||
: setLanguages([...keepLanguages.values()]),
|
||||
],
|
||||
executableName: 'UI-TARS',
|
||||
...(enableOsxSign
|
||||
? {
|
||||
osxSign: {
|
||||
keychain: process.env.KEYCHAIN_PATH,
|
||||
optionsForFile: () => ({
|
||||
entitlements: 'build/entitlements.mac.plist',
|
||||
}),
|
||||
},
|
||||
osxNotarize: {
|
||||
appleId: process.env.APPLE_ID!,
|
||||
appleIdPassword: process.env.APPLE_PASSWORD!,
|
||||
teamId: process.env.APPLE_TEAM_ID!,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
rebuildConfig: {},
|
||||
publishers: [
|
||||
{
|
||||
name: '@electron-forge/publisher-github',
|
||||
config: {
|
||||
repository: { owner: 'bytedance', name: 'ui-tars-desktop' },
|
||||
draft: true,
|
||||
force: true,
|
||||
generateReleaseNotes: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
makers: [
|
||||
new MakerZIP({}, ['darwin']),
|
||||
new MakerSquirrel({
|
||||
// CamelCase version without spaces
|
||||
name: 'UiTars',
|
||||
setupIcon: 'resources/icon.ico',
|
||||
}),
|
||||
// https://github.com/electron/forge/issues/3712
|
||||
new MakerDMG({
|
||||
overwrite: true,
|
||||
background: 'static/dmg-background.png',
|
||||
// icon: 'static/dmg-icon.icns',
|
||||
iconSize: 160,
|
||||
format: 'UDZO',
|
||||
additionalDMGOptions: { window: { size: { width: 660, height: 400 } } },
|
||||
contents: (opts) => [
|
||||
{ x: 180, y: 170, type: 'file', path: opts.appPath },
|
||||
{ x: 480, y: 170, type: 'link', path: '/Applications' },
|
||||
],
|
||||
}),
|
||||
],
|
||||
plugins: [
|
||||
new AutoUnpackNativesPlugin({}),
|
||||
// Fuses are used to enable/disable various Electron functionality
|
||||
// at package time, before code signing the application
|
||||
// https://github.com/microsoft/playwright/issues/28669#issuecomment-2268380066
|
||||
...(process.env.CI === 'e2e'
|
||||
? []
|
||||
: [
|
||||
new FusesPlugin({
|
||||
version: FuseVersion.V1,
|
||||
[FuseV1Options.RunAsNode]: false,
|
||||
[FuseV1Options.EnableCookieEncryption]: true,
|
||||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
||||
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
||||
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
||||
}),
|
||||
]),
|
||||
],
|
||||
hooks: {
|
||||
postMake: async (forgeConfig, makeResults) => {
|
||||
return await hooks.postMake?.(forgeConfig, makeResults);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 178 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 660 KiB |
|
After Width: | Height: | Size: 449 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 137 KiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 443 KiB |
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 178 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 145 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 233 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 221 KiB |
|
After Width: | Height: | Size: 249 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 42 KiB |
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"name": "ui-tars-desktop",
|
||||
"version": "0.2.4",
|
||||
"private": true,
|
||||
"main": "./dist/main/main.js",
|
||||
"packageManager": "pnpm@9.10.0",
|
||||
"description": "A GUI Agent application based on UI-TARS(Vision-Lanuage Model) that allows you to control your computer using natural language.",
|
||||
"author": "ByteDance",
|
||||
"scripts": {
|
||||
"format": "prettier --write .",
|
||||
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
|
||||
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --pretty --composite false",
|
||||
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --pretty --composite false",
|
||||
"typecheck": "npm run typecheck:node && npm run typecheck:web",
|
||||
"start": "electron-vite preview",
|
||||
"dev": "electron-vite dev",
|
||||
"debug": "electron-vite dev --sourcemap --remote-debugging-port=9222",
|
||||
"debug:w": "electron-vite dev -w --sourcemap --remote-debugging-port=9222",
|
||||
"dev:w": "electron-vite dev -w",
|
||||
"asar:analyze": "asar extract out/UI\\ TARS-darwin-arm64/UI\\ TARS.app/Contents/Resources/app.asar ./dist/asar",
|
||||
"package": "electron-forge package",
|
||||
"clean": "rimraf dist out",
|
||||
"test": "vitest",
|
||||
"test:bench": "vitest bench",
|
||||
"coverage": "vitest run --coverage",
|
||||
"build:e2e": "npm run build:dist && cross-env CI=e2e npm run package",
|
||||
"test:e2e": "playwright test",
|
||||
"build:deps": "pnpm --filter \"!ui-tars-desktop,ui-tars-desktop...\" build && cd packages/visualizer && pnpm install --ignore-workspace",
|
||||
"build:dist": "cross-env NODE_ENV=production electron-vite build",
|
||||
"build": "npm run clean && npm run typecheck && cross-env NODE_ENV=production electron-vite build && electron-forge make --enable-logging",
|
||||
"make": "electron-forge make",
|
||||
"publish:mac-x64": "npm run build && electron-forge publish --arch=x64 --platform=darwin",
|
||||
"publish:mac-arm64": "npm run build && electron-forge publish --arch=arm64 --platform=darwin",
|
||||
"publish:win32": "npm run build && electron-forge publish --arch=x64 --platform=win32",
|
||||
"publish:win32-arm64": "npm run build && electron-forge publish --arch=arm64 --platform=win32",
|
||||
"publish": "npm run build && electron-forge publish"
|
||||
},
|
||||
"build": {
|
||||
"electronDownload": {
|
||||
"mirror": "https://npmmirror.com/mirrors/electron/"
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"esbuild-register": "*",
|
||||
"ts-node": "*",
|
||||
"tsx": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"esbuild-register": {
|
||||
"optional": true
|
||||
},
|
||||
"ts-node": {
|
||||
"optional": true
|
||||
},
|
||||
"tsx": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@computer-use/node-mac-permissions": "2.2.2",
|
||||
"sharp": "0.33.3",
|
||||
"jose": "^6.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"semver": "7.7.2",
|
||||
"builder-util-runtime": "9.3.1",
|
||||
"@common/electron-build": "workspace:*",
|
||||
"@computer-use/mac-screen-capture-permissions": "^1.0.2",
|
||||
"@computer-use/nut-js": "^4.2.0",
|
||||
"@electron-forge/cli": "^7.7.0",
|
||||
"@electron-forge/maker-dmg": "^7.7.0",
|
||||
"@electron-forge/maker-pkg": "^7.7.0",
|
||||
"@electron-forge/maker-squirrel": "^7.7.0",
|
||||
"@electron-forge/maker-zip": "^7.7.0",
|
||||
"@electron-forge/plugin-auto-unpack-natives": "^7.7.0",
|
||||
"@electron-forge/plugin-base": "^7.7.0",
|
||||
"@electron-forge/plugin-fuses": "^7.7.0",
|
||||
"@electron-forge/plugin-vite": "^7.7.0",
|
||||
"@electron-forge/publisher-github": "^7.7.0",
|
||||
"@electron-forge/shared-types": "^7.7.0",
|
||||
"@electron-toolkit/eslint-config-prettier": "^2.0.0",
|
||||
"@electron-toolkit/eslint-config-ts": "^2.0.0",
|
||||
"@electron-toolkit/preload": "^3.0.1",
|
||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"@electron/asar": "^3.2.18",
|
||||
"@electron/fuses": "^1.8.0",
|
||||
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
||||
"@types/node": "^20.14.8",
|
||||
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
||||
"@typescript-eslint/parser": "^5.0.0",
|
||||
"@ui-tars/action-parser": "workspace:*",
|
||||
"@ui-tars/electron-ipc": "workspace:*",
|
||||
"@ui-tars/operator-nut-js": "workspace:*",
|
||||
"@ui-tars/operator-browser": "workspace:*",
|
||||
"@ui-tars/sdk": "workspace:*",
|
||||
"@ui-tars/shared": "workspace:*",
|
||||
"@ui-tars/utio": "workspace:*",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"@vitest/coverage-istanbul": "^3.0.3",
|
||||
"cross-env": "^7.0.3",
|
||||
"dotenv": "^16.4.7",
|
||||
"electron": "34.1.1",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-log": "5.2.4",
|
||||
"electron-packager-languages": "0.5.0",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"electron-store": "^10.0.0",
|
||||
"electron-vite": "^3.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-import": "^2.25.0",
|
||||
"eslint-plugin-react": "^7.34.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"ms": "^2.1.3",
|
||||
"prettier": "^3.3.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"sass-embedded": "^1.83.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsx": "^4.19.2",
|
||||
"typescript": "^5.7.2",
|
||||
"electron-updater": "^6.6.2",
|
||||
"vite": "^6.1.0",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^3.0.8",
|
||||
"zustand": "^5.0.0",
|
||||
"@tailwindcss/vite": "4.1.3",
|
||||
"tailwindcss": "4.1.3",
|
||||
"node-machine-id": "^1.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.x"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { defineConfig } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
fullyParallel: true,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
workers: 1,
|
||||
use: {
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
timeout: 60000,
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
provider: custom
|
||||
owner: bytedance
|
||||
repo: UI-TARS-desktop
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 47 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Baidu</title><path d="M8.859 11.735c1.017-1.71 4.059-3.083 6.202.286 1.579 2.284 4.284 4.397 4.284 4.397s2.027 1.601.73 4.684c-1.24 2.956-5.64 1.607-6.005 1.49l-.024-.009s-1.746-.568-3.776-.112c-2.026.458-3.773.286-3.773.286l-.045-.001c-.328-.01-2.38-.187-3.001-2.968-.675-3.028 2.365-4.687 2.592-4.968.226-.288 1.802-1.37 2.816-3.085zm.986 1.738v2.032h-1.64s-1.64.138-2.213 2.014c-.2 1.252.177 1.99.242 2.148.067.157.596 1.073 1.927 1.342h3.078v-7.514l-1.394-.022zm3.588 2.191l-1.44.024v3.956s.064.985 1.44 1.344h3.541v-5.3h-1.528v3.979h-1.46s-.466-.068-.553-.447v-3.556zM9.82 16.715v3.06H8.58s-.863-.045-1.126-1.049c-.136-.445.02-.959.088-1.16.063-.203.353-.671.951-.85H9.82zm9.525-9.036c2.086 0 2.646 2.06 2.646 2.742 0 .688.284 3.597-2.309 3.655-2.595.057-2.704-1.77-2.704-3.08 0-1.374.277-3.317 2.367-3.317zM4.24 6.08c1.523-.135 2.645 1.55 2.762 2.513.07.625.393 3.486-1.975 4-2.364.515-3.244-2.249-2.984-3.544 0 0 .28-2.797 2.197-2.969zm8.847-1.483c.14-1.31 1.69-3.316 2.931-3.028 1.236.285 2.367 1.944 2.137 3.37-.224 1.428-1.345 3.313-3.095 3.082-1.748-.226-2.143-1.823-1.973-3.424zM9.425 1c1.307 0 2.364 1.519 2.364 3.398 0 1.879-1.057 3.4-2.364 3.4s-2.367-1.521-2.367-3.4C7.058 2.518 8.118 1 9.425 1z" fill="#2932E1" fill-rule="nonzero"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Bing</title><defs><radialGradient cx="93.717%" cy="77.818%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.7146) rotate(49.288 2.035 -2.198)" id="lobe-icons-bing-fill-0" r="143.691%"><stop offset="0%" stop-color="#00CACC"></stop><stop offset="100%" stop-color="#048FCE"></stop></radialGradient><radialGradient cx="13.893%" cy="71.448%" fx="13.893%" fy="71.448%" gradientTransform="scale(.6042 1) rotate(-23.34 .184 .494)" id="lobe-icons-bing-fill-1" r="149.21%"><stop offset="0%" stop-color="#00BBEC"></stop><stop offset="100%" stop-color="#2756A9"></stop></radialGradient><linearGradient id="lobe-icons-bing-fill-2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00BBEC"></stop><stop offset="100%" stop-color="#2756A9"></stop></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M11.97 7.569a.92.92 0 00-.805.863c-.013.195-.01.209.43 1.347 1 2.59 1.242 3.214 1.283 3.302.099.213.237.413.41.592.134.138.222.212.37.311.26.176.39.224 1.405.527.989.295 1.529.49 1.994.723.603.302 1.024.644 1.29 1.051.191.292.36.815.434 1.342.029.206.029.661 0 .847a2.491 2.491 0 01-.376 1.026c-.1.151-.065.126.081-.058.415-.52.838-1.408 1.054-2.213a6.728 6.728 0 00.102-3.012 6.626 6.626 0 00-3.291-4.53 104.157 104.157 0 00-1.322-.698l-.254-.133a737.941 737.941 0 01-1.575-.827c-.548-.29-.78-.406-.846-.426a1.376 1.376 0 00-.29-.045l-.093.01z" fill="url(#lobe-icons-bing-fill-0)"></path><path d="M13.164 17.24a4.385 4.385 0 00-.202.125 511.45 511.45 0 00-1.795 1.115 163.087 163.087 0 01-.989.614l-.463.288a99.198 99.198 0 01-1.502.941c-.326.2-.704.334-1.09.387-.18.024-.52.024-.7 0a2.807 2.807 0 01-1.318-.538 3.665 3.665 0 01-.543-.545 2.837 2.837 0 01-.506-1.141 2.161 2.161 0 00-.041-.182c-.008-.008.006.138.032.33.027.199.085.487.147.733.482 1.907 1.85 3.457 3.705 4.195a6.31 6.31 0 001.658.412c.22.025.844.035 1.074.017 1.054-.08 1.972-.393 2.913-.992a325.28 325.28 0 01.937-.596l.384-.244.684-.435.234-.149.009-.005.025-.017.013-.007.172-.11.597-.38c.76-.481.987-.65 1.34-.998.148-.146.37-.394.381-.425.002-.007.042-.068.088-.136a2.49 2.49 0 00.373-1.023 4.181 4.181 0 000-.847 4.336 4.336 0 00-.318-1.137c-.224-.472-.7-.9-1.383-1.245a2.972 2.972 0 00-.406-.181c-.01 0-.646.392-1.413.87a7089.171 7089.171 0 00-1.658 1.031l-.439.274z" fill="url(#lobe-icons-bing-fill-1)" fill-rule="nonzero"></path><path d="M4.003 14.946l.004 3.33.042.193c.134.604.366 1.04.77 1.445a2.701 2.701 0 001.955.814c.536 0 1-.135 1.479-.43l.703-.435.556-.346V8.003c0-2.306-.004-3.675-.012-3.782a2.734 2.734 0 00-.797-1.765c-.145-.144-.268-.24-.637-.496A1780.102 1780.102 0 015.762.362C5.406.115 5.38.098 5.271.059a.943.943 0 00-1.254.696C4.003.818 4 1.659 4 6.223v5.394H4l.003 3.329z" fill="url(#lobe-icons-bing-fill-2)" fill-rule="nonzero"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Google</title><path d="M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z" fill="#4285F4"></path><path d="M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z" fill="#34A853"></path><path d="M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z" fill="#FBBC05"></path><path d="M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z" fill="#EB4335"></path></svg>
|
||||
|
After Width: | Height: | Size: 920 B |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,15 @@
|
||||
import pkg from '../package.json';
|
||||
|
||||
export const getExternalPkgs = () => {
|
||||
const { platform } = process;
|
||||
return [
|
||||
...Object.keys(pkg.dependencies),
|
||||
...(platform === 'darwin'
|
||||
? ['@computer-use/libnut-darwin']
|
||||
: platform === 'win32'
|
||||
? ['@computer-use/libnut-win32']
|
||||
: platform === 'linux'
|
||||
? ['@computer-use/libnut-linux']
|
||||
: []),
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { screen, desktopCapturer } from 'electron';
|
||||
import { NutJSElectronOperator } from './operator';
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('electron', () => ({
|
||||
screen: {
|
||||
getPrimaryDisplay: vi.fn(),
|
||||
},
|
||||
desktopCapturer: {
|
||||
getSources: vi.fn(),
|
||||
},
|
||||
app: {
|
||||
on: vi.fn(),
|
||||
off: vi.fn(),
|
||||
quit: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
relaunch: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('@main/env', () => ({
|
||||
isMacOS: false,
|
||||
}));
|
||||
|
||||
describe('NutJSElectronOperator', () => {
|
||||
let operator: NutJSElectronOperator;
|
||||
|
||||
beforeEach(() => {
|
||||
operator = new NutJSElectronOperator();
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('screenshot', () => {
|
||||
it('should capture screenshot successfully', async () => {
|
||||
const mockDisplay = {
|
||||
id: '1',
|
||||
size: { width: 1920, height: 1080 },
|
||||
scaleFactor: 1,
|
||||
};
|
||||
const mockSource = {
|
||||
display_id: '1',
|
||||
thumbnail: {
|
||||
toPNG: () => Buffer.from('mock-image'),
|
||||
resize: () => ({
|
||||
toPNG: () => Buffer.from('mock-image'),
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
vi.mocked(screen.getPrimaryDisplay).mockReturnValue(mockDisplay as any);
|
||||
vi.mocked(desktopCapturer.getSources).mockResolvedValueOnce([
|
||||
mockSource as any,
|
||||
]);
|
||||
|
||||
const result = await operator.screenshot();
|
||||
|
||||
expect(result).toEqual({
|
||||
base64: 'bW9jay1pbWFnZQ==',
|
||||
scaleFactor: 1,
|
||||
});
|
||||
expect(desktopCapturer.getSources).toHaveBeenCalledWith({
|
||||
types: ['screen'],
|
||||
thumbnailSize: {
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||