commit 1a390b2815c3774e13a6029636a05ac3c71e6cae Author: wehub-resource-sync Date: Mon Jul 13 12:08:49 2026 +0800 chore: import upstream snapshot with attribution diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..e5b6d8d --- /dev/null +++ b/.changeset/README.md @@ -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) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..6b0b0b3 --- /dev/null +++ b/.changeset/config.json @@ -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" + ] +} diff --git a/.commitlintrc.cjs b/.commitlintrc.cjs new file mode 100644 index 0000000..f980e6f --- /dev/null +++ b/.commitlintrc.cjs @@ -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', + ], + ], + }, +}; diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9d08a1a --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e42805e --- /dev/null +++ b/.env.example @@ -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 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..a6f34fe --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +node_modules +dist +out +.gitignore diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..cc99d4e --- /dev/null +++ b/.eslintrc.cjs @@ -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', + }, +}; diff --git a/.github/ISSUE_TEMPLATE/bug_report_agent_tars.yml b/.github/ISSUE_TEMPLATE/bug_report_agent_tars.yml new file mode 100644 index 0000000..87342ae --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_agent_tars.yml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/bug_report_ui_tars_desktop.yml b/.github/ISSUE_TEMPLATE/bug_report_ui_tars_desktop.yml new file mode 100644 index 0000000..6c567aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_ui_tars_desktop.yml @@ -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: + 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 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_requrest.yml b/.github/ISSUE_TEMPLATE/feature_requrest.yml new file mode 100644 index 0000000..8d27ba0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_requrest.yml @@ -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 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ba0790b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,35 @@ + + +## Summary + + + + + +## Checklist + + + +- [ ] 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. diff --git a/.github/workflows/agent_tars_test.yml b/.github/workflows/agent_tars_test.yml new file mode 100644 index 0000000..37b4916 --- /dev/null +++ b/.github/workflows/agent_tars_test.yml @@ -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 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..b78b9a1 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -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 diff --git a/.github/workflows/e2e-ui-tars.yml b/.github/workflows/e2e-ui-tars.yml new file mode 100644 index 0000000..531083c --- /dev/null +++ b/.github/workflows/e2e-ui-tars.yml @@ -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 diff --git a/.github/workflows/release-ui-tars.yml b/.github/workflows/release-ui-tars.yml new file mode 100644 index 0000000..bf8c95e --- /dev/null +++ b/.github/workflows/release-ui-tars.yml @@ -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 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..edb1cba --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -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 diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml new file mode 100644 index 0000000..ba719d8 --- /dev/null +++ b/.github/workflows/secret-scan.yml @@ -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 diff --git a/.github/workflows/secretlint.yml b/.github/workflows/secretlint.yml new file mode 100644 index 0000000..9df5ad2 --- /dev/null +++ b/.github/workflows/secretlint.yml @@ -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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7bc4c8c --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..407544a --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..da99483 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx --no -- commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..2312dc5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs new file mode 100644 index 0000000..d0ec08a --- /dev/null +++ b/.lintstagedrc.mjs @@ -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'], +}; diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..2bf5ad0 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +stable diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..5e2feb9 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +shamefully-hoist=true +node-linker=hoisted diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9c6b791 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +out +dist +pnpm-lock.yaml +LICENSE.md +tsconfig.json +tsconfig.*.json diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 0000000..9579ff6 --- /dev/null +++ b/.prettierrc.mjs @@ -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:(.*)$', + // '', + // '^@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'], +}; diff --git a/.secretlintignore b/.secretlintignore new file mode 100644 index 0000000..cb61835 --- /dev/null +++ b/.secretlintignore @@ -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 diff --git a/.secretlintrc.json b/.secretlintrc.json new file mode 100644 index 0000000..47bc78c --- /dev/null +++ b/.secretlintrc.json @@ -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(?(?:password|pass|secret|token|apiKey)(?:[_-]\\w+)?)\\b\\s*[:=]\\s*(?(?!['\"]?\\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" } + ] +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..4de1d7d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["esbenp.prettier-vscode", "psioniq.psi-header"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b2969b4 --- /dev/null +++ b/.vscode/settings.json @@ -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" + ] +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..df814a2 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..be43a9d --- /dev/null +++ b/CONTRIBUTING.md @@ -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. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f021272 --- /dev/null +++ b/README.md @@ -0,0 +1,299 @@ + + Agent TARS Banner + + +
+ +## Introduction + +English | [įŽ€äŊ“中文](./README.zh-CN.md) + +[![](https://trendshift.io/api/badge/repositories/13584)](https://trendshift.io/repositories/13584) + +TARS\* is a Multimodal AI Agent stack, currently shipping two projects: [Agent TARS](#agent-tars) and [UI-TARS-desktop](#ui-tars-desktop): + + + + + + + + + + + + + + + + + + +
Agent TARSUI-TARS-desktop
+ + + +
+ Agent TARS is a general multimodal AI Agent stack, it brings the power of GUI Agent and Vision into your terminal, computer, browser and product. +
+
+ It primarily ships with a CLI and Web UI 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 MCP tools. +
+ UI-TARS Desktop is a desktop application that provides a native GUI Agent based on the UI-TARS model. +
+
+ It primarily ships a + local and + remote computer as well as browser operators. +
+ +## Table of Contents + + + + +- [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) + + + +## 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. + +
+ +## Agent TARS + +

+ npm version + downloads + node version + Discord Community + Official Twitter + éŖžäšĻä礿ĩįž¤ + Ask DeepWiki +

+ +Agent TARS is a general multimodal AI Agent stack, it brings the power of GUI Agent and Vision into your terminal, computer, browser and product.

+It primarily ships with a CLI and Web UI 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 MCP 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 + +
+ + + + + + + + + + + + + + + + + + +
Booking HotelGenerate Chart with extra MCP Servers
+ + + +
+ Instruction: 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 + + Instruction: Draw me a chart of Hangzhou's weather for one month +
+ +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 + +Agent TARS CLI + +```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** 🌟 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryResource LinkDescription
🏠 Central Hub + + Website + + Your gateway to Agent TARS ecosystem
📚 Quick Start + + Quick Start + + Zero to hero in 5 minutes
🚀 What's New + + Blog + + Discover cutting-edge features & vision
đŸ› ī¸ Developer Zone + + Docs + + Master every command & features
đŸŽ¯ Showcase + + Examples + + View use cases built by the official and community
🔧 Reference + + API + + Complete technical reference
+ +
+
+
+ +## UI-TARS Desktop + +

+ UI-TARS +

+ +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. + +
+

+    📑 Paper    + | 🤗 Hugging Face Models   + |   đŸĢ¨ Discord   + |   đŸ¤– ModelScope   +
+đŸ–Ĩī¸ Desktop Application    +|    👓 Midscene (use in browser)    +

+ +
+ +### 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. |