源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
Creator App Tests / PR Spam Gate (push) Skipped
Frontend Tests / PR Spam Gate (push) Skipped
NPM Format (website & console) / PR Spam Gate (push) Skipped
Pre-commit Checks / PR Spam Gate (push) Skipped
QwenPaw Creator Plugin Release / check-version (push) Canceled after 0s
QwenPaw Creator Plugin Release / upload-oss (push) Canceled after 0s
Tests / PR Spam Gate (push) Skipped
CodeQL / CodeQL (python) (push) Canceled after 0s
CodeQL / CodeQL (typescript) (push) Canceled after 0s
Creator App Tests / Creator Backend Tests (push) Canceled after 0s
Creator App Tests / Creator UI Build & Tests (push) Canceled after 0s
E2E Smoke Tests / Playwright UI Smoke (push) Canceled after 0s
Frontend Tests / Detect console changes (push) Canceled after 0s
NPM Format (website & console) / website format check (push) Canceled after 0s
NPM Format (website & console) / console format check (push) Canceled after 0s
Pre-commit Checks / Pre-commit (push) Canceled after 0s
QwenPaw Data Plugin Release / check-version (push) Canceled after 0s
Tests / Detect code changes (push) Canceled after 0s
Frontend Tests / Vitest Unit Tests (push) Canceled after 0s
Frontend Tests / Frontend Summary (push) Canceled after 0s
QwenPaw Data Plugin Release / upload-oss (push) Canceled after 0s
Tests / Maintainer Approval (push) Canceled after 0s
Tests / Unit Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - fallback (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p2 (push) Canceled after 0s
Tests / Coverage Report (push) Canceled after 0s
Tests / Test Summary (push) Canceled after 0s

This commit is contained in:
agent-radar committed 2026-09-01 20:01:50 +08:00
commit 1a3a4ccde1
4652 files changed
+1891610

No files matched your search

+62
View File
@@ -0,0 +1,62 @@
# Git and IDE
.git
.gitignore
.idea
.vscode
*.md
!README.md
# Python dev and cache
__pycache__
*.py[cod]
*$py.class
.venv
venv
uv.lock
.pytest_cache
.coverage
htmlcov
.tox
.mypy_cache
.ruff_cache
# Tests (not needed in runtime image)
tests
test.py
*_test.py
pytest.ini
.pre-commit-config.yaml
.flake8
.eslintrc
.stylelintrc
# Frontend: exclude build artifacts; ship pre-built src/console/dist in image
website
!website/
!website/public/
!website/public/docs/
!website/public/docs/**
console/node_modules
console/dist
console/.vite
node_modules
**/node_modules
**/dist
!src/qwenpaw/console/dist
!src/qwenpaw/console/dist/**
**/.vite
# Example and local config (mount at runtime instead)
example
config.json
jobs.json
sessions_mount_dir
# Misc
.env
.env.*
!.env.example
.DS_Store
*.log
logs
cookbook
+12
View File
@@ -0,0 +1,12 @@
[flake8]
exclude =
scripts/*
src/agentscope/rpc/*
max-line-length = 79
inline-quotes = "
avoid-escape = no
ignore =
F401
F403
W503
E731
+3
View File
@@ -0,0 +1,3 @@
*.bat text eol=crlf
scripts/check-channels.sh text eol=lf
.github/workflows/tests.yml text eol=lf
+23
View File
@@ -0,0 +1,23 @@
---
name: Question / Discussion
about: Ask a question or start a discussion (consider GitHub Discussions for open-ended topics)
title: "[Question]: "
labels: ["question", "triage"]
assignees: []
---
## Question or topic
[What would you like to ask or discuss?]
## Context
[Relevant setup: QwenPaw version, channel, skill, or use case. This helps others answer.]
## Tried so far
[Optional: what you already tried or read (docs, issues, etc.).]
---
**Note:** For general questions or ideas, [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions) may get more visibility. Use this template when the answer might lead to a bug report, feature request, or doc change.
@@ -0,0 +1,43 @@
---
name: Feature Request
about: Suggest a new feature or enhancement
title: "[Feature]: "
labels: ["enhancement", "triage"]
assignees: []
---
## Summary
[One or two sentences: what do you want and why?]
## Component(s) Affected
- [ ] Core / Backend (app, agents, config, providers, utils, local_models)
- [ ] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy
## Problem / Motivation
[What problem does this solve? Who benefits?]
## Proposed Solution
[Describe the feature or change you have in mind. Be as specific as possible.]
## Alternatives Considered
[Any other approaches or workarounds you thought about.]
## Additional Context
[Screenshots, examples, links to docs or similar features elsewhere.]
## Willing to Contribute
- [ ] I am willing to open a PR for this feature (after discussion).
+36
View File
@@ -0,0 +1,36 @@
---
name: Documentation
about: Report docs issues or suggest documentation improvements
title: "[Docs]: "
labels: ["documentation", "triage"]
assignees: []
---
## Summary
[What is wrong or missing in the docs? One or two sentences.]
**Docs location:** [e.g. website, README, `website/public/docs/quickstart.en.md`, Console UI copy]
## Type
- [ ] Typo / wording fix
- [ ] Outdated or incorrect content
- [ ] Missing section or topic
- [ ] Broken link or image
- [ ] Translation (zh/en)
- [ ] Other
## Details
[Describe the issue or the change you suggest. If possible, point to the exact file or URL.]
**Current (if applicable):**
[Quote or describe current text.]
**Suggested:**
[Proposed text or structure.]
## Additional Context
[Optional: related issues, screenshots, which audience this affects.]
+62
View File
@@ -0,0 +1,62 @@
---
name: Bug Report
about: Report a bug or unexpected behavior
title: "[Bug]: "
labels: ["bug", "triage"]
assignees: []
---
## QwenPaw Version
[Provide the version of QwenPaw you are using, e.g. 0.x.x or git commit hash.]
[Using `qwenpaw --version` in your command line or checking the version in the console UI can help.]
## Description
[Describe the bug clearly and concisely. What happened vs what you expected?]
**Related PR(s):** #(optional)
**Security considerations:** [If applicable, e.g. auth, env/config exposure]
## Component(s) Affected
- [ ] Core / Backend (app, agents, config, providers, utils, local_models)
- [ ] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy
## Environment
- **QwenPaw version:** [e.g. 0.x.x or git commit]
- **OS:** [e.g. macOS 14, Ubuntu 22.04, Windows 11]
- **Install method:** [pip / one-line install / Docker / from source]
- **Python version (if applicable):** [e.g. 3.10]
## Steps to Reproduce
1.
2.
3.
## Actual vs Expected
- **Actual:**
- **Expected:**
## Logs / Screenshots
[Paste relevant log output or attach screenshots. Use code blocks for logs.]
```
(paste logs here)
```
## Additional Notes
[Optional: workarounds, similar issues, etc.]
@@ -0,0 +1,40 @@
---
name: Support / Environment
description: Issues with install, Docker, platform, or runtime environment
title: "[Support]: "
labels: ["support", "triage"]
assignees: []
---
## Summary
[What went wrong during install, run, or in your environment?]
## Environment
- **OS:** [e.g. macOS 14 (Apple Silicon / Intel), Ubuntu 22.04, Windows 11]
- **Install method:** [pip / one-line install (install.sh or install.ps1) / Docker / from source / ModelScope]
- **QwenPaw version:** [e.g. 0.x.x or commit]
- **Python version (if applicable):** [e.g. 3.10, 3.12]
## Steps you took
1.
2.
3.
## What happened
[Error message, log excerpt, or behavior. Paste relevant output in code blocks.]
```
(paste here)
```
## Expected
[What you expected to happen.]
## Additional context
[Optional: conda/venv, WSL, proxy, firewall, or other env details.]
+12
View File
@@ -0,0 +1,12 @@
# Issue template chooser. Templates are listed alphanumerically.
# See: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository
blank_issues_enabled: true
contact_links:
- name: GitHub Discussions
url: https://github.com/agentscope-ai/QwenPaw/discussions
about: Ask questions, share ideas, or discuss QwenPaw here.
- name: View docs
url: https://qwenpaw.agentscope.io/
about: QwenPaw docs and guides.
+76
View File
@@ -0,0 +1,76 @@
## Description
[Describe what this PR does and why]
**Related Issue:** Fixes #(issue_number) or Relates to #(issue_number)
**Security Considerations:** [If applicable, e.g. channel auth, env/config handling]
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
- [ ] Refactoring
## Component(s) Affected
- [ ] Core / Backend (app, agents, config, providers, utils, local_models)
- [ ] Console (frontend web UI)
- [ ] Channels (DingTalk, Lark, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy
## Checklist
- [ ] I ran `pre-commit run --all-files` locally and it passes
- [ ] If pre-commit auto-fixed files, I committed those changes and reran checks
- [ ] I ran tests locally (`pytest` or as relevant) and they pass
- [ ] Documentation updated (if needed)
- [ ] Ready for review
### For Channel Changes (DingTalk, Lark, QQ, Console, etc.)
- [ ] I ran `./scripts/check-channels.sh` (or `./scripts/check-channels.sh --changed`) and it passes
- [ ] **Contract test** exists in `tests/contract/channels/test_<channel>_contract.py` (REQUIRED)
- [ ] Contract test implements `create_instance()` with proper channel initialization
- [ ] All 19 contract verification points pass (see `tests/contract/channels/__init__.py`)
- [ ] **Optional**: Unit tests in `tests/unit/channels/test_<channel>.py` for complex internal logic
## Testing
[How to test these changes]
## Evidence
<!-- Required for external contributors. The CI "Real behavior proof" check
will block your PR if this section is missing or empty. Template
comments (like this one) do NOT count as evidence.
Keep the section headings "## Description" and "## Evidence" verbatim
— the CI check matches these headings by name. If you rename them,
your PR will be flagged as missing context even if you filled in the
content. -->
Examples of valid evidence:
- Terminal transcript of the test run (e.g. `pytest tests/unit/app/chats/ -q` output)
- Screenshot of the Console UI showing the fix
- CI artifact link
- `pre-commit run --all-files` summary
```bash
pre-commit run --all-files
# paste summary result
pytest
# paste summary result
```
## Additional Notes
[Optional: any other context]
+15
View File
@@ -0,0 +1,15 @@
self-hosted-runner:
labels: []
config-variables:
- tauri_updater_pubkey
- tauri_updater_endpoints
- oss_bucket
- oss_public_base_url
- review_model
paths:
# Legacy build-windows / build-macos jobs are intentionally parked with
# `if: ${{ false }}` after the switch to Tauri (#5734). The packaging
# code is kept in place but not run, so ignore the constant-condition hint.
.github/workflows/desktop-release.yml:
ignore:
- 'constant expression "false" in condition. remove the if: section'
+21
View File
@@ -0,0 +1,21 @@
name: Get QwenPaw Version
description: Extract __version__ from src/qwenpaw/__version__.py
outputs:
version:
description: The extracted version string (e.g. 1.2.3)
value: ${{ steps.extract.outputs.version }}
runs:
using: composite
steps:
- id: extract
shell: bash
run: |
set -euo pipefail
version=$(sed -n 's/^__version__[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' src/qwenpaw/__version__.py)
if [ -z "$version" ]; then
echo "::error::Failed to extract __version__ from src/qwenpaw/__version__.py"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
@@ -0,0 +1,45 @@
name: Verify Desktop (Tauri macOS)
description: |
Unpack Tauri .app zip, launch the shell (open <APP>), and drive the
embedded WebKit through the shared Playwright UI verifier. Stop /
cleanup / log upload steps live in the caller workflow because
composite actions cannot use `if: always()`.
inputs:
dashscope-api-key:
description: DashScope API key (empty -> verifier skips LLM round)
required: false
default: ""
allow-flaky-llm:
description: If 'true', verifier exits 0 on LLM retry exhaustion
required: false
default: "false"
runs:
using: composite
steps:
- name: Install verify deps (Playwright + WebKit)
shell: bash
run: |
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install -r scripts/verify/requirements-verify.txt
python -m playwright install webkit --with-deps
- name: Verify desktop (Tauri macOS)
shell: bash
env:
QWENPAW_DASHSCOPE_API_KEY: ${{ inputs.dashscope-api-key }}
ALLOW_FLAKY_LLM: ${{ inputs.allow-flaky-llm }}
run: |
set -euo pipefail
source scripts/verify/launch_tauri_macos.sh
extra_flags=()
if [ "$ALLOW_FLAKY_LLM" = "true" ]; then
extra_flags+=("--allow-flaky-llm")
fi
python scripts/verify/desktop_verify.py \
--base-url "$BASE_URL" \
--ui-mode tauri-macos \
--headed \
${extra_flags[@]+"${extra_flags[@]}"}
@@ -0,0 +1,48 @@
name: Verify Desktop (Tauri Windows)
description: |
Install NSIS-built Tauri desktop, launch the shell with CDP enabled,
and drive the real WebView2 through the shared Playwright UI verifier.
Stop / cleanup / log upload steps live in the caller workflow because
composite actions cannot use `if: always()`.
inputs:
dashscope-api-key:
description: DashScope API key (empty -> verifier skips LLM round)
required: false
default: ""
allow-flaky-llm:
description: If 'true', verifier exits 0 on LLM retry exhaustion
required: false
default: "false"
runs:
using: composite
steps:
- name: Install verify deps (Playwright + Chromium)
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
python -m pip install --upgrade pip
python -m pip install -r scripts/verify/requirements-verify.txt
python -m playwright install chromium --with-deps
- name: Verify desktop (Tauri Windows)
shell: pwsh
env:
QWENPAW_DASHSCOPE_API_KEY: ${{ inputs.dashscope-api-key }}
PYTHONIOENCODING: utf-8
ALLOW_FLAKY_LLM: ${{ inputs.allow-flaky-llm }}
run: |
. scripts/verify/launch_tauri_windows.ps1
$verifyArgs = @(
"scripts/verify/desktop_verify.py",
"--base-url", $env:BASE_URL,
"--ui-mode", "tauri-windows",
"--headed",
"--cdp-url", $env:CDP_URL
)
if ($env:ALLOW_FLAKY_LLM -eq "true") {
$verifyArgs += "--allow-flaky-llm"
}
python @verifyArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+20
View File
@@ -0,0 +1,20 @@
name: "QwenPaw CodeQL Config"
# Use security-extended for broader coverage than the default suite.
# This adds rules for path traversal, SSRF, command injection,
# hardcoded credentials, and unsafe deserialization.
queries:
- uses: security-extended
# Exclude test files — tests contain intentionally "unsafe" patterns
# (mock subprocess, test injection vectors, etc.) that are not real
# vulnerabilities.
paths-ignore:
- tests/**
- e2e/**
- scripts/repro_*.py
- .claude/**
- "**/*.test.ts"
- "**/*.test.tsx"
- "**/*.spec.ts"
- "**/*.spec.tsx"
+3
View File
@@ -0,0 +1,3 @@
# Explicit channels so conda does not warn about implicit 'defaults'
channels:
- defaults
+65
View File
@@ -0,0 +1,65 @@
version: 2
# Dependabot: automated dependency updates for Python + npm.
# Checks weekly, opens PRs with changelogs and test results.
# Only minor/patch updates by default — major versions need manual review.
updates:
# Python backend dependencies (pyproject.toml)
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "UTC"
open-pull-requests-limit: 5
allow:
- update-type: "version-update:semver-minor"
- update-type: "version-update:semver-patch"
commit-message:
prefix: "deps"
include: scope
labels:
- "dependencies"
- "python"
groups:
python-dev-deps:
patterns:
- "pytest*"
- "black"
- "flake8"
- "pylint"
- "mypy"
- "pre-commit"
- "ruff"
# Console frontend dependencies (package.json)
- package-ecosystem: "npm"
directory: "/console"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "UTC"
open-pull-requests-limit: 5
allow:
- update-type: "version-update:semver-minor"
- update-type: "version-update:semver-patch"
commit-message:
prefix: "deps"
include: scope
labels:
- "dependencies"
- "frontend"
# GitHub Actions dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "github-actions"
+42
View File
@@ -0,0 +1,42 @@
# Release Installation Duty Roster
#
# Each platform has its own independent rotation list of GitHub usernames.
# The Action picks the next person sequentially:
# index = (number of previous releases) % len(rotation)
# No state file needed — the count is derived from the GitHub Releases API.
#
# To temporarily swap, manually re-assign in the Duty Issue on GitHub.
pypi:
rotation:
- cuiyuebing
- jinliyl
- Osier-Yi
- qbc2016
- rayrayraykk
- xiaoming-qxm
- xieyxclack
- XiuShenAl
- zhijianma
docker:
rotation:
- rayrayraykk
- xiaoming-qxm
- xieyxclack
- XiuShenAl
- zhijianma
- cuiyuebing
- jinliyl
- Osier-Yi
- qbc2016
macos:
rotation:
- hongxicheng
- lalaliat
windows:
rotation:
- jinglinpeng
- wangfei010313
@@ -0,0 +1,34 @@
{
"name": "Required status checks (main)",
"target": "branch",
"enforcement": "active",
"conditions": {
"ref_name": {
"include": ["~DEFAULT_BRANCH"],
"exclude": []
}
},
"rules": [
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": false,
"do_not_enforce_on_create": false,
"required_status_checks": [
{ "context": "Test Summary", "integration_id": 15368 },
{ "context": "Pre-commit", "integration_id": 15368 },
{ "context": "Frontend Summary", "integration_id": 15368 },
{ "context": "console format check", "integration_id": 15368 },
{ "context": "website format check", "integration_id": 15368 }
]
}
}
],
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
}
]
}
+203
View File
@@ -0,0 +1,203 @@
# Reusable E2E Playwright job.
# Called by e2e-integration.yml (manual dispatch) and
# full-tests-nightly.yml (nightly four-tier coverage pipeline).
name: E2E Playwright Job
on:
workflow_call:
inputs:
test_marker:
description: 'Pytest marker expression'
type: string
default: 'integration'
shard_suffix:
# Set when this reusable job is fanned out into parallel shards
# (nightly runs p0 / p1 / p2). upload-artifact@v4 rejects
# duplicate artifact names within one run, so every artifact of
# this job gets the suffix appended. Empty default keeps the
# single-shard callers (e.g. e2e-integration.yml) unchanged.
description: 'Suffix appended to every artifact name to disambiguate parallel shards'
type: string
default: ''
jobs:
e2e:
name: E2E Playwright Tests
runs-on: ubuntu-latest
timeout-minutes: 45
environment: staging
env:
QWENPAW_BASE_URL: http://localhost:8088
QWENPAW_HEADLESS: 'true'
QWENPAW_TIMEOUT: '60000'
QWENPAW_DASHSCOPE_API_KEY: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
steps:
- uses: actions/checkout@v4
# ---- Build frontend ----
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
# ---- Install Python dependencies ----
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install backend + E2E dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
pip install -r e2e/requirements.txt
playwright install chromium --with-deps
# ---- Prepare coverage ----
- name: Prepare coverage config
shell: bash
run: |
mkdir -p .e2e_coverage
SRC_ABS=$(cd src/qwenpaw && pwd)
{
echo "[run]"
echo "parallel = true"
echo "branch = false"
echo "source = ${SRC_ABS}"
echo "omit ="
echo " */tests/*"
echo " */test_*"
echo " */__pycache__/*"
} > .e2e_coverage/coverage_e2e.ini
# ---- Start backend (isolated) ----
- name: Start QwenPaw backend
shell: bash
run: |
QWENPAW_E2E_DIR=$(mktemp -d)
echo "QWENPAW_E2E_DIR=$QWENPAW_E2E_DIR" >> "$GITHUB_ENV"
mkdir -p "$QWENPAW_E2E_DIR/working" \
"$QWENPAW_E2E_DIR/secret" \
"$QWENPAW_E2E_DIR/backups"
# Export working dirs so subsequent steps (notably the pytest
# step) can write seed files into the same paths the backend
# is reading from. Without this, pytest's os.getenv lookup
# falls back to ~/.qwenpaw and seeds land in the wrong place.
echo "QWENPAW_WORKING_DIR=$QWENPAW_E2E_DIR/working" >> "$GITHUB_ENV"
echo "QWENPAW_SECRET_DIR=$QWENPAW_E2E_DIR/secret" >> "$GITHUB_ENV"
echo "QWENPAW_BACKUP_DIR=$QWENPAW_E2E_DIR/backups" >> "$GITHUB_ENV"
QWENPAW_WORKING_DIR="$QWENPAW_E2E_DIR/working" \
QWENPAW_SECRET_DIR="$QWENPAW_E2E_DIR/secret" \
QWENPAW_BACKUP_DIR="$QWENPAW_E2E_DIR/backups" \
QWENPAW_AUTH_ENABLED=false \
PYTHONUNBUFFERED=1 \
COVERAGE_PROCESS_START="${{ github.workspace }}/.e2e_coverage/coverage_e2e.ini" \
COVERAGE_FILE="${{ github.workspace }}/.e2e_coverage/e2e_subproc" \
python -m qwenpaw app --host 127.0.0.1 --port 8088 --log-level info &
echo $! > /tmp/qwenpaw-e2e.pid
- name: Wait for backend ready
shell: bash
run: |
for i in $(seq 1 60); do
if curl -sf http://localhost:8088/api/version > /dev/null 2>&1; then
echo "Backend ready after ${i}s"
exit 0
fi
sleep 1
done
echo "Backend failed to start within 60s"
exit 1
# ---- Run E2E tests ----
- name: Run E2E tests
shell: bash
working-directory: e2e
run: |
pytest tests/ -m "${{ inputs.test_marker }}" -v --tb=short --reruns=1 --reruns-delay=3
# ---- Collect coverage ----
- name: Stop backend and collect coverage
if: always()
shell: bash
env:
SHARD_SUFFIX: ${{ inputs.shard_suffix }}
run: |
if [ -f /tmp/qwenpaw-e2e.pid ]; then
PID=$(cat /tmp/qwenpaw-e2e.pid)
kill -INT "$PID" 2>/dev/null || true
for i in $(seq 1 15); do
kill -0 "$PID" 2>/dev/null || break
sleep 1
done
kill -9 "$PID" 2>/dev/null || true
fi
# Shard-aware data file name: ".coverage.e2e" for single-shard
# callers (empty suffix, unchanged behaviour), ".coverage.e2e.<s>"
# for parallel shards so the nightly fan-out can merge them.
DATA_NAME=".coverage.e2e${SHARD_SUFFIX:+.$SHARD_SUFFIX}"
cd .e2e_coverage
if compgen -G "e2e_subproc*" > /dev/null 2>&1; then
coverage combine --data-file=e2e_subproc
cp e2e_subproc "../$DATA_NAME"
coverage xml --data-file=e2e_subproc -o ../coverage.e2e.xml || [ "$?" -eq 2 ]
coverage html --data-file=e2e_subproc -d ../htmlcov-e2e || [ "$?" -eq 2 ]
echo "## E2E Backend Coverage" >> "$GITHUB_STEP_SUMMARY"
coverage report --data-file=e2e_subproc --fail-under=0 | tee -a "$GITHUB_STEP_SUMMARY"
else
echo "No E2E coverage data collected"
fi
# ---- Upload artifacts ----
- name: Upload E2E coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-data-e2e${{ inputs.shard_suffix != '' && format('-{0}', inputs.shard_suffix) || '' }}
path: |
.coverage.e2e${{ inputs.shard_suffix != '' && format('.{0}', inputs.shard_suffix) || '' }}
coverage.e2e.xml
retention-days: 1
include-hidden-files: true
- name: Upload E2E test report
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-integration-report${{ inputs.shard_suffix != '' && format('-{0}', inputs.shard_suffix) || '' }}
path: e2e/reports/
retention-days: 7
- name: Upload E2E coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-coverage-report${{ inputs.shard_suffix != '' && format('-{0}', inputs.shard_suffix) || '' }}
path: |
coverage.e2e.xml
htmlcov-e2e/
retention-days: 7
+102
View File
@@ -0,0 +1,102 @@
name: CodeQL
# Security vulnerability scanning for QwenPaw.
#
# Phase 1 (current): dry-run mode — discoveries are reported as alerts
# in the Security tab and as PR comments, but do NOT block merge.
# Phase 2 (week 2): clean up findings, configure false-positive
# suppression.
# Phase 3 (week 3): remove continue-on-error to make CodeQL a required
# check (maintainer must add it to branch protection).
#
# Two shards, one per language — each scans its own file set, so findings
# are deduplicated across languages and no CI time is wasted on
# re-scanning the same files:
# python → all Python (src/qwenpaw/** + scripts/**), minus the
# test/repro exclusions in codeql-config.yml
# typescript → console/src/** (React/Vite frontend)
# Tests are intentionally excluded (see codeql-config.yml paths-ignore):
# they contain intentionally "unsafe" patterns that are not real
# vulnerabilities.
on:
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so the scan really runs
# right after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
branches: [main, master, dev, develop]
paths:
- 'src/**'
- 'console/src/**'
- 'scripts/**'
- 'tests/**'
- '.github/workflows/codeql.yml'
- '.github/codeql-config.yml'
push:
branches: [main]
schedule:
# Weekly full scan: Monday 03:17 UTC (off-peak)
- cron: '17 3 * * 1'
permissions:
contents: read
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: CodeQL (${{ matrix.shard }})
# Draft PRs skip the scan entirely: CodeQL is not part of the
# required-check set, so no placeholder context is needed. The
# ready_for_review trigger above re-runs it once the PR is ready.
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- shard: python
languages: python
build-mode: none
- shard: typescript
languages: typescript
build-mode: none
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.languages }}
config-file: ./.github/codeql-config.yml
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
with:
category: ${{ matrix.shard }}
# Phase 1: dry-run — don't fail the workflow on findings.
# Phase 3: remove this line to enable blocking.
continue-on-error: true
- name: Upload CodeQL results summary
if: always()
run: |
echo "### CodeQL Scan: ${{ matrix.shard }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ steps.analyze.outcome }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Language:** ${{ matrix.languages }}" >> $GITHUB_STEP_SUMMARY
echo "**Mode:** dry-run (non-blocking)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "View findings in the [Security tab](https://github.com/${{ github.repository }}/security/code-scanning)" >> $GITHUB_STEP_SUMMARY
+112
View File
@@ -0,0 +1,112 @@
name: Creator App Tests
on:
push:
branches: [main, master, dev, develop, "dev/**"]
paths:
- "plugins/apps/qwenpaw-creator/**"
- ".github/workflows/creator-app-tests.yml"
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so the checks really run
# right after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
branches: [main, master, dev, develop, "dev/**"]
paths:
- "plugins/apps/qwenpaw-creator/**"
- ".github/workflows/creator-app-tests.yml"
jobs:
spam-gate:
name: PR Spam Gate
if: github.event_name == 'pull_request'
uses: ./.github/workflows/pr-spam-gate.yml
with:
author: ${{ github.event.pull_request.user.login }}
backend-tests:
name: Creator Backend Tests
needs: [spam-gate]
if: |
always() &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true') &&
(github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Host package supplies the shared framework deps (fastapi, httpx,
# pydantic, agentscope, ...); the plugin requirements add the
# Creator-specific extras (oss2, imageio-ffmpeg).
pip install -e ".[test]"
pip install -r plugins/apps/qwenpaw-creator/requirements.txt
- name: Run Creator backend tests
working-directory: plugins/apps/qwenpaw-creator/backend
run: |
python -m pytest tests -v --timeout=120
ui-tests:
name: Creator UI Build & Tests
needs: [spam-gate]
if: |
always() &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true') &&
(github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins/apps/qwenpaw-creator/ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: plugins/apps/qwenpaw-creator/ui/package-lock.json
- name: Install dependencies
# npm ci occasionally crashes ("Exit handler never called") and can
# leave a broken node_modules behind. A poisoned ~/.npm cache restored
# by setup-node reproduces the crash on every retry, so wipe the npm
# cache between attempts before reinstalling from a clean slate.
run: |
for attempt in 1 2 3; do
rm -rf node_modules
if npm ci --no-audit --no-fund \
&& [ -e node_modules/.bin/tsc ] \
&& [ -e node_modules/.bin/vitest ] \
&& [ -e node_modules/.bin/vite ]; then
break
fi
echo "npm ci attempt ${attempt} left a broken node_modules"
if [ "${attempt}" = "3" ]; then
exit 1
fi
npm cache clean --force
done
- name: Verify toolchain matches lockfile
run: |
node_modules/.bin/tsc --version
node_modules/.bin/vitest --version
npm ls typescript vitest vite
- name: Type check
run: npm run typecheck
- name: Run unit tests
run: npm test
- name: Build plugin frontend
run: npm run build
+312
View File
@@ -0,0 +1,312 @@
# Standalone release pipeline for the QwenPaw Creator plugin.
#
# Unlike plugins-release.yml (which publishes ALL plugins on every main
# QwenPaw GitHub Release), this workflow is driven by the Creator plugin's
# own version: it fires when plugins/apps/qwenpaw-creator/plugin.json
# changes, and only uploads to OSS when that version is not yet on the CDN.
# Can also be run manually via the Actions tab (with an optional force flag).
name: QwenPaw Creator Plugin Release
on:
push:
branches: [main]
paths:
- "plugins/apps/qwenpaw-creator/plugin.json"
workflow_dispatch:
inputs:
force:
description: "Re-upload even if this version already exists on OSS"
required: false
type: boolean
default: false
# Least-privilege token: this workflow only reads the repo; all uploads
# go through ossutil with OSS secrets.
permissions:
contents: read
concurrency:
# Shared with plugins-release.yml so index merges never run concurrently.
group: plugins-release
cancel-in-progress: false
env:
PLUGIN_DIR: plugins/apps/qwenpaw-creator
PLUGIN_ID: qwenpaw-creator
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
should_publish: ${{ steps.decide.outputs.should_publish }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Creator plugin version
id: version
run: |
version=$(jq -r '.version' "${PLUGIN_DIR}/plugin.json")
if [[ -z "$version" || "$version" == "null" ]]; then
echo "ERROR: no version in ${PLUGIN_DIR}/plugin.json" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Creator plugin version: $version"
- name: Install ossutil
run: |
wget -q https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip -q ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Decide whether to publish
id: decide
env:
VERSION: ${{ steps.version.outputs.version }}
FORCE: ${{ github.event.inputs.force }}
run: |
# Publish only when this exact version is missing from the plugins
# index (or when forced via workflow_dispatch). Keeps re-runs and
# non-version edits to plugin.json idempotent.
#
# Read the authoritative index straight from OSS, matching
# release.yml / plugins-release.yml / desktop-promote.yml. The
# public CDN is NOT trustworthy here: overseas edges were observed
# serving gzip bodies without content negotiation and intermittent
# 403s on origin pulls, both of which broke this check on
# GitHub-hosted runners.
#
# Fail closed: only a confirmed NoSuchKey/404 counts as "no index
# yet". Auth, network or JSON failures abort the run instead of
# being misread as a green light to overwrite published objects.
file_id="${PLUGIN_ID}-${VERSION}"
if [[ "$FORCE" == "true" ]]; then
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "Force publish requested for ${file_id}."
exit 0
fi
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/metadata/plugins/index.json" 2>&1); then
ossutil cp "oss://qwenpaw-download/metadata/plugins/index.json" \
plugins-index.json
published=$(jq -r --arg id "$file_id" '.files | has($id)' \
plugins-index.json) || {
echo "ERROR: OSS plugins index is not valid JSON." >&2
exit 1
}
elif grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
published="false"
else
echo "ERROR: could not stat the plugins index on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
if [[ "$published" == "true" ]]; then
echo "should_publish=false" >> "$GITHUB_OUTPUT"
echo "${file_id} already on CDN; skipping upload."
else
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "${file_id} not on CDN yet; will publish."
fi
upload-oss:
runs-on: ubuntu-latest
needs: check-version
if: needs.check-version.outputs.should_publish == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: plugins/apps/qwenpaw-creator/ui/package-lock.json
- name: Build Creator plugin frontend
run: |
npm --prefix "${PLUGIN_DIR}/ui" ci
npm --prefix "${PLUGIN_DIR}/ui" run build
- name: Pack Creator plugin and build index
run: |
python scripts/pack/generate_plugin_metadata.py \
--plugins-root plugins \
--dist dist/plugins \
--metadata-out dist/plugins/index.json \
--cdn-prefix /files/plugins \
--only "${PLUGIN_ID}"
- name: Verify packaged zip is runtime-only
env:
VERSION: ${{ needs.check-version.outputs.version }}
run: |
# Fail closed before OSS upload: entry files must be present and
# pack_exclude'd dev-only trees must not leak into the zip.
zip_path="dist/plugins/apps/${PLUGIN_ID}/${PLUGIN_ID}-${VERSION}.zip"
if [[ ! -f "$zip_path" ]]; then
echo "ERROR: expected zip not found: $zip_path" >&2
exit 1
fi
names=$(unzip -Z1 "$zip_path")
for required in \
"${PLUGIN_ID}/plugin.json" \
"${PLUGIN_ID}/requirements.txt" \
"${PLUGIN_ID}/backend/main.py" \
"${PLUGIN_ID}/ui/dist/index.js"; do
if ! grep -qxF "$required" <<< "$names"; then
echo "ERROR: required file missing from zip: $required" >&2
exit 1
fi
done
if forbidden=$(grep -E \
"^${PLUGIN_ID}/(backend/(tests|scripts)/|e2e/|scripts/|ui/(src|node_modules)/)" \
<<< "$names"); then
echo "ERROR: dev-only files leaked into the zip:" >&2
echo "$forbidden" | head -20 >&2
exit 1
fi
echo "Zip verified: $(wc -l <<< "$names") files, runtime-only."
- name: Install ossutil
run: |
wget -q https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip -q ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Sync Creator plugin zip to OSS (long-cache, immutable)
env:
FORCE: ${{ github.event.inputs.force }}
run: |
shopt -s nullglob
while IFS= read -r -d '' f; do
rel="${f#dist/plugins/}"
# Versioned zips are advertised as immutable; never overwrite
# an existing object except on an explicit manual force run.
# A stat failure other than NoSuchKey aborts instead of
# risking an overwrite.
if [[ "$FORCE" != "true" ]]; then
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/files/plugins/${rel}" 2>&1); then
echo "Skipping ${rel}: already published and immutable."
continue
elif ! grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
echo "ERROR: could not stat files/plugins/${rel} on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
fi
echo "Uploading $f -> files/plugins/${rel}"
ossutil cp "$f" \
"oss://qwenpaw-download/files/plugins/${rel}" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=31536000, immutable"
done < <(find "dist/plugins/apps/${PLUGIN_ID}" -type f -name '*.zip' -print0 2>/dev/null || true)
- name: Merge historical versions into index
run: |
# Fail closed: a fetch error must never masquerade as "no index
# yet" and shrink the authoritative file list to this plugin.
# Only a confirmed NoSuchKey/404 may bootstrap an empty index.
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/metadata/plugins/index.json" 2>&1); then
ossutil cp "oss://qwenpaw-download/metadata/plugins/index.json" \
existing-index.json
python3 -c 'import json; json.load(open("existing-index.json"))' || {
echo "ERROR: existing plugins index is not valid JSON." >&2
exit 1
}
elif grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
echo "No plugins index on OSS yet; bootstrapping an empty one."
echo '{}' > existing-index.json
else
echo "ERROR: could not stat the plugins index on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
python3 scripts/pack/merge_plugin_index.py \
--new dist/plugins/index.json \
--old existing-index.json \
--out dist/plugins/index.json \
--retire-plugin-id computer-use-tool
- name: Upload plugins index (short-cache)
run: |
ossutil cp dist/plugins/index.json \
"oss://qwenpaw-download/metadata/plugins/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Patch main metadata index to advertise plugins product
run: |
# Same fail-closed rule for the top-level product index: only a
# confirmed NoSuchKey/404 may bootstrap a fresh skeleton.
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/metadata/index.json" 2>&1); then
ossutil cp "oss://qwenpaw-download/metadata/index.json" \
main-index.json
python3 -c 'import json; json.load(open("main-index.json"))' || {
echo "ERROR: existing main index is not valid JSON." >&2
exit 1
}
elif grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
echo "No main index on OSS yet; bootstrapping a skeleton."
cat > main-index.json << 'EOF'
{
"version": "1.0",
"updated_at": "",
"products": {}
}
EOF
else
echo "ERROR: could not stat the main index on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
python3 scripts/pack/patch_main_index.py \
--index main-index.json \
--out main-index.json
ossutil cp main-index.json \
"oss://qwenpaw-download/metadata/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Summary
env:
VERSION: ${{ needs.check-version.outputs.version }}
run: |
echo "Creator plugin ${VERSION} published. Index:"
cat dist/plugins/index.json | python3 -m json.tool | head -40 || true
+160
View File
@@ -0,0 +1,160 @@
# Deploy website to GitHub Pages (see scripts/website_build.sh).
# Custom domain: qwenpaw.agentscope.io (CNAME).
name: Deploy website to GitHub Pages
on:
release:
types: [published]
workflow_dispatch:
workflow_call:
inputs:
ref:
description: "Commit SHA to build/deploy (empty = the triggering ref)"
required: false
type: string
default: ""
dry_run:
description: "Stub the GitHub Pages push (fork verification)"
required: false
type: boolean
default: false
permissions:
contents: write
concurrency:
group: deploy-website
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
# Deploy on: stable releases OR manual workflow_dispatch
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.release.prerelease == false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: website/pnpm-lock.yaml
- name: Install dependencies
working-directory: website
run: pnpm install --frozen-lockfile
- name: Build
working-directory: website
env:
VITE_BASE_PATH: "/"
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
run: pnpm run build
- name: Generate contributors_data.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 << 'PYEOF'
import json
import subprocess
import sys
BOT_SUFFIXES = ("[bot]", "-bot")
BOT_LIST = {
"dependabot", "renovate", "github-actions",
"aquamarine-bot", "codecov", "allcontributors",
}
def is_bot(login):
lower = login.lower()
return (
any(lower.endswith(s) for s in BOT_SUFFIXES)
or lower in BOT_LIST
)
contributors = []
page = 1
while True:
result = subprocess.run(
[
"gh", "api",
f"repos/${{ github.repository }}/contributors"
f"?per_page=100&page={page}",
"--jq",
'.[] | "\(.login)\t\(.contributions)\t\(.type)"',
],
capture_output=True, text=True,
)
if result.returncode != 0:
print(
f"::warning::GitHub API failed on page {page}: "
f"{result.stderr.strip() or 'unknown error'}. "
f"Falling back to static contributors_data.json."
)
sys.exit(0)
if not result.stdout.strip():
break
for line in result.stdout.strip().split("\n"):
parts = line.split("\t")
if len(parts) < 3:
continue
login, contribs, user_type = (
parts[0], int(parts[1]), parts[2]
)
if user_type == "Bot" or is_bot(login):
continue
contributors.append({
"login": login,
"avatar_url": f"https://github.com/{login}.png",
"html_url": f"https://github.com/{login}",
"contributions": int(contribs),
})
page += 1
if page > 20:
break
if not contributors:
print("::warning::No contributors fetched. Using fallback.")
sys.exit(0)
contributors.sort(key=lambda x: x["login"].lower())
with open("website/dist/contributors_data.json", "w") as f:
json.dump(contributors, f, indent=2)
print(f"Generated contributors_data.json ({len(contributors)} contributors)")
PYEOF
# Copy installation scripts so they are served from the website
# (e.g. qwenpaw.agentscope.io/install.sh) instead of raw.githubusercontent.com,
# which may be blocked by some firewalls.
- name: Copy installation scripts to dist
run: cp scripts/install.sh scripts/install.ps1 scripts/install.bat website/dist/
# 404.html fallback for unknown paths (real routes from build script).
- name: 404 fallback for GitHub Pages
run: cp website/dist/index.html website/dist/404.html
- name: Deploy to GitHub Pages
if: ${{ !inputs.dry_run }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: website/dist
cname: qwenpaw.agentscope.io
- name: Dry-run notice
if: ${{ inputs.dry_run }}
run: |
echo "DRY-RUN: would deploy website/dist to GitHub Pages (cname qwenpaw.agentscope.io)"
+295
View File
@@ -0,0 +1,295 @@
# Reusable "prepare" half of the desktop release: build the Tauri desktop
# packages (Windows + macOS), run the install/launch/chat UI verification,
# and upload the installers + updater sidecars as run artifacts.
#
# This workflow performs NO publishing. It is called by release.yml during the
# prepare phase (pinned to the release commit via `ref`), and can also be run
# standalone via workflow_dispatch to validate a packaging change.
#
# The matching publish half lives in desktop-publish.yml.
name: Desktop Build (reusable)
on:
workflow_call:
inputs:
ref:
description: "Git ref/SHA to build (pins the build to the release commit)"
type: string
required: false
default: ""
workflow_dispatch:
inputs:
ref:
description: "Git ref/SHA to build (default: this workflow's ref)"
type: string
required: false
default: ""
permissions:
contents: read
jobs:
build-tauri-windows:
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: console/src-tauri
- name: Install NSIS
uses: negrutiu/nsis-install@v2
- name: Clean dist directory
shell: pwsh
run: |
if (Test-Path dist) {
Remove-Item -Recurse -Force dist
}
New-Item -ItemType Directory -Force -Path dist | Out-Null
- name: Build Tauri Windows package
shell: pwsh
env:
# Authenticate the python-build-standalone release lookup in
# stage_python_runtime.py to avoid anonymous API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
TAURI_UPDATER_PUBKEY: ${{ vars.TAURI_UPDATER_PUBKEY }}
TAURI_UPDATER_ENDPOINTS: ${{ vars.TAURI_UPDATER_ENDPOINTS }}
run: ./scripts/pack-tauri/build_win_pyinstaller.ps1
- name: Stage Tauri Windows installer and updater assets
shell: pwsh
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
run: |
$output = "dist/QwenPaw-Tauri-${{ steps.version.outputs.version }}-Windows-setup.exe"
if ([string]::IsNullOrWhiteSpace($env:TAURI_SIGNING_PRIVATE_KEY)) {
$installer = Get-ChildItem `
"console/src-tauri/target/release/bundle/nsis/*-setup.exe" |
Select-Object -First 1
if (-not $installer) {
throw "No Tauri Windows installer found"
}
Copy-Item -Force $installer.FullName $output
Write-Host "Staged installer without updater metadata: $output"
exit 0
}
python scripts/pack-tauri/generate_update_manifest.py stage `
--bundle-dir console/src-tauri/target/release/bundle/nsis `
--pattern '*-setup.exe' `
--target windows-x86_64 `
--output $output `
--pubkey-config console/src-tauri/tauri.version.conf.json
- name: Verify desktop (Tauri Windows)
timeout-minutes: 10
uses: ./.github/actions/verify-tauri-windows
with:
dashscope-api-key: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
- name: Stop desktop server (Tauri Windows)
if: always()
shell: pwsh
run: |
$ErrorActionPreference = "Continue"
# Kill the Tauri shell and its sidecar subprocess by name.
Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process -Name "qwenpaw-backend" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process -Name "qwenpaw-backend" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
exit 0
- name: Upload desktop verify logs (Tauri Windows)
if: failure()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-logs-tauri-windows-${{ steps.version.outputs.version }}
path: |
${{ runner.temp }}/qwenpaw-desktop-stdout.log
${{ runner.temp }}/qwenpaw-desktop-stderr.log
~/AppData/Local/com.qwenpaw.desktop/logs/
if-no-files-found: ignore
retention-days: 7
- name: Upload verify screenshots (Tauri Windows)
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-screenshots-tauri-windows-${{ steps.version.outputs.version }}
path: ${{ runner.temp }}/verify-screenshots/
if-no-files-found: ignore
retention-days: 7
- name: Upload Tauri Windows artifact
uses: actions/upload-artifact@v4
with:
name: QwenPaw-Desktop-Tauri-Windows-${{ steps.version.outputs.version }}
path: dist/QwenPaw-Tauri-*-Windows-setup.exe
- name: Upload Tauri Windows updater metadata
if: hashFiles('dist/QwenPaw-Tauri-*-Windows-setup.exe.sig') != ''
uses: actions/upload-artifact@v4
with:
name: tauri-updater-meta-windows
path: |
dist/QwenPaw-Tauri-*-Windows-setup.exe.sig
dist/tauri-windows-x86_64-updater.json
build-tauri-macos:
runs-on: macos-15
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Python
uses: actions/setup-python@v5
env:
PIP_NO_CACHE_DIR: "1"
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: console/src-tauri
- name: Clean dist directory
run: rm -rf dist && mkdir -p dist
- name: Build Tauri macOS package
env:
NODE_OPTIONS: "--max-old-space-size=8192"
# Authenticate the python-build-standalone release lookup in
# stage_python_runtime.py to avoid anonymous API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
TAURI_UPDATER_PUBKEY: ${{ vars.TAURI_UPDATER_PUBKEY }}
TAURI_UPDATER_ENDPOINTS: ${{ vars.TAURI_UPDATER_ENDPOINTS }}
run: |
chmod +x scripts/pack-tauri/build_macos_pyinstaller.sh
bash scripts/pack-tauri/build_macos_pyinstaller.sh
- name: Verify desktop (Tauri macOS)
timeout-minutes: 10
uses: ./.github/actions/verify-tauri-macos
with:
dashscope-api-key: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
- name: Stop desktop server (Tauri macOS)
if: always()
run: |
# Kill the Tauri shell and its sidecar subprocess.
pkill -f "QwenPaw Desktop" 2>/dev/null || true
pkill -f "qwenpaw-backend" 2>/dev/null || true
sleep 2
pkill -9 -f "QwenPaw Desktop" 2>/dev/null || true
pkill -9 -f "qwenpaw-backend" 2>/dev/null || true
# Best-effort: kill anything sitting on the detected port.
if [ -n "${BASE_URL:-}" ]; then
PORT="${BASE_URL##*:}"
lsof -ti:"$PORT" | xargs kill 2>/dev/null || true
fi
rm -rf dist/verify-tauri
- name: Upload desktop verify logs (Tauri macOS)
if: failure()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-logs-tauri-macos-${{ steps.version.outputs.version }}
path: |
${{ runner.temp }}/qwenpaw-desktop-stdout.log
${{ runner.temp }}/qwenpaw-desktop-stderr.log
~/Library/Logs/com.qwenpaw.desktop/
if-no-files-found: ignore
retention-days: 7
- name: Upload verify screenshots (Tauri macOS)
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-screenshots-tauri-macos-${{ steps.version.outputs.version }}
path: ${{ runner.temp }}/verify-screenshots/
if-no-files-found: ignore
retention-days: 7
- name: Upload Tauri macOS artifact
uses: actions/upload-artifact@v4
with:
name: QwenPaw-Desktop-Tauri-macOS-${{ steps.version.outputs.version }}
path: dist/QwenPaw-Tauri-*-macOS.zip
- name: Upload Tauri macOS updater metadata
if: hashFiles('dist/QwenPaw-Tauri-*-macOS.app.tar.gz.sig') != ''
uses: actions/upload-artifact@v4
with:
name: tauri-updater-meta-macos
path: |
dist/QwenPaw-Tauri-*-macOS.app.tar.gz
dist/QwenPaw-Tauri-*-macOS.app.tar.gz.sig
dist/tauri-darwin-*-updater.json
+262
View File
@@ -0,0 +1,262 @@
# Reusable "promote" step of the desktop release — runs ONLY after the release
# has been flipped to published (called by release.yml's post-finalize job).
#
# It promotes the already-uploaded versioned OSS files to `latest`, generates
# and uploads the Tauri auto-update manifest (qwenpaw-tauri-latest.json), and
# refreshes the desktop + main index. Splitting this out of desktop-publish.yml
# ensures existing users' auto-updater is never pointed at a version whose
# release/PyPI/Docker publish might still have failed.
#
# Skipped entirely when dry_run=true (fork verification never touches prod OSS).
name: Desktop Promote (reusable)
on:
workflow_call:
inputs:
tag:
description: "Published release tag (for updater manifest notes)"
type: string
required: true
ref:
description: "Git ref/SHA to checkout for the packaging scripts"
type: string
required: false
default: ""
dry_run:
description: "Skip promotion entirely (fork verification)"
type: boolean
required: false
default: false
permissions:
contents: read
jobs:
promote-oss:
if: ${{ !inputs.dry_run }}
runs-on: ubuntu-latest
env:
OSS_BUCKET: ${{ vars.OSS_BUCKET || 'qwenpaw-download' }}
OSS_PUBLIC_BASE_URL: ${{ vars.OSS_PUBLIC_BASE_URL || 'https://download.qwenpaw.agentscope.io/files/apps/desktop' }}
steps:
- name: Checkout (for scripts)
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Install ossutil
run: |
wget https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Promote versioned files to latest
if: hashFiles('QwenPaw-Desktop-Tauri-*/*') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
promote_latest() {
local dirs="$1"
local pattern="$2"
local platform="$3"
local versioned_name="$4"
local latest_name="$5"
local artifact
artifact=$(find ${dirs} -name "${pattern}" 2>/dev/null | head -1 || true)
if [ -z "${artifact}" ]; then
echo "No ${platform} artifact; skipping latest promotion"
return 0
fi
echo "Promoting ${platform} ${versioned_name} -> ${latest_name}"
ossutil cp \
"oss://${OSS_BUCKET}/files/apps/desktop/${platform}/${versioned_name}" \
"oss://${OSS_BUCKET}/files/apps/desktop/${platform}/${latest_name}" \
--acl public-read \
--force
ossutil cp \
"oss://${OSS_BUCKET}/metadata/apps/desktop/${platform}/${versioned_name}.json" \
"oss://${OSS_BUCKET}/metadata/apps/desktop/${platform}/${latest_name}.json" \
--acl public-read \
--force
}
promote_latest \
"QwenPaw-Desktop-Tauri-Windows-*" \
"QwenPaw-Tauri-*-Windows-setup.exe" \
"win-tauri" \
"QwenPaw-Tauri-${VERSION}-Windows-setup.exe" \
"QwenPaw-Tauri-latest-Windows-setup.exe"
promote_latest \
"QwenPaw-Desktop-Tauri-macOS-*" \
"QwenPaw-Tauri-*-macOS.zip" \
"mac-tauri" \
"QwenPaw-Tauri-${VERSION}-macOS.zip" \
"QwenPaw-Tauri-latest-macOS.zip"
- name: Link artifacts into updater-meta dirs for manifest generation
if: hashFiles('tauri-updater-meta-*/tauri-*-updater.json') != ''
run: |
# The manifest generator expects the artifact binary alongside the
# sidecar JSON. After artifact splitting the exe lives in a separate
# artifact directory, so we symlink it into the meta directory.
for f in QwenPaw-Desktop-Tauri-Windows-*/QwenPaw-Tauri-*-Windows-setup.exe; do
[ -f "$f" ] && ln -sf "../$f" tauri-updater-meta-windows/ 2>/dev/null || true
done
- name: Generate and upload OSS updater manifest
# The Tauri auto-updater uses OSS only; GitHub Releases only carry
# first-install artifacts.
if: hashFiles('tauri-updater-meta-*/tauri-*-updater.json') != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
RELEASE_BODY="$(gh release view "${{ inputs.tag }}" --json body -q .body --repo "$GITHUB_REPOSITORY" 2>/dev/null || true)"
OSS_BASE="${OSS_PUBLIC_BASE_URL%/}"
metadata_args=()
for f in tauri-updater-meta-windows/tauri-windows-*-updater.json \
tauri-updater-meta-macos/tauri-darwin-*-updater.json; do
[ -f "$f" ] && metadata_args+=(--metadata "$f")
done
if [ ${#metadata_args[@]} -eq 0 ]; then
echo "No Tauri updater sidecars found, skipping OSS manifest"
exit 0
fi
NOTES="${RELEASE_BODY:-QwenPaw Desktop ${VERSION}}"
python scripts/pack-tauri/generate_update_manifest.py manifest \
--version "$VERSION" \
--base-url "$OSS_BASE" \
--target-base "windows-x86_64=${OSS_BASE}/win-tauri" \
--target-base "darwin-aarch64=${OSS_BASE}/mac-tauri" \
"${metadata_args[@]}" \
--notes "$NOTES" \
--output qwenpaw-tauri-latest-oss.json
ossutil cp qwenpaw-tauri-latest-oss.json \
"oss://${OSS_BUCKET}/metadata/qwenpaw-tauri-latest.json" \
--acl public-read \
--force
- name: Update desktop index
run: |
VERSION="${{ steps.version.outputs.version }}"
# Download existing desktop/index.json if exists
ossutil cp "oss://${OSS_BUCKET}/metadata/apps/desktop/index.json" \
desktop-index.json 2>/dev/null || cat > desktop-index.json << 'EOF'
{
"product": "desktop",
"updated_at": "",
"platforms": {},
"files": {}
}
EOF
merge_tauri_metadata() {
local metadata="$1"
local dirs="$2"
local pattern="$3"
local platform="$4"
local artifact
artifact=$(find ${dirs} -name "${pattern}" 2>/dev/null | head -1 || true)
if [ -z "${artifact}" ]; then
return 0
fi
python scripts/pack/generate_oss_metadata.py \
--file "${artifact}" \
--product desktop \
--platform "${platform}" \
--version "$VERSION" \
--output "${metadata}" \
--merge-index desktop-index.json \
--output-index desktop-index.json
}
merge_tauri_metadata \
"win-tauri-metadata.json" \
"QwenPaw-Desktop-Tauri-Windows-*" \
"QwenPaw-Tauri-*-Windows-setup.exe" \
"win-tauri"
merge_tauri_metadata \
"mac-tauri-metadata.json" \
"QwenPaw-Desktop-Tauri-macOS-*" \
"QwenPaw-Tauri-*-macOS.zip" \
"mac-tauri"
# Upload updated desktop/index.json
ossutil cp desktop-index.json \
"oss://${OSS_BUCKET}/metadata/apps/desktop/index.json" \
--acl public-read \
--force
echo "✓ Desktop index updated"
- name: Update main index
run: |
# Download main index if exists
ossutil cp "oss://${OSS_BUCKET}/metadata/index.json" \
main-index.json 2>/dev/null || cat > main-index.json << 'EOF'
{
"version": "1.0",
"updated_at": "",
"products": {}
}
EOF
# Ensure desktop product is in main index
python3 << 'PYTHON'
import json
from datetime import datetime, timezone
with open("main-index.json", "r") as f:
index = json.load(f)
index["updated_at"] = datetime.now(timezone.utc).isoformat()
if "desktop" not in index["products"]:
index["products"]["desktop"] = {
"name": {
"zh-CN": "桌面客户端",
"en-US": "Desktop Client"
},
"index_url": "/metadata/apps/desktop/index.json"
}
with open("main-index.json", "w") as f:
json.dump(index, f, indent=2, ensure_ascii=False)
PYTHON
# Upload main index
ossutil cp main-index.json \
"oss://${OSS_BUCKET}/metadata/index.json" \
--acl public-read \
--force
echo "✓ Main index updated"
+178
View File
@@ -0,0 +1,178 @@
# Reusable "publish" half of the desktop release: take the desktop artifacts
# produced by desktop-build.yml (same run) and publish them.
#
# Called by release.yml during the gated publish phase. Performs two things:
# - upload-release: attach the installers to the (draft) GitHub Release by tag
# (this is safe to run on a fork, where it targets the fork's own release).
# - upload-oss: push the VERSIONED files + metadata to the download OSS
# bucket. The `latest` files, updater manifest and index are promoted
# separately AFTER the release is published — see desktop-promote.yml.
# Skipped when dry_run=true so fork verification never touches the shared
# production bucket.
name: Desktop Publish (reusable)
on:
workflow_call:
inputs:
tag:
description: "Target (draft) release tag to attach assets to"
type: string
required: true
ref:
description: "Git ref/SHA to checkout for the packaging scripts"
type: string
required: false
default: ""
dry_run:
description: "Skip the production OSS upload (fork verification)"
type: boolean
required: false
default: false
permissions:
contents: read
jobs:
# ── Attach installers to the (draft) GitHub Release ────────────────────────
upload-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Attach desktop installers to the draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
shopt -s nullglob
mv QwenPaw-Desktop-Tauri-Windows-*/QwenPaw-Tauri-*-Windows-setup.exe . 2>/dev/null || true
mv QwenPaw-Desktop-Tauri-macOS-*/QwenPaw-Tauri-*-macOS.zip . 2>/dev/null || true
files=(QwenPaw-Tauri-*-Windows-setup.exe QwenPaw-Tauri-*-macOS.zip)
if [ ${#files[@]} -eq 0 ]; then
echo "::error::No desktop installers found to attach to the release"
exit 1
fi
echo "Attaching to draft release ${{ inputs.tag }}: ${files[*]}"
gh release upload "${{ inputs.tag }}" "${files[@]}" --clobber --repo "$GITHUB_REPOSITORY"
# ── Publish files + updater metadata to OSS (skipped on dry_run) ───────────
upload-oss:
if: ${{ !inputs.dry_run }}
runs-on: ubuntu-latest
env:
OSS_BUCKET: ${{ vars.OSS_BUCKET || 'qwenpaw-download' }}
OSS_PUBLIC_BASE_URL: ${{ vars.OSS_PUBLIC_BASE_URL || 'https://download.qwenpaw.agentscope.io/files/apps/desktop' }}
steps:
- name: Checkout (for scripts)
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Install ossutil
run: |
wget https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Process and upload Tauri artifacts (versioned only)
# Only versioned files are uploaded here. The `latest` files, updater
# manifest and index are promoted AFTER the release is published — see
# desktop-promote.yml — so the auto-updater is never pointed at a version
# whose release/PyPI/Docker publish might still fail.
if: hashFiles('QwenPaw-Desktop-Tauri-*/*') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
upload_versioned() {
local dirs="$1"
local pattern="$2"
local platform="$3"
local versioned_name="$4"
local metadata="$5"
local artifact
artifact=$(find ${dirs} -name "${pattern}" 2>/dev/null | head -1 || true)
if [ -z "${artifact}" ]; then
echo "No ${platform} Tauri artifact found, skipping"
return 0
fi
echo "Processing ${platform} Tauri artifact: ${artifact}"
python scripts/pack/generate_oss_metadata.py \
--file "${artifact}" \
--product desktop \
--platform "${platform}" \
--version "${VERSION}" \
--output "${metadata}"
ossutil cp "${artifact}" \
"oss://${OSS_BUCKET}/files/apps/desktop/${platform}/${versioned_name}" \
--acl public-read \
--force
ossutil cp "${metadata}" \
"oss://${OSS_BUCKET}/metadata/apps/desktop/${platform}/${versioned_name}.json" \
--acl public-read \
--force
}
upload_versioned \
"QwenPaw-Desktop-Tauri-Windows-*" \
"QwenPaw-Tauri-*-Windows-setup.exe" \
"win-tauri" \
"QwenPaw-Tauri-${VERSION}-Windows-setup.exe" \
"win-tauri-metadata.json"
upload_versioned \
"QwenPaw-Desktop-Tauri-macOS-*" \
"QwenPaw-Tauri-*-macOS.zip" \
"mac-tauri" \
"QwenPaw-Tauri-${VERSION}-macOS.zip" \
"mac-tauri-metadata.json"
- name: Upload Tauri macOS updater archive to OSS
# The .zip is for first-install; the auto-updater pulls .app.tar.gz.
if: hashFiles('tauri-updater-meta-macos/*.app.tar.gz') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
APP_TAR_GZ=$(find tauri-updater-meta-macos -name "QwenPaw-Tauri-*-macOS.app.tar.gz" | head -1)
if [ -z "$APP_TAR_GZ" ]; then
echo "No macOS .app.tar.gz found, skipping"
exit 0
fi
ossutil cp "$APP_TAR_GZ" \
"oss://${OSS_BUCKET}/files/apps/desktop/mac-tauri/QwenPaw-Tauri-${VERSION}-macOS.app.tar.gz" \
--acl public-read \
--force
# NOTE: the `latest` files, the updater manifest
# (qwenpaw-tauri-latest.json) and the index are intentionally NOT uploaded
# here. They are promoted only AFTER the release is flipped to published —
# see desktop-promote.yml — so existing users' auto-updater is never
# pointed at a version whose release might still fail to publish.
+849
View File
@@ -0,0 +1,849 @@
# Build QwenPaw Desktop:
# - Legacy desktop: Windows (conda-pack + NSIS), macOS (conda-pack -> .app)
# - Tauri desktop: Windows/macOS app bundles with PyInstaller backend sidecar
# Runs on release publish and manual dispatch.
name: QwenPaw Desktop Build
on:
# NOTE: legacy fallback path. The standard release flow is now release.yml
# (see RELEASING.md), which builds desktop via desktop-build.yml +
# desktop-publish.yml and gates the web release on the desktop build.
# Publishing a GitHub Release directly still triggers this OLD, un-gated
# desktop build. Kept only as an emergency rollback.
release:
types: [published]
workflow_dispatch:
inputs:
upload_to_oss:
description: 'Upload to OSS'
required: false
type: boolean
default: false
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name != 'release' }}
jobs:
# On release events, fail fast if the DashScope secret is missing.
# Without it, the verifier would silently skip the LLM chat round
# and emit a misleading "PASS". Forks / manual dispatch are allowed
# to run without the secret (UI-load checks still execute).
check-release-secrets:
name: Check release secrets (release only)
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Ensure DashScope secret is configured
env:
QWENPAW_DASHSCOPE_API_KEY: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
run: |
if [ -z "$QWENPAW_DASHSCOPE_API_KEY" ]; then
echo "::error::QWENPAW_DASHSCOPE_API_KEY is not set; release verification cannot validate the LLM chat round. Configure the repo secret before publishing."
exit 1
fi
echo "DashScope secret present"
build-windows:
needs: [check-release-secrets]
# Keep the legacy desktop packaging code in place, but do not build it.
if: ${{ false }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.11"
activate-environment: "qwenpaw-build"
condarc-file: .github/condarc
conda-remove-defaults: false
- name: Install NSIS
uses: negrutiu/nsis-install@v2
- name: Clean dist directory
shell: pwsh
run: |
if (Test-Path dist) {
Remove-Item -Recurse -Force dist
}
New-Item -ItemType Directory -Force -Path dist | Out-Null
- name: Build Windows installer
shell: pwsh
run: conda run -n qwenpaw-build pwsh -File ./scripts/pack/build_win.ps1
- name: List dist (on failure)
if: failure()
shell: pwsh
run: |
Write-Host "=== dist contents ==="
Get-ChildItem -Path dist -Recurse -Depth 2 -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName }
if (Test-Path dist\win-unpacked) {
Write-Host "=== dist\win-unpacked (first 30) ==="
Get-ChildItem -Path dist\win-unpacked -ErrorAction SilentlyContinue | Select-Object -First 30 | ForEach-Object { $_.Name }
}
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: QwenPaw-Desktop-Windows-${{ steps.version.outputs.version }}
path: dist/QwenPaw-Setup-*.exe
build-macos:
needs: [check-release-secrets]
# Keep the legacy desktop packaging code in place, but do not build it.
if: ${{ false }}
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.11"
activate-environment: "qwenpaw-build"
condarc-file: .github/condarc
conda-remove-defaults: false
- name: Clean dist directory
run: rm -rf dist && mkdir -p dist
- name: Build macOS .app
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
chmod +x scripts/pack/build_macos.sh
conda run -n qwenpaw-build bash -c 'CREATE_ZIP=1 ./scripts/pack/build_macos.sh'
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: QwenPaw-Desktop-macOS-${{ steps.version.outputs.version }}
path: dist/QwenPaw-*.zip
build-tauri-windows:
needs: [check-release-secrets]
if: |
always() &&
(needs.check-release-secrets.result == 'success' ||
needs.check-release-secrets.result == 'skipped')
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: console/src-tauri
- name: Install NSIS
uses: negrutiu/nsis-install@v2
- name: Clean dist directory
shell: pwsh
run: |
if (Test-Path dist) {
Remove-Item -Recurse -Force dist
}
New-Item -ItemType Directory -Force -Path dist | Out-Null
- name: Build Tauri Windows package
shell: pwsh
env:
# Authenticate the python-build-standalone release lookup in
# stage_python_runtime.py to avoid anonymous API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
TAURI_UPDATER_PUBKEY: ${{ vars.TAURI_UPDATER_PUBKEY }}
TAURI_UPDATER_ENDPOINTS: ${{ vars.TAURI_UPDATER_ENDPOINTS }}
run: ./scripts/pack-tauri/build_win_pyinstaller.ps1
- name: Stage Tauri Windows installer and updater assets
shell: pwsh
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
run: |
$output = "dist/QwenPaw-Tauri-${{ steps.version.outputs.version }}-Windows-setup.exe"
if ([string]::IsNullOrWhiteSpace($env:TAURI_SIGNING_PRIVATE_KEY)) {
$installer = Get-ChildItem `
"console/src-tauri/target/release/bundle/nsis/*-setup.exe" |
Select-Object -First 1
if (-not $installer) {
throw "No Tauri Windows installer found"
}
Copy-Item -Force $installer.FullName $output
Write-Host "Staged installer without updater metadata: $output"
exit 0
}
python scripts/pack-tauri/generate_update_manifest.py stage `
--bundle-dir console/src-tauri/target/release/bundle/nsis `
--pattern '*-setup.exe' `
--target windows-x86_64 `
--output $output `
--pubkey-config console/src-tauri/tauri.version.conf.json
- name: Verify desktop (Tauri Windows)
timeout-minutes: 10
uses: ./.github/actions/verify-tauri-windows
with:
dashscope-api-key: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
- name: Stop desktop server (Tauri Windows)
if: always()
shell: pwsh
run: |
$ErrorActionPreference = "Continue"
# Kill the Tauri shell and its sidecar subprocess by name.
Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process -Name "qwenpaw-backend" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process -Name "qwenpaw-backend" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
exit 0
- name: Upload desktop verify logs (Tauri Windows)
if: failure()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-logs-tauri-windows-${{ steps.version.outputs.version }}
path: |
${{ runner.temp }}/qwenpaw-desktop-stdout.log
${{ runner.temp }}/qwenpaw-desktop-stderr.log
~/AppData/Local/com.qwenpaw.desktop/logs/
if-no-files-found: ignore
retention-days: 7
- name: Upload verify screenshots (Tauri Windows)
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-screenshots-tauri-windows-${{ steps.version.outputs.version }}
path: ${{ runner.temp }}/verify-screenshots/
if-no-files-found: ignore
retention-days: 7
- name: Upload Tauri Windows artifact
uses: actions/upload-artifact@v4
with:
name: QwenPaw-Desktop-Tauri-Windows-${{ steps.version.outputs.version }}
path: dist/QwenPaw-Tauri-*-Windows-setup.exe
- name: Upload Tauri Windows updater metadata
if: >-
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.upload_to_oss == 'true')) &&
hashFiles('dist/QwenPaw-Tauri-*-Windows-setup.exe.sig') != ''
uses: actions/upload-artifact@v4
with:
name: tauri-updater-meta-windows
path: |
dist/QwenPaw-Tauri-*-Windows-setup.exe.sig
dist/tauri-windows-x86_64-updater.json
build-tauri-macos:
needs: [check-release-secrets]
if: |
always() &&
(needs.check-release-secrets.result == 'success' ||
needs.check-release-secrets.result == 'skipped')
runs-on: macos-15
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Python
uses: actions/setup-python@v5
env:
PIP_NO_CACHE_DIR: "1"
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: console/src-tauri
- name: Clean dist directory
run: rm -rf dist && mkdir -p dist
- name: Build Tauri macOS package
env:
NODE_OPTIONS: "--max-old-space-size=8192"
# Authenticate the python-build-standalone release lookup in
# stage_python_runtime.py to avoid anonymous API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
TAURI_UPDATER_PUBKEY: ${{ vars.TAURI_UPDATER_PUBKEY }}
TAURI_UPDATER_ENDPOINTS: ${{ vars.TAURI_UPDATER_ENDPOINTS }}
run: |
chmod +x scripts/pack-tauri/build_macos_pyinstaller.sh
bash scripts/pack-tauri/build_macos_pyinstaller.sh
- name: Verify desktop (Tauri macOS)
timeout-minutes: 10
uses: ./.github/actions/verify-tauri-macos
with:
dashscope-api-key: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
- name: Stop desktop server (Tauri macOS)
if: always()
run: |
# Kill the Tauri shell and its sidecar subprocess.
pkill -f "QwenPaw Desktop" 2>/dev/null || true
pkill -f "qwenpaw-backend" 2>/dev/null || true
sleep 2
pkill -9 -f "QwenPaw Desktop" 2>/dev/null || true
pkill -9 -f "qwenpaw-backend" 2>/dev/null || true
# Best-effort: kill anything sitting on the detected port.
if [ -n "${BASE_URL:-}" ]; then
PORT="${BASE_URL##*:}"
lsof -ti:"$PORT" | xargs kill 2>/dev/null || true
fi
rm -rf dist/verify-tauri
- name: Upload desktop verify logs (Tauri macOS)
if: failure()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-logs-tauri-macos-${{ steps.version.outputs.version }}
path: |
${{ runner.temp }}/qwenpaw-desktop-stdout.log
${{ runner.temp }}/qwenpaw-desktop-stderr.log
~/Library/Logs/com.qwenpaw.desktop/
if-no-files-found: ignore
retention-days: 7
- name: Upload verify screenshots (Tauri macOS)
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-verify-screenshots-tauri-macos-${{ steps.version.outputs.version }}
path: ${{ runner.temp }}/verify-screenshots/
if-no-files-found: ignore
retention-days: 7
- name: Upload Tauri macOS artifact
uses: actions/upload-artifact@v4
with:
name: QwenPaw-Desktop-Tauri-macOS-${{ steps.version.outputs.version }}
path: dist/QwenPaw-Tauri-*-macOS.zip
- name: Upload Tauri macOS updater metadata
if: >-
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.upload_to_oss == 'true')) &&
hashFiles('dist/QwenPaw-Tauri-*-macOS.app.tar.gz.sig') != ''
uses: actions/upload-artifact@v4
with:
name: tauri-updater-meta-macos
path: |
dist/QwenPaw-Tauri-*-macOS.app.tar.gz
dist/QwenPaw-Tauri-*-macOS.app.tar.gz.sig
dist/tauri-darwin-*-updater.json
upload-release:
needs: [build-tauri-windows, build-tauri-macos]
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Move artifacts to root for upload
run: |
mv QwenPaw-Desktop-Windows-*/QwenPaw-Setup-*.exe . 2>/dev/null || true
mv QwenPaw-Desktop-macOS-*/QwenPaw-*.zip . 2>/dev/null || true
mv QwenPaw-Desktop-Tauri-Windows-*/QwenPaw-Tauri-*-Windows-setup.exe . 2>/dev/null || true
mv QwenPaw-Desktop-Tauri-macOS-*/QwenPaw-Tauri-*-macOS.zip . 2>/dev/null || true
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: |
QwenPaw-Setup-*.exe
QwenPaw-[0-9]*-macOS.zip
QwenPaw-Tauri-*-Windows-setup.exe
QwenPaw-Tauri-*-macOS.zip
qwenpaw-tauri-latest.json
fail_on_unmatched_files: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-oss:
needs: [build-tauri-windows, build-tauri-macos]
# Run on: 1) release trigger, or 2) manual trigger with upload_to_oss checked
if: |
always() &&
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_oss == 'true')) &&
needs.build-tauri-windows.result == 'success' &&
needs.build-tauri-macos.result == 'success'
runs-on: ubuntu-latest
env:
OSS_BUCKET: ${{ vars.OSS_BUCKET || 'qwenpaw-download' }}
OSS_PUBLIC_BASE_URL: ${{ vars.OSS_PUBLIC_BASE_URL || 'https://download.qwenpaw.agentscope.io/files/apps/desktop' }}
steps:
- name: Checkout (for scripts)
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Install ossutil
run: |
wget https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Process and upload Windows artifacts
if: hashFiles('QwenPaw-Desktop-Windows-*/*.exe') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
WIN_EXE=$(find QwenPaw-Desktop-Windows-* -name "QwenPaw-Setup-*.exe" | head -1)
if [ -z "$WIN_EXE" ]; then
echo "No Windows exe found, skipping"
exit 0
fi
echo "Processing Windows artifact: $WIN_EXE"
# Generate metadata
python scripts/pack/generate_oss_metadata.py \
--file "$WIN_EXE" \
--product desktop \
--platform win \
--version "$VERSION" \
--output win-metadata.json
# Upload file (versioned)
ossutil cp "$WIN_EXE" \
"oss://${OSS_BUCKET}/files/apps/desktop/win/QwenPaw-Setup-${VERSION}.exe" \
--acl public-read \
--force
# Upload file (latest)
ossutil cp "$WIN_EXE" \
"oss://${OSS_BUCKET}/files/apps/desktop/win/QwenPaw-Setup-latest.exe" \
--acl public-read \
--force
# Upload metadata (versioned)
ossutil cp win-metadata.json \
"oss://${OSS_BUCKET}/metadata/apps/desktop/win/QwenPaw-Setup-${VERSION}.exe.json" \
--acl public-read \
--force
# Upload metadata (latest)
ossutil cp win-metadata.json \
"oss://${OSS_BUCKET}/metadata/apps/desktop/win/QwenPaw-Setup-latest.exe.json" \
--acl public-read \
--force
echo "✓ Windows artifacts uploaded"
- name: Process and upload macOS artifacts
if: hashFiles('QwenPaw-Desktop-macOS-*/*.zip') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
MAC_ZIP=$(find QwenPaw-Desktop-macOS-* -name "QwenPaw-*.zip" | head -1)
if [ -z "$MAC_ZIP" ]; then
echo "No macOS zip found, skipping"
exit 0
fi
echo "Processing macOS artifact: $MAC_ZIP"
# Generate metadata
python scripts/pack/generate_oss_metadata.py \
--file "$MAC_ZIP" \
--product desktop \
--platform mac \
--version "$VERSION" \
--output mac-metadata.json
# Upload file (versioned)
ossutil cp "$MAC_ZIP" \
"oss://${OSS_BUCKET}/files/apps/desktop/mac/QwenPaw-${VERSION}-macOS.zip" \
--acl public-read \
--force
# Upload file (latest)
ossutil cp "$MAC_ZIP" \
"oss://${OSS_BUCKET}/files/apps/desktop/mac/QwenPaw-latest-macOS.zip" \
--acl public-read \
--force
# Upload metadata (versioned)
ossutil cp mac-metadata.json \
"oss://${OSS_BUCKET}/metadata/apps/desktop/mac/QwenPaw-${VERSION}-macOS.zip.json" \
--acl public-read \
--force
# Upload metadata (latest)
ossutil cp mac-metadata.json \
"oss://${OSS_BUCKET}/metadata/apps/desktop/mac/QwenPaw-latest-macOS.zip.json" \
--acl public-read \
--force
echo "✓ macOS artifacts uploaded"
- name: Process and upload Tauri artifacts
if: hashFiles('QwenPaw-Desktop-Tauri-*/*') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
upload_tauri_artifact() {
local dirs="$1"
local pattern="$2"
local platform="$3"
local versioned_name="$4"
local latest_name="$5"
local metadata="$6"
local artifact
artifact=$(find ${dirs} -name "${pattern}" 2>/dev/null | head -1 || true)
if [ -z "${artifact}" ]; then
echo "No ${platform} Tauri artifact found, skipping"
return 0
fi
echo "Processing ${platform} Tauri artifact: ${artifact}"
python scripts/pack/generate_oss_metadata.py \
--file "${artifact}" \
--product desktop \
--platform "${platform}" \
--version "${VERSION}" \
--output "${metadata}"
ossutil cp "${artifact}" \
"oss://${OSS_BUCKET}/files/apps/desktop/${platform}/${versioned_name}" \
--acl public-read \
--force
ossutil cp "${artifact}" \
"oss://${OSS_BUCKET}/files/apps/desktop/${platform}/${latest_name}" \
--acl public-read \
--force
ossutil cp "${metadata}" \
"oss://${OSS_BUCKET}/metadata/apps/desktop/${platform}/${versioned_name}.json" \
--acl public-read \
--force
ossutil cp "${metadata}" \
"oss://${OSS_BUCKET}/metadata/apps/desktop/${platform}/${latest_name}.json" \
--acl public-read \
--force
}
upload_tauri_artifact \
"QwenPaw-Desktop-Tauri-Windows-*" \
"QwenPaw-Tauri-*-Windows-setup.exe" \
"win-tauri" \
"QwenPaw-Tauri-${VERSION}-Windows-setup.exe" \
"QwenPaw-Tauri-latest-Windows-setup.exe" \
"win-tauri-metadata.json"
upload_tauri_artifact \
"QwenPaw-Desktop-Tauri-macOS-*" \
"QwenPaw-Tauri-*-macOS.zip" \
"mac-tauri" \
"QwenPaw-Tauri-${VERSION}-macOS.zip" \
"QwenPaw-Tauri-latest-macOS.zip" \
"mac-tauri-metadata.json"
- name: Upload Tauri macOS updater archive to OSS
# The .zip is for first-install; the auto-updater pulls .app.tar.gz.
if: hashFiles('tauri-updater-meta-macos/*.app.tar.gz') != ''
run: |
VERSION="${{ steps.version.outputs.version }}"
APP_TAR_GZ=$(find tauri-updater-meta-macos -name "QwenPaw-Tauri-*-macOS.app.tar.gz" | head -1)
if [ -z "$APP_TAR_GZ" ]; then
echo "No macOS .app.tar.gz found, skipping"
exit 0
fi
ossutil cp "$APP_TAR_GZ" \
"oss://${OSS_BUCKET}/files/apps/desktop/mac-tauri/QwenPaw-Tauri-${VERSION}-macOS.app.tar.gz" \
--acl public-read \
--force
- name: Link artifacts into updater-meta dirs for manifest generation
if: hashFiles('tauri-updater-meta-*/tauri-*-updater.json') != ''
run: |
# The manifest generator expects the artifact binary alongside the
# sidecar JSON. After artifact splitting the exe lives in a separate
# artifact directory, so we symlink it into the meta directory.
for f in QwenPaw-Desktop-Tauri-Windows-*/QwenPaw-Tauri-*-Windows-setup.exe; do
[ -f "$f" ] && ln -sf "../$f" tauri-updater-meta-windows/ 2>/dev/null || true
done
- name: Generate and upload OSS updater manifest
# The Tauri auto-updater uses OSS only; GitHub Releases only carry
# first-install artifacts.
if: hashFiles('tauri-updater-meta-*/tauri-*-updater.json') != ''
env:
# Pass release.body via env so quotes/newlines/$ in markdown are safe.
RELEASE_BODY: ${{ github.event.release.body }}
run: |
VERSION="${{ steps.version.outputs.version }}"
OSS_BASE="${OSS_PUBLIC_BASE_URL%/}"
metadata_args=()
for f in tauri-updater-meta-windows/tauri-windows-*-updater.json \
tauri-updater-meta-macos/tauri-darwin-*-updater.json; do
[ -f "$f" ] && metadata_args+=(--metadata "$f")
done
if [ ${#metadata_args[@]} -eq 0 ]; then
echo "No Tauri updater sidecars found, skipping OSS manifest"
exit 0
fi
NOTES="${RELEASE_BODY:-QwenPaw Desktop ${VERSION}}"
python scripts/pack-tauri/generate_update_manifest.py manifest \
--version "$VERSION" \
--base-url "$OSS_BASE" \
--target-base "windows-x86_64=${OSS_BASE}/win-tauri" \
--target-base "darwin-aarch64=${OSS_BASE}/mac-tauri" \
"${metadata_args[@]}" \
--notes "$NOTES" \
--output qwenpaw-tauri-latest-oss.json
ossutil cp qwenpaw-tauri-latest-oss.json \
"oss://${OSS_BUCKET}/metadata/qwenpaw-tauri-latest.json" \
--acl public-read \
--force
- name: Update desktop index
run: |
VERSION="${{ steps.version.outputs.version }}"
# Download existing desktop/index.json if exists
ossutil cp "oss://${OSS_BUCKET}/metadata/apps/desktop/index.json" \
desktop-index.json 2>/dev/null || cat > desktop-index.json << 'EOF'
{
"product": "desktop",
"updated_at": "",
"platforms": {},
"files": {}
}
EOF
# Merge Windows metadata if exists
if [ -f "win-metadata.json" ]; then
python scripts/pack/generate_oss_metadata.py \
--file "$(find QwenPaw-Desktop-Windows-* -name 'QwenPaw-Setup-*.exe' | head -1)" \
--product desktop \
--platform win \
--version "$VERSION" \
--output win-metadata.json \
--merge-index desktop-index.json \
--output-index desktop-index.json
fi
# Merge macOS metadata if exists
if [ -f "mac-metadata.json" ]; then
python scripts/pack/generate_oss_metadata.py \
--file "$(find QwenPaw-Desktop-macOS-* -name 'QwenPaw-*.zip' | head -1)" \
--product desktop \
--platform mac \
--version "$VERSION" \
--output mac-metadata.json \
--merge-index desktop-index.json \
--output-index desktop-index.json
fi
merge_tauri_metadata() {
local metadata="$1"
local dirs="$2"
local pattern="$3"
local platform="$4"
if [ ! -f "${metadata}" ]; then
return 0
fi
python scripts/pack/generate_oss_metadata.py \
--file "$(find ${dirs} -name "${pattern}" | head -1)" \
--product desktop \
--platform "${platform}" \
--version "$VERSION" \
--output "${metadata}" \
--merge-index desktop-index.json \
--output-index desktop-index.json
}
merge_tauri_metadata \
"win-tauri-metadata.json" \
"QwenPaw-Desktop-Tauri-Windows-*" \
"QwenPaw-Tauri-*-Windows-setup.exe" \
"win-tauri"
merge_tauri_metadata \
"mac-tauri-metadata.json" \
"QwenPaw-Desktop-Tauri-macOS-*" \
"QwenPaw-Tauri-*-macOS.zip" \
"mac-tauri"
# Upload updated desktop/index.json
ossutil cp desktop-index.json \
"oss://${OSS_BUCKET}/metadata/apps/desktop/index.json" \
--acl public-read \
--force
echo "✓ Desktop index updated"
- name: Update main index
run: |
# Download main index if exists
ossutil cp "oss://${OSS_BUCKET}/metadata/index.json" \
main-index.json 2>/dev/null || cat > main-index.json << 'EOF'
{
"version": "1.0",
"updated_at": "",
"products": {}
}
EOF
# Ensure desktop product is in main index
python3 << 'PYTHON'
import json
from datetime import datetime, timezone
with open("main-index.json", "r") as f:
index = json.load(f)
index["updated_at"] = datetime.now(timezone.utc).isoformat()
if "desktop" not in index["products"]:
index["products"]["desktop"] = {
"name": {
"zh-CN": "桌面客户端",
"en-US": "Desktop Client"
},
"index_url": "/metadata/apps/desktop/index.json"
}
with open("main-index.json", "w") as f:
json.dump(index, f, indent=2, ensure_ascii=False)
PYTHON
# Upload main index
ossutil cp main-index.json \
"oss://${OSS_BUCKET}/metadata/index.json" \
--acl public-read \
--force
echo "✓ Main index updated"
+110
View File
@@ -0,0 +1,110 @@
# Build QwenPaw multi-arch Docker image and push to DockerHub + Aliyun ACR on release.
# Pre-release: update <version> and pre only.
# Formal release: update <version>, pre and latest.
#
# Pipeline: verify (build amd64 + health-check) → build-and-push (multi-arch).
name: Docker Build and Push on Release
on:
# NOTE: legacy fallback path. The standard release flow is now release.yml
# (see RELEASING.md). Publishing a GitHub Release directly still triggers this
# OLD publish, which is NOT gated on the desktop build. Kept only as an
# emergency rollback until the old release workflows are removed.
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Image tag (e.g. v1.2.3 or v1.2.3-beta.1)"
required: true
type: string
is_prerelease:
description: "Pre-release (do not update latest tag)"
required: false
type: boolean
default: false
env:
ACR_REGISTRY: agentscope-registry.ap-southeast-1.cr.aliyuncs.com
IMAGE: agentscope/qwenpaw
jobs:
# ── Stage 1: Verify Docker image boots correctly ───────────────────────────
verify-docker:
uses: ./.github/workflows/release-verify.yml
with:
verify_docker: true
secrets: inherit
# ── Stage 2: Build multi-arch and push ─────────────────────────────────────
build-and-push:
needs: [verify-docker]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get QwenPaw version
id: qwenpaw_version
uses: ./.github/actions/get-version
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to Aliyun ACR
uses: docker/login-action@v3
with:
registry: ${{ env.ACR_REGISTRY }}
username: ${{ secrets.ALIYUN_ACR_USERNAME }}
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
- name: Set version and prerelease flag
id: vars
run: |
if [ -n "${{ github.event.release.tag_name }}" ]; then
VERSION="${{ github.event.release.tag_name }}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
# Parse version to determine if it's a pre-release
# Beta/alpha/rc/dev are pre-releases, but .post is NOT
if [[ "$VERSION" =~ (beta|alpha|rc|dev) ]]; then
echo "is_prerelease=true" >> $GITHUB_OUTPUT
elif [[ "$VERSION" =~ post ]]; then
# .post versions should update latest (post-release patches)
echo "is_prerelease=false" >> $GITHUB_OUTPUT
else
# Use GitHub's prerelease flag as fallback
echo "is_prerelease=${{ github.event.release.prerelease }}" >> $GITHUB_OUTPUT
fi
else
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "is_prerelease=${{ github.event.inputs.is_prerelease }}" >> $GITHUB_OUTPUT
fi
- name: Build and push multi-arch (version + pre [+ latest])
env:
VERSION: ${{ steps.vars.outputs.version }}
IS_PRERELEASE: ${{ steps.vars.outputs.is_prerelease }}
QWENPAW_DISABLED_CHANNELS: "imessage"
QWENPAW_VERSION: ${{ steps.qwenpaw_version.outputs.version }}
run: |
TAGS="-t ${ACR_REGISTRY}/${IMAGE}:${VERSION} -t ${ACR_REGISTRY}/${IMAGE}:pre"
TAGS="${TAGS} -t docker.io/${IMAGE}:${VERSION} -t docker.io/${IMAGE}:pre"
if [ "${IS_PRERELEASE}" != "true" ]; then
TAGS="${TAGS} -t ${ACR_REGISTRY}/${IMAGE}:latest -t docker.io/${IMAGE}:latest"
fi
docker buildx build --platform linux/amd64,linux/arm64 \
-f deploy/Dockerfile \
--build-arg QWENPAW_DISABLED_CHANNELS="${QWENPAW_DISABLED_CHANNELS}" \
--build-arg \
QWENPAW_MANAGED_RUNTIME_BOUNDARY_VERSION="${QWENPAW_VERSION}" \
${TAGS} --push .
+20
View File
@@ -0,0 +1,20 @@
# Standalone E2E Integration Tests (manual dispatch only).
# Nightly E2E runs are handled by full-tests-nightly.yml as part of the
# four-tier coverage pipeline. Use this workflow for ad-hoc E2E runs
# with a custom marker filter.
name: E2E Integration Tests
on:
workflow_dispatch:
inputs:
test_marker:
description: 'Pytest marker filter (default: p0)'
required: false
default: 'p0'
jobs:
e2e-integration:
uses: ./.github/workflows/_e2e-job.yml
with:
test_marker: ${{ github.event.inputs.test_marker || 'p0' }}
secrets: inherit
+86
View File
@@ -0,0 +1,86 @@
name: E2E Smoke Tests
on:
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so the smoke run really
# happens right after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
branches: [main, master, dev, develop]
paths:
- 'console/**'
- 'e2e/**'
- '.github/workflows/e2e-smoke.yml'
push:
branches: [main, master, dev, develop]
paths:
- 'console/**'
- 'e2e/**'
- '.github/workflows/e2e-smoke.yml'
jobs:
e2e-smoke:
name: Playwright UI Smoke
# Draft PRs skip the smoke run entirely: this check is not part of
# the required-check set, so no placeholder context is needed. The
# ready_for_review trigger above re-runs it once the PR is ready.
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Install frontend dependencies
working-directory: console
run: npm ci
- name: Start frontend dev server
working-directory: console
run: |
npm run dev &
# Wait for dev server to be ready
npx wait-on http://localhost:5173 --timeout 30000
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-e2e-${{ hashFiles('e2e/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-e2e-
- name: Install E2E dependencies
working-directory: e2e
run: |
pip install -r requirements.txt
playwright install chromium --with-deps
- name: Run UI smoke tests
working-directory: e2e
env:
QWENPAW_BASE_URL: http://localhost:5173
QWENPAW_HEADLESS: 'true'
QWENPAW_TIMEOUT: '30000'
run: |
pytest tests/ -m "ui_smoke" -v --tb=short
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-smoke-report
path: e2e/reports/
retention-days: 7
@@ -0,0 +1,49 @@
name: First-Time Contributor Welcome
on:
pull_request_target:
types: [closed]
jobs:
welcome-comment:
if: >-
github.event.pull_request.merged == true &&
contains(toJSON(github.event.pull_request.labels.*.name), 'first-time-contributor')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Post welcome comment
uses: actions/github-script@v7
with:
script: |
const author = context.payload.pull_request.user.login;
const prNumber = context.payload.pull_request.number;
const body = [
`## Welcome to QwenPaw! :tada:`,
``,
`Thank you @${author} for your first contribution! Your PR has been merged. :rocket:`,
``,
`We'd love to give you a shout-out in our release notes! If you're comfortable sharing, ` +
`please reply to this comment with your social media handles using the format below:`,
``,
'```',
`discord: your_discord_handle`,
`x: your_x_handle`,
`xiaohongshu: your_xiaohongshu_id`,
'```',
``,
`> **Note:** Only share what you're comfortable with — all fields are optional.`,
``,
`Thanks again for helping make QwenPaw better!`,
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body,
});
core.info(`Posted welcome comment on PR #${prNumber} for @${author}`);
+186
View File
@@ -0,0 +1,186 @@
# One-click desktop release verification for fork repositories.
# Builds the Tauri desktop packages (macOS + Windows) and runs the
# end-to-end UI verification (Playwright + headless browser) against
# the freshly built product.
#
# Unlike desktop-release.yml this workflow does NOT upload artifacts to
# a GitHub Release or OSS — it only verifies that the build + LLM chain
# works. Use it to validate packaging changes before opening a PR.
#
# Usage: Actions → Fork Desktop Release Verification → Run workflow.
name: Fork Desktop Release Verification
on:
workflow_dispatch:
inputs:
platforms:
description: 'Which platforms to verify'
required: false
type: choice
default: 'all'
options:
- 'all'
- 'tauri-only'
- 'macos-only'
- 'windows-only'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tauri-macos:
if: >-
inputs.platforms == 'all' ||
inputs.platforms == 'tauri-only' ||
inputs.platforms == 'macos-only'
runs-on: macos-15
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Build Tauri macOS package
env:
NODE_OPTIONS: "--max-old-space-size=8192"
# Authenticate the python-build-standalone release lookup in
# stage_python_runtime.py to avoid anonymous API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional. Forks only need a matching minisign key pair when
# validating updater artifacts; regular app packages do not need it.
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
TAURI_UPDATER_PUBKEY: ${{ vars.TAURI_UPDATER_PUBKEY }}
run: |
chmod +x scripts/pack-tauri/build_macos_pyinstaller.sh
bash scripts/pack-tauri/build_macos_pyinstaller.sh
- name: Verify desktop (Tauri macOS)
timeout-minutes: 10
uses: ./.github/actions/verify-tauri-macos
with:
dashscope-api-key: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
allow-flaky-llm: "true"
- name: Stop desktop server
if: always()
run: |
pkill -f "QwenPaw Desktop" 2>/dev/null || true
pkill -f "qwenpaw-backend" 2>/dev/null || true
sleep 2
pkill -9 -f "QwenPaw Desktop" 2>/dev/null || true
pkill -9 -f "qwenpaw-backend" 2>/dev/null || true
tauri-windows:
if: >-
inputs.platforms == 'all' ||
inputs.platforms == 'tauri-only' ||
inputs.platforms == 'windows-only'
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install packaging helper dependencies
run: python -m pip install packaging
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install NSIS
uses: negrutiu/nsis-install@v2
- name: Build Tauri Windows package
shell: pwsh
env:
# Authenticate the python-build-standalone release lookup in
# stage_python_runtime.py to avoid anonymous API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/pack-tauri/build_win_pyinstaller.ps1
- name: Stage Tauri Windows installer
shell: pwsh
run: |
$installer = Get-ChildItem "console/src-tauri/target/release/bundle/nsis/*.exe" |
Select-Object -First 1
if (-not $installer) { throw "No Tauri Windows installer found" }
$target = "dist/QwenPaw-Tauri-${{ steps.version.outputs.version }}-Windows-setup.exe"
New-Item -ItemType Directory -Force -Path dist | Out-Null
Copy-Item -Force $installer.FullName $target
Write-Host "Staged: $target"
- name: Verify desktop (Tauri Windows)
timeout-minutes: 10
uses: ./.github/actions/verify-tauri-windows
with:
dashscope-api-key: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
allow-flaky-llm: "true"
- name: Stop desktop server
if: always()
shell: pwsh
run: |
$ErrorActionPreference = "Continue"
Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process -Name "qwenpaw-backend" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process -Name "qwenpaw-backend" -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
exit 0
+83
View File
@@ -0,0 +1,83 @@
# One-click release verification for fork repositories.
# Builds the wheel, then runs all verification jobs (pip, Docker, script install).
#
# Docker uses public base images (node:20-slim, ghcr.io/astral-sh/uv) instead of
# the private ACR registry, so forks can validate the full pipeline without credentials.
#
# Usage: trigger manually via Actions → Fork Release Verification → Run workflow.
name: Fork Release Verification
on:
workflow_dispatch:
permissions:
contents: read
jobs:
# ── Build wheel (same steps as publish-pypi.yml build job) ─────────────────
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node (for console build)
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Build console frontend
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Bundle docs into package
run: |
rm -rf src/qwenpaw/docs
mkdir -p src/qwenpaw/docs
cp website/public/docs/*.md src/qwenpaw/docs/
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Build package
run: python -m build
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: qwenpaw-dist
path: dist/
retention-days: 7
- name: Upload version metadata
uses: actions/upload-artifact@v4
with:
name: qwenpaw-version
path: src/qwenpaw/__version__.py
retention-days: 7
# ── Run all verification jobs ──────────────────────────────────────────────
verify:
needs: [build]
uses: ./.github/workflows/release-verify.yml
with:
verify_pip: true
verify_docker: true
verify_script_install: true
docker_node_image: "node:20-slim"
docker_uv_image: "ghcr.io/astral-sh/uv:latest"
+141
View File
@@ -0,0 +1,141 @@
name: Frontend Tests
on:
push:
branches: [main, master, dev, develop]
paths:
- 'console/**'
- '.github/workflows/frontend-tests.yml'
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so vitest really runs right
# after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
branches: [main, master, dev, develop]
jobs:
spam-gate:
name: PR Spam Gate
if: github.event_name == 'pull_request'
uses: ./.github/workflows/pr-spam-gate.yml
with:
author: ${{ github.event.pull_request.user.login }}
# Replaces the former `on.pull_request.paths` filter: the workflow now runs
# (and reports a status) on every PR so `Frontend Summary` can be a
# required check; PRs not touching the console skip the actual test run
# and the summary reports an explicit success instead of a skip.
changes:
name: Detect console changes
runs-on: ubuntu-latest
outputs:
code: ${{ github.event_name != 'pull_request' && 'true' || steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v3
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
code:
- 'console/**'
- '.github/workflows/frontend-tests.yml'
vitest:
name: Vitest Unit Tests
needs: [spam-gate, changes]
# Also guard on the detection job's RESULT: if detection failed/was
# cancelled its `code` output is empty and this job would silently skip,
# which a ruleset cannot distinguish from a bypass. The frontend-summary
# job below turns that detection failure into a hard red.
# Draft PRs defer the real run: the summary reports an explicit green
# placeholder (GitHub forbids merging drafts), and the ready_for_review
# trigger re-runs everything when the PR is marked ready.
if: |
always() &&
needs.changes.result == 'success' &&
needs.changes.outputs.code == 'true' &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true') &&
(github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
defaults:
run:
working-directory: console
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Install dependencies
run: npm ci
# A single vitest pass: runs the full suite AND enforces the coverage
# ratchet (fails on test failures or coverage regression). The previous
# separate `npm run test:run` pass executed the identical suite twice.
- name: Run unit tests with coverage (ratchet blocks PR on regression)
run: npm run test:coverage
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: console/coverage/
retention-days: 7
frontend-summary:
name: Frontend Summary
needs: [changes, spam-gate, vitest]
# Fail-closed gate. This job ALWAYS runs (no path condition) so the
# required-check context can never be satisfied by an accidental skip.
# Four-state decision, mirroring `Test Summary` in tests.yml:
# 1. change detection did not succeed -> red;
# 2. detection succeeded, no console changes -> explicit green;
# 3. draft PR with console changes -> explicit green placeholder
# (the real run resumes automatically once the PR is marked
# ready via the ready_for_review trigger);
# 4. console change -> vitest must be strictly `success`.
if: always()
runs-on: ubuntu-latest
steps:
- name: Check frontend results
shell: bash
run: |
echo "Changes detection: ${{ needs.changes.result }}"
echo "Spam gate: ${{ needs.spam-gate.result }}"
echo "Vitest: ${{ needs.vitest.result }}"
if [ "${{ needs.changes.result }}" != "success" ]; then
echo "❌ Change detection did not succeed (${{ needs.changes.result }}) — gate closed, refusing untested merge"
exit 1
fi
if [ "${{ needs.changes.outputs.code }}" != "true" ]; then
echo "✅ No console changes — vitest not required"
exit 0
fi
if [ "${{ github.event_name }}" = "pull_request" ] && \
[ "${{ github.event.pull_request.draft }}" = "true" ]; then
echo "✅ Draft PR — vitest deferred until the PR is marked ready for review"
exit 0
fi
if [ "${{ needs.spam-gate.result }}" = "success" ] && \
[ "${{ needs.spam-gate.outputs.blocked }}" = "true" ]; then
echo "❌ Spam gate blocked this PR"
exit 1
fi
if [ "${{ needs.vitest.result }}" != "success" ]; then
echo "❌ Vitest must be success (failure/cancelled/skipped are all rejected)"
exit 1
fi
echo "✅ Frontend tests passed"
+720
View File
@@ -0,0 +1,720 @@
name: Full Tests Nightly
# Nightly sweep of the entire test suite (unit + contract + integration +
# E2E Playwright + frontend vitest) with combined four-tier backend
# coverage plus separately reported frontend coverage.
#
# tests.yml runs the PR (p0) and pre-merge (p0+p1) integration tiers
# gated by event name; this workflow exercises the full integration suite
# (all markers including p2), the full E2E Playwright suite against a
# live backend, the console vitest suite with coverage, and re-runs unit /
# contract on every supported platform/python combo to catch nightly drift.
#
# Independent of tests.yml so it can run unattended without going through
# the manual maintainer-approval gate that protects PR/push CI.
#
# Coverage data files (.coverage.unit / .coverage.contract /
# .coverage.integration / .coverage.e2e plus their cobertura xml) are
# produced on a single matrix entry (ubuntu-latest + python 3.13 for
# lower tracer overhead) per test class and consumed by coverage-report,
# which only combines and renders — it does not run pytest itself.
on:
schedule:
# 17:17 UTC daily ~= 01:17 Beijing the next day.
# Off-the-hour to avoid the global GitHub Actions cron rush at :00 / :30.
- cron: '17 17 * * *'
workflow_dispatch:
inputs:
coverage_platforms:
description: 'Which platforms collect integration coverage (schedule always uses all)'
required: false
default: 'linux'
type: choice
options:
- 'linux'
- 'macos'
- 'windows'
- 'all'
jobs:
unit-tests:
name: Unit Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Node.js (for console build)
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# Pin setuptools <82 on EVERY platform. setuptools >= 82 removes
# pkg_resources entirely, and lark-oapi's namespace packages still
# call pkg_resources.declare_namespace at import time. On a fresh
# install the resulting ImportError falls through lark-oapi's
# pkgutil fallback and works, but the macOS runners upgrade the
# legacy setuptools (65.5.0) in-place, leaving a half-removed
# pkg_resources (module present, declare_namespace gone) that
# raises AttributeError the fallback does not catch — crashing the
# Feishu mock IM integration tests. Pinning everywhere removes
# that failure mode and future-proofs the other platforms too
# (they already resolved to 84.0.0 with all tests green in the
# verification run). The pin must ride in the SAME pip command as
# the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
pip install -e ".[dev,test,full]" "setuptools<82"
- name: Run unit tests
shell: bash
env:
COVERAGE_FILE: .coverage.unit
run: |
# Coverage is collected only on the ubuntu/py3.13 entry so the
# data file can be uploaded for coverage-report. Other matrix
# entries only verify cross-platform compatibility.
if [ "${{ matrix.os }}" = "ubuntu-latest" ] && \
[ "${{ matrix.python-version }}" = "3.13" ]; then
pytest tests/unit -v \
--cov=src/qwenpaw \
--cov-report=xml:coverage.unit.xml \
--cov-fail-under=0
else
pytest tests/unit -v
fi
- name: Upload unit coverage data
if: |
always() &&
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: coverage-data-unit
path: |
.coverage.unit
coverage.unit.xml
retention-days: 1
include-hidden-files: true
contract-tests:
name: Contract Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Node.js (for console build)
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# Pin setuptools <82 on EVERY platform. setuptools >= 82 removes
# pkg_resources entirely, and lark-oapi's namespace packages still
# call pkg_resources.declare_namespace at import time. On a fresh
# install the resulting ImportError falls through lark-oapi's
# pkgutil fallback and works, but the macOS runners upgrade the
# legacy setuptools (65.5.0) in-place, leaving a half-removed
# pkg_resources (module present, declare_namespace gone) that
# raises AttributeError the fallback does not catch — crashing the
# Feishu mock IM integration tests. Pinning everywhere removes
# that failure mode and future-proofs the other platforms too
# (they already resolved to 84.0.0 with all tests green in the
# verification run). The pin must ride in the SAME pip command as
# the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
pip install -e ".[dev,test,full]" "setuptools<82"
- name: Run contract tests
shell: bash
env:
COVERAGE_FILE: .coverage.contract
run: |
# Same conditional-coverage pattern as unit-tests.
if [ "${{ matrix.os }}" = "ubuntu-latest" ] && \
[ "${{ matrix.python-version }}" = "3.13" ]; then
pytest tests/contract -v \
--cov=src/qwenpaw \
--cov-report=xml:coverage.contract.xml \
--cov-fail-under=0
else
pytest tests/contract -v
fi
- name: Upload contract coverage data
if: |
always() &&
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: coverage-data-contract
path: |
.coverage.contract
coverage.contract.xml
retention-days: 1
include-hidden-files: true
integrated-tests:
name: Integrated Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Node.js (for console build)
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# Pin setuptools <82 on EVERY platform. setuptools >= 82 removes
# pkg_resources entirely, and lark-oapi's namespace packages still
# call pkg_resources.declare_namespace at import time. On a fresh
# install the resulting ImportError falls through lark-oapi's
# pkgutil fallback and works, but the macOS runners upgrade the
# legacy setuptools (65.5.0) in-place, leaving a half-removed
# pkg_resources (module present, declare_namespace gone) that
# raises AttributeError the fallback does not catch — crashing the
# Feishu mock IM integration tests. Pinning everywhere removes
# that failure mode and future-proofs the other platforms too
# (they already resolved to 84.0.0 with all tests green in the
# verification run). The pin must ride in the SAME pip command as
# the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
pip install -e ".[dev,test,full]" "setuptools<82"
# tests/integration/browser drives a real Chromium through the
# Playwright control link, so the browser binary must exist before the
# full sweep runs. Same command as the e2e workflows.
- name: Install Playwright browser
shell: bash
run: |
playwright install chromium --with-deps
- name: Determine coverage flag
id: cov_flag
shell: bash
run: |
# schedule -> all platforms collect coverage (py3.11 only)
# workflow_dispatch -> use inputs.coverage_platforms (default linux)
# Only py3.11 entries collect coverage — py3.13 has excessive
# trace overhead that starves ACP stdio I/O on 2-core runners.
if [ "${{ matrix.python-version }}" != "3.11" ]; then
echo "enabled=" >> "$GITHUB_OUTPUT"
echo "Skipping coverage: py${{ matrix.python-version }}"
exit 0
fi
if [ "${{ github.event_name }}" = "schedule" ]; then
PLATFORMS="all"
else
PLATFORMS="${{ inputs.coverage_platforms }}"
fi
OS="${{ matrix.os }}"
ENABLED=""
case "$PLATFORMS" in
all) ENABLED="1" ;;
linux) [ "$OS" = "ubuntu-latest" ] && ENABLED="1" ;;
macos) [ "$OS" = "macos-latest" ] && ENABLED="1" ;;
windows) [ "$OS" = "windows-latest" ] && ENABLED="1" ;;
esac
echo "enabled=$ENABLED" >> "$GITHUB_OUTPUT"
echo "coverage platforms=$PLATFORMS, this os=$OS, enabled=${ENABLED:-no}"
- name: Run integration suite (full sweep)
shell: bash
env:
QWENPAW_INTEGRATION_COVERAGE: ${{ steps.cov_flag.outputs.enabled }}
# Windows/macOS runners are slower and IO-bound; under xdist
# parallel the default HTTP timeouts are too tight and
# intermittently surface as ``httpx.ReadTimeout`` (e.g. the real
# plugin install on macOS). Lift the floor on non-Linux runners.
QWENPAW_INTEGRATION_HTTP_TIMEOUT: ${{ matrix.os != 'ubuntu-latest' && '120' || '' }}
run: |
# Nightly always runs the full -m integration sweep (p0 + p1 +
# p2), unlike tests.yml which gates by GITHUB_EVENT_NAME.
if [ -n "$QWENPAW_INTEGRATION_COVERAGE" ]; then
# Subprocess coverage entry. Parent process must not carry
# --cov, hence --no-cov here.
#
# Runtime coverage is collected by the app subprocesses
# regardless of pass/fail, so it must be exported even when
# tests fail. Under the default `bash -e`, a failing pytest
# aborts the script right here and the cp/xml steps below
# never run, silently dropping the artifact. Capture the
# exit code, export, then restore it so failures still fail.
set +e
pytest tests/integration -v --no-cov \
-n auto --dist=loadscope --timeout=300 -m integration
PYTEST_RC=$?
set -e
if [ -f .integration_coverage/integration_subproc ]; then
cp .integration_coverage/integration_subproc \
.coverage.integration
# `coverage xml` honours fail_under and exits 2 when below;
# tolerate that — the combined value is what matters.
coverage xml --data-file=.coverage.integration \
-o coverage.integration.xml || [ "$?" -eq 2 ]
# Fail-closed guard: a collection that ran but recorded
# zero executed lines is a silent failure, not coverage.
# Historically the Windows data file uploaded fine while
# holding 752 file entries and 0 executed lines, masked
# by the combined report. Make that loud.
# Fail-closed guard: a collection that ran but recorded
# zero executed lines is a silent failure, not coverage.
# Historically the Windows data file uploaded fine while
# holding 752 file entries and 0 executed lines, masked
# by the combined report. Make that loud: the line_bits
# table holds every executed line, so an empty table
# means the flush path dropped all data. Any anomaly
# (missing table, corrupt file) also fails loud here.
if ! python -c "import sqlite3, sys; conn = sqlite3.connect('.coverage.integration'); n = conn.execute('SELECT COUNT(*) FROM line_bits').fetchone()[0]; conn.close(); print(f'[coverage guard] {n} executed-line rows recorded'); sys.exit(0 if n > 0 else 1)"; then
echo "::error::Integration coverage collection ran but recorded 0 executed lines - the flush path is silently dropping data"
PYTEST_RC=1
fi
else
echo "::warning::Integration coverage data file missing despite QWENPAW_INTEGRATION_COVERAGE=1 (session may have crashed before coverage flush)"
fi
exit "$PYTEST_RC"
else
pytest tests/integration -v \
-n auto --dist=loadscope --timeout=300 -m integration
fi
- name: Upload integration coverage data
if: always() && steps.cov_flag.outputs.enabled == '1'
uses: actions/upload-artifact@v4
with:
name: coverage-data-integration-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
.coverage.integration
coverage.integration.xml
retention-days: 1
include-hidden-files: true
# E2E split into three parallel priority shards. The full
# -m integration sweep holds 202 cases and takes ~90 minutes to
# run serially -- double this workflow's 45-minute job timeout,
# which cancelled the suite every night for weeks.
#
# Shard sizes and wall-clock timings were verified two ways.
# Static audit of this revision: p0 73, p1 89, p2 42, where two
# cases (test_add_environment_cancel / test_add_environment_key_required)
# carry both p0 and p2 markers and therefore execute in two shards
# (204 executions covering all 202 cases); zero cases are unmarked,
# so the union of the three shard selections is exactly the old
# -m integration set -- nothing is silently skipped.
# Live runs of the split expressions on a branch that also resolves
# the dual-marker overlap (71/89/42, zero overlap): p0 selected 71
# in 11:24 (run 32727540603), p1 selected 89 in
# 14:46 (run 32727547551), p2 selected 42 in 5:48 (run 32727554417),
# all green. The slowest shard stays far inside the timeout even
# with the two dual-marker cases still on this revision.
#
# Marker expressions must stay "integration and pX": a bare -m pX
# would silently drag in 12 slash_commands cases that carry a
# priority marker but no integration marker.
e2e-p0:
uses: ./.github/workflows/_e2e-job.yml
with:
test_marker: 'integration and p0'
shard_suffix: p0
secrets: inherit
e2e-p1:
uses: ./.github/workflows/_e2e-job.yml
with:
test_marker: 'integration and p1'
shard_suffix: p1
secrets: inherit
e2e-p2:
uses: ./.github/workflows/_e2e-job.yml
with:
test_marker: 'integration and p2'
shard_suffix: p2
secrets: inherit
frontend-tests:
name: Frontend Tests (Vitest)
runs-on: ubuntu-latest
defaults:
run:
working-directory: console
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run vitest with coverage (ratchet enforced)
run: npm run test:coverage
- name: Stage frontend coverage xml for report
if: always()
working-directory: ${{ github.workspace }}
shell: bash
run: |
# Rename vitest's cobertura output to the coverage.<tier>.xml
# convention so coverage-report picks it up via the shared
# coverage-data-* download + get_pct() pipeline.
if [ -f console/coverage/cobertura-coverage.xml ]; then
cp console/coverage/cobertura-coverage.xml coverage.frontend.xml
fi
- name: Upload frontend coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-data-frontend
path: coverage.frontend.xml
retention-days: 1
- name: Upload frontend coverage report (html)
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report-frontend
path: console/coverage/
retention-days: 14
coverage-report:
name: Coverage Report
needs: [unit-tests, contract-tests, integrated-tests, e2e-p0, e2e-p1, e2e-p2, frontend-tests]
if: always()
continue-on-error: true
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Install coverage tool
shell: bash
run: |
python -m pip install --upgrade pip
# Only the coverage tool is needed for combine / report; no need
# to install the full project (the per-tier .coverage data files
# arrive via download-artifact below).
pip install coverage
- name: Download coverage data artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
path: coverage-artifacts
- name: Flatten coverage data with unique names
shell: bash
run: |
# Each artifact landed in coverage-artifacts/<artifact-name>/.
# Move + rename so multi-platform integration files don't
# collide on the shared .coverage.integration name.
shopt -s nullglob
for dir in coverage-artifacts/coverage-data-*; do
name=$(basename "$dir")
for f in "$dir"/.coverage.*; do
base=$(basename "$f")
# Suffix integration tier with the artifact origin to make
# filenames unique across the multi-OS matrix.
if [ "$base" = ".coverage.integration" ]; then
cp "$f" "./.coverage.integration.${name#coverage-data-integration-}"
else
cp "$f" "./$base"
fi
done
# Also surface the xml report (already unique per tier).
for f in "$dir"/coverage.*.xml; do
cp "$f" "./$(basename "$f")" 2>/dev/null || true
done
done
- name: Inspect downloaded coverage data
shell: bash
run: |
ls -la .coverage* coverage.*.xml 2>&1 | head -30 || true
- name: Combine all coverage data
shell: bash
run: |
# Write a paths config to remap cross-OS absolute paths.
cat > .coveragerc <<RCEOF
[paths]
source =
src/qwenpaw
*/src/qwenpaw
/Users/runner/work/QwenPaw/QwenPaw/src/qwenpaw
/home/runner/work/QwenPaw/QwenPaw/src/qwenpaw
D:\a\QwenPaw\QwenPaw\src\qwenpaw
RCEOF
COMBINE_ARGS=""
for f in .coverage.unit .coverage.contract .coverage.integration .coverage.integration.* .coverage.e2e .coverage.e2e.*; do
[ -f "$f" ] && COMBINE_ARGS="$COMBINE_ARGS $f"
done
if [ -z "$COMBINE_ARGS" ]; then
echo "No coverage data files found"
exit 0
fi
echo "Combining: $COMBINE_ARGS"
# Also produce an integration-only combined data file +
# xml so the per-tier summary table still has a single
# "Integration" number after the multi-platform split.
INTEGRATION_FILES=""
for f in .coverage.integration .coverage.integration.*; do
[ -f "$f" ] && INTEGRATION_FILES="$INTEGRATION_FILES $f"
done
if [ -n "$INTEGRATION_FILES" ]; then
coverage combine --rcfile=.coveragerc --keep \
--data-file=.coverage.integration.merged \
$INTEGRATION_FILES
coverage xml --rcfile=.coveragerc \
--data-file=.coverage.integration.merged \
-o coverage.integration.xml || [ "$?" -eq 2 ]
fi
rm -f .coverage.integration.merged
# Same precedent for the E2E tier: the nightly fan-out uploads
# one data file per shard (.coverage.e2e.p0 / .p1 / .p2). Merge
# them into one merged file + xml so the per-tier summary table
# still has a single "E2E" number after the three-way split.
E2E_FILES=""
for f in .coverage.e2e .coverage.e2e.*; do
[ -f "$f" ] && E2E_FILES="$E2E_FILES $f"
done
if [ -n "$E2E_FILES" ]; then
coverage combine --rcfile=.coveragerc --keep \
--data-file=.coverage.e2e.merged \
$E2E_FILES
coverage xml --rcfile=.coveragerc \
--data-file=.coverage.e2e.merged \
-o coverage.e2e.xml || [ "$?" -eq 2 ]
fi
rm -f .coverage.e2e.merged
coverage combine --rcfile=.coveragerc $COMBINE_ARGS
coverage xml -o coverage.combined.xml || [ "$?" -eq 2 ]
coverage html -d htmlcov-combined || [ "$?" -eq 2 ]
echo "Combined coverage report:"
coverage report --skip-covered --fail-under=0
- name: Build coverage summary table
id: cov_summary
shell: bash
run: |
# Best-effort number per tier; missing/malformed data => "n/a".
set +e
# Read line-rate from cobertura xml directly to avoid the
# coverage source-filter mismatch that would otherwise produce
# "No data to report" on the per-tier data files.
get_pct() {
python3 -c 'import sys, xml.etree.ElementTree as ET; print(round(float(ET.parse(sys.argv[1]).getroot().attrib.get("line-rate", "0")) * 100))' "$1" 2>/dev/null || echo "n/a"
}
UNIT=$(get_pct coverage.unit.xml)
CONTRACT=$(get_pct coverage.contract.xml)
INTEGRATION=$(get_pct coverage.integration.xml)
E2E=$(get_pct coverage.e2e.xml)
FRONTEND=$(get_pct coverage.frontend.xml)
COMBINED=$(get_pct coverage.combined.xml)
echo "UNIT=${UNIT:-n/a}"
echo "CONTRACT=${CONTRACT:-n/a}"
echo "INTEGRATION=${INTEGRATION:-n/a}"
echo "E2E=${E2E:-n/a}"
echo "FRONTEND=${FRONTEND:-n/a}"
echo "COMBINED=${COMBINED:-n/a}"
{
echo "## 📊 Coverage report (nightly full sweep)"
echo ""
echo "| Test category | Coverage |"
echo "|---|---|"
echo "| Unit | ${UNIT:-n/a}% |"
echo "| Contract | ${CONTRACT:-n/a}% |"
echo "| Integration | ${INTEGRATION:-n/a}% |"
echo "| E2E | ${E2E:-n/a}% |"
echo "| Frontend (vitest) | ${FRONTEND:-n/a}% |"
echo "| **Combined** | **${COMBINED:-n/a}%** |"
echo ""
echo "> Combined = \`coverage combine\` of the backend Python tiers (unit + contract + integration + E2E)."
echo "> Frontend (vitest) is JS/TS coverage of the console app, reported separately (not merged into Combined)."
echo "> Integration ran the full \`-m integration\` sweep (p0 + p1 + p2)."
echo "> E2E ran the full Playwright suite against a live backend."
echo "> HTML reports under workflow artifact \`coverage-reports\` (\`htmlcov-combined\` / \`htmlcov-integration\` / \`htmlcov-e2e\`); frontend HTML under \`coverage-report-frontend\`."
echo "> Backend coverage is collected only on the ubuntu/py3.13 matrix entry; other matrix entries verify cross-platform compatibility without the tracer overhead."
} > coverage_summary.md
cat coverage_summary.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
coverage.unit.xml
coverage.contract.xml
coverage.integration.xml
coverage.e2e.xml
coverage.frontend.xml
coverage.combined.xml
htmlcov-combined/
htmlcov-integration/
htmlcov-e2e/
retention-days: 14
test-summary:
name: Test Summary
needs: [unit-tests, contract-tests, integrated-tests, e2e-p0, e2e-p1, e2e-p2, frontend-tests, coverage-report]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check test results
shell: bash
run: |
echo "Unit tests: ${{ needs.unit-tests.result }}"
echo "Contract tests: ${{ needs.contract-tests.result }}"
echo "Integrated tests: ${{ needs.integrated-tests.result }}"
echo "E2E p0: ${{ needs.e2e-p0.result }}"
echo "E2E p1: ${{ needs.e2e-p1.result }}"
echo "E2E p2: ${{ needs.e2e-p2.result }}"
echo "Frontend tests: ${{ needs.frontend-tests.result }}"
# Fail-closed: any result that is not an outright success
# (failure OR cancelled OR skipped) turns the summary red.
# The previous check only looked for "failure", so a suite
# killed by its job timeout (result "cancelled") still passed
# the summary -- which masked the nightly E2E timeout for
# weeks behind a green summary.
if [ "${{ needs.unit-tests.result }}" != "success" ] || \
[ "${{ needs.contract-tests.result }}" != "success" ] || \
[ "${{ needs.integrated-tests.result }}" != "success" ] || \
[ "${{ needs.e2e-p0.result }}" != "success" ] || \
[ "${{ needs.e2e-p1.result }}" != "success" ] || \
[ "${{ needs.e2e-p2.result }}" != "success" ] || \
[ "${{ needs.frontend-tests.result }}" != "success" ]; then
echo "❌ Some tests did not succeed"
exit 1
else
echo "✅ All tests passed"
fi
+359
View File
@@ -0,0 +1,359 @@
name: Issue Welcome Bot
on:
issues:
types: [opened]
permissions:
issues: write
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- name: Welcome Issue Author
uses: actions/github-script@v7
with:
script: |
// Helper function for English ordinal suffix (1st, 2nd, 3rd, 4th...)
function getOrdinalSuffix(num) {
const j = num % 10;
const k = num % 100;
if (j === 1 && k !== 11) return 'st';
if (j === 2 && k !== 12) return 'nd';
if (j === 3 && k !== 13) return 'rd';
return 'th';
}
const author = context.payload.issue.user.login;
const issueNumber = context.payload.issue.number;
const issueTitle = context.payload.issue.title;
const issueBody = context.payload.issue.body || '';
// ---------------------------------------------------------------
// Spam gate: close if author has >10 open issues in this repo.
// Bypassed for repo maintainers and admins.
// per_page=1 is sufficient — we only need total_count.
// ---------------------------------------------------------------
try {
// Bypass for repo maintainers / admins.
try {
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: author,
});
if (['admin', 'maintain'].includes(perm.permission)) {
console.log(`@${author} is a repo ${perm.permission} — bypassing spam gate`);
// Fall through to normal welcome flow.
throw new Error('__bypass__');
}
} catch (permErr) {
if (permErr.message === '__bypass__') throw permErr;
// 404 = not a collaborator, proceed with spam check.
if (permErr.status !== 404) {
console.log(`Permission check warning: ${permErr.message} — proceeding with spam check`);
}
}
const { data: openResult } = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} type:issue is:open author:${author}`,
per_page: 1,
});
const openCount = openResult.total_count;
console.log(`@${author} has ${openCount} open issue(s) in this repo`);
if (openCount > 10) {
// Ensure the label exists (create it if missing)
try {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Close-and-review-later',
color: 'e4e669',
description: 'Closed automatically for later review',
});
} catch (labelErr) {
// 422 = label already exists, that's fine
if (labelErr.status !== 422) console.log(`Label creation warning: ${labelErr.message}`);
}
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
labels: ['Close-and-review-later'],
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
state: 'closed',
});
const warningComment = [
`<div align="center">`,
``,
`<img src="https://img.alicdn.com/imgextra/i2/O1CN01eSmIfy1hJImze8NN8_!!6000000004256-2-tps-1858-1858.png" width="80" height="80" />`,
``,
`</div>`,
``,
`Hi @${author},`,
``,
`This issue has been **automatically closed** because you currently have more than **10 open issues** in this repository.`,
``,
`> **Why this happened**`,
`> Our [contribution policy](https://github.com/${context.repo.owner}/${context.repo.repo}/issues/4333) asks contributors to maintain a manageable number of active issues to ensure fair use of maintainer resources. A high volume of simultaneous open issues — especially those that are AI-generated and submitted without personal verification — places a significant burden on maintainers.`,
``,
`**What you can do:**`,
`1. Review your open issues and close any that are no longer relevant, duplicated, or have not been personally verified.`,
`2. Once you have fewer than 10 open issues, you are welcome to reopen this issue or file a new one.`,
`3. Please ensure every issue you file has been **personally reproduced** and includes all required information per our issue templates.`,
``,
`This issue has been labeled \`Close-and-review-later\` and may be revisited by a maintainer.`,
``,
`Thank you for your understanding. 🐾`,
``,
`---`,
``,
`你好 @${author},`,
``,
`由于你目前在本仓库有超过 **10 个处于 open 状态的 issue**,此 issue 已被**自动关闭**。`,
``,
`> **原因说明**`,
`> 根据我们的[贡献规范](https://github.com/${context.repo.owner}/${context.repo.repo}/issues/4333),为保障维护者资源的合理使用,我们要求贡献者控制活跃 issue 的数量。大量未经人工验证的 open issue(尤其是 AI 生成内容)会给维护者带来沉重负担。`,
``,
`**你可以采取以下措施:**`,
`1. 检查并关闭不再相关、重复或未经本人验证的 open issue。`,
`2. 当你的 open issue 数量少于 10 个时,欢迎重新开启此 issue 或提交新的 issue。`,
`3. 请确保每个 issue 均经过**本人亲自复现**,并按照 issue 模板填写所有必填信息。`,
``,
`此 issue 已被标记为 \`Close-and-review-later\`,维护者可能会在后续进行审核。`,
``,
`感谢你的理解与配合。🐾`,
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: warningComment,
});
console.log(`Closed issue #${issueNumber} for @${author} — open issue limit exceeded (${openCount} open)`);
return;
}
} catch (spamErr) {
if (spamErr.message !== '__bypass__') {
// Fail open: if the check itself errors, don't block legitimate contributors.
console.log(`Spam gate check failed: ${spamErr.message} — continuing with normal welcome`);
}
}
// ---------------------------------------------------------------
// Check if Chinese characters exist in title
const hasChinese = /[\u4e00-\u9fff]/.test(issueTitle);
// Count user's total issues in this repo using search API
let issueCount = 0;
let hasValidIssueCount = false;
let isFirstIssue = false;
try {
const { data: searchResult } = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} type:issue author:${author}`,
});
issueCount = searchResult.total_count;
hasValidIssueCount = true;
isFirstIssue = issueCount === 1;
} catch (err) {
console.log(`Could not get issue count for ${author}, will skip count display`);
hasValidIssueCount = false;
}
// Check if user has starred the repo by listing user's starred
// repos
let hasStarred = false;
try {
const fullRepoName = `${context.repo.owner}/${context.repo.repo}`;
let page = 1;
let found = false;
while (page <= 10 && !found) {
const { data: starredRepos } = await github.rest.activity.listReposStarredByUser({
username: author,
per_page: 100,
page: page
});
if (starredRepos.length === 0) break;
found = starredRepos.some(repo => repo.full_name === fullRepoName);
if (found) {
hasStarred = true;
console.log(`User ${author} has starred the repo`);
break;
}
page++;
}
if (!found) {
console.log(`User ${author} has not starred the repo`);
}
} catch (error) {
console.log(
`Could not verify star status for ${author}:`,
error.message
);
}
// Check if this is a bug report by title or label
// Match "bug", "bugs", or "[Bug]:" prefix (case-insensitive)
const titleContainsBug = /\bbug(s)?\b/i.test(issueTitle) || /^\s*\[bug\]\s*:/i.test(issueTitle);
const labels = context.payload.issue.labels.map(label => label.name);
const hasBugLabel = labels.some(name => name && name.toLowerCase() === 'bug');
const isBugRelated = titleContainsBug || hasBugLabel;
// Check if issue uses bug report template
const usedBugTemplate = issueBody.includes('## QwenPaw Version') ||
issueBody.includes('## Environment') ||
issueBody.includes('## Steps to Reproduce');
// If bug-related but template not used, need to remind
const needBugTemplateReminder = isBugRelated && !usedBugTemplate;
// Build comment
let comment = '';
if (hasChinese) {
// Bilingual response with logo
comment = `<div align="center">\n\n`;
comment += `<img src="https://img.alicdn.com/imgextra/i2/O1CN01eSmIfy1hJImze8NN8_!!6000000004256-2-tps-1858-1858.png" width="80" height="80" />\n\n`;
comment += `## 欢迎来到 QwenPaw! 🐾 Welcome to QwenPaw!\n\n`;
comment += `</div>\n\n`;
if (hasValidIssueCount) {
if (isFirstIssue) {
comment += `你好 @${author},感谢你提交的第一个 issue!\n`;
comment += `Hi @${author}, thank you for your first issue!\n\n`;
} else {
comment += `你好 @${author},这是你提交的第 ${issueCount} 个 issue。\n`;
comment += `Hi @${author}, this is your ${issueCount}${getOrdinalSuffix(issueCount)} issue.\n\n`;
}
} else {
comment += `你好 @${author},感谢你提交 issue!\n`;
comment += `Hi @${author}, thank you for your issue!\n\n`;
}
if (needBugTemplateReminder) {
comment += `### 📋 关于 Bug Report 模板 / About Bug Report Template\n\n`;
comment += `我们注意到你的 issue 似乎与 bug 相关,但没有使用 Bug Report 模板。为了帮助我们更快地定位和修复问题,请确保你的 bug report 包含以下信息:\n`;
comment += `We noticed your issue seems to be bug-related, but doesn't use the Bug Report template. To help us reproduce and fix the issue faster, please make sure your bug report includes:\n\n`;
comment += `- ✅ **QwenPaw 版本 / Version** (使用 \`qwenpaw --version\` 查看)\n`;
comment += `- ✅ **操作系统 / OS** (macOS/Linux/Windows 及版本)\n`;
comment += `- ✅ **复现步骤 / Steps to Reproduce** (详细的步骤)\n`;
comment += `- ✅ **实际结果 vs 预期结果 / Actual vs Expected**\n`;
comment += `- ✅ **日志或截图 / Logs or Screenshots**\n\n`;
comment += `你可以编辑 issue 来补充这些信息。如果你的 issue 缺少这些信息,维护者可能需要额外时间来询问细节。\n`;
comment += `You can edit your issue to add this information. Missing information may require maintainers to ask follow-up questions.\n\n`;
}
comment += `我们会尽快查看你的 issue。感谢你对 QwenPaw 的支持!\n`;
comment += `We'll review your issue soon. Thank you for supporting QwenPaw!\n\n`;
// Internationalization reminder
comment += `---\n\n`;
comment += `> **🌍 关于国际化 / About Internationalization**\n`;
comment += `> \n`;
comment += `> QwenPaw 是一个国际化的开源社区。我们建议使用英文提交 issue,这样可以让更多的开发者参与讨论和贡献。\n`;
comment += `> \n`;
comment += `> QwenPaw is an international open-source community. We recommend using English for issues so that more developers worldwide can participate in discussions and contributions.\n\n`;
// Star reminder at the end
if (!hasStarred) {
comment += `> [!TIP]\n`;
comment += `> **⭐ 如果你觉得 QwenPaw 有帮助,请给我们一个 Star!**\n`;
comment += `> \n`;
comment += `> **⭐ If you find QwenPaw useful, please give us a Star!**\n`;
comment += `> \n`;
comment += `> <div align="center">\n`;
comment += `> \n`;
comment += `> <a href="https://github.com/agentscope-ai/QwenPaw"><img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" alt="Star QwenPaw" width="600" /></a>\n`;
comment += `> \n`;
comment += `> </div>\n`;
comment += `> \n`;
comment += `> **掌握最新动态 / Staying ahead**\n`;
comment += `> \n`;
comment += `> 在 GitHub 上 Star QwenPaw,第一时间收到新版本发布通知。\n`;
comment += `> \n`;
comment += `> Star QwenPaw on GitHub and be instantly notified of new releases.\n`;
comment += `> \n`;
comment += `> 你的 star 将帮助更多开发者发现这个项目!🐾\n`;
comment += `> \n`;
comment += `> Your star helps more developers discover this project! 🐾`;
}
} else {
// English only with logo
comment = `<div align="center">\n\n`;
comment += `<img src="https://img.alicdn.com/imgextra/i2/O1CN01eSmIfy1hJImze8NN8_!!6000000004256-2-tps-1858-1858.png" width="80" height="80" />\n\n`;
comment += `## Welcome to QwenPaw! 🐾\n\n`;
comment += `</div>\n\n`;
if (hasValidIssueCount) {
if (isFirstIssue) {
comment += `Hi @${author}, thank you for your first issue!\n\n`;
} else {
comment += `Hi @${author}, this is your ${issueCount}${getOrdinalSuffix(issueCount)} issue.\n\n`;
}
} else {
comment += `Hi @${author}, thank you for your issue!\n\n`;
}
if (needBugTemplateReminder) {
comment += `### 📋 About Bug Report Template\n\n`;
comment += `We noticed your issue seems to be bug-related, but doesn't use the Bug Report template. To help us reproduce and fix the issue faster, please make sure your bug report includes:\n\n`;
comment += `- ✅ **QwenPaw Version** (use \`qwenpaw --version\`)\n`;
comment += `- ✅ **Operating System** (macOS/Linux/Windows and version)\n`;
comment += `- ✅ **Steps to Reproduce** (detailed steps)\n`;
comment += `- ✅ **Actual vs Expected Behavior**\n`;
comment += `- ✅ **Logs or Screenshots**\n\n`;
comment += `You can edit your issue to add this information. Missing information may require us to ask follow-up questions, which can delay the fix.\n\n`;
}
comment += `We'll review your issue soon. Thank you for supporting QwenPaw!\n\n`;
// Star reminder at the end
if (!hasStarred) {
comment += `---\n\n`;
comment += `> [!TIP]\n`;
comment += `> **⭐ If you find QwenPaw useful, please give us a Star!**\n`;
comment += `> \n`;
comment += `> <div align="center">\n`;
comment += `> \n`;
comment += `> <a href="https://github.com/agentscope-ai/QwenPaw"><img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" alt="Star QwenPaw" width="600" /></a>\n`;
comment += `> \n`;
comment += `> </div>\n`;
comment += `> \n`;
comment += `> **Staying ahead**\n`;
comment += `> \n`;
comment += `> Star QwenPaw on GitHub and be instantly notified of new releases.\n`;
comment += `> \n`;
comment += `> Your star helps more developers discover this project! 🐾`;
}
}
// Post comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: comment
});
const logMessage = hasValidIssueCount
? `Posted welcome comment on issue #${issueNumber} for @${author} (issue #${issueCount})`
: `Posted welcome comment on issue #${issueNumber} for @${author}`;
console.log(logMessage);
+133
View File
@@ -0,0 +1,133 @@
name: NPM Format (website & console)
on:
push:
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so the checks really run
# right after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
jobs:
spam-gate:
name: PR Spam Gate
if: github.event_name == 'pull_request'
uses: ./.github/workflows/pr-spam-gate.yml
with:
author: ${{ github.event.pull_request.user.login }}
website:
name: website format check
needs: [spam-gate]
if: |
always() &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true')
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
# Draft PRs defer the real run: this job still reports a green
# placeholder so the required-check context stays present (GitHub
# forbids merging drafts), and the ready_for_review trigger
# re-runs everything once the PR is marked ready.
- name: Detect draft PR
id: draft
# Override the job-level working-directory: the website/console
# subdirectories only exist after checkout, and this step must run
# before checkout to decide whether the real steps run at all.
working-directory: .
shell: bash
run: |
if [ "${{ github.event_name }}" = "pull_request" ] && \
[ "${{ github.event.pull_request.draft }}" = "true" ]; then
echo "value=true" >> "$GITHUB_OUTPUT"
else
echo "value=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v4
if: steps.draft.outputs.value != 'true'
- name: Setup pnpm
if: steps.draft.outputs.value != 'true'
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
if: steps.draft.outputs.value != 'true'
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: website/pnpm-lock.yaml
- name: Install dependencies
if: steps.draft.outputs.value != 'true'
run: pnpm install --frozen-lockfile
- name: Run format check
if: steps.draft.outputs.value != 'true'
run: pnpm run format:check
- name: Report draft placeholder
if: steps.draft.outputs.value == 'true'
# Same override as the draft-detection step: the subdirectory does
# not exist before checkout, which never runs on draft PRs.
working-directory: .
shell: bash
run: echo "✅ Draft PR — website format check deferred until the PR is marked ready for review"
console:
name: console format check
needs: [spam-gate]
if: |
always() &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true')
runs-on: ubuntu-latest
defaults:
run:
working-directory: console
steps:
- name: Detect draft PR
id: draft
# Override the job-level working-directory: the website/console
# subdirectories only exist after checkout, and this step must run
# before checkout to decide whether the real steps run at all.
working-directory: .
shell: bash
run: |
if [ "${{ github.event_name }}" = "pull_request" ] && \
[ "${{ github.event.pull_request.draft }}" = "true" ]; then
echo "value=true" >> "$GITHUB_OUTPUT"
else
echo "value=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v4
if: steps.draft.outputs.value != 'true'
- name: Setup Node
if: steps.draft.outputs.value != 'true'
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Install dependencies
if: steps.draft.outputs.value != 'true'
run: npm ci
- name: Run format check
if: steps.draft.outputs.value != 'true'
run: npm run format:check
- name: Report draft placeholder
if: steps.draft.outputs.value == 'true'
# Same override as the draft-detection step: the subdirectory does
# not exist before checkout, which never runs on draft PRs.
working-directory: .
shell: bash
run: echo "✅ Draft PR — console format check deferred until the PR is marked ready for review"
+171
View File
@@ -0,0 +1,171 @@
# Pack repo plugins (bundle/tool/apps) and publish to the download CDN (OSS).
# Runs on any published GitHub Release (including prereleases), same as Desktop OSS upload; also manually via Actions tab.
# The Creator plugin is excluded here: it has its own version-driven
# pipeline (creator-release.yml) so a main release never overwrites a
# creator zip with mid-cycle code under the same immutable URL.
name: QwenPaw Plugins Release
on:
# NOTE: legacy fallback path. The standard release flow is now release.yml
# (see RELEASING.md). Publishing a GitHub Release directly still triggers this
# OLD publish, which is NOT gated on the desktop build. Kept only as an
# emergency rollback until the old release workflows are removed.
release:
types: [published]
workflow_dispatch:
inputs:
upload_to_oss:
description: "Upload to OSS"
required: false
type: boolean
default: false
concurrency:
group: plugins-release
cancel-in-progress: false
jobs:
upload-oss:
runs-on: ubuntu-latest
# Run on: 1) any published release (including prerelease), or 2) manual with upload_to_oss.
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_oss == 'true')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Build app plugin frontends
shell: bash
run: |
shopt -s nullglob
for app_dir in plugins/apps/*; do
if [[ "$(basename "$app_dir")" == "qwenpaw-creator" ]]; then
echo "Skipping ${app_dir} (released via creator-release.yml)"
continue
fi
if [[ "$(basename "$app_dir")" == "qwenpaw-data" ]]; then
echo "Skipping ${app_dir} (released via qwenpaw-data-release.yml)"
continue
fi
if [[ -f "$app_dir/ui/package-lock.json" ]]; then
echo "Building ${app_dir}/ui"
npm --prefix "$app_dir/ui" ci
npm --prefix "$app_dir/ui" run build
fi
done
- name: Pack plugins and build index
# qwenpaw-creator and qwenpaw-data are released through their own
# version-driven pipelines (creator-release.yml,
# qwenpaw-data-release.yml); qwenpaw-data additionally needs the vendored
# context console staged before packing. Their plugin.json
# pack_requires declarations make an accidental un-exclude fail
# this step loudly instead of shipping a broken artifact.
run: |
python scripts/pack/generate_plugin_metadata.py \
--plugins-root plugins \
--dist dist/plugins \
--metadata-out dist/plugins/index.json \
--cdn-prefix /files/plugins \
--exclude qwenpaw-creator \
--exclude qwenpaw-data
- name: Install ossutil
run: |
wget -q https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip -q ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Sync plugin zips to OSS (long-cache, immutable)
run: |
# nullglob ensures empty globs expand to nothing in this bash session
shopt -s nullglob
for kind in bundle tool apps; do
while IFS= read -r -d '' f; do
rel="${f#dist/plugins/}"
echo "Uploading $f -> files/plugins/${rel}"
ossutil cp "$f" \
"oss://qwenpaw-download/files/plugins/${rel}" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=31536000, immutable"
done < <(find "dist/plugins/${kind}" -type f -name '*.zip' -print0 2>/dev/null || true)
done
# One-time cleanup: remove legacy flat zips (pre per-plugin directory layout).
# This only targets {kind}/*.zip (flat files), not {kind}/{plugin_id}/*.zip (versioned).
for kind in bundle tool apps; do
remote_flat=$(ossutil ls "oss://qwenpaw-download/files/plugins/${kind}/" -s 2>/dev/null \
| grep -E "^oss://qwenpaw-download/files/plugins/${kind}/[^/]+\.zip$" \
| sed 's|.*/||' \
| sort -u || true)
for name in $remote_flat; do
echo "Removing legacy flat OSS object: ${kind}/${name}"
ossutil rm \
"oss://qwenpaw-download/files/plugins/${kind}/${name}" \
--force
done
done
- name: Merge historical versions into index
run: |
ossutil cp "oss://qwenpaw-download/metadata/plugins/index.json" \
existing-index.json 2>/dev/null || echo '{}' > existing-index.json
python3 scripts/pack/merge_plugin_index.py \
--new dist/plugins/index.json \
--old existing-index.json \
--out dist/plugins/index.json \
--retire-plugin-id computer-use-tool
- name: Upload plugins index (short-cache)
run: |
ossutil cp dist/plugins/index.json \
"oss://qwenpaw-download/metadata/plugins/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Patch main metadata index to advertise plugins product
run: |
ossutil cp "oss://qwenpaw-download/metadata/index.json" \
main-index.json 2>/dev/null || cat > main-index.json << 'EOF'
{
"version": "1.0",
"updated_at": "",
"products": {}
}
EOF
python3 scripts/pack/patch_main_index.py \
--index main-index.json \
--out main-index.json
ossutil cp main-index.json \
"oss://qwenpaw-download/metadata/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Summary
run: |
echo "Plugins published. Index:"
cat dist/plugins/index.json | python3 -m json.tool | head -40 || true
+285
View File
@@ -0,0 +1,285 @@
name: AI Code Review
on:
pull_request_target:
types: [opened, synchronize]
permissions: {}
jobs:
# Maintainer must approve before AI review runs
review-gate:
name: AI Review Approval
runs-on: ubuntu-latest
environment: ai-review-approved
permissions: {}
steps:
- run: |
echo "Maintainer approved AI review for PR #${{ github.event.pull_request.number }}"
ai-review:
name: QwenPaw AI Review
needs: review-gate
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
pull-requests: read
outputs:
verdict: ${{ steps.review.outputs.verdict }}
high_count: ${{ steps.review.outputs.high_count }}
medium_count: ${{ steps.review.outputs.medium_count }}
env:
REVIEW_PROVIDER: dashscope
REVIEW_MODEL: ${{ vars.REVIEW_MODEL || 'qwen3.6-plus' }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_REPO: ${{ github.event.pull_request.base.repo.full_name }}
QWENPAW_TOOL_GUARD_APPROVAL_TIMEOUT_SECONDS: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install QwenPaw and dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
pip install httpx
- name: Verify gh CLI and authentication
run: |
gh --version
gh auth status
echo "Verifying PR access..."
gh pr view ${{ env.PR_NUMBER }} --repo ${{ env.PR_REPO }} --json number,title --jq '.title'
env:
GH_TOKEN: ${{ github.token }}
- name: Initialize QwenPaw workspace
run: |
qwenpaw init --defaults --accept-security
python scripts/review-bot/setup_review_workspace.py
env:
DASHSCOPE_API_KEY: ${{ secrets.REVIEW_DASHSCOPE_API_KEY }}
- name: Start QwenPaw server
run: |
QWENPAW_AUTH_ENABLED=false \
GH_TOKEN=${{ github.token }} \
GITHUB_TOKEN=${{ github.token }} \
python -m qwenpaw app --host 127.0.0.1 --port 8088 &
echo $! > /tmp/qwenpaw.pid
- name: Wait for QwenPaw to be ready
run: |
for i in $(seq 1 90); do
if curl -sf http://localhost:8088/api/version > /dev/null 2>&1; then
echo "QwenPaw is ready (took ${i}s)"
exit 0
fi
sleep 1
done
echo "QwenPaw failed to start within 90 seconds"
exit 1
- name: Verify review model is configured
run: |
python - <<'PY'
import json
import os
import sys
import urllib.request
expected_provider = os.environ.get("REVIEW_PROVIDER", "dashscope")
expected_model = os.environ.get("REVIEW_MODEL", "qwen3.6-plus")
with urllib.request.urlopen("http://localhost:8088/api/models/active?scope=global") as resp:
data = json.load(resp)
active = data.get("active_llm") or {}
provider = active.get("provider_id")
model = active.get("model")
print(f"Active model: {provider}/{model}")
if provider != expected_provider or model != expected_model:
print(f"ERROR: expected {expected_provider}/{expected_model}")
sys.exit(1)
PY
- name: Remove secrets from disk
run: |
rm -f ~/.qwenpaw.secret/.master_key
rm -rf ~/.qwenpaw.secret/providers
echo "Secrets removed from disk (cached in server memory)"
- name: Run AI Review
id: review
run: python scripts/review-bot/review_runner.py
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
- name: Upload AI review result
if: success()
uses: actions/upload-artifact@v4
with:
name: pr-ai-review-${{ github.run_id }}-${{ github.run_attempt }}
path: /tmp/review_result.md
if-no-files-found: error
retention-days: 1
- name: Stop QwenPaw
if: always()
run: |
if [ -f /tmp/qwenpaw.pid ]; then
kill $(cat /tmp/qwenpaw.pid) 2>/dev/null || true
fi
publish-review:
name: Publish QwenPaw AI Review
needs: [review-gate, ai-review]
if: >-
${{ always() && needs.review-gate.result == 'success' &&
needs.ai-review.result != 'cancelled' }}
runs-on: ubuntu-latest
permissions:
actions: read
pull-requests: write
steps:
- name: Download AI review result
if: needs.ai-review.result == 'success'
uses: actions/download-artifact@v4
with:
name: pr-ai-review-${{ github.run_id }}-${{ github.run_attempt }}
path: /tmp/ai-review
- name: Post review comment and manage labels
if: needs.ai-review.result == 'success'
uses: actions/github-script@v7
env:
REVIEW_VERDICT: ${{ needs.ai-review.outputs.verdict }}
with:
script: |
const fs = require('fs');
const prNumber = context.payload.pull_request.number;
const expectedHeadSha = context.payload.pull_request.head.sha;
const currentPull = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
if (currentPull.data.head.sha !== expectedHeadSha) {
core.notice(
`Skipping stale AI review for ${expectedHeadSha}; ` +
`current head is ${currentPull.data.head.sha}`,
);
return;
}
const verdict = process.env.REVIEW_VERDICT;
if (!['APPROVE', 'REQUEST_CHANGES'].includes(verdict)) {
core.setFailed(`Invalid AI review verdict: ${verdict}`);
return;
}
const reviewBody = fs.readFileSync(
'/tmp/ai-review/review_result.md',
'utf8',
);
if (!reviewBody.trim()) {
core.setFailed('AI review result is empty');
return;
}
const readyForHumanReview = verdict === 'APPROVE';
const icon = readyForHumanReview ? '✅' : '⚠️';
const title = readyForHumanReview
? 'Passed AI Review — Awaiting Human Review'
: 'Changes Requested';
const header = `## ${icon} QwenPaw AI Review: ${title}\n\n`;
const footer = '\n\n---\n' +
`*Auto-generated by QwenPaw Review Agent | ` +
`Triggered by maintainer approval*`;
const fullBody = `${header}${reviewBody}${footer}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: fullBody,
});
// Label logic:
// APPROVE (high=0, medium<=2) → add ready-for-human-review
// REQUEST_CHANGES → remove ready-for-human-review
if (readyForHumanReview) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['ready-for-human-review'],
});
} else {
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
name: 'ready-for-human-review',
});
} catch (e) {}
}
- name: Post fallback on review failure
if: needs.ai-review.result == 'failure'
uses: actions/github-script@v7
with:
script: |
const prNumber = context.payload.pull_request.number;
const expectedHeadSha = context.payload.pull_request.head.sha;
const currentPull = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
if (currentPull.data.head.sha !== expectedHeadSha) {
core.notice(
`Skipping stale failure notice for ${expectedHeadSha}; ` +
`current head is ${currentPull.data.head.sha}`,
);
return;
}
const body = [
'## ⚠️ QwenPaw AI Review: Review Failed\n',
'The AI Review Bot encountered an error and could not ',
'generate a review.\n',
'Possible causes:',
'- LLM API unavailable or timed out',
'- `gh` CLI authentication failure',
'- QwenPaw internal service error\n',
'**Please have a maintainer review this PR manually.**\n',
'---',
'*🤖 Auto-generated by QwenPaw Review Agent | ',
'Review failed — manual review required*',
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: body,
});
+182
View File
@@ -0,0 +1,182 @@
name: PR preview tests
# Fork-local preview of the Tests matrix from agentscope-ai/QwenPaw's
# `.github/workflows/tests.yml`, WITHOUT its `approval-gate` (the upstream
# `maintainer-approved` environment that gates every Tests run behind a manual
# maintainer approval). Purpose: catch cross-OS regressions on this branch
# *before* asking upstream to re-approve, so we don't loop on "approve ->
# red -> fix -> re-approve".
#
# Triggers on any push to a `backend-*` branch (this PR's source branch family)
# and on manual dispatch. Runs the same 3 matrices upstream runs - unit,
# contract, integrated - but mirrors upstream's PR-gate marker
# (`integration and p0`) for the integrated tier. Coverage/artifact upload is
# omitted (that's a downstream coverage-report concern, not a pass/fail gate).
# The npm console build from upstream tests.yml is omitted too: tests under
# tests/unit / tests/contract / tests/integration do not import the built
# frontend static assets (verified); `console` is an API route name there, not
# console/dist.
on:
push:
branches:
- 'backend-regression'
- 'backend-*'
workflow_dispatch:
jobs:
unit-tests:
name: Unit Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Faithful copy of upstream tests.yml's unit-tests matrix.
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# Pin setuptools <82 on EVERY platform. setuptools >= 82 removes
# pkg_resources entirely, and lark-oapi's namespace packages still
# call pkg_resources.declare_namespace at import time. On a fresh
# install the resulting ImportError falls through lark-oapi's
# pkgutil fallback and works, but the macOS runners upgrade the
# legacy setuptools (65.5.0) in-place, leaving a half-removed
# pkg_resources (module present, declare_namespace gone) that
# raises AttributeError the fallback does not catch — crashing the
# Feishu mock IM integration tests. Pinning everywhere removes
# that failure mode and future-proofs the other platforms too
# (they already resolved to 84.0.0 with all tests green in the
# verification run). The pin must ride in the SAME pip command as
# the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
pip install -e ".[dev,test,full]" "setuptools<82"
- name: Run unit tests
shell: bash
run: pytest tests/unit -v
contract-tests:
name: Contract Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Faithful copy of upstream tests.yml's contract-tests matrix.
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# Pin setuptools <82 on EVERY platform. setuptools >= 82 removes
# pkg_resources entirely, and lark-oapi's namespace packages still
# call pkg_resources.declare_namespace at import time. On a fresh
# install the resulting ImportError falls through lark-oapi's
# pkgutil fallback and works, but the macOS runners upgrade the
# legacy setuptools (65.5.0) in-place, leaving a half-removed
# pkg_resources (module present, declare_namespace gone) that
# raises AttributeError the fallback does not catch — crashing the
# Feishu mock IM integration tests. Pinning everywhere removes
# that failure mode and future-proofs the other platforms too
# (they already resolved to 84.0.0 with all tests green in the
# verification run). The pin must ride in the SAME pip command as
# the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
pip install -e ".[dev,test,full]" "setuptools<82"
- name: Run contract tests
shell: bash
run: pytest tests/contract -v
integrated-tests:
name: Integrated Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Faithful copy of upstream tests.yml's integrated-tests matrix.
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# Pin setuptools <82 on EVERY platform. setuptools >= 82 removes
# pkg_resources entirely, and lark-oapi's namespace packages still
# call pkg_resources.declare_namespace at import time. On a fresh
# install the resulting ImportError falls through lark-oapi's
# pkgutil fallback and works, but the macOS runners upgrade the
# legacy setuptools (65.5.0) in-place, leaving a half-removed
# pkg_resources (module present, declare_namespace gone) that
# raises AttributeError the fallback does not catch — crashing the
# Feishu mock IM integration tests. Pinning everywhere removes
# that failure mode and future-proofs the other platforms too
# (they already resolved to 84.0.0 with all tests green in the
# verification run). The pin must ride in the SAME pip command as
# the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
pip install -e ".[dev,test,full]" "setuptools<82"
# Upstream gates the integrated tier with `-m "integration and p0"` for
# pull_request events (fast feedback). Fork pushes are not PR events, but
# the intent here is the same pre-merge signal, so we hard-code p0.
# Non-Linux runners get the same lifted HTTP timeout upstream applies.
- name: Run integrated tests
shell: bash
env:
QWENPAW_INTEGRATION_HTTP_TIMEOUT: ${{ matrix.os != 'ubuntu-latest' && '120' || '' }}
run: |
pytest tests/integration -v \
-n auto --dist=loadscope --timeout=300 \
-m "integration and p0"
+65
View File
@@ -0,0 +1,65 @@
name: PR Spam Gate
# Reusable workflow: checks if a PR author has more than 10 open PRs in this repo.
# Uses the Search API with per_page=1 to read total_count directly — no pagination needed.
# Called by other workflows to skip expensive jobs when a PR is auto-closed for spam.
on:
workflow_call:
inputs:
author:
description: "GitHub login of the PR author"
required: true
type: string
outputs:
blocked:
description: "'true' if the author has >10 open PRs and should be blocked, 'false' otherwise"
value: ${{ jobs.gate.outputs.blocked }}
jobs:
gate:
name: Check Open PR Count
runs-on: ubuntu-latest
outputs:
blocked: ${{ steps.check.outputs.blocked }}
steps:
- name: Count author's open PRs in this repo
id: check
uses: actions/github-script@v7
with:
script: |
const author = '${{ inputs.author }}';
// Bypass for repo maintainers and admins.
try {
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: author,
});
if (['admin', 'maintain'].includes(perm.permission)) {
console.log(`@${author} is a repo ${perm.permission} — bypassing spam gate`);
core.setOutput('blocked', 'false');
return;
}
} catch (permErr) {
// 404 = not a collaborator, proceed with the check.
if (permErr.status !== 404) {
console.log(`Permission check warning: ${permErr.message} — proceeding with spam check`);
}
}
try {
// per_page=1 is enough — we only need total_count, not the actual items.
const { data } = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} type:pr is:open author:${author}`,
per_page: 1,
});
const count = data.total_count;
console.log(`@${author} has ${count} open PR(s) in this repo`);
core.setOutput('blocked', count > 10 ? 'true' : 'false');
} catch (err) {
// On API error (e.g. rate-limit), fail open — don't block legitimate contributors.
console.log(`Gate check failed for @${author}: ${err.message} — allowing through`);
core.setOutput('blocked', 'false');
}
+129
View File
@@ -0,0 +1,129 @@
name: PR Under Review Label
# Automatically adds "Under Review" label when a maintainer (admin/maintain/write permission)
# comments on or reviews a PR.
# Note: Review events may not work on fork PRs due to GitHub Actions permission restrictions,
# but the workflow will exit gracefully without errors.
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
pull_request_review_comment:
types: [created]
jobs:
add-under-review-label:
# Only run on pull requests
if: github.event.issue.pull_request || github.event.pull_request
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Add Under Review label
uses: actions/github-script@v7
with:
script: |
// Get commenter/reviewer information and PR details
let commenter;
let commenterType;
let prNumber;
let prAuthor;
if (context.eventName === 'issue_comment') {
commenter = context.payload.comment.user.login;
commenterType = context.payload.comment.user.type;
prNumber = context.payload.issue.number;
prAuthor = context.payload.issue.user.login;
} else if (context.eventName === 'pull_request_review') {
commenter = context.payload.review.user.login;
commenterType = context.payload.review.user.type;
prNumber = context.payload.pull_request.number;
prAuthor = context.payload.pull_request.user.login;
} else if (context.eventName === 'pull_request_review_comment') {
commenter = context.payload.comment.user.login;
commenterType = context.payload.comment.user.type;
prNumber = context.payload.pull_request.number;
prAuthor = context.payload.pull_request.user.login;
}
core.info(`Processing from @${commenter} (type: ${commenterType}) on PR #${prNumber} by @${prAuthor}`);
// Ignore bots
if (commenterType === 'Bot' || commenter.endsWith('[bot]')) {
core.info(`@${commenter} is a bot, skipping`);
return;
}
// Ignore PR author self-comments
if (commenter === prAuthor) {
core.info(`@${commenter} is the PR author, skipping self-comment`);
return;
}
// Check commenter's permission level
core.info(`Checking permissions for @${commenter}`);
let permission;
try {
const response = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: commenter,
});
permission = response.data;
} catch (error) {
// Handle non-collaborators (404) or other API errors
if (error.status === 404) {
core.info(`@${commenter} is not a collaborator, skipping`);
return;
}
// For other errors, log and exit gracefully
core.warning(`Failed to get permissions for @${commenter}: ${error.message}`);
return;
}
core.info(`@${commenter} permission level: ${permission.permission}`);
// Check if user has admin, maintain, or write permission
const allowedPermissions = ['admin', 'maintain', 'write'];
if (!allowedPermissions.includes(permission.permission)) {
core.info(`@${commenter} has insufficient permissions (${permission.permission}), skipping`);
return;
}
// Check if label already exists before adding
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
});
const hasLabel = labels.some(label => label.name === 'Under Review');
if (hasLabel) {
core.info(`PR #${prNumber} already has "Under Review" label, skipping`);
return;
}
// Add label
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['Under Review'],
});
core.info(`Successfully added "Under Review" label to PR #${prNumber}`);
} catch (error) {
if (error.status === 403) {
core.info(`Unable to add label due to permissions (403). This is expected for review events on fork PRs.`);
} else {
core.warning(`Failed to add label: ${error.message}`);
}
}
+444
View File
@@ -0,0 +1,444 @@
name: PR Welcome Bot
on:
pull_request_target:
types: [opened]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- name: Welcome and Label First-Time PR Author
uses: actions/github-script@v7
with:
script: |
const author = context.payload.pull_request.user.login;
const prNumber = context.payload.pull_request.number;
const prTitle = context.payload.pull_request.title;
const prBody = context.payload.pull_request.body || '';
// ---------------------------------------------------------------
// Spam gate: close if author has >10 open PRs in this repo.
// Bypassed for repo maintainers and admins.
// per_page=1 is sufficient — we only need total_count.
// ---------------------------------------------------------------
try {
// Bypass for repo maintainers / admins.
try {
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: author,
});
if (['admin', 'maintain'].includes(perm.permission)) {
console.log(`@${author} is a repo ${perm.permission} — bypassing spam gate`);
throw new Error('__bypass__');
}
} catch (permErr) {
if (permErr.message === '__bypass__') throw permErr;
// 404 = not a collaborator, proceed with spam check.
if (permErr.status !== 404) {
console.log(`Permission check warning: ${permErr.message} — proceeding with spam check`);
}
}
const { data: openResult } = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} type:pr is:open author:${author}`,
per_page: 1,
});
const openCount = openResult.total_count;
console.log(`@${author} has ${openCount} open PR(s) in this repo`);
if (openCount > 10) {
// Ensure the label exists (create it if missing)
try {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Close-and-review-later',
color: 'e4e669',
description: 'Closed automatically for later review',
});
} catch (labelErr) {
// 422 = label already exists, that's fine
if (labelErr.status !== 422) console.log(`Label creation warning: ${labelErr.message}`);
}
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['Close-and-review-later'],
});
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
state: 'closed',
});
const warningComment = [
`<div align="center">`,
``,
`<img src="https://img.alicdn.com/imgextra/i2/O1CN01eSmIfy1hJImze8NN8_!!6000000004256-2-tps-1858-1858.png" width="80" height="80" />`,
``,
`</div>`,
``,
`Hi @${author},`,
``,
`This pull request has been **automatically closed** because you currently have more than **10 open pull requests** in this repository.`,
``,
`> **Why this happened**`,
`> Our [contribution policy](https://github.com/${context.repo.owner}/${context.repo.repo}/issues/4333) asks contributors to maintain a manageable number of active pull requests to ensure fair use of maintainer resources. A high volume of simultaneous open PRs — especially those that are AI-generated and submitted without personal verification — places a significant burden on maintainers.`,
``,
`**What you can do:**`,
`1. Review your open pull requests and close any that are no longer relevant, are duplicated, or have not been personally verified.`,
`2. Once you have fewer than 10 open pull requests, you are welcome to reopen this PR or submit a new one.`,
`3. Please ensure every PR you submit has been **personally tested**, addresses a verified issue, and follows our [pull request guidelines](https://github.com/${context.repo.owner}/${context.repo.repo}/issues/4333).`,
``,
`This pull request has been labeled \`Close-and-review-later\` and may be revisited by a maintainer.`,
``,
`Thank you for your understanding. 🐾`,
``,
`---`,
``,
`你好 @${author},`,
``,
`由于你目前在本仓库有超过 **10 个处于 open 状态的 PR**,此 pull request 已被**自动关闭**。`,
``,
`> **原因说明**`,
`> 根据我们的[贡献规范](https://github.com/${context.repo.owner}/${context.repo.repo}/issues/4333),为保障维护者资源的合理使用,我们要求贡献者控制活跃 PR 的数量。大量未经人工验证的 open PR(尤其是 AI 生成内容)会给维护者带来沉重负担。`,
``,
`**你可以采取以下措施:**`,
`1. 检查并关闭不再相关、重复或未经本人验证的 open PR。`,
`2. 当你的 open PR 数量少于 10 个时,欢迎重新开启此 PR 或提交新的 PR。`,
`3. 请确保每个 PR 均经过**本人亲自测试**,针对已验证的问题,并遵循我们的 [PR 提交规范](https://github.com/${context.repo.owner}/${context.repo.repo}/issues/4333)。`,
``,
`此 PR 已被标记为 \`Close-and-review-later\`,维护者可能会在后续进行审核。`,
``,
`感谢你的理解与配合。🐾`,
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: warningComment,
});
console.log(`Closed PR #${prNumber} for @${author} — open PR limit exceeded (${openCount} open)`);
return;
}
} catch (spamErr) {
if (spamErr.message !== '__bypass__') {
// Fail open: if the check itself errors, don't block legitimate contributors.
console.log(`Spam gate check failed: ${spamErr.message} — continuing with normal welcome`);
}
}
// ---------------------------------------------------------------
// Check if Chinese characters exist in title
const hasChinese = /[\u4e00-\u9fff]/.test(prTitle);
// Helper function for English ordinal suffix (1st, 2nd, 3rd, 4th...)
function getOrdinalSuffix(num) {
const j = num % 10;
const k = num % 100;
if (j === 1 && k !== 11) return 'st';
if (j === 2 && k !== 12) return 'nd';
if (j === 3 && k !== 13) return 'rd';
return 'th';
}
// Count user's total PRs in this repo using search API
let prCount = 0;
let hasValidPRCount = false;
try {
const { data: searchResult } = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${author}`,
});
prCount = searchResult.total_count;
hasValidPRCount = true;
} catch (err) {
console.log(`Could not get PR count for ${author}, will skip count display`);
hasValidPRCount = false;
}
// Check if this is user's first PR (for labeling)
let isFirstPR = false;
try {
const { data: searchResult } = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${author} is:closed`,
});
isFirstPR = searchResult.total_count === 0;
// Add first-time-contributor label only for first PR
if (isFirstPR) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['first-time-contributor'],
});
console.log(`Labeled PR #${prNumber} as first-time-contributor`);
}
} catch (err) {
if (err.status === 422 && err.message && err.message.includes('cannot be searched')) {
console.log(`Search API cannot look up author ${author}, continuing without label`);
} else {
throw err;
}
}
// Check if user has starred the repo by listing user's starred
// repos
let hasStarred = false;
try {
const fullRepoName = `${context.repo.owner}/${context.repo.repo}`;
let page = 1;
let found = false;
while (page <= 10 && !found) {
const { data: starredRepos } = await github.rest.activity.listReposStarredByUser({
username: author,
per_page: 100,
page: page
});
if (starredRepos.length === 0) break;
found = starredRepos.some(repo => repo.full_name === fullRepoName);
if (found) {
hasStarred = true;
console.log(`User ${author} has starred the repo`);
break;
}
page++;
}
if (!found) {
console.log(`User ${author} has not starred the repo`);
}
} catch (error) {
console.log(
`Could not verify star status for ${author}:`,
error.message
);
}
// Check if PR uses template properly
const hasDescription = prBody.includes('## Description') &&
prBody.length > 100;
const hasTypeOfChange = prBody.includes('## Type of Change');
const hasComponents = prBody.includes('## Component(s) Affected');
const hasChecklist = prBody.includes('## Checklist');
const hasTesting = prBody.includes('## Testing');
const usedTemplate = hasDescription && hasTypeOfChange &&
hasComponents && hasChecklist;
// Calculate milestone celebration (shared by both branches)
// 🏆 = 100, 🎖️ = 50, 🏅 = 10
let isMilestone = false;
let medalEmoji = '';
if (hasValidPRCount && !isFirstPR && prCount % 10 === 0) {
isMilestone = true;
// Calculate medal composition
const hundreds = Math.floor(prCount / 100);
const remainder1 = prCount % 100;
const fifties = Math.floor(remainder1 / 50);
const remainder2 = remainder1 % 50;
const tens = Math.floor(remainder2 / 10);
medalEmoji = '🏆'.repeat(hundreds) + '🎖️'.repeat(fifties) + '🏅'.repeat(tens);
}
// Build comment
let comment = '';
if (hasChinese) {
// Bilingual response with logo
comment = `<div align="center">\n\n`;
comment += `<img src="https://img.alicdn.com/imgextra/i2/O1CN01eSmIfy1hJImze8NN8_!!6000000004256-2-tps-1858-1858.png" width="80" height="80" />\n\n`;
comment += `## 欢迎来到 QwenPaw! 🐾 Welcome to QwenPaw!\n\n`;
comment += `</div>\n\n`;
if (hasValidPRCount) {
if (isFirstPR) {
comment += `你好 @${author},感谢你提交的第一个 Pull Request!🎉\n`;
comment += `Hi @${author}, thank you for your first Pull Request! 🎉\n\n`;
} else {
comment += `你好 @${author},这是你提交的第 ${prCount} 个 Pull Request。\n`;
comment += `Hi @${author}, this is your ${prCount}${getOrdinalSuffix(prCount)} Pull Request.\n\n`;
// Add milestone celebration if applicable
if (isMilestone) {
comment += `### 🎁 里程碑庆祝 / Milestone Celebration\n\n`;
comment += `${medalEmoji} 恭喜!这是你的第 ${prCount} 个贡献,感谢你对 QwenPaw 的持续支持!你是 QwenPaw 社区的重要成员!🐾\n`;
comment += `${medalEmoji} Congratulations! This is your ${prCount}${getOrdinalSuffix(prCount)} contribution. Thank you for your continued support! You're an important member of the QwenPaw community! 🐾\n\n`;
}
}
} else {
comment += `你好 @${author},感谢你的 Pull Request!🎉\n`;
comment += `Hi @${author}, thank you for your Pull Request! 🎉\n\n`;
}
if (!usedTemplate) {
comment += `### 📋 关于 Pull Request 模板 / About PR Template\n\n`;
comment += `为了帮助维护者更快地审查你的 PR,请确保包含以下信息:\n`;
comment += `To help maintainers review your PR faster, please make sure to include:\n\n`;
comment += `- ✅ **描述 / Description** - 说明这个 PR 做了什么以及为什么 / What this PR does and why\n`;
comment += `- ✅ **变更类型 / Type of Change** - Bug fix / Feature / Breaking change / Docs / Refactoring\n`;
comment += `- ✅ **影响的组件 / Component(s) Affected** - Core / Console / Channels / Skills / CLI / Docs / Tests / CI/CD\n`;
comment += `- ✅ **检查清单 / Checklist**:\n`;
comment += ` - 运行 \`pre-commit run --all-files\` 并通过 / Run and pass \`pre-commit run --all-files\`\n`;
comment += ` - 运行相关测试并通过 / Run and pass relevant tests\n`;
comment += ` - 更新文档(如需要)/ Update docs if needed\n`;
comment += `- ✅ **测试方法 / Testing** - 如何测试这些变更 / How to test these changes\n`;
comment += `- ✅ **本地验证证据 / Local Verification Evidence**:\n`;
comment += ` \`\`\`bash\n`;
comment += ` pre-commit run --all-files\n`;
comment += ` # paste summary result\n`;
comment += ` \n`;
comment += ` pytest\n`;
comment += ` # paste summary result\n`;
comment += ` \`\`\`\n\n`;
comment += `完整的 PR 信息可以加快审查速度。你可以编辑 PR 描述来补充这些内容。\n`;
comment += `Complete PR information helps speed up the review process. You can edit the PR description to add these details.\n\n`;
} else if (usedTemplate && !hasTesting) {
comment += `### 💡 小提示 / Quick Tip\n\n`;
comment += `看起来你使用了 PR 模板,太棒了!别忘了填写 **Testing** 部分,说明如何测试你的变更。\n`;
comment += `Great job using the PR template! Don't forget to fill in the **Testing** section with how to test your changes.\n\n`;
}
comment += `### 🙌 加入开发者社区 / Join Developer Community\n\n`;
comment += `非常感谢你的贡献!我们诚挚地邀请你加入 QwenPaw 官方开发者群!\n`;
comment += `Thanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group!\n\n`;
comment += `你可以在我们的文档页面的 "Developer Community" 部分找到 Discord 和钉钉群链接:\n`;
comment += `You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:\n`;
comment += `https://qwenpaw.agentscope.io/docs/community\n\n`;
comment += `我们真诚地感谢你的热情,也期待你未来的更多贡献!😊\n`;
comment += `We truly appreciate your enthusiasm—and look forward to your future contributions! 😊\n\n`;
comment += `我们会尽快审查你的 PR。\n`;
comment += `We'll review your PR soon.\n\n`;
// Star reminder at the end
if (!hasStarred) {
comment += `---\n\n`;
comment += `> [!TIP]\n`;
comment += `> **⭐ 如果你觉得 QwenPaw 有帮助,请给我们一个 Star!**\n`;
comment += `> \n`;
comment += `> **⭐ If you find QwenPaw useful, please give us a Star!**\n`;
comment += `> \n`;
comment += `> <div align="center">\n`;
comment += `> \n`;
comment += `> <a href="https://github.com/agentscope-ai/QwenPaw"><img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" alt="Star QwenPaw" width="600" /></a>\n`;
comment += `> \n`;
comment += `> </div>\n`;
comment += `> \n`;
comment += `> **掌握最新动态 / Staying ahead**\n`;
comment += `> \n`;
comment += `> 在 GitHub 上 Star QwenPaw,第一时间收到新版本发布通知。\n`;
comment += `> \n`;
comment += `> Star QwenPaw on GitHub and be instantly notified of new releases.\n`;
comment += `> \n`;
comment += `> 你的 star 将帮助更多开发者发现这个项目!🐾\n`;
comment += `> \n`;
comment += `> Your star helps more developers discover this project! 🐾`;
}
} else {
// English only with logo
comment = `<div align="center">\n\n`;
comment += `<img src="https://img.alicdn.com/imgextra/i2/O1CN01eSmIfy1hJImze8NN8_!!6000000004256-2-tps-1858-1858.png" width="80" height="80" />\n\n`;
comment += `## Welcome to QwenPaw! 🐾\n\n`;
comment += `</div>\n\n`;
if (hasValidPRCount) {
if (isFirstPR) {
comment += `Hi @${author}, thank you for your first Pull Request! 🎉\n\n`;
} else {
comment += `Hi @${author}, this is your ${prCount}${getOrdinalSuffix(prCount)} Pull Request.\n\n`;
// Add milestone celebration if applicable
if (isMilestone) {
comment += `### 🎁 Milestone Celebration\n\n`;
comment += `${medalEmoji} Congratulations! This is your ${prCount}${getOrdinalSuffix(prCount)} contribution. Thank you for your continued support! You're an important member of the QwenPaw community! 🐾\n\n`;
}
}
} else {
comment += `Hi @${author}, thank you for your Pull Request! 🎉\n\n`;
}
if (!usedTemplate) {
comment += `### 📋 About PR Template\n\n`;
comment += `To help maintainers review your PR faster, please make sure to include:\n\n`;
comment += `- ✅ **Description** - What this PR does and why\n`;
comment += `- ✅ **Type of Change** - Bug fix / Feature / Breaking change / Documentation / Refactoring\n`;
comment += `- ✅ **Component(s) Affected** - Core / Console / Channels / Skills / CLI / Documentation / Tests / CI/CD / Scripts\n`;
comment += `- ✅ **Checklist**:\n`;
comment += ` - Run and pass \`pre-commit run --all-files\`\n`;
comment += ` - Run and pass relevant tests (\`pytest\` or as applicable)\n`;
comment += ` - Update documentation if needed\n`;
comment += `- ✅ **Testing** - How to test these changes\n`;
comment += `- ✅ **Local Verification Evidence**:\n`;
comment += ` \`\`\`bash\n`;
comment += ` pre-commit run --all-files\n`;
comment += ` # paste summary result\n`;
comment += ` \n`;
comment += ` pytest\n`;
comment += ` # paste summary result\n`;
comment += ` \`\`\`\n\n`;
comment += `Complete PR information helps speed up the review process. You can edit the PR description to add these details.\n\n`;
} else if (usedTemplate && !hasTesting) {
comment += `### 💡 Quick Tip\n\n`;
comment += `Great job using the PR template! Don't forget to fill in the **Testing** section with how to test your changes.\n\n`;
}
comment += `### 🙌 Join Developer Community\n\n`;
comment += `Thanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:\n`;
comment += `https://qwenpaw.agentscope.io/docs/community\n\n`;
comment += `We truly appreciate your enthusiasm—and look forward to your future contributions! 😊\n\n`;
comment += `We'll review your PR soon.\n\n`;
// Star reminder at the end
if (!hasStarred) {
comment += `---\n\n`;
comment += `> [!TIP]\n`;
comment += `> **⭐ If you find QwenPaw useful, please give us a Star!**\n`;
comment += `> \n`;
comment += `> <div align="center">\n`;
comment += `> \n`;
comment += `> <a href="https://github.com/agentscope-ai/QwenPaw"><img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" alt="Star QwenPaw" width="600" /></a>\n`;
comment += `> \n`;
comment += `> </div>\n`;
comment += `> \n`;
comment += `> **Staying ahead**\n`;
comment += `> \n`;
comment += `> Star QwenPaw on GitHub and be instantly notified of new releases.\n`;
comment += `> \n`;
comment += `> Your star helps more developers discover this project! 🐾`;
}
}
// Post comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: comment
});
const logMessage = hasValidPRCount
? `Posted welcome comment on PR #${prNumber} for @${author} (PR #${prCount}${isFirstPR ? ', first-time contributor' : ''})`
: `Posted welcome comment on PR #${prNumber} for @${author}${isFirstPR ? ' (first-time contributor)' : ''}`;
console.log(logMessage);
+84
View File
@@ -0,0 +1,84 @@
name: Pre-commit Checks
on:
push:
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so the checks really run
# right after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
jobs:
spam-gate:
name: PR Spam Gate
if: github.event_name == 'pull_request'
uses: ./.github/workflows/pr-spam-gate.yml
with:
author: ${{ github.event.pull_request.user.login }}
run:
name: Pre-commit
needs: [spam-gate]
if: |
always() &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true')
runs-on: ubuntu-latest
strategy:
fail-fast: true
env:
OS: ubuntu-latest
PYTHON: "3.11"
steps:
# Draft PRs defer the real run: this job still reports a green
# placeholder so the required-check context stays present (GitHub
# forbids merging drafts), and the ready_for_review trigger
# re-runs everything once the PR is marked ready.
- name: Detect draft PR
id: draft
shell: bash
run: |
if [ "${{ github.event_name }}" = "pull_request" ] && \
[ "${{ github.event.pull_request.draft }}" = "true" ]; then
echo "value=true" >> "$GITHUB_OUTPUT"
else
echo "value=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v4
if: steps.draft.outputs.value != 'true'
- name: Setup Python
if: steps.draft.outputs.value != 'true'
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Update setuptools and wheel
if: steps.draft.outputs.value != 'true'
run: |
pip install setuptools==68.2.2 wheel==0.41.2
- name: Install QwenPaw with dev dependencies
if: steps.draft.outputs.value != 'true'
run: |
pip install -q -e ".[dev]"
- name: Install pre-commit hooks
if: steps.draft.outputs.value != 'true'
run: |
pre-commit install
- name: Run pre-commit
if: steps.draft.outputs.value != 'true'
run: |
pre-commit run --all-files 2>&1 | tee pre-commit.log || true
if grep -q Failed pre-commit.log; then
echo -e "\e[41m [**FAIL**] pre-commit checks failed. Run 'pre-commit run --all-files' locally, commit any auto-fixes, then push again. \e[0m"
exit 1
fi
echo -e "\e[46m ********************************Passed******************************** \e[0m"
- name: Report draft placeholder
if: steps.draft.outputs.value == 'true'
shell: bash
run: echo "✅ Draft PR — pre-commit checks deferred until the PR is marked ready for review"
+109
View File
@@ -0,0 +1,109 @@
# Publish Python package to PyPI when a release is created.
# Build includes console frontend (see scripts/wheel_build.sh).
# Manual trigger: can optionally force push to PyPI or just upload artifacts.
# Release trigger: publishes to PyPI.
#
# Pipeline: build → verify (install + boot + health-check) → publish.
name: Publish Python Package to PyPI
on:
workflow_dispatch:
inputs:
force_push_to_pypi:
description: 'Force push to PyPI (even without release)'
required: false
type: boolean
default: false
# NOTE: legacy fallback path. The standard release flow is now release.yml
# (see RELEASING.md). Publishing a GitHub Release directly still triggers this
# OLD publish, which is NOT gated on the desktop build. Kept only as an
# emergency rollback until the old release workflows are removed.
release:
types: [published]
permissions:
contents: read
jobs:
# ── Stage 1: Build wheel ───────────────────────────────────────────────────
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node (for console build)
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Build console frontend
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Bundle docs into package
run: |
rm -rf src/qwenpaw/docs
mkdir -p src/qwenpaw/docs
cp website/public/docs/*.md src/qwenpaw/docs/
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Build package
run: python -m build
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: qwenpaw-dist
path: dist/
retention-days: 30
- name: Upload version metadata
uses: actions/upload-artifact@v4
with:
name: qwenpaw-version
path: src/qwenpaw/__version__.py
retention-days: 30
# ── Stage 2: Verify installation ───────────────────────────────────────────
verify:
needs: [build]
uses: ./.github/workflows/release-verify.yml
with:
verify_pip: true
verify_script_install: true
# ── Stage 3: Publish to PyPI ───────────────────────────────────────────────
publish:
needs: [verify, build]
runs-on: ubuntu-latest
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.force_push_to_pypi == 'true')
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: qwenpaw-dist
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
+346
View File
@@ -0,0 +1,346 @@
# Standalone release pipeline for the QwenPaw-Data (qwenpaw-data) plugin.
#
# Unlike plugins-release.yml (which publishes ALL plugins on every main
# QwenPaw GitHub Release), this workflow is driven by the qwenpaw-data plugin's
# own version: it fires when plugins/apps/qwenpaw-data/plugin.json changes, and
# only uploads to OSS when that version is not yet on the CDN. Can also be
# run manually via the Actions tab (with an optional force flag).
#
# The qwenpaw-data frontend embeds the qwenpaw-data-context console as vendored
# static assets. They are not committed to this repo, so the upload job
# checks out the public QwenPaw-Data repository at a pinned ref and runs
# the plugin's sync-context-ui.sh before building ui/dist. The packer's
# pack_requires validation (declared in plugin.json) fails the run if any
# required artifact is missing.
name: QwenPaw Data Plugin Release
on:
push:
branches: [main]
paths:
- "plugins/apps/qwenpaw-data/plugin.json"
workflow_dispatch:
inputs:
force:
description: "Re-upload even if this version already exists on OSS"
required: false
type: boolean
default: false
data_ref:
description: "QwenPaw-Data ref to vendor the context console from"
required: false
type: string
# Least-privilege token: this workflow only reads the repo; all uploads
# go through ossutil with OSS secrets.
permissions:
contents: read
concurrency:
# Shared with plugins-release.yml so index merges never run concurrently.
group: plugins-release
cancel-in-progress: false
env:
PLUGIN_DIR: plugins/apps/qwenpaw-data
PLUGIN_ID: qwenpaw-data
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
should_publish: ${{ steps.decide.outputs.should_publish }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read qwenpaw-data plugin version
id: version
run: |
version=$(jq -r '.version' "${PLUGIN_DIR}/plugin.json")
if [[ -z "$version" || "$version" == "null" ]]; then
echo "ERROR: no version in ${PLUGIN_DIR}/plugin.json" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "qwenpaw-data plugin version: $version"
- name: Install ossutil
run: |
wget -q https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip -q ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Decide whether to publish
id: decide
env:
VERSION: ${{ steps.version.outputs.version }}
FORCE: ${{ github.event.inputs.force }}
run: |
# Publish only when this exact version is missing from the plugins
# index (or when forced via workflow_dispatch). Keeps re-runs and
# non-version edits to plugin.json idempotent.
#
# Read the authoritative index straight from OSS, matching
# creator-release.yml / plugins-release.yml. The public CDN is NOT
# trustworthy here: overseas edges were observed serving gzip
# bodies without content negotiation and intermittent 403s on
# origin pulls.
#
# Fail closed: only a confirmed NoSuchKey/404 counts as "no index
# yet". Auth, network or JSON failures abort the run instead of
# being misread as a green light to overwrite published objects.
file_id="${PLUGIN_ID}-${VERSION}"
if [[ "$FORCE" == "true" ]]; then
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "Force publish requested for ${file_id}."
exit 0
fi
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/metadata/plugins/index.json" 2>&1); then
ossutil cp "oss://qwenpaw-download/metadata/plugins/index.json" \
plugins-index.json
published=$(jq -r --arg id "$file_id" '.files | has($id)' \
plugins-index.json) || {
echo "ERROR: OSS plugins index is not valid JSON." >&2
exit 1
}
elif grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
published="false"
else
echo "ERROR: could not stat the plugins index on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
if [[ "$published" == "true" ]]; then
echo "should_publish=false" >> "$GITHUB_OUTPUT"
echo "${file_id} already on CDN; skipping upload."
else
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "${file_id} not on CDN yet; will publish."
fi
upload-oss:
runs-on: ubuntu-latest
needs: check-version
if: needs.check-version.outputs.should_publish == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout QwenPaw-Data (context console sources)
uses: actions/checkout@v4
with:
repository: agentscope-ai/QwenPaw-Data
# Pinned for reproducible vendoring; bump together with the
# plugin version, or override per-run via the data_ref input.
# Pinned to the QwenPaw-Data rename commit (PR
# agentscope-ai/QwenPaw-Data#32, branch chore/rename-qwenpaw-data):
# no tag or main commit carries the renamed
# packages/qwenpaw-data-context/frontend layout yet. Once #32
# merges and is tagged, move this default to that tag.
ref: ${{ github.event.inputs.data_ref || '99ef4f31f6fbf6ded6596c1e4aa7a3c8105946d7' }}
path: qwenpaw-data
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: plugins/apps/qwenpaw-data/ui/package-lock.json
- name: Vendor the context console
run: |
# Builds the qwenpaw-data-context frontend from the QwenPaw-Data
# checkout, patches it for static hash routing, injects the auth
# bridge, and lands the output in ui/public/context-console.
QWENPAW_DATA_SOURCE_DIR="${GITHUB_WORKSPACE}/qwenpaw-data" \
"${PLUGIN_DIR}/scripts/sync-context-ui.sh"
- name: Build qwenpaw-data plugin frontend
run: |
npm --prefix "${PLUGIN_DIR}/ui" ci
npm --prefix "${PLUGIN_DIR}/ui" run build
- name: Pack qwenpaw-data plugin and build index
run: |
# pack_requires in plugin.json makes this step fail loudly when
# ui/dist or the vendored console assets are missing.
python scripts/pack/generate_plugin_metadata.py \
--plugins-root plugins \
--dist dist/plugins \
--metadata-out dist/plugins/index.json \
--cdn-prefix /files/plugins \
--only "${PLUGIN_ID}"
- name: Verify packaged zip is runtime-only
env:
VERSION: ${{ needs.check-version.outputs.version }}
run: |
# Fail closed before OSS upload: entry files must be present and
# pack_exclude'd dev-only trees must not leak into the zip.
zip_path="dist/plugins/apps/${PLUGIN_ID}/${PLUGIN_ID}-${VERSION}.zip"
if [[ ! -f "$zip_path" ]]; then
echo "ERROR: expected zip not found: $zip_path" >&2
exit 1
fi
names=$(unzip -Z1 "$zip_path")
for required in \
"${PLUGIN_ID}/plugin.json" \
"${PLUGIN_ID}/backend/main.py" \
"${PLUGIN_ID}/ui/dist/index.js" \
"${PLUGIN_ID}/ui/dist/context-console/index.html" \
"${PLUGIN_ID}/ui/dist/app/logo-mark-v4.png"; do
if ! grep -qxF "$required" <<< "$names"; then
echo "ERROR: required file missing from zip: $required" >&2
exit 1
fi
done
if forbidden=$(grep -E \
"^${PLUGIN_ID}/(ui/(src|public|node_modules)/|\.venv-qwenpaw-data/|\.qwenpaw-data-dev/)" \
<<< "$names"); then
echo "ERROR: dev-only files leaked into the zip:" >&2
echo "$forbidden" | head -20 >&2
exit 1
fi
echo "Zip verified: $(wc -l <<< "$names") files, runtime-only."
- name: Install ossutil
run: |
wget -q https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip -q ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Sync qwenpaw-data plugin zip to OSS (long-cache, immutable)
env:
FORCE: ${{ github.event.inputs.force }}
run: |
shopt -s nullglob
while IFS= read -r -d '' f; do
rel="${f#dist/plugins/}"
# Versioned zips are advertised as immutable; never overwrite
# an existing object except on an explicit manual force run.
# A stat failure other than NoSuchKey aborts instead of
# risking an overwrite.
if [[ "$FORCE" != "true" ]]; then
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/files/plugins/${rel}" 2>&1); then
echo "Skipping ${rel}: already published and immutable."
continue
elif ! grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
echo "ERROR: could not stat files/plugins/${rel} on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
fi
echo "Uploading $f -> files/plugins/${rel}"
ossutil cp "$f" \
"oss://qwenpaw-download/files/plugins/${rel}" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=31536000, immutable"
done < <(find "dist/plugins/apps/${PLUGIN_ID}" -type f -name '*.zip' -print0 2>/dev/null || true)
- name: Merge historical versions into index
run: |
# Fail closed: a fetch error must never masquerade as "no index
# yet" and shrink the authoritative file list to this plugin.
# Only a confirmed NoSuchKey/404 may bootstrap an empty index.
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/metadata/plugins/index.json" 2>&1); then
ossutil cp "oss://qwenpaw-download/metadata/plugins/index.json" \
existing-index.json
python3 -c 'import json; json.load(open("existing-index.json"))' || {
echo "ERROR: existing plugins index is not valid JSON." >&2
exit 1
}
elif grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
echo "No plugins index on OSS yet; bootstrapping an empty one."
echo '{}' > existing-index.json
else
echo "ERROR: could not stat the plugins index on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
python3 scripts/pack/merge_plugin_index.py \
--new dist/plugins/index.json \
--old existing-index.json \
--out dist/plugins/index.json
- name: Upload plugins index (short-cache)
run: |
ossutil cp dist/plugins/index.json \
"oss://qwenpaw-download/metadata/plugins/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Patch main metadata index to advertise plugins product
run: |
# Same fail-closed rule for the top-level product index: only a
# confirmed NoSuchKey/404 may bootstrap a fresh skeleton.
if stat_out=$(ossutil stat \
"oss://qwenpaw-download/metadata/index.json" 2>&1); then
ossutil cp "oss://qwenpaw-download/metadata/index.json" \
main-index.json
python3 -c 'import json; json.load(open("main-index.json"))' || {
echo "ERROR: existing main index is not valid JSON." >&2
exit 1
}
elif grep -qiE 'NoSuchKey|StatusCode=404' <<< "$stat_out"; then
echo "No main index on OSS yet; bootstrapping a skeleton."
cat > main-index.json << 'EOF'
{
"version": "1.0",
"updated_at": "",
"products": {}
}
EOF
else
echo "ERROR: could not stat the main index on OSS:" >&2
echo "$stat_out" >&2
exit 1
fi
python3 scripts/pack/patch_main_index.py \
--index main-index.json \
--out main-index.json
ossutil cp main-index.json \
"oss://qwenpaw-download/metadata/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Summary
env:
VERSION: ${{ needs.check-version.outputs.version }}
run: |
echo "qwenpaw-data plugin ${VERSION} published. Index:"
cat dist/plugins/index.json | python3 -m json.tool | head -40 || true
+95
View File
@@ -0,0 +1,95 @@
name: Real behavior proof
# Check that PRs from external contributors include a real problem
# description and validation evidence in the PR body. Maintainer and
# bot PRs are auto-skipped.
#
# Ported from openclaw's real-behavior-proof system. Complements
# pr-spam-gate (which filters by volume) with a quality filter.
on:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
real-behavior-proof:
name: Real behavior proof
permissions:
contents: read
issues: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Use the workflow revision, not the PR head — never run
# untrusted PR code.
ref: ${{ github.workflow_sha }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Check real behavior proof
env:
GITHUB_TOKEN: ${{ github.token }}
run: python scripts/github/real_behavior_proof_check.py
- name: Add needs-context label on failure
# Fork PRs do not have permission to write labels on the target
# repository, so label manipulation is restricted to same-repo PRs.
# The proof check itself still runs for fork PRs.
if: |
failure() &&
github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const labels = pr.labels.map(l => l.name);
if (!labels.includes("triage: needs-pr-context")) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ["triage: needs-pr-context"],
});
}
- name: Remove needs-context label on success
# Same restriction as the add-label step above: fork PRs cannot
# write labels on the target repository.
if: |
success() &&
github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const labels = pr.labels.map(l => l.name);
if (labels.includes("triage: needs-pr-context")) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name: "triage: needs-pr-context",
});
}
+352
View File
@@ -0,0 +1,352 @@
# Auto-create a Release Duty issue for every published release
# (pre-release, stable, and post-release).
# Each platform gets its own assignee from an independent rotation list.
# Rotation is sequential: index = (number of releases published BEFORE
# this one) % list length. Stateless — derived from the GitHub Releases API.
# Supports manual dispatch for testing or re-triggering a missed duty issue.
name: Release Duty Issue
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag to create duty issue for (e.g. v1.1.11)"
required: true
type: string
release_type:
description: "Override release type (leave empty to auto-detect from tag)"
required: false
type: choice
options:
- "auto"
- beta
- alpha
- rc
- dev
- post
- stable
workflow_call:
inputs:
tag:
description: "Release tag to create the duty issue for"
required: true
type: string
release_type:
description: "Override release type (empty = auto-detect from tag)"
required: false
type: string
default: ""
permissions:
issues: write
contents: read
jobs:
create-duty-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install pyyaml requests
- name: Classify release type and compute assignees
id: meta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
CURRENT_TAG: >-
${{ github.event_name == 'release'
&& github.event.release.tag_name
|| inputs.tag }}
TYPE_OVERRIDE: ${{ inputs.release_type || '' }}
run: |
python - << 'EOF'
import os
import re
import json
import yaml
import requests
token = os.environ["GH_TOKEN"]
repo = os.environ["REPO"]
current_tag = os.environ["CURRENT_TAG"]
type_override = os.environ.get("TYPE_OVERRIDE", "").strip()
if type_override == "auto":
type_override = ""
# ── Classify release type ────────────────────────────────────────
if type_override:
release_type = type_override
else:
tag_lower = current_tag.lower()
if re.search(r"beta", tag_lower):
release_type = "beta"
elif re.search(r"alpha", tag_lower):
release_type = "alpha"
elif re.search(r"rc", tag_lower):
release_type = "rc"
elif re.search(r"dev", tag_lower):
release_type = "dev"
elif re.search(r"\.post\d*$", tag_lower):
release_type = "post"
else:
release_type = "stable"
print(f"Tag: {current_tag}, Release type: {release_type}")
# ── Count releases published BEFORE this one (rotation index) ───
headers = {"Authorization": f"Bearer {token}"}
url = f"https://api.github.com/repos/{repo}/releases"
all_releases = []
page = 1
while True:
r = requests.get(
url,
headers=headers,
params={"per_page": 100, "page": page},
)
r.raise_for_status()
batch = r.json()
if not batch:
break
all_releases.extend(batch)
page += 1
previous = [
rel for rel in all_releases
if rel["tag_name"] != current_tag
]
idx = len(previous)
print(f"Previous releases: {idx}, rotation index: {idx}")
# ── Pick assignees from roster ───────────────────────────────────
roster_path = ".github/release-duty-roster.yml"
with open(roster_path) as f:
roster = yaml.safe_load(f)
result = {}
for platform in ("pypi", "docker", "macos", "windows"):
rotation = roster.get(platform, {}).get("rotation", [])
if rotation:
slot = idx % len(rotation)
github_user = rotation[slot]
result[platform] = {"github": github_user}
print(f"{platform}: slot={slot}, assignee={github_user}")
else:
result[platform] = {"github": ""}
print(f"{platform}: no rotation configured")
# ── Write outputs ────────────────────────────────────────────────
out_path = os.environ["GITHUB_OUTPUT"]
with open(out_path, "a") as f:
f.write(f"assignees={json.dumps(result)}\n")
f.write(f"release_type={release_type}\n")
EOF
- name: Compute deadline (4h from now)
id: due
run: |
due=$(date -u -d '+4 hours' '+%Y-%m-%d %H:%M UTC' 2>/dev/null || \
date -u -v+4H '+%Y-%m-%d %H:%M UTC')
echo "due=${due}" >> "$GITHUB_OUTPUT"
- name: Create Duty Issue
uses: actions/github-script@v7
env:
ASSIGNEES_JSON: ${{ steps.meta.outputs.assignees }}
RELEASE_TYPE: ${{ steps.meta.outputs.release_type }}
DUE_TIME: ${{ steps.due.outputs.due }}
INPUT_TAG: ${{ inputs.tag }}
with:
script: |
const isManual = context.eventName !== 'release';
let tag, releaseUrl;
if (isManual) {
tag = process.env.INPUT_TAG.trim();
// Try to fetch the release URL from the API
try {
const { data: rel } = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag,
});
releaseUrl = rel.html_url;
} catch (_) {
releaseUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/releases/tag/${tag}`;
}
} else {
tag = context.payload.release.tag_name;
releaseUrl = context.payload.release.html_url;
}
const version = tag.replace(/^v/, '');
const dueTime = process.env.DUE_TIME;
const assignees = JSON.parse(process.env.ASSIGNEES_JSON);
const releaseType = process.env.RELEASE_TYPE;
// Human-readable badge for title / label
const typeBadge = {
beta: 'Beta',
alpha: 'Alpha',
rc: 'RC',
dev: 'Dev',
post: 'Post',
stable: 'Stable',
}[releaseType] || releaseType;
const mention = (platform) => {
const gh = assignees[platform]?.github;
return gh ? `@${gh}` : '_TBD_';
};
const body = `## Release Info
- **Version:** ${tag}
- **Type:** ${typeBadge}
- **Release page:** ${releaseUrl}
- **Deadline:** ${dueTime} (4 hours after publish)
## Pass Criteria
A platform **passes** only when all four checkpoints are green:
| Checkpoint | What to verify |
|------------|---------------|
| Install | Follow docs, exits without error |
| Launch | Service / app opens, UI is reachable |
| Configure model | Enter API key, select model, save succeeds |
| Basic chat | Send a message, receive a non-error reply |
**Any checkpoint fails → comment with repro steps → label \`installation-bug\` → ping maintainer.**
---
## PyPI — ${mention('pypi')}
\`\`\`bash
python -m venv /tmp/qwenpaw-test && source /tmp/qwenpaw-test/bin/activate
pip install qwenpaw==${version}
qwenpaw
\`\`\`
- [ ] Install succeeds (\`pip install\` exits cleanly)
- [ ] Launch succeeds (\`qwenpaw\` starts, browser UI reachable)
- [ ] Model configured (API key + model saved without error)
- [ ] Basic chat works (message sent, normal reply received)
**Environment:** OS: &nbsp; / Python: &nbsp; / Notes:
---
## Docker — ${mention('docker')}
\`\`\`bash
docker run --rm -p 8088:8088 agentscope/qwenpaw:${tag}
\`\`\`
- [ ] Image pulled successfully
- [ ] Container starts, \`http://localhost:8088\` reachable
- [ ] Model configured (API key + model saved without error)
- [ ] Basic chat works (message sent, normal reply received)
**Environment:** OS: &nbsp; / Docker: &nbsp; / Arch (amd64/arm64): &nbsp; / Notes:
---
## macOS Desktop — ${mention('macos')}
1. Go to the [Release page](${releaseUrl})
2. Download \`QwenPaw-${version}-macOS.zip\`
3. Unzip, drag \`QwenPaw.app\` to Applications, launch
- [ ] Download and unzip succeed
- [ ] App launches without crash
- [ ] Model configured (API key + model saved without error)
- [ ] Basic chat works (message sent, normal reply received)
**Environment:** macOS version: &nbsp; / Chip (Apple Silicon / Intel): &nbsp; / Notes:
---
## Windows Desktop — ${mention('windows')}
1. Go to the [Release page](${releaseUrl})
2. Download \`QwenPaw-Setup-${version}.exe\`
3. Run the installer, follow the wizard, launch QwenPaw
- [ ] Installer runs without error
- [ ] App launches without crash
- [ ] Model configured (API key + model saved without error)
- [ ] Basic chat works (message sent, normal reply received)
**Environment:** Windows version: &nbsp; / Notes:
---
## Summary
| Platform | Result | Assignee |
|----------|--------|----------|
| PyPI | ⬜ PENDING | ${mention('pypi')} |
| Docker | ⬜ PENDING | ${mention('docker')} |
| macOS Desktop | ⬜ PENDING | ${mention('macos')} |
| Windows Desktop | ⬜ PENDING | ${mention('windows')} |
**All PASS** → close this issue with label \`verified\`. Release proceeds normally.
**Any FAIL** → comment with repro steps + logs, add label \`installation-bug\`, ping maintainer to decide whether to block the release announcement.
`;
// Create issue first (without assignees to avoid 422 on
// repos where roster members aren't collaborators)
const { data: issue } = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `[Release Duty] QwenPaw ${tag} (${typeBadge}) — Installation Verification`,
body: body,
labels: ['release-duty', releaseType === 'stable' || releaseType === 'post'
? 'stable'
: 'pre-release'],
});
console.log(
`Created duty issue #${issue.number}: ${issue.html_url}`
);
// Try to assign platform owners; log warning if any aren't
// collaborators (the @mentions in the body still notify them)
const assigneeSet = [...new Set(
Object.values(assignees).map(a => a.github).filter(Boolean)
)];
if (assigneeSet.length > 0) {
try {
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
assignees: assigneeSet,
});
console.log(`Assigned: ${assigneeSet.join(', ')}`);
} catch (err) {
core.warning(
`Could not assign ${assigneeSet.join(', ')}: ${err.message}. ` +
`They are still @mentioned in the issue body.`
);
}
}
core.summary.addRaw(
`Created [Release Duty Issue #${issue.number}](${issue.html_url})`
);
await core.summary.write();
+370
View File
@@ -0,0 +1,370 @@
# Reusable verification gate: install the built artefacts, boot the server,
# and hit /api/version before any publish step runs.
# Called by publish-pypi.yml, docker-release.yml, and fork-verify.yml.
name: Release Verification
on:
workflow_call:
inputs:
verify_pip:
description: "Run pip-install-from-wheel verification"
type: boolean
default: false
verify_docker:
description: "Run Docker build + health-check verification"
type: boolean
default: false
verify_script_install:
description: "Run install-script (install.sh / install.ps1) verification"
type: boolean
default: false
docker_node_image:
description: "Override Dockerfile NODE_IMAGE build-arg (for fork without ACR access)"
type: string
default: ""
docker_uv_image:
description: "Override Dockerfile UV_IMAGE build-arg (for fork without ACR access)"
type: string
default: ""
ref:
description: "Git ref/SHA to checkout for docker/script verification (empty = default)"
type: string
default: ""
jobs:
# ── pip install wheel ──────────────────────────────────────────────────────
verify-pip:
if: inputs.verify_pip
name: Verify pip install - py${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: qwenpaw-dist
path: dist
- name: Download version file
uses: actions/download-artifact@v4
with:
name: qwenpaw-version
path: version-meta
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install wheel in clean venv
shell: bash
run: |
python -m venv .verify-venv
if [ "$RUNNER_OS" = "Windows" ]; then
VENV_BIN="$(cd .verify-venv/Scripts && pwd)"
else
VENV_BIN="$(cd .verify-venv/bin && pwd)"
fi
source "$VENV_BIN/activate"
python -m pip install --upgrade pip
pip install dist/*.whl
echo "$VENV_BIN" >> "$GITHUB_PATH"
- name: Read expected version
id: expected
shell: bash
run: |
ver=$(python -c "
import re, pathlib
text = pathlib.Path('version-meta/__version__.py').read_text()
print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', text).group(1))
")
echo "version=$ver" >> "$GITHUB_OUTPUT"
- name: Verify CLI version
shell: bash
run: |
actual=$(qwenpaw --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9.]*' | head -1)
expected="${{ steps.expected.outputs.version }}"
echo "Expected: $expected"
echo "Actual: $actual"
if [ "$actual" != "$expected" ]; then
echo "::error::Version mismatch: expected=$expected actual=$actual"
exit 1
fi
- name: Verify Python import
shell: bash
run: |
python -c "from qwenpaw.cli.main import cli; print('import OK')"
- name: Initialize and start server
shell: bash
run: |
qwenpaw init --defaults --accept-security
qwenpaw app --host 127.0.0.1 --port 8088 &
echo $! > "$RUNNER_TEMP/qwenpaw.pid" || true
- name: Wait for /api/version
shell: bash
run: |
for i in $(seq 1 60); do
if curl -sf http://127.0.0.1:8088/api/version; then
echo ""
echo "Server is up after ~$((i*2))s"
exit 0
fi
sleep 2
done
echo "::error::Server did not respond within 120s"
exit 1
- name: Verify server version
shell: bash
run: |
response=$(curl -sf http://127.0.0.1:8088/api/version)
server_ver=$(echo "$response" | python -c "import sys,json; print(json.load(sys.stdin)['version'])")
expected="${{ steps.expected.outputs.version }}"
echo "Server version: $server_ver"
if [ "$server_ver" != "$expected" ]; then
echo "::error::Server version mismatch: expected=$expected server=$server_ver"
exit 1
fi
- name: Stop server
if: always()
shell: bash
run: |
if [ -f "$RUNNER_TEMP/qwenpaw.pid" ]; then
kill "$(cat "$RUNNER_TEMP/qwenpaw.pid")" 2>/dev/null || true
fi
if [ "$RUNNER_OS" = "Linux" ] || [ "$RUNNER_OS" = "macOS" ]; then
lsof -ti:8088 | xargs kill 2>/dev/null || true
fi
if [ "$RUNNER_OS" = "Windows" ]; then
pid=$(netstat -ano 2>/dev/null | grep ':8088 ' | grep LISTEN | awk '{print $5}' | tr -d '\r' | head -1) || true
if [ -n "$pid" ]; then taskkill //F //PID "$pid" 2>/dev/null || true; fi
fi
# ── Docker build + health check ────────────────────────────────────────────
verify-docker:
if: inputs.verify_docker
name: Verify Docker image
runs-on: ubuntu-latest
timeout-minutes: 30
env:
ACR_REGISTRY: agentscope-registry.ap-southeast-1.cr.aliyuncs.com
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Get QwenPaw version
id: version
uses: ./.github/actions/get-version
- name: Log in to Aliyun ACR (when credentials available)
if: env.ACR_USERNAME != ''
uses: docker/login-action@v3
with:
registry: ${{ env.ACR_REGISTRY }}
username: ${{ secrets.ALIYUN_ACR_USERNAME }}
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
env:
ACR_USERNAME: ${{ secrets.ALIYUN_ACR_USERNAME }}
- name: Build Docker image (amd64 only)
env:
DOCKER_NODE_IMAGE: ${{ inputs.docker_node_image }}
DOCKER_UV_IMAGE: ${{ inputs.docker_uv_image }}
QWENPAW_VERSION: ${{ steps.version.outputs.version }}
run: |
BUILD_ARGS=""
if [ -n "$DOCKER_NODE_IMAGE" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg NODE_IMAGE=$DOCKER_NODE_IMAGE"
fi
if [ -n "$DOCKER_UV_IMAGE" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg UV_IMAGE=$DOCKER_UV_IMAGE"
fi
docker build \
-f deploy/Dockerfile \
-t qwenpaw-verify:test \
--build-arg \
QWENPAW_MANAGED_RUNTIME_BOUNDARY_VERSION="$QWENPAW_VERSION" \
$BUILD_ARGS \
.
- name: Verify managed runtime boundary version
env:
QWENPAW_VERSION: ${{ steps.version.outputs.version }}
run: |
actual=$(docker image inspect qwenpaw-verify:test \
--format '{{ index .Config.Labels "io.qwenpaw.managed-runtime-boundary.version" }}')
if [ "$actual" != "$QWENPAW_VERSION" ]; then
echo "::error::Runtime boundary version mismatch: $actual != $QWENPAW_VERSION"
exit 1
fi
- name: Start container
run: |
docker run -d \
--name qwenpaw-test \
-p 8088:8088 \
qwenpaw-verify:test
- name: Wait for /api/version
run: |
for i in $(seq 1 90); do
if curl -sf http://127.0.0.1:8088/api/version; then
echo ""
echo "Container is up after ~$((i*2))s"
exit 0
fi
sleep 2
done
echo "::error::Container did not respond within 180s"
docker logs qwenpaw-test
exit 1
- name: Verify container version
run: |
expected=$(python3 -c "
import re, pathlib
text = pathlib.Path('src/qwenpaw/__version__.py').read_text()
print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', text).group(1))
")
response=$(curl -sf http://127.0.0.1:8088/api/version)
echo "Response: $response"
actual=$(echo "$response" | python3 -c "import sys,json; print(json.load(sys.stdin)['version'])")
echo "Expected: $expected"
echo "Actual: $actual"
if [ "$actual" != "$expected" ]; then
echo "::error::Docker version mismatch: expected=$expected actual=$actual"
exit 1
fi
- name: Show container logs
if: always()
run: docker logs qwenpaw-test 2>&1 | tail -50
- name: Stop container
if: always()
run: docker rm -f qwenpaw-test 2>/dev/null || true
# ── Script install (install.sh / install.ps1) ──────────────────────────────
verify-script-install:
if: inputs.verify_script_install
name: Verify script install - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Set up Node.js (for console build during from-source install)
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Run install script (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
bash scripts/install.sh --from-source "$(pwd)"
- name: Run install script (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
.\scripts\install.ps1 -FromSource -SourceDir "$PWD"
- name: Verify CLI, init, start server, and health check
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
source "$USERPROFILE/.qwenpaw/venv/Scripts/activate"
else
export PATH="$HOME/.qwenpaw/bin:$PATH"
fi
# Verify version matches source
expected=$(python -c "
import re, pathlib
text = pathlib.Path('src/qwenpaw/__version__.py').read_text()
print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', text).group(1))
")
actual=$(qwenpaw --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9.]*' | head -1)
echo "Expected: $expected"
echo "Actual: $actual"
if [ "$actual" != "$expected" ]; then
echo "::error::Version mismatch: expected=$expected actual=$actual"
exit 1
fi
qwenpaw init --defaults --accept-security
qwenpaw app --host 127.0.0.1 --port 8088 &
echo $! > "$RUNNER_TEMP/qwenpaw.pid" || true
for i in $(seq 1 60); do
if curl -sf http://127.0.0.1:8088/api/version; then
echo ""
echo "Server is up after ~$((i*2))s"
exit 0
fi
sleep 2
done
echo "::error::Server did not respond within 120s"
exit 1
- name: Stop server
if: always()
shell: bash
run: |
if [ -f "$RUNNER_TEMP/qwenpaw.pid" ]; then
kill "$(cat "$RUNNER_TEMP/qwenpaw.pid")" 2>/dev/null || true
fi
if [ "$RUNNER_OS" = "Linux" ] || [ "$RUNNER_OS" = "macOS" ]; then
lsof -ti:8088 | xargs kill 2>/dev/null || true
fi
if [ "$RUNNER_OS" = "Windows" ]; then
pid=$(netstat -ano 2>/dev/null | grep ':8088 ' | grep LISTEN | awk '{print $5}' | tr -d '\r' | head -1) || true
if [ -n "$pid" ]; then taskkill //F //PID "$pid" 2>/dev/null || true; fi
fi
+577
View File
@@ -0,0 +1,577 @@
# QwenPaw unified release orchestrator (draft-driven, all-or-nothing).
#
# Flow (方案二 · 草稿变体):
# 1. A maintainer creates a DRAFT GitHub Release (tag + notes), does NOT publish.
# 2. They run this workflow (Actions ▸ Run workflow). It resolves the draft,
# pins every job to the draft's target commit, then builds + verifies ALL
# products in parallel (wheel / web verify / desktop win+mac / plugins).
# 3. Only if EVERY prepare job is green does the publish phase run: PyPI,
# Docker, desktop (GitHub assets + OSS), plugins. The draft is flipped to
# published LAST. Post-publish (inline): promote the desktop latest/updater,
# deploy the website (stable/post only — skipped for betas), and open the
# Release Duty issue.
# 4. If anything fails, nothing is published and the draft is left untouched
# (zero external trace; just fix and re-run).
#
# dry_run=true stubs the three production-external publishes (PyPI / Docker /
# OSS) so fork CI can exercise the gating + draft flip without touching prod.
# Draft-asset upload, the draft→published flip and the duty issue still run for
# real because on a fork they only affect the fork's own resources.
name: Release (unified)
on:
workflow_dispatch:
inputs:
tag:
description: "Draft release tag to publish (empty = auto-detect the single draft)"
required: false
type: string
default: ""
dry_run:
description: "Stub production publishes (PyPI/Docker/OSS) — use on forks"
required: false
type: boolean
default: false
permissions:
contents: write
issues: write
concurrency:
group: release-${{ inputs.tag || github.ref }}
cancel-in-progress: false
jobs:
# ── Resolve the draft, pin the commit, fail fast on missing secrets ─────────
resolve:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.pick.outputs.tag }}
sha: ${{ steps.pick.outputs.sha }}
is_prerelease: ${{ steps.pick.outputs.is_prerelease }}
steps:
- name: Resolve target draft release and commit
id: pick
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
INPUT_TAG: ${{ inputs.tag }}
run: |
set -euo pipefail
TAG="$INPUT_TAG"
if [ -z "$TAG" ]; then
drafts="$(gh release list --repo "$REPO" --limit 100 \
--json tagName,isDraft --jq '[.[] | select(.isDraft) | .tagName]')"
count="$(echo "$drafts" | jq 'length')"
if [ "$count" -eq 0 ]; then
echo "::error::No draft release found. Create a draft first or pass an explicit tag."
exit 1
fi
if [ "$count" -gt 1 ]; then
echo "::error::Multiple draft releases found: $(echo "$drafts" | jq -r 'join(", ")'). Pass an explicit tag to disambiguate."
exit 1
fi
TAG="$(echo "$drafts" | jq -r '.[0]')"
fi
echo "Target tag: $TAG"
isDraft="$(gh release view "$TAG" --repo "$REPO" --json isDraft --jq '.isDraft')"
if [ "$isDraft" != "true" ]; then
echo "::error::Release $TAG is not a draft; refusing to operate on a published release."
exit 1
fi
target="$(gh release view "$TAG" --repo "$REPO" --json targetCommitish --jq '.targetCommitish')"
sha="$(gh api "repos/$REPO/commits/$target" --jq '.sha')"
echo "Target commitish '$target' resolved to SHA $sha"
if [[ "$TAG" =~ (beta|alpha|rc|dev) ]]; then
is_prerelease=true
else
is_prerelease=false
fi
echo "Prerelease (tag-based): $is_prerelease"
{
echo "tag=$TAG"
echo "sha=$sha"
echo "is_prerelease=$is_prerelease"
} >> "$GITHUB_OUTPUT"
- name: Checkout the resolved commit
uses: actions/checkout@v4
with:
ref: ${{ steps.pick.outputs.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Validate tag matches src/qwenpaw/__version__.py
run: |
python -m pip install --quiet packaging
ver="$(sed -n 's/^__version__[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' src/qwenpaw/__version__.py)"
tag="${{ steps.pick.outputs.tag }}"
python - "${tag#v}" "$ver" <<'PY'
import sys
from packaging.version import InvalidVersion, Version
tag_ver, ver = sys.argv[1], sys.argv[2]
try:
if Version(tag_ver) != Version(ver):
print(
f"::error::Draft tag '{tag_ver}' does not match "
f"src/qwenpaw/__version__.py '{ver}'. "
f"Fix the tag or bump the version before releasing."
)
sys.exit(1)
except InvalidVersion as exc:
print(f"::error::Cannot parse versions for comparison ({exc}).")
sys.exit(1)
print(f"OK: tag normalizes to __version__ ({ver}).")
PY
- name: Ensure release secrets present (skip on dry_run)
env:
QWENPAW_DASHSCOPE_API_KEY: ${{ secrets.QWENPAW_DASHSCOPE_API_KEY }}
run: |
if [ "${{ inputs.dry_run }}" != "true" ] && [ -z "${QWENPAW_DASHSCOPE_API_KEY:-}" ]; then
echo "::error::QWENPAW_DASHSCOPE_API_KEY is not set; desktop verification cannot validate the LLM chat round."
exit 1
fi
echo "Secret check OK (dry_run=${{ inputs.dry_run }})"
# ── Prepare phase: build + verify everything, publish nothing ──────────────
build-wheel:
needs: [resolve]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.resolve.outputs.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node (for console build)
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: console/package-lock.json
- name: Build console frontend
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Bundle docs into package
run: |
rm -rf src/qwenpaw/docs
mkdir -p src/qwenpaw/docs
cp website/public/docs/*.md src/qwenpaw/docs/
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Build package
run: python -m build
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: qwenpaw-dist
path: dist/
retention-days: 7
- name: Upload version metadata
uses: actions/upload-artifact@v4
with:
name: qwenpaw-version
path: src/qwenpaw/__version__.py
retention-days: 7
verify-web:
needs: [resolve, build-wheel]
uses: ./.github/workflows/release-verify.yml
with:
verify_pip: true
verify_docker: true
verify_script_install: true
ref: ${{ needs.resolve.outputs.sha }}
# On dry_run (fork) the private ACR base images are unreachable, so fall
# back to public images for the Docker health-check build.
docker_node_image: ${{ inputs.dry_run && 'node:20-slim' || '' }}
docker_uv_image: ${{ inputs.dry_run && 'ghcr.io/astral-sh/uv:latest' || '' }}
secrets: inherit
build-desktop:
needs: [resolve]
uses: ./.github/workflows/desktop-build.yml
with:
ref: ${{ needs.resolve.outputs.sha }}
secrets: inherit
build-plugins:
needs: [resolve]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.resolve.outputs.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Pack plugins and build index
# qwenpaw-creator and qwenpaw-data are released through their own
# version-driven pipelines (creator-release.yml,
# qwenpaw-data-release.yml pending); qwenpaw-data additionally needs its
# vendored context console staged before packing, so packing it
# here fails pack_requires validation by design.
run: |
python scripts/pack/generate_plugin_metadata.py \
--plugins-root plugins \
--dist dist/plugins \
--metadata-out dist/plugins/index.json \
--cdn-prefix /files/plugins \
--exclude qwenpaw-creator \
--exclude qwenpaw-data
- name: Upload plugins dist
uses: actions/upload-artifact@v4
with:
name: qwenpaw-plugins-dist
path: dist/plugins
retention-days: 7
build-docker:
needs: [resolve]
runs-on: ubuntu-latest
env:
ACR_REGISTRY: agentscope-registry.ap-southeast-1.cr.aliyuncs.com
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.resolve.outputs.sha }}
submodules: recursive
- name: Get QwenPaw version
id: version
uses: ./.github/actions/get-version
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Aliyun ACR
if: ${{ !inputs.dry_run }}
uses: docker/login-action@v3
with:
registry: ${{ env.ACR_REGISTRY }}
username: ${{ secrets.ALIYUN_ACR_USERNAME }}
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
- name: Build multi-arch image
env:
DOCKER_NODE_IMAGE: ${{ inputs.dry_run && 'node:20-slim' || '' }}
DOCKER_UV_IMAGE: ${{ inputs.dry_run && 'ghcr.io/astral-sh/uv:latest' || '' }}
QWENPAW_DISABLED_CHANNELS: "imessage"
QWENPAW_VERSION: ${{ steps.version.outputs.version }}
run: |
BUILD_ARGS=()
if [ -n "${DOCKER_NODE_IMAGE}" ]; then
BUILD_ARGS+=(--build-arg "NODE_IMAGE=${DOCKER_NODE_IMAGE}")
fi
if [ -n "${DOCKER_UV_IMAGE}" ]; then
BUILD_ARGS+=(--build-arg "UV_IMAGE=${DOCKER_UV_IMAGE}")
fi
docker buildx build --platform linux/amd64,linux/arm64 \
-f deploy/Dockerfile \
--build-arg QWENPAW_DISABLED_CHANNELS="${QWENPAW_DISABLED_CHANNELS}" \
--build-arg \
QWENPAW_MANAGED_RUNTIME_BOUNDARY_VERSION="${QWENPAW_VERSION}" \
--output "type=oci,dest=${RUNNER_TEMP}/qwenpaw-image.tar" \
"${BUILD_ARGS[@]}" .
- name: Upload multi-arch OCI image
uses: actions/upload-artifact@v4
with:
name: qwenpaw-docker-image
path: ${{ runner.temp }}/qwenpaw-image.tar
compression-level: 0
retention-days: 7
# ── Gate: publish jobs below run only if every prepare job above is green ──
publish-pypi:
needs: [resolve, build-wheel, verify-web, build-desktop, build-plugins, build-docker]
runs-on: ubuntu-latest
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: qwenpaw-dist
path: dist
- name: Publish package to PyPI
if: ${{ !inputs.dry_run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dry-run notice
if: ${{ inputs.dry_run }}
run: |
echo "DRY-RUN: would publish $(ls dist) to PyPI"
push-docker:
needs: [resolve, build-wheel, verify-web, build-desktop, build-plugins, build-docker]
runs-on: ubuntu-latest
env:
ACR_REGISTRY: agentscope-registry.ap-southeast-1.cr.aliyuncs.com
IMAGE: agentscope/qwenpaw
steps:
- name: Download multi-arch OCI image
uses: actions/download-artifact@v4
with:
name: qwenpaw-docker-image
path: ${{ runner.temp }}/qwenpaw-docker-image
- name: Install Skopeo
run: |
sudo apt-get update
sudo apt-get install -y skopeo
- name: Validate multi-arch OCI image
run: |
SOURCE="oci-archive:${RUNNER_TEMP}/qwenpaw-docker-image/qwenpaw-image.tar"
MANIFEST="$(skopeo inspect --raw "${SOURCE}")"
PLATFORMS="$(jq -r '
.manifests[]?.platform
| select(.os != null and .architecture != null)
| "\(.os)/\(.architecture)"
' <<< "${MANIFEST}")"
echo "Platforms in OCI image:"
echo "${PLATFORMS}"
for REQUIRED_PLATFORM in linux/amd64 linux/arm64; do
if ! grep -Fxq "${REQUIRED_PLATFORM}" <<< "${PLATFORMS}"; then
echo "::error::OCI image is missing ${REQUIRED_PLATFORM}"
exit 1
fi
done
- name: Log in to DockerHub
if: ${{ !inputs.dry_run }}
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to Aliyun ACR
if: ${{ !inputs.dry_run }}
uses: docker/login-action@v3
with:
registry: ${{ env.ACR_REGISTRY }}
username: ${{ secrets.ALIYUN_ACR_USERNAME }}
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
- name: Push multi-arch image (version + pre [+ latest])
if: ${{ !inputs.dry_run }}
env:
VERSION: ${{ needs.resolve.outputs.tag }}
run: |
IS_PRERELEASE="${{ needs.resolve.outputs.is_prerelease }}"
DESTINATIONS=(
"${ACR_REGISTRY}/${IMAGE}:${VERSION}"
"${ACR_REGISTRY}/${IMAGE}:pre"
"docker.io/${IMAGE}:${VERSION}"
"docker.io/${IMAGE}:pre"
)
if [ "${IS_PRERELEASE}" != "true" ]; then
DESTINATIONS+=(
"${ACR_REGISTRY}/${IMAGE}:latest"
"docker.io/${IMAGE}:latest"
)
fi
SOURCE="oci-archive:${RUNNER_TEMP}/qwenpaw-docker-image/qwenpaw-image.tar"
AUTH_FILE="${HOME}/.docker/config.json"
for DESTINATION in "${DESTINATIONS[@]}"; do
skopeo copy --all --authfile "${AUTH_FILE}" \
"${SOURCE}" "docker://${DESTINATION}"
done
- name: Dry-run notice
if: ${{ inputs.dry_run }}
run: |
echo "DRY-RUN: would push the prebuilt Docker image for ${{ needs.resolve.outputs.tag }}"
publish-desktop:
needs: [resolve, build-wheel, verify-web, build-desktop, build-plugins, build-docker]
uses: ./.github/workflows/desktop-publish.yml
with:
tag: ${{ needs.resolve.outputs.tag }}
ref: ${{ needs.resolve.outputs.sha }}
dry_run: ${{ inputs.dry_run }}
secrets: inherit
publish-plugins:
needs: [resolve, build-wheel, verify-web, build-desktop, build-plugins, build-docker]
runs-on: ubuntu-latest
env:
OSS_BUCKET: ${{ vars.OSS_BUCKET || 'qwenpaw-download' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.resolve.outputs.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Download plugins dist
uses: actions/download-artifact@v4
with:
name: qwenpaw-plugins-dist
path: dist/plugins
- name: Dry-run notice
if: ${{ inputs.dry_run }}
run: |
echo "DRY-RUN: would sync $(find dist/plugins -name '*.zip' | wc -l) plugin zips + index to OSS"
- name: Install ossutil
if: ${{ !inputs.dry_run }}
run: |
wget -q https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil-v1.7.18-linux-amd64.zip
unzip -q ossutil-v1.7.18-linux-amd64.zip
chmod +x ossutil-v1.7.18-linux-amd64/ossutil64
sudo mv ossutil-v1.7.18-linux-amd64/ossutil64 /usr/local/bin/ossutil
ossutil --version
- name: Configure ossutil
if: ${{ !inputs.dry_run }}
run: |
ossutil config -e ${{ secrets.OSS_ENDPOINT }} \
-i ${{ secrets.OSS_ACCESS_KEY_ID }} \
-k ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
-L CH
- name: Sync plugin zips to OSS (long-cache, immutable)
if: ${{ !inputs.dry_run }}
run: |
shopt -s nullglob
for kind in bundle tool apps; do
while IFS= read -r -d '' f; do
rel="${f#dist/plugins/}"
echo "Uploading $f -> files/plugins/${rel}"
ossutil cp "$f" \
"oss://${OSS_BUCKET}/files/plugins/${rel}" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=31536000, immutable"
done < <(find "dist/plugins/${kind}" -type f -name '*.zip' -print0 2>/dev/null || true)
done
- name: Merge historical versions into index
if: ${{ !inputs.dry_run }}
run: |
ossutil cp "oss://${OSS_BUCKET}/metadata/plugins/index.json" \
existing-index.json 2>/dev/null || echo '{}' > existing-index.json
python3 scripts/pack/merge_plugin_index.py \
--new dist/plugins/index.json \
--old existing-index.json \
--out dist/plugins/index.json \
--retire-plugin-id computer-use-tool
- name: Upload plugins index (short-cache)
if: ${{ !inputs.dry_run }}
run: |
ossutil cp dist/plugins/index.json \
"oss://${OSS_BUCKET}/metadata/plugins/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
- name: Patch main metadata index to advertise plugins product
if: ${{ !inputs.dry_run }}
run: |
ossutil cp "oss://${OSS_BUCKET}/metadata/index.json" \
main-index.json 2>/dev/null || cat > main-index.json << 'EOF'
{
"version": "1.0",
"updated_at": "",
"products": {}
}
EOF
python3 scripts/pack/patch_main_index.py \
--index main-index.json \
--out main-index.json
ossutil cp main-index.json \
"oss://${OSS_BUCKET}/metadata/index.json" \
--acl public-read \
--force \
--meta "Cache-Control:public, max-age=60, must-revalidate"
# ── Finalize: flip the draft to published LAST (pinned to the built SHA) ────
finalize:
needs: [resolve, publish-pypi, push-docker, publish-desktop, publish-plugins]
runs-on: ubuntu-latest
steps:
- name: Publish the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ needs.resolve.outputs.tag }}
SHA: ${{ needs.resolve.outputs.sha }}
run: |
echo "Flipping draft $TAG -> published, pinned to $SHA"
gh release edit "$TAG" --repo "$REPO" --draft=false --target "$SHA"
# ── Post-publish: promote desktop latest + updater manifest + index ─────────
# Runs only after the release is published, so the auto-updater is pointed at
# the new version only once the release actually exists.
promote-desktop:
needs: [resolve, finalize]
uses: ./.github/workflows/desktop-promote.yml
with:
tag: ${{ needs.resolve.outputs.tag }}
ref: ${{ needs.resolve.outputs.sha }}
dry_run: ${{ inputs.dry_run }}
secrets: inherit
# ── Post-publish: create the Release Duty verification issue (inline) ───────
duty-issue:
needs: [resolve, finalize]
uses: ./.github/workflows/release-duty.yml
with:
tag: ${{ needs.resolve.outputs.tag }}
secrets: inherit
# ── Post-publish: deploy the public website (stable + post only) ────────────
# Skipped for pre-releases (beta/alpha/rc/dev) so the site advertises only
# GA/post versions. Invoked inline because the finalize job flips the draft
# with GITHUB_TOKEN, which suppresses deploy-website.yml's own release trigger.
deploy-website:
needs: [resolve, finalize]
if: needs.resolve.outputs.is_prerelease == 'false'
uses: ./.github/workflows/deploy-website.yml
with:
ref: ${{ needs.resolve.outputs.sha }}
dry_run: ${{ inputs.dry_run }}
secrets: inherit
+742
View File
@@ -0,0 +1,742 @@
name: Tests
on:
push:
branches: [main, master, dev, develop]
paths:
- 'src/**'
- 'tests/**'
- 'scripts/check-channels.sh'
- 'scripts/check_channel_contracts.py'
- '.gitattributes'
- 'pyproject.toml'
- 'setup.py'
- 'deploy/Dockerfile'
- '.github/workflows/tests.yml'
pull_request:
# Default types plus ready_for_review: converting a draft PR to
# ready must re-trigger this workflow so the real tiers run on the
# current head right after the author leaves draft state.
types: [opened, synchronize, reopened, ready_for_review]
branches: [main, master, dev, develop]
workflow_dispatch:
inputs:
integration_marker:
description: >-
Pytest marker expression for the integration tier. Leave blank
to run the FULL integration suite (the default for every event).
Fill in to narrow a manual run, e.g. "integration and p0",
"integration and (p0 or p1)".
required: false
default: ''
# Coverage data is collected on a single matrix entry per test class
# (ubuntu-latest + python 3.13 for lower tracer overhead)
# instead of being re-run from scratch in coverage-report. The data files
# (.coverage.unit / .coverage.contract / .coverage.integration plus their
# cobertura xml) are uploaded as short-lived artifacts and consumed by the
# coverage-report job, which only combines and renders — it does not run
# pytest itself anymore.
jobs:
spam-gate:
name: PR Spam Gate
if: github.event_name == 'pull_request'
uses: ./.github/workflows/pr-spam-gate.yml
with:
author: ${{ github.event.pull_request.user.login }}
# Replaces the former `on.pull_request.paths` filter: the workflow now runs
# (and reports a status) on every PR so `Test Summary` can be a required
# check, but docs-only PRs skip the approval gate and every test tier.
changes:
name: Detect code changes
runs-on: ubuntu-latest
outputs:
code: ${{ github.event_name != 'pull_request' && 'true' || steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v3
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
code:
- 'src/**'
- 'tests/**'
- 'scripts/check-channels.sh'
- 'scripts/check_channel_contracts.py'
- '.gitattributes'
- 'pyproject.toml'
- 'setup.py'
- '.github/workflows/tests.yml'
approval-gate:
name: Maintainer Approval
needs: [spam-gate, changes]
if: |
always() &&
needs.changes.outputs.code == 'true' &&
(needs.spam-gate.result == 'skipped' || needs.spam-gate.outputs.blocked != 'true') &&
(github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
environment: maintainer-approved
steps:
- name: Approval granted
run: echo "Approved by maintainer"
unit-tests:
name: Unit Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
needs: approval-gate
if: |
always() &&
needs.approval-gate.result == 'success'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Install Linux isolation dependency
if: |
runner.os == 'Linux' &&
matrix.python-version == '3.11'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y bubblewrap
if sysctl kernel.apparmor_restrict_unprivileged_userns \
>/dev/null 2>&1; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
- name: Set up Node.js (for console build)
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,full]"
- name: Run unit tests
shell: bash
env:
COVERAGE_FILE: .coverage.unit
run: |
# Coverage is collected only on the ubuntu/py3.13 entry so the
# data file can be uploaded for coverage-report. Other matrix
# entries only verify cross-platform compatibility.
if [ "${{ matrix.os }}" = "ubuntu-latest" ] && \
[ "${{ matrix.python-version }}" = "3.13" ]; then
pytest tests/unit -v \
--cov=src/qwenpaw \
--cov-report=xml:coverage.unit.xml
else
pytest tests/unit -v
fi
- name: Run Hub Local runtime E2E
if: matrix.python-version == '3.11'
shell: bash
env:
QWENPAW_LOCAL_RUNTIME_E2E: '1'
run: |
python -m pip install --no-deps --force-reinstall .
pytest tests/e2e/test_hub_local_runtime.py -v
- name: Upload unit coverage data
if: |
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: coverage-data-unit
path: |
.coverage.unit
coverage.unit.xml
retention-days: 1
include-hidden-files: true
contract-tests:
name: Contract Tests - py${{ matrix.python-version }} - ${{ matrix.os }}
needs: approval-gate
if: |
always() &&
needs.approval-gate.result == 'success'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Node.js (for console build)
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,full]"
- name: Check channel contract coverage
run: python scripts/check_channel_contracts.py
- name: Validate channel check script
shell: bash
run: bash -n scripts/check-channels.sh
- name: Run contract tests
shell: bash
env:
COVERAGE_FILE: .coverage.contract
run: |
# Same conditional-coverage pattern as unit-tests.
if [ "${{ matrix.os }}" = "ubuntu-latest" ] && \
[ "${{ matrix.python-version }}" = "3.13" ]; then
pytest tests/contract -v \
--cov=src/qwenpaw \
--cov-report=xml:coverage.contract.xml \
--cov-fail-under=0
else
pytest tests/contract -v
fi
- name: Upload contract coverage data
if: |
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: coverage-data-contract
path: |
.coverage.contract
coverage.contract.xml
retention-days: 1
include-hidden-files: true
integrated-tests:
name: Integrated Tests - py${{ matrix.python-version }} - ${{ matrix.os }} - ${{ matrix.shard }}
# Wait for the unit tier: when unit tests are red the 13 integration
# jobs used to burn ~30 minutes of runners for nothing. Sequencing
# them also cuts the per-PR concurrent-job peak (org limit is 60).
needs: [approval-gate, unit-tests]
if: |
always() &&
needs.approval-gate.result == 'success' &&
needs.unit-tests.result == 'success'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
os: [ubuntu-latest]
shard: [p0, p1, p2]
include:
# The fallback shard is the unclassified-test alarm: it only
# fails when some integration test lacks a p0/p1/p2 marker.
# One platform is enough for the alarm to ring, so it runs on
# ubuntu 3.11 only — the other platforms would just duplicate
# it and waste concurrency.
- os: ubuntu-latest
python-version: "3.11"
shard: fallback
- os: macos-latest
python-version: "3.11"
shard: p0
- os: macos-latest
python-version: "3.11"
shard: p1
- os: macos-latest
python-version: "3.11"
shard: p2
- os: windows-latest
python-version: "3.11"
shard: p0
- os: windows-latest
python-version: "3.11"
shard: p1
- os: windows-latest
python-version: "3.11"
shard: p2
steps:
- uses: actions/checkout@v4
- name: Set up Node.js (for console build)
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: console/package-lock.json
- name: Build console frontend
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
cd console && npm ci && npm run build
- name: Copy console build into package
shell: bash
run: |
rm -rf src/qwenpaw/console/*
mkdir -p src/qwenpaw/console
cp -R console/dist/* src/qwenpaw/console/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
# The macOS runner ships setuptools 65.5.0, which pip's resolver
# upgrades to the latest release (84.x) while backtracking the
# dependency graph. setuptools >= 82 no longer ships
# pkg_resources.declare_namespace, which lark-oapi's namespace
# packages still call at import time, so the Feishu mock IM
# integration tests crash with AttributeError on macOS. Pin
# setuptools <82 here — the pin must ride in the SAME pip command
# as the install: a separate `pip install "setuptools<82"` step
# beforehand gets upgraded away by this resolution again
# (reproduced with pip 26.2.1; see CI run 31571533395).
if [ "${{ runner.os }}" = "macOS" ]; then
pip install -e ".[dev,test,full]" "setuptools<82"
else
pip install -e ".[dev,test,full]"
fi
# tests/integration/browser carries the integration marker but no
# priority marker, so any expression without a p0/p1 filter (a
# workflow_dispatch of "integration", say) selects it and needs a real
# Chromium. Same command as the e2e workflows.
- name: Install Playwright browser
shell: bash
run: |
playwright install chromium --with-deps
- name: Check if integrated tests exist
id: check-integrated
shell: bash
run: |
if [ -d "tests/integration" ] && compgen -G "tests/integration/*.py" > /dev/null; then
echo "has_tests=true" >> "$GITHUB_OUTPUT"
else
echo "has_tests=false" >> "$GITHUB_OUTPUT"
fi
- name: Determine pytest marker expression
id: marker
if: steps.check-integrated.outputs.has_tests == 'true'
shell: bash
env:
DISPATCH_MARKER: ${{ inputs.integration_marker }}
run: |
# Manual dispatch override -> use whatever the maintainer typed.
# Everything else (PR gate / push) -> split by shard (p0/p1/p2).
# The PR gate is the only layer that reliably runs (post-merge
# push runs wait on the maintainer-approved environment), so
# problems are blocked here rather than detected after merge.
if [ -n "${DISPATCH_MARKER}" ]; then
EXPR="${DISPATCH_MARKER}"
else
# Split by shard for parallel execution. The fallback shard
# catches any integration test that lacks a p0/p1/p2 marker
# so it can never be silently skipped.
case "${{ matrix.shard }}" in
p0) EXPR="integration and p0" ;;
p1) EXPR="integration and p1" ;;
p2) EXPR="integration and p2" ;;
fallback) EXPR="integration and not (p0 or p1 or p2)" ;;
esac
fi
echo "expr=$EXPR" >> "$GITHUB_OUTPUT"
echo "Selected marker expression: $EXPR"
- name: Fail on unclassified integration tests
if: |
steps.check-integrated.outputs.has_tests == 'true' &&
matrix.shard == 'fallback' &&
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.11'
shell: bash
run: |
# Guard: every integration test must carry a priority marker.
# If the fallback shard collects anything, a new unclassified
# test slipped in -- fail loudly instead of silently running
# it outside the three priority shards.
UNCLASSIFIED=$(python -m pytest tests/integration --collect-only -q \
-m "integration and not (p0 or p1 or p2)" 2>/dev/null \
| grep -c "::" || true)
if [ "${UNCLASSIFIED}" -gt 0 ]; then
echo "::error::${UNCLASSIFIED} integration test(s) lack a p0/p1/p2 priority marker. Assign one so the test joins a priority shard."
python -m pytest tests/integration --collect-only -q \
-m "integration and not (p0 or p1 or p2)" 2>/dev/null | grep "::" || true
exit 1
fi
echo "No unclassified integration tests."
- name: Run integrated tests
if: steps.check-integrated.outputs.has_tests == 'true'
shell: bash
env:
# Subprocess coverage on the ubuntu/py3.11 entry only. conftest.py
# treats empty / missing as off, so the other matrix entries do
# not pay the tracer overhead. Multi-platform coverage is opt-in
# via full-tests-nightly.yml dispatch (coverage_platforms input).
QWENPAW_INTEGRATION_COVERAGE: ${{ (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11') && '1' || '' }}
# Windows/macOS runners are slower and IO-bound; under xdist
# parallel the default HTTP timeouts are too tight and
# intermittently surface as ``httpx.ReadTimeout`` (e.g. the real
# plugin install on macOS). Lift the floor on non-Linux runners.
QWENPAW_INTEGRATION_HTTP_TIMEOUT: ${{ matrix.os != 'ubuntu-latest' && '120' || '' }}
run: |
if [ -n "$QWENPAW_INTEGRATION_COVERAGE" ]; then
# Subprocess coverage entry. Parent process must not carry
# --cov, hence --no-cov here. Capture the exit code with
# || so bash -e does not abort before the tolerance check.
PYTEST_RC=0
pytest tests/integration -v --no-cov \
-n auto --dist=loadscope --timeout=300 \
-m "${{ steps.marker.outputs.expr }}" || PYTEST_RC=$?
# exit 5 = no tests collected: expected for the fallback
# shard when every integration test carries a priority
# marker. Any other nonzero code still fails.
if [ "$PYTEST_RC" -ne 0 ] && [ "$PYTEST_RC" -ne 5 ]; then
exit "$PYTEST_RC"
fi
if [ -f .integration_coverage/integration_subproc ]; then
cp .integration_coverage/integration_subproc \
.coverage.integration.${{ matrix.shard }}
# `coverage xml` honours fail_under and exits 2 when below;
# tolerate that — the combined value is what matters.
coverage xml --data-file=.coverage.integration.${{ matrix.shard }} \
-o coverage.integration.${{ matrix.shard }}.xml || [ "$?" -eq 2 ]
fi
else
PYTEST_RC=0
pytest tests/integration -v \
-n auto --dist=loadscope --timeout=300 \
-m "${{ steps.marker.outputs.expr }}" || PYTEST_RC=$?
# exit 5 = no tests collected: expected for the
# fallback shard when nothing is unclassified.
if [ "$PYTEST_RC" -ne 0 ] && [ "$PYTEST_RC" -ne 5 ]; then
exit "$PYTEST_RC"
fi
fi
- name: Upload integration coverage data
if: |
steps.check-integrated.outputs.has_tests == 'true' &&
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-data-integration-${{ matrix.shard }}
path: |
.coverage.integration.${{ matrix.shard }}
coverage.integration.${{ matrix.shard }}.xml
retention-days: 1
include-hidden-files: true
# The fallback shard produces no data file when every
# integration test carries a priority marker; a missing
# artifact there is expected, not an error.
if-no-files-found: ignore
coverage-report:
name: Coverage Report
needs: [approval-gate, unit-tests, contract-tests, integrated-tests]
if: |
always() &&
needs.approval-gate.result == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Install coverage tool
shell: bash
run: |
python -m pip install --upgrade pip
# Only the coverage tool is needed for combine / report; no need
# to install the full project (the per-tier .coverage data files
# arrive via download-artifact below).
pip install coverage
- name: Download coverage data artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Inspect downloaded coverage data
shell: bash
run: |
ls -la .coverage* coverage.*.xml 2>&1 | head -30 || true
- name: Combine all coverage data
shell: bash
run: |
# First, combine the integration shards into one. The fallback
# shard only produces a data file when it actually ran tests
# (i.e. some integration test lacked a priority marker), so
# include whichever shard files exist.
SHARDS=$(ls .coverage.integration.* 2>/dev/null || true)
if [ -n "$SHARDS" ]; then
coverage combine --data-file=.coverage.integration $SHARDS
coverage xml --data-file=.coverage.integration \
-o coverage.integration.xml || [ "$?" -eq 2 ]
fi
# Then, combine all three tiers: unit, contract, and integration.
# Integrated tests are sequenced after the unit tier, so when
# unit tests fail the integration data files are absent — combine
# whatever exists instead of going red on the missing tier.
DATA_FILES=""
for f in .coverage.unit .coverage.contract .coverage.integration; do
[ -f "$f" ] && DATA_FILES="$DATA_FILES $f"
done
if [ -n "$DATA_FILES" ]; then
coverage combine $DATA_FILES
else
echo "No coverage data files present (all tiers failed or skipped)"
fi
# Tolerate fail-under (exit 2): combined number is what matters
# and reflected in the summary regardless.
coverage xml -o coverage.combined.xml || [ "$?" -eq 2 ]
coverage html -d htmlcov-combined || [ "$?" -eq 2 ]
echo "Combined coverage report:"
coverage report --skip-covered --fail-under=0
coverage json -o coverage.combined.json || [ "$?" -eq 2 ]
- name: Build coverage summary table
id: cov_summary
shell: bash
run: |
# Best-effort number per tier; missing/malformed data => "n/a".
set +e
# Read line-rate from cobertura xml directly to avoid the
# coverage source-filter mismatch that would otherwise produce
# "No data to report" on the per-tier data files.
get_pct() {
python3 -c 'import sys, xml.etree.ElementTree as ET; print(round(float(ET.parse(sys.argv[1]).getroot().attrib.get("line-rate", "0")) * 100))' "$1" 2>/dev/null || echo "n/a"
}
UNIT=$(get_pct coverage.unit.xml)
CONTRACT=$(get_pct coverage.contract.xml)
INTEGRATION=$(get_pct coverage.integration.xml)
COMBINED=$(get_pct coverage.combined.xml)
echo "UNIT=${UNIT:-n/a}"
echo "CONTRACT=${CONTRACT:-n/a}"
echo "INTEGRATION=${INTEGRATION:-n/a}"
echo "COMBINED=${COMBINED:-n/a}"
{
echo "## 📊 Coverage report"
echo ""
echo "| Test category | Coverage |"
echo "|---|---|"
echo "| Unit | ${UNIT:-n/a}% |"
echo "| Contract | ${CONTRACT:-n/a}% |"
echo "| Integration | ${INTEGRATION:-n/a}% |"
echo "| **Combined** | **${COMBINED:-n/a}%** |"
echo ""
echo "> Combined = \`coverage combine\` of unit + contract + integration (subprocess mode)."
echo "> HTML reports under workflow artifact \`coverage-reports\` (\`htmlcov-combined\` / \`htmlcov-integration\`)."
echo "> Coverage is collected only on the ubuntu/py3.13 matrix entry; other matrix entries verify cross-platform compatibility without the tracer overhead."
} > coverage_summary.md
cat coverage_summary.md >> "$GITHUB_STEP_SUMMARY"
- name: Sticky coverage PR comment
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const body = fs.readFileSync('coverage_summary.md', 'utf8');
const marker = '<!-- qwenpaw-coverage-summary -->';
const finalBody = `${marker}\n${body}`;
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
},
);
const existing = comments.find(
(c) => c.body && c.body.includes(marker),
);
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body: finalBody,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: finalBody,
});
}
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
coverage.unit.xml
coverage.contract.xml
coverage.integration.xml
coverage.combined.xml
htmlcov-combined/
htmlcov-integration/
retention-days: 7
test-summary:
name: Test Summary
needs: [changes, approval-gate, unit-tests, contract-tests, integrated-tests, coverage-report]
# Fail-closed gate. This job ALWAYS runs (no path condition) so the
# required-check context can never be satisfied by an accidental skip.
# Four-state decision:
# 1. change detection did not succeed -> red (its `code` output is
# unreliable when the detection job fails/is cancelled, so the
# gate must close rather than open);
# 2. detection succeeded and reported a docs-only PR -> explicit
# green (instead of skipping, which a ruleset cannot distinguish
# from a bypass);
# 3. draft PR with code changes -> explicit green placeholder: the
# real tiers are deferred while the PR is a draft (GitHub forbids
# merging drafts, so the placeholder cannot smuggle anything in),
# and the `ready_for_review` trigger re-runs the whole workflow
# the moment the author marks the PR ready;
# 4. code change -> approval plus EVERY test tier must be strictly
# `success`; failure/cancelled/skipped are all rejected.
# coverage-report is intentionally observed, not enforced: a coverage
# tooling outage must not block an otherwise green PR.
if: always()
runs-on: ubuntu-latest
steps:
- name: Check test results
shell: bash
run: |
echo "Changes detection: ${{ needs.changes.result }}"
echo "Approval gate: ${{ needs.approval-gate.result }}"
echo "Unit tests: ${{ needs.unit-tests.result }}"
echo "Contract tests: ${{ needs.contract-tests.result }}"
echo "Integrated tests: ${{ needs.integrated-tests.result }}"
echo "Coverage report: ${{ needs.coverage-report.result }}"
if [ "${{ needs.changes.result }}" != "success" ]; then
echo "❌ Change detection did not succeed (${{ needs.changes.result }}) — gate closed, refusing untested merge"
exit 1
fi
if [ "${{ needs.changes.outputs.code }}" != "true" ]; then
echo "✅ Docs-only change — no test tiers required"
exit 0
fi
if [ "${{ github.event_name }}" = "pull_request" ] && \
[ "${{ github.event.pull_request.draft }}" = "true" ]; then
echo "✅ Draft PR — test tiers deferred until the PR is marked ready for review"
exit 0
fi
if [ "${{ needs.approval-gate.result }}" != "success" ]; then
echo "❌ Approval not granted"
exit 1
fi
if [ "${{ needs.unit-tests.result }}" != "success" ] || \
[ "${{ needs.contract-tests.result }}" != "success" ] || \
[ "${{ needs.integrated-tests.result }}" != "success" ]; then
echo "❌ Every test tier must be success (failure/cancelled/skipped are all rejected)"
exit 1
fi
echo "✅ All tests passed"
+156
View File
@@ -0,0 +1,156 @@
# Reme local data
.reme/
# Local issue tracking (not committed)
.scratch/
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# AI agent / copilot local config
.aone_copilot/
.agents/
# dependencies
/.pnp
.pnp.js
node_modules/
sessions_mount_dir/
# testing
/coverage
.coverage
coverage.xml
htmlcov/
htmlcov.zip
htmlcov-integration/
.integration_coverage/
**/.creator-dev-runtime/
# cookbook
cookbook/_build
# production
/build
dist/
.wheelshim/
# Console frontend build (generated in Docker/CI, do not commit)
console/.cursor/
console/.wiki/
src/qwenpaw/console/dist/
src/qwenpaw/console/
# Docs bundled at build time (copied from website/public/docs/)
src/qwenpaw/docs/
# frontend (website)
website/node_modules/
website/.vite/
website/tsconfig.tsbuildinfo
website/dist/
# Search index generated by scripts/build-search-index.mjs (run during build)
website/public/search-index.json
# misc
.env
.env.*
providers.json
envs.json
!.env.example
!.env.template
__pycache__/
*.db
*.rdb
*.egg-info/
*.zip
config.json
# IDEs and editors
.idea/
.vscode/
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
openapi-ts*.log
# Only ignore npm lockfiles inside subpackages
console/package-lock.json
website/package-lock.json
# MacOS
.DS_Store
# Windows
Thumbs.db
ehthumbs.db
Desktop.ini
# Linux
*~
# Python
*.py[cod]
*$py.class
uv.lock
venv/
.venv/
providers.json
# Logs
logs/
*.log
# vibe coding
AGENTS.md
.claude
openspec
CLAUDE.md
*.tmp
# Build cache
.cache/ # Includes conda_unpack_wheels/ for Windows packaging workaround
# Hypothesis test cache
.hypothesis/
src/.hypothesis/
# Kiro IDE
.kiro/
# Qoder IDE
.qoder/
# Cursor IDE
.cursor/
# Codex IDE
.codex/
# Worktrees
.worktrees/
.qwenpaw/worktrees/
# Local File
/localfile/
local-docs/
# E2E test artifacts
e2e/reports/
e2e/data/
e2e/.pytest_cache/
e2e/__pycache__/
# knowledge-base related
graphify-out/
local-docs/
docs-site/
# Local review notes
docs/reviews/
tmp/
+1
View File
@@ -0,0 +1 @@
22
+129
View File
@@ -0,0 +1,129 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- id: sort-simple-yaml
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- id: check-yaml
exclude: |
(?x)^(
meta.yaml
)$
- id: check-xml
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- id: check-toml
- id: check-docstring-first
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- id: check-json
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- id: fix-encoding-pragma
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- id: detect-private-key
- id: trailing-whitespace
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
hooks:
- id: mypy
exclude:
(?x)(
pb2\.py$
| grpc\.py$
| ^docs
| \.html$
| .*/skills/.*
| ^e2e/
| ^plugins/
)
args: [
--ignore-missing-imports,
--disable-error-code=var-annotated,
--disable-error-code=union-attr,
--disable-error-code=assignment,
--disable-error-code=attr-defined,
--disable-error-code=import-untyped,
--disable-error-code=truthy-function,
--follow-imports=skip,
--explicit-package-bases,
]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [ --line-length=79 ]
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [ "--extend-ignore=E203"]
exclude: '(?x)(.*/skills/.*|^scripts/pack/|^e2e/)'
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.2
hooks:
- id: pylint
exclude:
(?x)(
^docs
| pb2\.py$
| grpc\.py$
| \.demo$
| \.md$
| \.html$
| .*/skills/.*
| ^e2e/
| ^plugins/apps/qwenpaw-creator/e2e/
)
args: [
--disable=W0511,
--disable=W0718,
--disable=W0122,
--disable=C0103,
--disable=R0913,
--disable=E0401,
--disable=E1101,
--disable=C0415,
--disable=W0603,
--disable=R1705,
--disable=R0914,
--disable=E0601,
--disable=W0602,
--disable=W0604,
--disable=R0801,
--disable=R0902,
--disable=R0903,
--disable=C0123,
--disable=W0231,
--disable=W1113,
--disable=W0221,
--disable=R0401,
--disable=W0632,
--disable=W0123,
--disable=C3001,
--disable=W0201,
--disable=C0302,
--disable=W1203,
--disable=C2801,
--disable=C0114, # Disable missing module docstring for quick dev
--disable=C0115, # Disable missing class docstring for quick dev
--disable=C0116, # Disable missing function or method docstring for quick dev
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.0'
hooks:
- id: prettier
additional_dependencies: [ 'prettier@3.0.0' ]
files: \.(tsx?)$
exclude: '(?x)(^web/|^console/|/dist/|.*/skills/.*|^scripts/pack/)'
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
args: ['-shellcheck=']
+1
View File
@@ -0,0 +1 @@
3.11
+231
View File
@@ -0,0 +1,231 @@
# Contributing to QwenPaw
## Welcome! 🐾
Thank you for your interest in contributing to QwenPaw! QwenPaw is an open-source **personal AI assistant** that runs in your own environment—on your machine or in the cloud. It connects to DingTalk, Feishu, QQ, Discord, iMessage, and other chat apps, supports scheduled tasks and heartbeat, and extends its capabilities through **Skills**. We warmly welcome contributions that help make QwenPaw more useful for everyone: whether you add a new channel, a new model provider, a Skill, improve docs, or fix bugs.
**Quick links:** [GitHub](https://github.com/agentscope-ai/QwenPaw) · [Docs](https://qwenpaw.agentscope.io/) · [License: Apache 2.0](LICENSE)
---
## How to Contribute
To keep collaboration smooth and maintain quality, please follow these guidelines.
### 1. Check Existing Plans and Issues
Before starting:
- **Check [Open Issues](https://github.com/agentscope-ai/QwenPaw/issues)** and any [Projects](https://github.com/agentscope-ai/QwenPaw/projects) or roadmap labels.
- **If a related issue exists** and is open or unassigned: comment to say you want to work on it to avoid duplicate effort.
- **If no related issue exists**: open a new issue describing your proposal. The maintainers will respond and can help align with the project direction.
### 2. Commit Message Format
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for clear history and tooling.
**Format:**
```
<type>(<scope>): <subject>
```
**Types:**
- `feat:` New feature
- `fix:` Bug fix
- `docs:` Documentation only
- `style:` Code style (whitespace, formatting, etc.)
- `refactor:` Code change that neither fixes a bug nor adds a feature
- `perf:` Performance improvement
- `test:` Adding or updating tests
- `chore:` Build, tooling, or maintenance
**Examples:**
```bash
feat(channels): add Telegram channel stub
fix(skills): correct SKILL.md front matter parsing
docs(readme): update quick start for Docker
refactor(providers): simplify custom provider validation
test(agents): add tests for skill loading
```
### 3. Pull Request Title Format
PR titles should follow the same convention:
**Format:** ` <type>(<scope>): <description> `
- Use one of: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`, `perf`, `style`, `build`, `revert`.
- **Scope must be lowercase** (letters, numbers, hyphens, underscores only).
- Keep the description short and descriptive.
**Examples:**
```
feat(models): add custom provider for Azure OpenAI
fix(channels): handle empty content_parts in Discord
docs(skills): document Skills Hub import
```
### 4. Code and Quality
- **Required local gate (must pass before push/PR):**
```bash
pip install -e ".[dev,test,full]"
pre-commit install
pre-commit run --all-files
pytest
```
- **If pre-commit modifies files:** Commit those changes, then rerun
`pre-commit run --all-files` until it passes cleanly.
- **CI policy:** Pull requests with failing pre-commit checks are not merge-ready.
- **Frontend formatting:** If your changes involve the `console` or `website` directories, run the formatter before committing:
```bash
cd console && npm run format
cd website && npm run format
```
- **Documentation:** Update docs and README when you add or change user-facing behavior. The docs live under `website/public/docs/`.
---
## Types of Contributions
QwenPaw is designed to be **extensible**: you can add models, channels, Skills, and more. Below are the main contribution areas we care about.
---
### Adding New Models / Model Providers
QwenPaw supports multiple providers, including cloud providers (such as DashScope, ModelScope) and local providers (such as Ollama, LM Studio). We also welcome new model providers to enrich user choices.
Contributed model providers should have the following characteristics:
1. (Required) Natively compatible with the OpenAI `chat.completions` API or Anthropic `messages` API. If this condition is not met, please create an issue for discussion first. Directly adding an incompatible provider will significantly increase maintenance costs.
2. (Recommended) Support the `/model/list` endpoint to automatically obtain the model list. Although not mandatory, this will greatly enhance the user experience.
If the above conditions are met, you can create a new Provider instance in `src/qwenpaw/providers/provider_manager.py` and register it in the `ProviderManager` class to make it a built-in provider in QwenPaw.
If you wish to submit a Pull Request, please ensure that the following conditions are met.
1. (Required) Include at least one tested model to ensure the model list is not empty, and provide a connection test and a screenshot of a chat session using this model in the PR.
2. (Required) Add the provider to the provider list in the model documentation (website/public/docs/models.*.md). If the provider's configuration is significantly different from others, a separate section should be added for detailed explanation.
3. (Recommended) Pre-set capability tags for the built-in model (such as whether it supports images or videos). This can reduce the user's effort in manually verifying model capabilities.
---
### Adding New Channels
Channels are how QwenPaw talks to **DingTalk, Feishu, QQ, Discord, iMessage**, etc. You can add a new channel so QwenPaw can work with your favorite IM or bot platform.
- **Protocol:** All channels use a unified in-process contract: **native payload → `content_parts`** (e.g. `TextContent`, `ImageContent`, `FileContent`). The agent receives `AgentRequest` with these content parts; replies are sent back via the channel’s send path.
- **Implementation:** Implement a **subclass of `BaseChannel`** (in `src/qwenpaw/app/channels/base.py`):
- Set the class attribute `channel` to a unique channel key (e.g. `"telegram"`).
- Implement the lifecycle and message handling (e.g. receive → `content_parts` → `process` → send response).
- Use the manager’s queue and consumer loop if the channel is long-lived (default).
- **Discovery:** Built-in channels are registered in `src/qwenpaw/app/channels/registry.py`. **Custom channels** are registered via the plugin system — create a plugin with `type: "channel"` and call `api.register_channel(...)` in your plugin's `register()` method. See the [Plugin System docs](website/public/docs/plugins.en.md) for a full example.
- **CLI:** `qwenpaw channels config` — interactive config; `qwenpaw channels list` — view status.
If you contribute a **new built-in channel**, add it to the registry and, if needed, a configurator so it appears in the Console and CLI. Document the new channel (auth, webhooks, etc.) in `website/public/docs/channels.*.md`.
---
### Adding Base Skills
**Skills** define what QwenPaw can do: cron, file reading, PDF/Office, news, browser, etc. We welcome **broadly useful** base skills (productivity, documents, communication, automation) that fit the majority of users.
- **Structure:** Each skill is a **directory** containing:
- **`SKILL.md`** — Markdown instructions for the agent. Use YAML front matter for at least `name` and `description`; optional `metadata` (e.g. for Console).
- **`references/`** (optional) — Reference documents the agent can use.
- **`scripts/`** (optional) — Scripts or tools the skill uses.
- **Location:** Built-in skills live under `src/qwenpaw/agents/skills/<skill_name>/`. The app merges built-in and user **customized_skills** from the working dir into **active_skills**; no extra registration is needed beyond placing a valid `SKILL.md` in a directory.
- **Content:** Write clear, task-oriented instructions. Describe **when** the skill should be used and **how** (steps, commands, file formats). Avoid overly niche or personal workflows if targeting the **base** repository; those are great as custom or community Skills.
- **Skills Hub:** QwenPaw supports importing skills from a community hub (e.g. ClawHub). If you want your skill to be installable via hub, follow the same `SKILL.md` + `references/`/`scripts/` layout and the hub’s packaging format.
Examples of in-repo base skills: **cron**, **file_reader**, **news**, **pdf**, **docx**, **pptx**, **xlsx**, **browser**. Contributing a new base skill usually means: add the directory under `agents/skills/`, add a short entry in the docs (e.g. Skills table in `website/public/docs/skills.*.md`), and ensure it syncs correctly to the working directory.
#### Writing Effective Skill Descriptions
To help the model accurately recognize and invoke your skill, the `description` field in your SKILL.md front matter must be **clear, specific, and include trigger keywords**. Follow these best practices:
**✅ Recommended format:**
```yaml
---
name: example_skill
description: "Use this skill whenever user wants to [main functionality]. Trigger especially when user mentions: [trigger keywords]. Also use when [other scenarios]."
# Detailed instructions below
...
```
**✅ Best practices:**
1. **Clearly state when to trigger**: Use phrases like "Use this skill whenever user wants to..." or "Trigger when user asks for..."
2. **List trigger keywords explicitly**: Make it easy for the model to recognize, for example:
- "Trigger especially when user mentions: \"call\", \"dial\", \"phone\", \"microsip\""
- "Also trigger for desktop automation tasks like opening apps, controlling windows"
3. **Be specific about the skill's scope**: Say exactly what it does, avoid vague terms
- ✅ Good: "Make phone calls via MicroSIP or similar desktop apps"
- ❌ Not ideal: "Control desktop"
4. **Provide usage examples**: If the skill has specific usage patterns, explain them in the body of SKILL.md
**❌ Common pitfalls:**
- Overly abstract descriptions (like "control desktop", "process files")
- Missing trigger keywords, making it hard for the model to identify use cases
- Lack of usage scenario context
**📝 Examples comparison:**
| Skill | Description (Not ideal) | Description (Better) |
|-------|-------------------------|----------------------|
| Desktop Control | "Control desktop applications" | "Use this skill whenever user wants to control desktop applications or make phone calls. Trigger especially when user mentions: \"call\", \"dial\", \"phone\", \"microsip\", or requests to use specific desktop apps." |
| File Reader | "Read files" | "Use this skill when user asks to read or summarize local text-based files. PDFs, Office documents, images are out of scope." |
---
### Platform support (Windows, Linux, macOS, etc.)
QwenPaw aims to run on **Windows**, **Linux**, and **macOS**. Contributions that improve support on a specific platform are welcome.
- **Compatibility fixes:** Path handling, line endings, shell commands, or dependencies that behave differently per OS. For example: Windows compatibility for the memory/vector stack, or install scripts that work on both Linux and macOS.
- **Install and run:** One-line install (`install.sh`), `pip` install, and `qwenpaw init` / `qwenpaw app` should work (or be clearly documented) on each supported platform. Fixes to install or startup on a given OS are valuable.
- **Platform-specific features:** Optional integrations (e.g. notifying only when supported) are fine as long as they don’t break other platforms. Use runtime checks or optional dependencies where appropriate.
- **Documentation:** Document any platform-specific steps, known limitations, or recommended setups (e.g. WSL on Windows, Apple Silicon vs x86) in the docs or README.
If you add or change platform support, please test on the affected OS and mention it in the PR description. Opening an issue first is recommended for larger or ambiguous platform work.
---
### Other Contributions
- **MCP (Model Context Protocol):** QwenPaw supports runtime **MCP tool** discovery and hot-plug. Contributing new MCP servers or tools (or docs on how to attach them) helps users extend the agent without changing core code.
- **Documentation:** Fixes and improvements to [the docs](https://qwenpaw.agentscope.io/) (under `website/public/docs/`) and README are always welcome.
- **Bug fixes and refactors:** Small fixes, clearer error messages, and refactors that keep behavior the same are valuable. Prefer opening an issue for larger refactors so we can align on approach.
- **Examples and workflows:** Tutorials or example workflows (e.g. “daily digest to DingTalk”, “local model + cron”) can be documented or linked from the repo/docs.
- **Any other useful things!**
---
## Do's and Don'ts
### ✅ DO
- Start with small, focused changes.
- Discuss large or design-sensitive changes in an issue first.
- Write or update tests where applicable.
- Update documentation for user-facing changes.
- Use conventional commit messages and PR titles.
- Be respectful and constructive (we follow a welcoming Code of Conduct).
### ❌ DON'T
- Don’t open very large PRs without prior discussion.
- Don’t ignore CI or pre-commit failures.
- Don’t mix unrelated changes in one PR.
- Don’t break existing APIs without a good reason and clear migration notes.
- Don’t add heavy or optional dependencies to the core install without discussing in an issue.
---
## Getting Help
- **Discussions:** [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions)
- **Bugs and features:** [GitHub Issues](https://github.com/agentscope-ai/QwenPaw/issues)
- **Community:** DingTalk group (see [README](README.md)) and [Discord](https://discord.gg/eYMpfnkG8h)
Thank you for contributing to QwenPaw. Your work helps make it a better assistant for everyone. 🐾
+233
View File
@@ -0,0 +1,233 @@
# 为 QwenPaw 贡献代码
## 欢迎!🐾
感谢你对 QwenPaw 的关注!QwenPaw 是一个开源的**个人 AI 助手**,可以在你自己的环境中运行——无论是你的机器还是云端。它可以连接钉钉、飞书、QQ、Discord、iMessage 等聊天应用,支持定时任务和心跳机制,并通过 **Skills** 扩展其能力。我们热烈欢迎能让 QwenPaw 对所有人更有用的贡献:无论是添加新的频道、新的模型提供商、Skill,改进文档,还是修复 bug。
**快速链接:** [GitHub](https://github.com/agentscope-ai/QwenPaw) · [文档](https://qwenpaw.agentscope.io/) · [许可证:Apache 2.0](LICENSE)
---
## 如何贡献
为了保持协作顺畅并维护质量,请遵循以下指南。
### 1. 检查现有计划和问题
在开始之前:
- **检查 [Open Issues](https://github.com/agentscope-ai/QwenPaw/issues)** 以及任何 [Projects](https://github.com/agentscope-ai/QwenPaw/projects) 或路线图标签。
- **如果存在相关 issue** 且处于开放或未分配状态:发表评论表示你想要处理它,以避免重复工作。
- **如果不存在相关 issue**:创建一个新 issue 描述你的提案。维护者会回复并帮助与项目方向对齐。
### 2. 提交信息格式
我们遵循 [Conventional Commits](https://www.conventionalcommits.org/) 规范,以保持清晰的历史记录和工具支持。
**格式:**
```
<type>(<scope>): <subject>
```
**类型:**
- `feat:` 新功能
- `fix:` Bug 修复
- `docs:` 仅文档更改
- `style:` 代码风格(空格、格式等)
- `refactor:` 既不修复 bug 也不添加功能的代码更改
- `perf:` 性能改进
- `test:` 添加或更新测试
- `chore:` 构建、工具或维护
**示例:**
```bash
feat(channels): add Telegram channel stub
fix(skills): correct SKILL.md front matter parsing
docs(readme): update quick start for Docker
refactor(providers): simplify custom provider validation
test(agents): add tests for skill loading
```
### 3. Pull Request 标题格式
PR 标题应遵循相同的约定:
**格式:** ` <type>(<scope>): <description> `
- 使用以下之一:`feat`、`fix`、`docs`、`test`、`refactor`、`chore`、`perf`、`style`、`build`、`revert`。
- **scope 必须小写**(仅字母、数字、连字符、下划线)。
- 保持描述简短且描述性强。
**示例:**
```
feat(models): add custom provider for Azure OpenAI
fix(channels): handle empty content_parts in Discord
docs(skills): document Skills Hub import
```
### 4. 代码和质量
- **本地必跑门禁(push/提 PR 前必须通过):**
```bash
pip install -e ".[dev,test,full]"
pre-commit install
pre-commit run --all-files
pytest
```
- **如果 pre-commit 自动修改了文件:** 先提交这些修改,再重复执行
`pre-commit run --all-files`,直到无修改且通过。
- **CI 策略:** pre-commit 检查失败的 PR 视为未就绪(not merge-ready)。
- **前端代码格式化:** 如果你的修改涉及到 `console` 或 `website` 目录,请在提交前运行格式化:
```bash
cd console && npm run format
cd website && npm run format
```
- **文档:** 当你添加或更改面向用户的行为时,更新文档和 README。文档位于 `website/public/docs/` 下。
---
## 贡献类型
QwenPaw 设计为**可扩展的**:你可以添加模型、频道、Skills 等。以下是我们关心的主要贡献领域。
---
### 添加新模型 / 模型提供商
QwenPaw 支持多种提供商:包括云提供商(如 DashScope、ModelScope)以及本地提供商(如 Ollama、LM Studio),但我们也欢迎新的模型供应商以丰富用户选择。
贡献的模型提供商具有以下特征:
1. (强制)原生兼容 OpenAI `chat.completions` API 或 Anthropic `messages` API,如不满足该条件,请先创建 issue 讨论,直接添加一个不兼容的提供商会大幅增加维护成本。
2. (推荐)支持 `/model/list` 端点以自动获取模型列表,虽然不强制,但这会大大提升用户体验。
确定满足上述条件后,可以在 `src/qwenpaw/providers/provider_manager.py` 中创建新的 Provider 实例并在 `ProviderManager` 类中注册,使其成为 QwenPaw 内置的提供商。
如果想要将新的提供商作为内置提供商贡献,请在 PR 中提供以下内容:
1. (强制)内置至少一个通过测试的模型,确保模型列表不为空,并且在 PR 中提供连接测试以及使用该模型的聊天实例截图。
2. (强制)在模型文档(`website/public/docs/models.*.md`)的提供商列表中增加该提供商,并且如果该提供商的配置与其他提供商有明显区别,应该单独开一节详细说明。
3. (推荐)为内置的模型提前设置能力标签(例如是否支持图片、视频),这能够减少用户手动验证模型能力的开销。
---
### 添加新频道
频道是 QwenPaw 与**钉钉、飞书、QQ、Discord、iMessage** 等通信的方式。你可以添加新频道,以便 QwenPaw 可以与你喜欢的 IM 或机器人平台配合使用。
- **协议:** 所有频道使用统一的进程内契约:**原生 payload → `content_parts`**(如 `TextContent`、`ImageContent`、`FileContent`)。agent 接收带有这些内容部分的 `AgentRequest`;回复通过频道的发送路径返回。
- **实现:** 实现 **`BaseChannel` 的子类**(在 `src/qwenpaw/app/channels/base.py` 中):
- 将类属性 `channel` 设置为唯一的频道键(如 `"telegram"`)。
- 实现生命周期和消息处理(如 receive → `content_parts` → `process` → send response)。
- 如果频道是长期运行的(默认),使用 manager 的队列和消费者循环。
- **发现:** 内置频道在 `src/qwenpaw/app/channels/registry.py` 中注册。**自定义频道**通过插件系统注册 — 创建 `type: "channel"` 的插件,在 `register()` 方法中调用 `api.register_channel(...)`。完整示例请参阅[插件系统文档](website/public/docs/plugins.zh.md)。
- **CLI:** `qwenpaw channels config` — 交互式配置;`qwenpaw channels list` — 查看状态。
如果你贡献**新的内置频道**,将其添加到注册表,如有需要,添加配置器以使其出现在 Console 和 CLI 中。在 `website/public/docs/channels.*.md` 中记录新频道(身份验证、webhooks 等)。
---
### 添加基础 Skills
**Skills** 定义了 QwenPaw 可以做什么:cron、文件读取、PDF/Office、新闻、浏览器等。我们欢迎**广泛有用的**基础 skills(生产力、文档、通信、自动化),适合大多数用户。
- **结构:** 每个 skill 是一个**目录**,包含:
- **`SKILL.md`** — agent 的 Markdown 指令。使用 YAML front matter 至少包含 `name` 和 `description`;可选的 `metadata`(如用于 Console)。
- **`references/`**(可选)— agent 可以使用的参考文档。
- **`scripts/`**(可选)— skill 使用的脚本或工具。
- **位置:** 内置 skills 位于 `src/qwenpaw/agents/skills/<skill_name>/` 下。应用程序将内置和用户的 **customized_skills**(来自工作目录)合并到 **active_skills** 中;除了在目录中放置有效的 `SKILL.md` 外,不需要额外的注册。
- **内容:** 编写清晰的、面向任务的指令。描述**何时**应该使用该 skill 以及**如何**使用(步骤、命令、文件格式)。如果针对**基础**仓库,避免过于小众或个人的工作流程;这些作为自定义或社区 Skills 非常好。
#### 编写有效的 Skill Description
为了让 model 能够准确识别并调用你的 skill,`description` 字段必须**清晰、具体且包含触发词**。请遵循以下最佳实践:
**✅ 推荐格式:**
```yaml
---
name: example_skill
description: "Use this skill whenever user wants to [主要功能]. Trigger especially when user mentions: [触发词列表]. Also use when [其他场景]."
# 详细说明
...
```
**✅ 最佳实践:**
1. **明确触发时机**:使用 "Use this skill whenever user wants to..." 或 "Trigger when user asks for..."
2. **列出触发关键词**:在 description 中明确列出触发词,例如:
- "Trigger especially when user mentions: \"call\", \"dial\", \"phone\", \"microsip\""
- "Also trigger for desktop automation tasks like opening apps, controlling windows"
3. **具体描述功能范围**:说明技能做什么,不要含糊
- ✅ 好的:"Make phone calls via MicroSIP or similar desktop apps"
- ❌ 不好:"Control desktop"
4. **提供使用示例**:如果技能有特定用法,在 SKILL.md 主体部分说明
**❌ 常见问题:**
- 描述过于抽象(如"控制桌面"、"处理文件")
- 没有列出触发关键词,导致 model 无法识别
- 缺少使用场景说明
**📝 示例对比:**
| 技能 | 描述(不好) | 描述(好) |
|------|---------------|-------------|
| Desktop Control | "控制桌面应用" | "Use this skill whenever user wants to control desktop applications or make phone calls. Trigger especially when user mentions: \"call\" (呼叫), \"dial\" (拨打), \"phone\" (电话), \"microsip\", or requests to use specific desktop apps." |
| File Reader | "读取文件" | "Use this skill when user asks to read or summarize local text-based files. PDFs, Office documents, and images are out of scope." |
- **Skills Hub:** QwenPaw 支持从社区 hub(如 ClawHub)导入 skills。如果你希望你的 skill 可以通过 hub 安装,请遵循相同的 `SKILL.md` + `references/`/`scripts/` 布局和 hub 的打包格式。
仓库内基础 skills 的示例:**cron**、**file_reader**、**news**、**pdf**、**docx**、**pptx**、**xlsx**、**browser**。贡献新的基础 skill 通常意味着:在 `agents/skills/` 下添加目录,在文档中添加简短条目(如 `website/public/docs/skills.*.md` 中的 Skills 表),并确保它正确同步到工作目录。
---
### 平台支持(Windows、Linux、macOS 等)
QwenPaw 旨在在 **Windows**、**Linux** 和 **macOS** 上运行。欢迎改进特定平台支持的贡献。
- **兼容性修复:** 路径处理、行尾、shell 命令或在不同操作系统上行为不同的依赖项。例如:内存/向量栈的 Windows 兼容性,或在 Linux 和 macOS 上都能工作的安装脚本。
- **安装和运行:** 一行安装(`install.sh`)、`pip` 安装,以及 `qwenpaw init` / `qwenpaw app` 应该在每个支持的平台上工作(或有清晰的文档说明)。对给定操作系统上的安装或启动的修复很有价值。
- **平台特定功能:** 可选集成(如仅在支持时通知)是可以的,只要它们不会破坏其他平台。在适当的地方使用运行时检查或可选依赖项。
- **文档:** 在文档或 README 中记录任何平台特定的步骤、已知限制或推荐设置(如 Windows 上的 WSL、Apple Silicon vs x86)。
如果你添加或更改平台支持,请在受影响的操作系统上进行测试,并在 PR 描述中提及。对于较大或模糊的平台工作,建议先创建 issue。
---
### 其他贡献
- **MCP(模型上下文协议):** QwenPaw 支持运行时 **MCP 工具**发现和热插拔。贡献新的 MCP 服务器或工具(或关于如何附加它们的文档)可以帮助用户扩展 agent 而无需更改核心代码。
- **文档:** 对 [文档](https://qwenpaw.agentscope.io/)(位于 `website/public/docs/` 下)和 README 的修复和改进始终受欢迎。
- **Bug 修复和重构:** 小的修复、更清晰的错误消息以及保持行为相同的重构都很有价值。对于较大的重构,最好先创建 issue,以便我们可以就方法达成一致。
- **示例和工作流程:** 教程或示例工作流程(如"每日摘要到钉钉"、"本地模型 + cron")可以记录或从仓库/文档链接。
- **任何其他有用的东西!**
---
## 应该做和不应该做
### ✅ 应该做
- 从小的、集中的更改开始。
- 在 issue 中首先讨论大型或涉及敏感的更改。
- 在适用的地方编写或更新测试。
- 为面向用户的更改更新文档。
- 使用常规提交消息和 PR 标题。
- 保持尊重和建设性(我们遵循友好的行为准则)。
### ❌ 不应该做
- 不要在没有事先讨论的情况下打开非常大的 PR。
- 不要忽略 CI 或 pre-commit 失败。
- 不要在一个 PR 中混合不相关的更改。
- 不要在没有充分理由和清晰迁移说明的情况下破坏现有 API。
- 不要在没有在 issue 中讨论的情况下向核心安装添加重型或可选依赖项。
---
## 获取帮助
- **讨论:** [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions)
- **Bug 和功能:** [GitHub Issues](https://github.com/agentscope-ai/QwenPaw/issues)
- **社区:** 钉钉群(见 [README](README_zh.md))和 [Discord](https://discord.gg/eYMpfnkG8h)
感谢你为 QwenPaw 贡献代码。你的工作帮助它成为每个人更好的助手。🐾
+190
View File
@@ -0,0 +1,190 @@
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 the 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
Copyright 2025 The QwenPaw Authors
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.
+14
View File
@@ -0,0 +1,14 @@
# 镜像说明
- 上游:https://github.com/agentscope-ai/QwenPaw
- 许可证:Apache License 2.0(L1)
- 抓取日期:2026-09-01
## 这不是完整保真镜像
本仓库只含**源码与文档**,已剔除图片、音视频、字体等非源码素材。
原因:Gitea 前置 nginx 的 `client_max_body_size` 上限约 45 MB,
完整裸仓打包 280 MB 会被 HTTP 413 拒绝。
完整保真快照保留在追踪体系的本地裸仓 `.mirrors/qwenpaw.git` 中。
把服务器 nginx 放开到 `client_max_body_size 512m;` 后即可推送完整版。
+70
View File
@@ -0,0 +1,70 @@
# CoPaw Test & Coverage Makefile
.PHONY: test test-unit test-contract test-integration test-channel test-channel-contract coverage-full clean gen-browser-manual install-dev install-mail-mcp
# Cross-platform default (override with: make PYTHON=python3.12 <target>)
PYTHON ?= python
PYTEST := $(PYTHON) -m pytest
# Default: run all tests
test:
$(PYTEST) tests/ -v --tb=short -q
# Unit tests only
test-unit:
$(PYTEST) tests/unit/ -v --tb=short
# Contract tests (interface compliance)
test-contract:
$(PYTEST) tests/contract/ -v --tb=short
# Integration tests
test-integration:
$(PYTEST) tests/integration/ -v --tb=short
# Full coverage (all modules)
coverage-full:
$(PYTEST) tests/unit/ tests/integration/ -v \
--cov=src/qwenpaw \
--cov-report=term-missing \
--cov-report=html
# Check contract coverage for all channels
check-contracts:
$(PYTHON) scripts/check_channel_contracts.py
# Clean generated files
clean:
rm -rf htmlcov/ .pytest_cache/
rm -f coverage.xml coverage-sa.xml .coverage
# Quick check (fast feedback)
quick:
@qp_test_workdir=$$(mktemp -d); \
trap 'rm -rf "$$qp_test_workdir"' EXIT; \
QWENPAW_WORKING_DIR="$$qp_test_workdir" \
$(PYTEST) tests/unit/ -x -q --tb=line
gen-browser-manual:
$(PYTHON) scripts/gen_browser_manual.py
# Channel-specific tests
test-channel:
@echo "Running Channel unit tests..."
$(PYTEST) tests/unit/channels/ -v --tb=short
test-channel-contract:
@echo "Running Channel contract tests..."
$(PYTEST) tests/contract/channels/ -v --tb=short
# BaseChannel core unit tests (optional, not enforced)
test-base-core:
$(PYTEST) tests/unit/channels/test_base_core.py -v
## Install the project and bundled mail MCP for development.
install-dev:
$(PYTHON) -m pip install -e .
## Install only the standalone mail MCP package.
install-mail-mcp:
$(PYTHON) -m pip install -e packages/qwenpawmail-mcp
+567
View File
@@ -0,0 +1,567 @@
<div align="center">
# QwenPaw
[![GitHub Repo](https://img.shields.io/badge/GitHub-Repo-black.svg?logo=github)](https://github.com/agentscope-ai/QwenPaw)
[![PyPI](https://img.shields.io/pypi/v/qwenpaw?color=3775A9&label=PyPI&logo=pypi)](https://pypi.org/project/qwenpaw/)
[![Documentation](https://img.shields.io/badge/Docs-Website-green.svg?logo=readthedocs&label=Docs)](https://qwenpaw.agentscope.io/)
[![Python Version](https://img.shields.io/badge/python-3.11%20~%20%3C3.14-blue.svg?logo=python&label=Python)](https://www.python.org/downloads/)
[![Last Commit](https://img.shields.io/github/last-commit/agentscope-ai/QwenPaw)](https://github.com/agentscope-ai/QwenPaw)
[![License](https://img.shields.io/badge/license-Apache%202.0-red.svg?logo=apache&label=License)](LICENSE)
[![Code Style](https://img.shields.io/badge/code%20style-black-black.svg?logo=python&label=CodeStyle)](https://github.com/psf/black)
[![GitHub Stars](https://img.shields.io/github/stars/agentscope-ai/QwenPaw?style=flat&logo=github&color=yellow&label=Stars)](https://github.com/agentscope-ai/QwenPaw/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/agentscope-ai/QwenPaw?style=flat&logo=github&color=purple&label=Forks)](https://github.com/agentscope-ai/QwenPaw/network)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-Ask_Devin-navy.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/agentscope-ai/QwenPaw)
[![Discord](https://img.shields.io/badge/Discord-Join_Us-blueviolet.svg?logo=discord)](https://discord.gg/eYMpfnkG8h)
[![X](https://img.shields.io/badge/X-Follow_Us-black.svg?logo=x)](https://x.com/agentscope_ai)
[![DingTalk](https://img.shields.io/badge/DingTalk-Join_Us-orange.svg)](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11)
[![AgentScope Platform](https://img.shields.io/badge/%E2%98%81_AgentScope_Platform-%F0%9F%90%BE_7%2F24_Online_%26_Free-FF6B2B.svg)](https://platform.agentscope.io/)
<a href="https://trendshift.io/repositories/25882" target="_blank"><img src="https://trendshift.io/api/badge/trendshift/repositories/25882/daily" alt="agentscope-ai%2FQwenPaw | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[[Documentation](https://qwenpaw.agentscope.io/)] [[中文](README_zh.md)] [[日本語](README_ja.md)] [[Русский](README_ru.md)]
<p align="center">
<img src="https://gw.alicdn.com/imgextra/i1/O1CN01sens5C1TuwioeGexL_!!6000000002443-55-tps-771-132.svg" alt="QwenPaw Logo" width="120">
</p>
<p align="center"><b>Works for you, grows with you.</b></p>
</div>
Your personal AI assistant — deploy locally or in the cloud, extend with Skills & Plugins, connect across every channel.
| | |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Never forgets** | Three-layer memory — live working context, full verbatim history, and a self-evolving personal knowledge base powered by [ReMe](https://github.com/agentscope-ai/ReMe). Conversations and resources continuously become readable, editable, searchable, and linked Markdown memory. |
| **Local or cloud, runs free** | QwenPaw-Flash models (2B / 4B / 9B) trained for agent tasks. Built-in QwenPaw Local runtime — no API key, no cloud dependency. Also works with Ollama, LM Studio, or 14+ cloud providers. |
| **Security built in** | Kernel-level Sandbox, Tool Guard, File Guard, Skill Scanner, and Access Policy. Dangerous commands are blocked before they run. |
| **Multi-agent & parallel** | Spawn independent agents with their own memory and skills. Sub-agents at runtime. Agent Communication Protocol (ACP) for cross-system orchestration. |
| **File workspace** | Unified file navigation, preview, editing, diffs, upload, and download across project and Agent files. |
| **Extensible** | Skills for scheduling, documents, browser, news, and more. Plugin architecture with a marketplace. MCP integration for external tools. Combine them into purpose-built workflows. |
| **Reachable anywhere** | DingTalk, Lark, WeChat, Discord, Telegram, iMessage, QQ — one instance, all channels. Console, TUI, and desktop app for direct access. |
| **Yours, not ours** | Deploy locally — data stays on your machine. No third-party hosting, no data upload. |
<details>
<summary><b>What you can do with QwenPaw</b></summary>
<br>
- **Automation & scheduling**: Set up recurring tasks — news digests, report generation, multi-channel broadcasting — all on your schedule.
- **Code & development**: Read, edit, review, and test code in your projects with the unified file workspace.
- **Document processing**: Read, write, and convert PDF, Word, Excel, and PowerPoint files.
- **Information gathering**: Search the web, follow subscriptions, summarize videos, and find what you need in your personal knowledge base.
- **Multi-channel ops**: Push alerts, summaries, or AI-generated content to DingTalk, Lark, Discord, Telegram, and more — simultaneously or per channel.
- **Custom workflows**: Combine built-in capabilities, plugins, and scheduled tasks into workflows tailored to your needs.
</details>
---
## News
- [2026-08-13] **v2.1.0** | QwenPaw OS Shell, unified Files workspace, QwenPaw Creator, Codex/Qoder Agent integration, Browser-use, Computer-use, workspace checkpoints, and long-running conversation continuity. [v2.1.0 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v2.1.0)
- [2026-07-24] **v2.0.1** | PawApp mini-app platform, user-editable Agent Modes, Oh-My-Paw plugins, [ReMe](https://github.com/agentscope-ai/ReMe) memory enhancements, desktop UX improvements, and more. [v2.0.1 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v2.0.1)
- [2026-07-10] **v2.0.0 — QwenPaw 2.0 Official Release** 🎉 | An AgentScope 2.0 based ground-up rewrite delivering the Agent OS architecture, Loop Engineering, Scroll Context, [ReMe](https://github.com/agentscope-ai/ReMe) v0.4 Self-evolving Personal Knowledge Base, and a bundled Terminal UI.
| Highlight | What's new |
|-----------|------------|
| **Agent OS — Workspace** | Three pillars per agent: **Resources** (transparent on disk), **Governance** (allow/deny/ask/sandbox), **Sandbox** (macOS / Linux / Windows). |
| **Agent OS — Drivers** | Protocol-neutral MCP / A2A / ACP connector layer with encrypted credentials and per-call policy gate. |
| **Loop Engineering** | Advanced agent loop templates (Coding Mode, Mission Mode, more to come) with composable approval gates. |
| **Scroll Context** | Every turn persisted; evicted turns indexed with on-demand recall — nothing summarized away. |
| **[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 Self-evolving Personal Knowledge Base** | Continuously turns conversations and resources into readable, editable, searchable, and linked Markdown memory. |
| **Terminal UI (TUI)** | Full-screen terminal chat — same agent, memory, and sessions as Console and channels. |
Built on Agent OS, we will be launching out-of-box QwenPaw applications — such as **QwenPaw Creator** and **QwenPaw Insight** — stay tuned. [v2.0.0 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v2.0.0)
- [2026-06-17] **v1.1.12 — Models Page Overhaul & Simple Mode** | Redesigned Models page with provider aggregation; new Simple Mode for streamlined navigation. [v1.1.12 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v1.1.12)
- [2026-06-11] **AgentScope Platform is live** — Free QwenPaw deployment, plugin sharing, and Skill marketplace. [Try it now →](https://platform.agentscope.io/)
- [2026-06-10] **v1.1.11** — Free Model OAuth, Plugin Market, MCP Tool Whitelisting. [v1.1.11 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v1.1.11)
[All release notes →](https://qwenpaw.agentscope.io/release-notes)
---
## Table of Contents
- [News](#news)
- [Quick Start](#quick-start)
- [API Key](#api-key)
- [Local Models](#local-models)
- [Security Features](#security-features)
- [Documentation](#documentation)
- [FAQ](#faq)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [Install From Source](#install-from-source)
- [Why QwenPaw?](#why-qwenpaw)
- [Built By](#built-by)
- [License](#license)
---
## Quick Start
### Option 1: Pip Install
If you prefer managing Python yourself (requires Python >= 3.11, < 3.14):
```bash
pip install qwenpaw
qwenpaw init --defaults
qwenpaw app
```
Then open the Console in your browser at **http://127.0.0.1:8088/** to configure your model. To chat in DingTalk, Lark, WeChat, etc., see the [Channel setup](https://qwenpaw.agentscope.io/docs/channels) documentation.
![Console](https://img.alicdn.com/imgextra/i2/O1CN01EP1ra01iOAcBvF0TC_!!6000000004402-2-tps-3822-2070.png)
---
### Option 2: Script Install
No Python setup required, one command installs everything. The script will automatically download uv (Python package manager), create a virtual environment, and install QwenPaw with all dependencies (including Node.js and frontend assets). Note: May not work in restricted network environments or corporate firewalls.
**macOS / Linux:**
```bash
curl -fsSL https://qwenpaw.agentscope.io/install.sh | bash
```
**Windows (CMD):**
```CMD
curl -fsSL https://qwenpaw.agentscope.io/install.bat -o install.bat && install.bat
```
**Windows (PowerShell):**
```powershell
irm https://qwenpaw.agentscope.io/install.ps1 | iex
```
> **Note**: The installer will automatically check the status of uv. If it is not installed, it will attempt to download and configure it automatically. If the automatic installation fails, please follow the on-screen prompts or execute `python -m pip install -U uv`, then rerun the installer.
> **⚠️ Special Notice for Windows Enterprise LTSC Users**
>
> If you are using Windows LTSC or an enterprise environment governed by strict security policies, PowerShell may run in **Constrained Language Mode**, potentially causing the following issue:
> 1. **If using CMD (.bat): Script executes successfully but fails to write to `Path`**
>
> The script completes file installation. Due to **Constrained Language Mode**, it cannot automatically update environment variables. Manually configure as follows:
> - **Locate the installation directory**:
> - Check if `uv` is available: Enter `uv --version` in CMD. If a version number appears, **only configure the QwenPaw path**. If you receive the prompt `'uv' is not recognized as an internal or external command, operable program or batch file,` configure both paths.
> - uv path (choose one based on installation location; use if `uv` fails): Typically `%USERPROFILE%\.local\bin`, `%USERPROFILE%\AppData\Local\uv`, or the `Scripts` folder within your Python installation directory
> - QwenPaw path: Typically located at `%USERPROFILE%\.qwenpaw\bin`.
> - **Manually add to the system's Path environment variable**:
> - Press `Win + R`, type `sysdm.cpl` and press Enter to open System Properties.
> - Click “Advanced” -> “Environment Variables”.
> - Under “System variables”, locate and select `Path`, then click “Edit”.
> - Click “New”, enter both directory paths sequentially, then click OK to save.
> 2. **If using PowerShell (.ps1): Script execution interrupted**
>
> Due to **Constrained Language Mode**, the script may fail to automatically download `uv`.
> - **Manually install uv**: Refer to the [GitHub Release](https://github.com/astral-sh/uv/releases) to download `uv.exe` and place it in `%USERPROFILE%\.local\bin` or `%USERPROFILE%\AppData\Local\uv`; or ensure Python is installed and run `python -m pip install -U uv`.
> - **Configure `uv` environment variables**: Add the `uv` directory and `%USERPROFILE%\.qwenpaw\bin` to your system's `Path` variable.
> - **Re-run the installation**: Open a new terminal and execute the installation script again to complete the `QwenPaw` installation.
> - **Configure the `QwenPaw` environment variable**: Add `%USERPROFILE%\.qwenpaw\bin` to your system's `Path` variable.
Once installed, open a new terminal and run:
```bash
qwenpaw init --defaults # or: qwenpaw init (interactive)
qwenpaw app
```
<details>
<summary><b>Install options</b></summary>
**macOS / Linux:**
```bash
# Install a specific version
curl -fsSL ... | bash -s -- --version 1.1.0
# Install from source (dev/testing)
curl -fsSL ... | bash -s -- --from-source
# Upgrade — just re-run the installer
curl -fsSL ... | bash
# Uninstall
qwenpaw uninstall # keeps config and data
qwenpaw uninstall --purge # removes everything
```
**Windows (PowerShell):**
```powershell
# Install a specific version
irm ... | iex; .\install.ps1 -Version 1.1.12
# Install from source (dev/testing)
.\install.ps1 -FromSource
# Upgrade — just re-run the installer
irm ... | iex
# Uninstall
qwenpaw uninstall # keeps config and data
qwenpaw uninstall --purge # removes everything
```
</details>
---
### Option 3: Docker
Images are on **Docker Hub** (`agentscope/qwenpaw`). Image tags: `latest` (stable); `pre` (PyPI pre-release).
```bash
docker pull agentscope/qwenpaw:latest
docker run -p 127.0.0.1:8088:8088 \
-v qwenpaw-data:/app/working \
-v qwenpaw-secrets:/app/working.secret \
-v qwenpaw-backups:/app/working.backups \
agentscope/qwenpaw:latest
```
Also available on Alibaba Cloud Container Registry (ACR) for users in China: `agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/qwenpaw` (same tags).
Then open **http://127.0.0.1:8088/** for the Console. Config, memory, and skills are stored in the `qwenpaw-data` volume; model provider settings and API keys are in the `qwenpaw-secrets` volume; backup archives are stored in the `qwenpaw-backups` volume. To pass API keys (e.g. `DASHSCOPE_API_KEY`), add `-e VAR=value` or `--env-file .env` to `docker run`.
> **Connecting to Ollama or other services on the host machine**
>
> Inside a Docker container, `localhost` refers to the container itself, not your host machine. If you run Ollama (or other model services) on the host and want QwenPaw in Docker to reach them, use one of these approaches:
>
> **Option A** — Explicit host binding (all platforms):
> ```bash
> docker run -p 127.0.0.1:8088:8088 \
> --add-host=host.docker.internal:host-gateway \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> Then in QwenPaw **Settings → Models**, change the Base URL to `http://host.docker.internal:<port>` — for example, `http://host.docker.internal:11434` for Ollama, or `http://host.docker.internal:1234/v1` for LM Studio.
>
> **Option B** — Host networking (Linux only):
> ```bash
> docker run --network=host \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> No port mapping (`-p`) is needed; the container shares the host network directly. Note that all container ports are exposed on the host, which may cause conflicts if the port is already in use.
>
The image is built from scratch. To build the image yourself, please refer to the [Build Docker image](scripts/README.md#build-docker-image) section in `scripts/README.md`, and then push to your registry.
---
### Option 4: Deploy on Alibaba Cloud ECS
To run QwenPaw on Alibaba Cloud (ECS), use the one-click deployment: open the [QwenPaw on Alibaba Cloud (ECS) deployment link](https://computenest.console.aliyun.com/service/instance/create/cn-hangzhou?type=user&ServiceId=service-1ed84201799f40879884) and follow the prompts. For step-by-step instructions, see [Alibaba Cloud Developer: Deploy your AI assistant in 3 minutes](https://developer.aliyun.com/article/1713682).
---
### Option 5: AgentScope Platform
[AgentScope Platform](https://platform.agentscope.io/) provides one-click cloud QwenPaw deployment, plugin sharing, and a Skill marketplace. Free, 7/24 online.
---
### Option 6: Using ModelScope
[ModelScope Studio](https://modelscope.cn/studios/fork?target=AgentScope/QwenPaw) also supports cloud QwenPaw deployment. Note: set your Studio to **non-public** so others cannot control your QwenPaw.
---
### Option 7: Desktop Application (Beta)
> **Beta Notice**: The desktop application is currently in Beta testing phase with the following known limitations:
> - **Incomplete compatibility testing**: Not fully tested across all system versions and hardware configurations
> - **Potential performance issues**: Startup time, memory usage, and other performance aspects may need further optimization
> - **Features under development**: Some features may be unstable or missing
If you're not comfortable with command-line tools, you can download and use QwenPaw's desktop application without manually configuring Python environments or running commands.
#### Download
Download the desktop app (Tauri build) from [the official download page](https://qwenpaw.agentscope.io/downloads):
- **Windows**: `QwenPaw-Tauri-<version>-Windows-setup.exe`
- **macOS**: `QwenPaw-Tauri-<version>-macOS.zip` (Apple Silicon recommended)
#### Features
- ✅ **Zero configuration**: Download and double-click to run, no need to install Python or configure environment variables
- ✅ **Cross-platform**: Supports Windows 10+ and macOS 14+
- ✅ **Visual interface**: Automatically opens the app window, no need to manually enter addresses
- ⚠️ **Beta stage**: Features are continuously being improved, feedback welcome
#### First Launch
**Important**: The first launch may take 10-60 seconds (depending on your system configuration). The application needs to initialize the Python environment and load dependencies. Please wait patiently for the window to open automatically.
#### macOS: Bypass System Security Restrictions
When you download the QwenPaw macOS app from Releases, macOS may show: *"Apple cannot verify that 'QwenPaw' contains no malicious software"*. This happens because the app is not notarized. You can still open it as follows:
- **Right-click to open (recommended)**
Right-click (or Control+click) the QwenPaw app → **Open** → in the dialog click **Open** again. This tells Gatekeeper you trust the app; after that you can double-click to launch as usual.
- **Allow in System Settings**
If it is still blocked, go to **System Settings → Privacy & Security**, scroll to the message like *"QwenPaw was blocked because it is from an unidentified developer"*, and click **Open Anyway** or **Allow**.
- **Remove quarantine attribute (not recommended for most users)**
In Terminal run:
`xattr -cr "/Applications/QwenPaw Desktop.app"`
(or use the path to the `.app` after unzipping). This clears the "downloaded from the internet" quarantine flag so the warning usually does not appear, but is less safe and controllable than using **Right-click → Open**.
For detailed usage instructions, troubleshooting, and common issues, see the [Desktop Application Guide](https://qwenpaw.agentscope.io/docs/desktop).
---
### What's Next?
After installation, configure your model in **Console → Settings → Models**, then explore:
- [Add Skills](https://qwenpaw.agentscope.io/docs/skills) to extend capabilities (PDF, Office, browser, news, etc.)
- [Set up Channels](https://qwenpaw.agentscope.io/docs/channels) for DingTalk, Lark, Discord, and more
- [Configure Cron](https://qwenpaw.agentscope.io/docs/cron) for scheduled tasks and automation
- See the full [Quick Start guide](https://qwenpaw.agentscope.io/docs/quickstart) for all options and verification steps
---
## Terminal UI (TUI)
Prefer to stay in the terminal? Run `qwenpaw` to open a full-screen chat **TUI** that drives the _same_ agent as the Console and the IM Channels — same memory, skills, MCP tools, and sessions — without leaving your keyboard.
```bash
qwenpaw # open a chat with the active agent
qwenpaw tui --resume <id> # resume a previous session
qwenpaw . # start in the current repo (Coding Mode)
```
It supports streaming replies, slash commands (`/help`, `/resume`, `/theme`, plus the agent's own `/model`, `/clear`, …), pasting files/long text as attachments, and inline tool-permission prompts. See the [Terminal UI guide](https://qwenpaw.agentscope.io/docs/tui) for details.
![QwenPaw TUI](https://img.alicdn.com/imgextra/i2/O1CN01IULzib1TRAzigIcqG_!!6000000002378-2-tps-2350-1312.png)
---
## API Key
If you use a **cloud LLM API** (e.g., DashScope / Qwen, OpenAI, Anthropic, Google Gemini, DeepSeek, Kimi, OpenRouter, and more), you must configure an API key before chatting. QwenPaw will not work until a valid key is set. See the [official docs](https://qwenpaw.agentscope.io/docs/models) for details.
**How to configure:**
1. **Console (recommended)** — After running `qwenpaw app`, open **http://127.0.0.1:8088/** → **Settings** → **Models**. Choose a provider, enter the **API Key**, and enable that provider and model.
2. **`qwenpaw init`** — When you run `qwenpaw init`, it will guide you through configuring the LLM provider and API key. Follow the prompts to choose a provider and enter your key.
3. **Environment variable** — For DashScope you can set `DASHSCOPE_API_KEY` in your shell or in a `.env` file in the working directory.
Tools that need extra keys (e.g. `TAVILY_API_KEY` for web search) can be set in Console **Settings → Environment variables**, see [Config](https://qwenpaw.agentscope.io/docs/config) for details.
> **Using local models only?** If you use [Local Models](#local-models) (QwenPaw Local / Ollama / LM Studio), you do **not** need any API key.
## Local Models
QwenPaw can run LLMs entirely on your machine — no API keys or cloud services required. See the [official docs](https://qwenpaw.agentscope.io/docs/models) for details.
QwenPaw also provides the **QwenPaw-Flash** series — purpose-trained 2B / 4B / 9B models for agent scenarios, with Q4 and Q8 quantizations. Available on [ModelScope](https://www.modelscope.cn/organization/AgentScope?tab=model) and [Hugging Face](https://huggingface.co/agentscope-ai/models).
| Backend | Best for | Install |
| -------------------- | ---------------------------------------- | -------------------------------------------------------------------- |
| **QwenPaw Local** (llama.cpp) | Cross-platform (macOS / Linux / Windows) | Built-in; click "Download" in the web UI. Supports QwenPaw-Flash with hardware-aware recommendations. |
| **Ollama** | Cross-platform (requires Ollama service) | Install and start Ollama; set context length ≥ 32k. |
| **LM Studio** | Cross-platform (requires LM Studio) | Install and start LM Studio; enable Local Server. |
---
## Security Features
QwenPaw includes five core security layers:
- **Sandbox** — Kernel-level execution isolation using Seatbelt (macOS), Bubblewrap / Landlock (Linux), and AppContainer (Windows). Shell commands run inside a restricted filesystem view.
- **Tool Guard** — YAML rule engine with `ShellEvasionGuardian` inspects every tool call before execution, detecting command injection, path traversal, reverse shells, and obfuscated attacks. Configurable approval levels: STRICT / SMART / AUTO / OFF.
- **File Guard** — Independent of Tool Guard; blocks agent access to sensitive files and directories (default-protects `~/.qwenpaw.secret/`, `~/.ssh`, etc.).
- **Skill Scanner** — Pre-activation scanning with block / warn / off modes and whitelist support. Detects prompt injection, hardcoded secrets, data exfiltration, and more.
- **Access Policy** — Declarative access rules that allow, deny, or request human approval for each capability call, with tool-level granularity and source-aware matching.
See [Security](https://qwenpaw.agentscope.io/docs/security) for details.
---
## Documentation
| Topic | Description |
| --------------------------------------------------------------------- | ------------------------------------------------ |
| [Introduction](https://qwenpaw.agentscope.io/docs/intro) | What QwenPaw is and how to use it |
| [Quick start](https://qwenpaw.agentscope.io/docs/quickstart) | Install and run (local or ModelScope Studio) |
| [Console](https://qwenpaw.agentscope.io/docs/console) | Web UI: chat and agent configuration |
| [Terminal UI (TUI)](https://qwenpaw.agentscope.io/docs/tui) | Full-screen terminal chat, same agent as Console |
| [Desktop App](https://qwenpaw.agentscope.io/docs/desktop) | Desktop application installation and usage |
| [Models](https://qwenpaw.agentscope.io/docs/models) | Configure cloud, local, and custom providers |
| [Channels](https://qwenpaw.agentscope.io/docs/channels) | DingTalk, Lark, QQ, Discord, iMessage, and more |
| [Skills](https://qwenpaw.agentscope.io/docs/skills) | Extend and customize capabilities |
| [Plugins](https://qwenpaw.agentscope.io/docs/plugins) | Plugin system and Plugin Market |
| [MCP](https://qwenpaw.agentscope.io/docs/mcp) | Manage MCP clients |
| [Persona](https://qwenpaw.agentscope.io/docs/persona) | Agent personality customization (SOUL / PROFILE) |
| [Memory](https://qwenpaw.agentscope.io/docs/memory) | Self-evolving personal knowledge base built on local, editable, searchable, and linked Markdown memory, powered by [ReMe](https://github.com/agentscope-ai/ReMe) |
| [ReMe Documentation](https://docs.agentscope.io/reme/latest/en/overview) | Official ReMe overview and documentation |
| [Memory-Evolving & Proactive](https://qwenpaw.agentscope.io/docs/memory-evolving-and-proactive) | Agent memory evolution and proactive interaction |
| [Context](https://qwenpaw.agentscope.io/docs/context) | Scroll-based context management |
| [Magic commands](https://qwenpaw.agentscope.io/docs/commands) | Control conversation state without waiting for the AI |
| [Heartbeat](https://qwenpaw.agentscope.io/docs/heartbeat) | Scheduled check-in and digest |
| [Cron / Scheduled Tasks](https://qwenpaw.agentscope.io/docs/cron) | Scheduled tasks and automation |
| [Multi-Agent](https://qwenpaw.agentscope.io/docs/multi-agent) | Create multiple agents and enable collaboration |
| [Security](https://qwenpaw.agentscope.io/docs/security) | Sandbox, tool guard, file guard, skill scanner, access policy |
| [Backup & Restore](https://qwenpaw.agentscope.io/docs/backup) | Data backup and recovery |
| [Config & working dir](https://qwenpaw.agentscope.io/docs/config) | Working directory and config file |
| [REST API](https://qwenpaw.agentscope.io/docs/api-tutorial) | HTTP API for integration and automation |
| [ACP Integration](https://qwenpaw.agentscope.io/docs/acp-integration) | Agent Communication Protocol integration |
| [CLI](https://qwenpaw.agentscope.io/docs/cli) | Init, cron jobs, skills, clean |
| [Agent Team Practice](https://qwenpaw.agentscope.io/docs/practice-agent-team) | Multi-agent team deployment guide |
| [FAQ](https://qwenpaw.agentscope.io/docs/faq) | Common questions and troubleshooting |
Full documentation: [qwenpaw.agentscope.io/docs](https://qwenpaw.agentscope.io/docs)
---
## FAQ
For common questions, troubleshooting tips, and known issues, please visit the **[FAQ page](https://qwenpaw.agentscope.io/docs/faq)**.
---
## Roadmap
| Area | Item | Status |
| ------------------------------- | ---------------------------------------------------------------------- | -------------------- |
| **Horizontal Expansion** | More channels, models, skills, and MCPs | Seeking Contributors |
| **Existing Feature Extension** | Display, download, and Windows improvements | Seeking Contributors |
| **Models** | Multi-model switching | In Progress |
| **Safety & Approval** | Batch preview and approval | In Progress |
| **Automation** | Automated tasks | In Progress |
| **Agent Interaction** | Agent task handoff | In Progress |
| | Running task steering | In Progress |
| **Workspaces** | Multiple workspaces | In Progress |
| **Context** | System prompt compression | In Progress |
| **Tooling** | Multi-location file changes | In Progress |
| | Persistent terminals and background tasks | In Progress |
| **Computer-use** | On-screen target detection and actions | In Progress |
| **Voice Interaction** | Real-time voice tasks | In Progress |
| **Context Management & Memory** | Hot-swappable vector models and storage | In Progress |
| | Personal knowledge base | In Progress |
| **QwenPaw Applications** | QwenPaw Insight | In Progress |
| | QwenPaw Mail | In Progress |
_Status:_ **In Progress** — actively being worked on; **Seeking Contributors** — we strongly encourage community contributions.
---
## Contributing
QwenPaw evolves through open collaboration, and we welcome all forms of contribution! Check the [Roadmap](#roadmap) above (especially items marked **Seeking Contributors**) to find areas that interest you, and read [CONTRIBUTING](https://github.com/agentscope-ai/QwenPaw/blob/main/CONTRIBUTING.md) to get started. We particularly welcome:
- **Horizontal expansion** — new channels, model providers, skills, MCPs.
- **Existing feature extension & refinement** — display and interaction improvements, download hints, Windows path compatibility, etc.
Join [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions) to discuss ideas or pick up tasks.
---
## Install From Source
```bash
git clone https://github.com/agentscope-ai/QwenPaw.git
cd QwenPaw
# Build console frontend first (required for web UI)
cd console && npm ci && npm run build
cd ..
# Copy console build output to package directory
mkdir -p src/qwenpaw/console
cp -R console/dist/. src/qwenpaw/console/
# Install Python package
pip install -e .
```
- **Dev** (tests, formatting): `pip install -e ".[dev,test,full]"`
- **Then**: Run `qwenpaw init --defaults`, then `qwenpaw app`.
> **Note for updates:** When updating to a new major version after `git pull`, please also rebuild the frontend, reinstall the package (`pip install -e .`), restart `qwenpaw app`, and clear your browser cache with `Ctrl+Shift+R` (or `Cmd+Shift+R` on macOS).
---
## Why QwenPaw?
QwenPaw stands for Qwen Personal Agent Workstation, and also embodies the wisdom of Qwen and the warmth of a Paw.
We hope it is not a cold tool, but an intelligent and warm "little paw" always ready to help—a most intuitive partner in your digital life.
---
## Built By
[AgentScope team](https://github.com/agentscope-ai) · [AgentScope](https://github.com/agentscope-ai/agentscope) · [AgentScope Runtime](https://github.com/agentscope-ai/agentscope-runtime) · [ReMe](https://github.com/agentscope-ai/ReMe)
---
## Contact Us
| [Discord](https://discord.gg/eYMpfnkG8h) | [X (Twitter)](https://x.com/agentscope_ai) | [DingTalk](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [RedNote](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [<img src="https://gw.alicdn.com/imgextra/i1/O1CN01hhD1mu1Dd3BWVUvxN_!!6000000000238-2-tps-400-400.png" width="80" height="80" alt="Discord">](https://discord.gg/eYMpfnkG8h) | [<img src="https://img.shields.io/badge/X-black.svg?logo=x&logoColor=white" width="80" height="80" alt="X">](https://x.com/agentscope_ai) | [<img src="https://img.alicdn.com/imgextra/i2/O1CN01vCWI8a1skHtLGXEMQ_!!6000000005804-2-tps-458-460.png" width="80" height="80" alt="DingTalk">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [<img src="https://img.alicdn.com/imgextra/i3/O1CN016BoEPS1l33CE9mHb9_!!6000000004762-0-tps-160-160.jpg" width="80" height="80" alt="RedNote">](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
---
## Staying Ahead
<a href="https://github.com/agentscope-ai/QwenPaw">
<img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" width="600" alt="Star QwenPaw" />
</a>
Star QwenPaw on GitHub and be instantly notified of new releases.
---
## Telemetry
QwenPaw collects **anonymous** usage data during `qwenpaw init` to help us understand our user base and prioritize improvements. Data is sent **once per version** — when you upgrade QwenPaw, telemetry is re-collected so we can track version adoption.
**What we collect:**
- QwenPaw version (e.g., 1.1.12)
- Install method (pip, Docker, or desktop app)
- OS and version (e.g., macOS 14.0, Ubuntu 22.04)
- Python version (e.g., 3.13)
- CPU architecture (e.g., x86_64, arm64)
- GPU availability (yes/no)
**What we do NOT collect:** No personal data, no files, no credentials, no IP addresses, no identifiable information.
When running `qwenpaw init` interactively, you will be asked whether to opt in. If you choose `--defaults`, telemetry is accepted automatically. The prompt appears once per version and never affects QwenPaw's functionality.
---
## License
QwenPaw is released under the [Apache License 2.0](LICENSE).
---
## Contributors
All thanks to our contributors:
<a href="https://github.com/agentscope-ai/QwenPaw/graphs/contributors">
<img src="https://contrib.rocks/image?repo=agentscope-ai/QwenPaw" alt="Contributors" />
</a>
+565
View File
@@ -0,0 +1,565 @@
<div align="center">
# QwenPaw
[![GitHub Repo](https://img.shields.io/badge/GitHub-Repo-black.svg?logo=github)](https://github.com/agentscope-ai/QwenPaw)
[![PyPI](https://img.shields.io/pypi/v/qwenpaw?color=3775A9&label=PyPI&logo=pypi)](https://pypi.org/project/qwenpaw/)
[![Documentation](https://img.shields.io/badge/Docs-Website-green.svg?logo=readthedocs&label=Docs)](https://qwenpaw.agentscope.io/)
[![Python Version](https://img.shields.io/badge/python-3.11%20~%20%3C3.14-blue.svg?logo=python&label=Python)](https://www.python.org/downloads/)
[![Last Commit](https://img.shields.io/github/last-commit/agentscope-ai/QwenPaw)](https://github.com/agentscope-ai/QwenPaw)
[![License](https://img.shields.io/badge/license-Apache%202.0-red.svg?logo=apache&label=License)](LICENSE)
[![Code Style](https://img.shields.io/badge/code%20style-black-black.svg?logo=python&label=CodeStyle)](https://github.com/psf/black)
[![GitHub Stars](https://img.shields.io/github/stars/agentscope-ai/QwenPaw?style=flat&logo=github&color=yellow&label=Stars)](https://github.com/agentscope-ai/QwenPaw/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/agentscope-ai/QwenPaw?style=flat&logo=github&color=purple&label=Forks)](https://github.com/agentscope-ai/QwenPaw/network)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-Ask_Devin-navy.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/agentscope-ai/QwenPaw)
[![Discord](https://img.shields.io/badge/Discord-Join_Us-blueviolet.svg?logo=discord)](https://discord.gg/eYMpfnkG8h)
[![X](https://img.shields.io/badge/X-Follow_Us-black.svg?logo=x)](https://x.com/agentscope_ai)
[![DingTalk](https://img.shields.io/badge/DingTalk-Join_Us-orange.svg)](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11)
[![AgentScope Platform](https://img.shields.io/badge/%E2%98%81_AgentScope_Platform-%F0%9F%90%BE_7%2F24_Online_%26_Free-FF6B2B.svg)](https://platform.agentscope.io/)
<a href="https://trendshift.io/repositories/25882" target="_blank"><img src="https://trendshift.io/api/badge/trendshift/repositories/25882/daily" alt="agentscope-ai%2FQwenPaw | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[[ドキュメント](https://qwenpaw.agentscope.io/)] [[English](README.md)] [[中文](README_zh.md)] [[Русский](README_ru.md)]
<p align="center">
<img src="https://gw.alicdn.com/imgextra/i1/O1CN01sens5C1TuwioeGexL_!!6000000002443-55-tps-771-132.svg" alt="QwenPaw Logo" width="120">
</p>
<p align="center"><b>あなたのために働き、あなたとともに成長する。</b></p>
</div>
あなた専用の AI アシスタント — ローカルまたはクラウドに展開し、Skills & Plugins で拡張、あらゆるチャネルで接続。
| | |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **忘れない** | 3 層メモリ — ライブな作業コンテキスト、完全な逐語履歴、そして [ReMe](https://github.com/agentscope-ai/ReMe) による自己進化型パーソナルナレッジベース。会話と資料を、読み取り・編集・検索が可能で相互にリンクされた Markdown メモリへ継続的に変換。 |
| **ローカルもクラウドも、自由に動く** | QwenPaw-Flash モデル(2B / 4B / 9B)— エージェントタスク向けに訓練。内蔵 QwenPaw Local ランタイム — API キー不要、クラウド依存なし。Ollama、LM Studio、14+ クラウドプロバイダーにも対応。 |
| **セキュリティ内蔵** | カーネルレベルの Sandbox、Tool Guard、File Guard、Skill Scanner、Access Policy。危険なコマンドは実行前にブロック。 |
| **マルチエージェント&並列** | 独自のメモリとスキルを持つ独立エージェントを生成。実行時のサブエージェント。Agent Communication Protocol(ACP)によるクロスシステム編成。 |
| **ファイルワークスペース** | プロジェクトと Agent のファイルに共通するナビゲーション、プレビュー、編集、Diff、アップロード、ダウンロード。 |
| **拡張可能** | スケジューリング、ドキュメント、ブラウザ、ニュースなどの Skills。マーケット付きプラグインアーキテクチャ。MCP で外部ツールを統合。目的別ワークフローに自由に組み合わせ可能。 |
| **どこでも届く** | DingTalk、Lark、WeChat、Discord、Telegram、iMessage、QQ — 1 インスタンス、全チャネル。Console、TUI、デスクトップアプリで直接アクセス。 |
| **あなたのもの、私たちのものではない** | ローカル展開 — データはあなたのマシンに留まる。サードパーティホスティングなし、データアップロードなし。 |
> <details>
> <summary><b>QwenPaw でできること</b></summary>
>
> <br>
>
> - **自動化 & スケジューリング**: 定期タスクを設定 — ニュースダイジェスト、レポート生成、マルチチャネル配信 — すべてスケジュール通りに自動実行。
> - **コード & 開発**: 統合ファイルワークスペースでプロジェクト内のコードを読み取り、編集、レビュー、テスト。
> - **ドキュメント処理**: PDF、Word、Excel、PowerPoint の読み取り、書き込み、変換。
> - **情報収集**: Web 検索、購読情報のフォロー、動画要約、個人ナレッジベースからの検索。
> - **マルチチャネル運用**: DingTalk、Lark、Discord、Telegram などへアラート、要約、AI 生成コンテンツをプッシュ — 同時またはチャネル別。
> - **カスタムワークフロー**: 組み込み機能、プラグイン、定期タスクを組み合わせて、自分に合ったワークフローを構築。
>
> </details>
---
## ニュース
- [2026-08-13] **v2.1.0** | QwenPaw OS Shell、統合 Files ワークスペース、QwenPaw Creator、Codex/Qoder エージェント連携、Browser-use、Computer-use、ワークスペースチェックポイント、長時間の対話タスク継続など。[v2.1.0 リリースノート →](https://qwenpaw.agentscope.io/release-notes#v2.1.0)
- [2026-07-24] **v2.0.1** | PawApp ミニアプリプラットフォーム、ユーザー編集可能な Agent Mode、Oh-My-Paw plugins、[ReMe](https://github.com/agentscope-ai/ReMe) メモリ強化、デスクトップ UX 改善など。[v2.0.1 リリースノート →](https://qwenpaw.agentscope.io/release-notes#v2.0.1)
- [2026-07-10] **v2.0.0 — QwenPaw 2.0 正式リリース** 🎉 | AgentScope 2.0 ベースの全面リライト:Agent OS アーキテクチャ、Loop Engineering、Scroll Context、[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 自己進化型パーソナルナレッジベース、組み込み TUI を提供。
| ハイライト | 内容 |
|-----------|------|
| **Agent OS — Workspace** | エージェントごとの 3 本柱:**Resources**(透明なディスク保存)、**Governance**(allow/deny/ask/sandbox)、**Sandbox**(macOS / Linux / Windows)。 |
| **Agent OS — Drivers** | プロトコル中立な MCP / A2A / ACP コネクタ層、暗号化資格情報と呼び出しごとのポリシーゲート付き。 |
| **Loop Engineering** | 高度なエージェントループテンプレート(Coding Mode、Mission Mode、今後さらに追加予定)と組み合わせ可能な承認ゲート。 |
| **Scroll Context** | 全ターンを永続化;退去ターンはインデックス付きでオンデマンド再生 — 要約なし、情報欠落なし。 |
| **[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 自己進化型パーソナルナレッジベース** | 会話と資料を、読み取り・編集・検索が可能で相互にリンクされた Markdown メモリへ継続的に変換。 |
| **Terminal UI (TUI)** | フルスクリーンターミナルチャット — Console やチャネルと同一のエージェント・記憶・セッション。 |
Agent OS をベースに、すぐに使える QwenPaw アプリケーション — **QwenPaw Creator**、**QwenPaw Insight** など — を順次リリース予定です。 [v2.0.0 リリースノート →](https://qwenpaw.agentscope.io/release-notes#v2.0.0)
- [2026-06-17] **v1.1.12 — モデルページ大刷新 & シンプルモード** | Provider 集約による新モデルページデザイン、フラットナビのシンプルモード追加。[v1.1.12 リリースノート →](https://qwenpaw.agentscope.io/release-notes#v1.1.12)
- [2026-06-11] **AgentScope プラットフォーム公開** — QwenPaw の無料デプロイ、プラグイン共有、Skill マーケットに対応。[今すぐ試す →](https://platform.agentscope.io/)
- [2026-06-10] **v1.1.11** — 無料モデル OAuth、プラグインマーケット、MCP ツールホワイトリスト。[v1.1.11 リリースノート →](https://qwenpaw.agentscope.io/release-notes#v1.1.11)
[すべてのリリースノート →](https://qwenpaw.agentscope.io/release-notes)
---
## 目次
- [ニュース](#ニュース)
- [クイックスタート](#クイックスタート)
- [API キー](#api-キー)
- [ローカルモデル](#ローカルモデル)
- [セキュリティ機能](#セキュリティ機能)
- [ドキュメント](#ドキュメント)
- [FAQ](#faq)
- [ロードマップ](#ロードマップ)
- [コントリビュート](#コントリビュート)
- [ソースからインストール](#ソースからインストール)
- [なぜ QwenPaw?](#なぜ-qwenpaw)
- [開発元](#開発元)
- [ライセンス](#ライセンス)
---
## クイックスタート
### オプション 1: Pip Install
Python を自分で管理する場合(Python >= 3.11, < 3.14 が必要):
```bash
pip install qwenpaw
qwenpaw init --defaults
qwenpaw app
```
ブラウザで **http://127.0.0.1:8088/** を開いてコンソールでモデルを設定します。DingTalk、Lark、WeChat などでチャットするには、[チャネル設定](https://qwenpaw.agentscope.io/docs/channels) ドキュメントを参照してください。
![Console](https://img.alicdn.com/imgextra/i2/O1CN01EP1ra01iOAcBvF0TC_!!6000000004402-2-tps-3822-2070.png)
---
### オプション 2: Script Install
Python 環境の手動設定は不要。1 つのコマンドで自動的にすべてをインストール。スクリプトは uv(Python パッケージマネージャー)のダウンロード、仮想環境の作成、QwenPaw と全依存関係(Node.js とフロントエンドアセットを含む)のインストールを自動的に行います。注:一部のネットワーク環境や企業の権限管理下では使用できない場合があります。
**macOS / Linux:**
```bash
curl -fsSL https://qwenpaw.agentscope.io/install.sh | bash
```
**Windows (CMD):**
```CMD
curl -fsSL https://qwenpaw.agentscope.io/install.bat -o install.bat && install.bat
```
**Windows (PowerShell):**
```powershell
irm https://qwenpaw.agentscope.io/install.ps1 | iex
```
> **注意**: インストーラーは uv の状態を自動的に確認します。未インストールの場合はダウンロードと設定を試みます。自動インストールに失敗した場合は、画面の指示に従うか、`python -m pip install -U uv` を実行してからインストーラーを再実行してください。
> **⚠️ Windows Enterprise LTSC ユーザーへの重要なお知らせ**
>
> Windows LTSC または厳格なセキュリティポリシーが適用された企業環境をご利用の場合、PowerShell は **制限付き言語モード** で実行される可能性があり、以下の問題が発生する可能性があります:
> 1. **CMD(.bat)使用時:スクリプトは正常に実行されるが `Path` への書き込みができない**
>
> スクリプトはファイルインストールを完了しましたが、**制限付き言語モード** のため環境変数への自動書き込みができません。この場合、手動で設定してください:
> - **インストールディレクトリを確認**:
> - `uv` の利用可否を確認:CMD で `uv --version` と入力し、バージョン番号が表示された場合は **QwenPaw パスのみ設定**。`『uv』 は内部コマンドでも外部コマンドでもなく、実行可能プログラムまたはバッチファイルでもありません。` と表示された場合は両方を設定する必要があります。
> - uv パス(いずれか一つ、インストール場所に応じて選択。`uv` が利用不可の場合に記入):通常 `%USERPROFILE%\.local\bin`、`%USERPROFILE%\AppData\Local\uv`、または Python インストールディレクトリの `Scripts` フォルダ
> - QwenPaw パス:通常 `%USERPROFILE%\.qwenpaw\bin` にあります。
> - **システム環境変数 Path への手動追加**:
> - `Win + R` を押し、`sysdm.cpl` と入力して Enter キーを押し、「システムのプロパティ」を開く。
> - 「詳細設定」→「環境変数」をクリック。
> - 「システム変数」で `Path` を探して選択し、「編集」をクリック。
> - 「新規」をクリックし、上記の 2 つのディレクトリパスを順に入力して「OK」をクリックし保存します。
> 2. **PowerShell(.ps1)を使用している場合:スクリプト実行が中断する**
>
> **制限付き言語モード** のため、スクリプトが自動的に `uv` をダウンロードできない可能性があります。
> - **uv を手動でインストール**: [GitHub Release](https://github.com/astral-sh/uv/releases) を参照し、`uv.exe` を `%USERPROFILE%\.local\bin` または `%USERPROFILE%\AppData\Local\uv` に配置。または Python がインストールされていることを確認し、`python -m pip install -U uv` を実行。
> - **`uv` 環境変数の設定**:`uv` の配置ディレクトリと `%USERPROFILE%\.qwenpaw\bin` をシステムの `Path` 変数に追加してください。
> - **再実行**:新しいターミナルを開き、インストールスクリプトを再度実行して `QwenPaw` のインストールを完了させてください。
> - **`QwenPaw` 環境変数の設定**:`%USERPROFILE%\.qwenpaw\bin` をシステムの `Path` 変数に追加します。
インストール完了後、新しいターミナルを開き、以下を実行してください:
```bash
qwenpaw init --defaults # または: qwenpaw init(対話式)
qwenpaw app
```
<details>
<summary><b>インストールオプション</b></summary>
**macOS / Linux:**
```bash
# 特定のバージョンをインストール
curl -fsSL ... | bash -s -- --version 1.1.0
# ソースからインストール(開発/テスト用)
curl -fsSL ... | bash -s -- --from-source
# アップグレード — インストーラーを再実行するだけ
curl -fsSL ... | bash
# アンインストール
qwenpaw uninstall # 設定とデータを保持
qwenpaw uninstall --purge # すべて削除
```
**Windows (PowerShell):**
```powershell
# 特定のバージョンをインストール
irm ... | iex; .\install.ps1 -Version 1.1.12
# ソースからインストール(開発/テスト用)
.\install.ps1 -FromSource
# アップグレード — インストーラーを再実行するだけ
irm ... | iex
# アンインストール
qwenpaw uninstall # 設定とデータを保持
qwenpaw uninstall --purge # すべて削除
```
</details>
---
### オプション 3: Docker
イメージは **Docker Hub**(`agentscope/qwenpaw`)で公開しています。タグ: `latest`(安定版); `pre`(PyPI プレリリース版)。
```bash
docker pull agentscope/qwenpaw:latest
docker run -p 127.0.0.1:8088:8088 \
-v qwenpaw-data:/app/working \
-v qwenpaw-secrets:/app/working.secret \
-v qwenpaw-backups:/app/working.backups \
agentscope/qwenpaw:latest
```
中国のユーザーは阿里雲コンテナレジストリ(ACR)も利用できます: `agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/qwenpaw`(タグは同じ)。
ブラウザで **http://127.0.0.1:8088/** を開くとコンソールが利用できます。設定、メモリ、スキルは `qwenpaw-data` ボリュームに保存されます。モデル設定と API キーは `qwenpaw-secrets` ボリュームに保存されます。バックアップアーカイブは `qwenpaw-backups` ボリュームに保存されます。API キー(例: `DASHSCOPE_API_KEY`)を渡すには、`docker run` に `-e VAR=value` または `--env-file .env` を追加してください。
> **ホストマシン上の Ollama や他のモデルサービスに接続する**
>
> Docker コンテナ内の `localhost` はコンテナ自身を指し、ホストマシンではありません。Ollama(または他のモデルサービス)がホスト上で動作している場合、以下のいずれかの方法で QwenPaw コンテナからアクセスできます:
>
> **方法 A** — ホストアドレスの明示的バインディング(全プラットフォーム対応):
> ```bash
> docker run -p 127.0.0.1:8088:8088 \
> --add-host=host.docker.internal:host-gateway \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> その後、QwenPaw の **設定 → モデル** で、Base URL を `http://host.docker.internal:<ポート>` に変更してください — 例えば、Ollama の場合は `http://host.docker.internal:11434`、LM Studio の場合は `http://host.docker.internal:1234/v1` とします。
>
> **方法 B** — ホストネットワーク(Linux のみ):
> ```bash
> docker run --network=host \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> ポートマッピング(`-p`)は不要で、コンテナはホストネットワークを直接共有します。ただし、コンテナの全ポートがホスト上に公開されるため、使用中のポートと競合する可能性があります。
>
イメージはゼロからビルドされています。自分でイメージをビルドする場合は、`scripts/README.md` の [Build Docker image](scripts/README.md#build-docker-image) セクションを参照し、レジストリにプッシュしてください。
---
### オプション 4: Alibaba Cloud ECS へのデプロイ
QwenPaw を Alibaba Cloud(ECS)で実行するには、ワンクリックデプロイを使用します: [QwenPaw on Alibaba Cloud (ECS) デプロイリンク](https://computenest.console.aliyun.com/service/instance/create/cn-hangzhou?type=user&ServiceId=service-1ed84201799f40879884) を開き、プロンプトに従ってください。ステップバイステップの手順については、[Alibaba Cloud Developer: 3 分で AI アシスタントをデプロイ](https://developer.aliyun.com/article/1713682) を参照してください。
---
### オプション 5: AgentScope Platform
[AgentScope Platform](https://platform.agentscope.io/) でワンクリックのクラウド QwenPaw デプロイ、プラグイン共有、Skill マーケットに対応。無料、7/24 オンライン。
---
### オプション 6: ModelScope を使用
[ModelScope Studio](https://modelscope.cn/studios/fork?target=AgentScope/QwenPaw) でもクラウド QwenPaw デプロイに対応。注意:他の人があなたの QwenPaw を操作できないよう、Studio を **非公開** に設定してください。
---
### オプション 7: Desktop Application (Beta)
> **Beta 版の注意事項**: デスクトップアプリケーションは現在 Beta 版テスト段階にあり、以下の既知の制限があります:
> - **互換性テストが不完全**: すべてのシステムバージョンとハードウェア構成で十分にテストされていません
> - **パフォーマンスの問題の可能性**: 起動時間、メモリ使用量などのパフォーマンス面でさらなる最適化が必要な場合があります
> - **開発中の機能**: 一部の機能が不安定または欠落している可能性があります
コマンドラインツールに慣れていない場合、QwenPaw のデスクトップアプリケーションをダウンロードして使用できます。Python 環境の手動設定やコマンドの実行は不要です。
#### ダウンロード
[公式ダウンロードページ](https://qwenpaw.agentscope.io/downloads) からデスクトップアプリ(Tauri 版)をダウンロード:
- **Windows**: `QwenPaw-Tauri-<version>-Windows-setup.exe`
- **macOS**: `QwenPaw-Tauri-<version>-macOS.zip` (Apple Silicon 推奨)
#### 特徴
- ✅ **ゼロ設定**: ダウンロードしてダブルクリックするだけで実行可能、Python のインストールや環境変数の設定は不要
- ✅ **クロスプラットフォーム**: Windows 10+ と macOS 14+ に対応
- ✅ **ビジュアルインターフェース**: アプリのウィンドウが自動的に開き、手動でアドレスを入力する必要はありません
- ⚠️ **Beta 段階**: 機能は継続的に改善中、フィードバックを歓迎します
#### 初回起動
**重要**: 初回起動には 10〜60 秒かかる場合があります(システム構成によります)。アプリケーションは Python 環境の初期化と依存関係の読み込みが必要です。ウィンドウが自動的に開くまでお待ちください。
#### macOS: システムセキュリティ制限の回避
Releases から QwenPaw macOS アプリをダウンロードすると、macOS は次のように表示する場合があります: *「Apple は 'QwenPaw' に悪意のあるソフトウェアが含まれていないことを確認できません」*。これはアプリが公証されていないためです。以下の方法で開くことができます:
- **右クリックして開く(推奨)**
QwenPaw アプリを右クリック(または Control+クリック)→ **「開く」** → ダイアログで再度 **「開く」** をクリック。これにより Gatekeeper にアプリを信頼していることを伝えます。その後は通常通りダブルクリックで起動できます。
- **システム設定で許可**
それでもブロックされる場合、**システム設定 → プライバシーとセキュリティ** に移動し、*「'QwenPaw' は未確認の開発元からのものであるためブロックされました」* のようなメッセージまでスクロールし、**「このまま開く」** または **「許可」** をクリックします。
- **検疫属性の削除(ほとんどのユーザーには非推奨)**
ターミナルで実行:
`xattr -cr "/Applications/QwenPaw Desktop.app"`
(または解凍後の `.app` へのパスを使用)。これにより「インターネットからダウンロードされた」検疫フラグがクリアされ、通常は警告が表示されなくなりますが、**右クリック → 開く** を使用するよりも安全性と制御性が低くなります。
詳細な使用方法、トラブルシューティング、よくある問題については、[デスクトップアプリケーションガイド](https://qwenpaw.agentscope.io/docs/desktop) を参照してください。
---
### 次は何をする?
インストール後、**コンソール → 設定 → モデル** でモデルを設定し、以下を探索してください:
- [スキルを追加](https://qwenpaw.agentscope.io/docs/skills) して機能を拡張(PDF、Office、ブラウザ、ニュースなど)
- [チャネルを設定](https://qwenpaw.agentscope.io/docs/channels) して DingTalk、Lark、Discord などに接続
- [Cron を設定](https://qwenpaw.agentscope.io/docs/cron) してスケジュールタスクと自動化を実現
- すべてのオプションと検証手順については、[クイックスタートガイド](https://qwenpaw.agentscope.io/docs/quickstart) を参照
---
## ターミナル UI(TUI)
ターミナルで完結したい場合、`qwenpaw` を実行するとフルスクリーンのチャット **TUI** が開きます。コンソールや IM チャネルと **同じ** エージェントを駆動 — 同じメモリ、スキル、MCP ツール、セッション — キーボードから離れずに操作できます。
```bash
qwenpaw # アクティブなエージェントでチャットを開く
qwenpaw tui --resume <id> # 以前のセッションを再開
qwenpaw . # 現在のリポジトリで開始(Coding Mode)
```
ストリーミング応答、スラッシュコマンド(`/help`、`/resume`、`/theme`、エージェント独自の `/model`、`/clear` など)、ファイル/長文の貼り付け添付、インラインツール権限プロンプトに対応。詳細は [ターミナル UI ガイド](https://qwenpaw.agentscope.io/docs/tui) を参照してください。
![QwenPaw TUI](https://img.alicdn.com/imgextra/i2/O1CN01IULzib1TRAzigIcqG_!!6000000002378-2-tps-2350-1312.png)
---
## API キー
**クラウド LLM API**(例: DashScope / Qwen、OpenAI、Anthropic、Google Gemini、DeepSeek、Kimi、OpenRouter など)を使用する場合、チャットの前に API キーを設定する必要があります。有効なキーが設定されるまで QwenPaw は動作しません。詳細は [公式ドキュメント](https://qwenpaw.agentscope.io/docs/models) をご覧ください。
**設定方法:**
1. **コンソール(推奨)** — `qwenpaw app` 実行後、**http://127.0.0.1:8088/** を開き → **設定** → **モデル**。プロバイダーを選択し、**API キー** を入力して、そのプロバイダーとモデルを有効にしてください。
2. **`qwenpaw init`** — `qwenpaw init` を実行すると、LLM プロバイダーと API キーの設定が案内されます。プロンプトに従ってプロバイダーを選択し、キーを入力してください。
3. **環境変数** — DashScope の場合、シェルまたはワーキングディレクトリの `.env` ファイルで `DASHSCOPE_API_KEY` を設定できます。
その他のキー(例: Web 検索用 `TAVILY_API_KEY`)は、コンソールの **設定 → 環境変数** で設定できます。詳細は [Config](https://qwenpaw.agentscope.io/docs/config) を確認してください。
> **ローカルモデルのみ使用する場合:** [ローカルモデル](#ローカルモデル)(QwenPaw Local / Ollama / LM Studio)を使用する場合、API キーは **不要** です。
## ローカルモデル
QwenPaw は LLM を完全にローカルマシン上で実行できます — API キーやクラウドサービスは不要です。詳細は [公式ドキュメント](https://qwenpaw.agentscope.io/docs/models) をご覧ください。
QwenPaw は **QwenPaw-Flash** シリーズも提供 — エージェントシナリオ向けに目的訓練された 2B / 4B / 9B モデル、Q4 と Q8 量子化に対応。[ModelScope](https://www.modelscope.cn/organization/AgentScope?tab=model) と [Hugging Face](https://huggingface.co/agentscope-ai/models) で入手可能。
| バックエンド | 最適な用途 | インストール |
| -------------------- | ---------------------------------------- | -------------------------------------------------------------------- |
| **QwenPaw Local** (llama.cpp) | クロスプラットフォーム(macOS / Linux / Windows) | 内蔵;Web UI で「Download」をクリック。QwenPaw-Flash に対応、ハードウェアに応じた推奨あり。 |
| **Ollama** | クロスプラットフォーム(Ollama サービスが必要) | Ollama をインストールして起動;コンテキスト長 ≥ 32k を設定。 |
| **LM Studio** | クロスプラットフォーム(LM Studio が必要) | LM Studio をインストールして起動;Local Server を有効化。 |
---
## セキュリティ機能
QwenPaw には 5 つのコアセキュリティレイヤーが含まれています:
- **Sandbox** — macOS では Seatbelt、Linux では Bubblewrap / Landlock、Windows では AppContainer によるカーネルレベルの実行分離。シェルコマンドは制限されたファイルシステムビュー内で実行されます。
- **Tool Guard** — YAML ルールエンジンと `ShellEvasionGuardian` が実行前にすべてのツール呼び出しを検査し、コマンドインジェクション、パストラバーサル、リバースシェル、難読化攻撃を検出。承認レベル設定可能:STRICT / SMART / AUTO / OFF。
- **File Guard** — Tool Guard とは独立;エージェントの機密ファイル・ディレクトリへのアクセスをブロック(デフォルトで `~/.qwenpaw.secret/`、`~/.ssh` などを保護)。
- **Skill Scanner** — block / warn / off モードとホワイトリスト対応の事前アクティベーションスキャン。プロンプトインジェクション、ハードコードされた秘密情報、データ流出などを検出。
- **Access Policy** — 宣言型アクセスポリシー:各機能呼び出しに対し許可(allow)、拒否(deny)、または承認要求(ask)を裁定。ツールレベルの粒度とリクエスト元に応じたマッチングに対応。
詳細は [セキュリティ](https://qwenpaw.agentscope.io/docs/security) を参照してください。
---
## ドキュメント
| トピック | 説明 |
| --------------------------------------------------------------------- | ------------------------------------------------ |
| [はじめに](https://qwenpaw.agentscope.io/docs/intro) | QwenPaw とは何か、使い方 |
| [クイックスタート](https://qwenpaw.agentscope.io/docs/quickstart) | インストールと実行(ローカルまたは ModelScope Studio) |
| [コンソール](https://qwenpaw.agentscope.io/docs/console) | Web UI: チャットとエージェント設定 |
| [ターミナル UI(TUI)](https://qwenpaw.agentscope.io/docs/tui) | フルスクリーンターミナルチャット、コンソールと同じエージェント |
| [デスクトップアプリ](https://qwenpaw.agentscope.io/docs/desktop) | デスクトップアプリケーションのインストールと使用方法 |
| [モデル](https://qwenpaw.agentscope.io/docs/models) | クラウド、ローカル、カスタムプロバイダーの設定 |
| [チャネル](https://qwenpaw.agentscope.io/docs/channels) | DingTalk、Lark、QQ、Discord、iMessage など |
| [スキル](https://qwenpaw.agentscope.io/docs/skills) | 機能の拡張とカスタマイズ |
| [プラグイン](https://qwenpaw.agentscope.io/docs/plugins) | プラグインシステムと Plugin Market |
| [MCP](https://qwenpaw.agentscope.io/docs/mcp) | MCP クライアントの管理 |
| [Persona](https://qwenpaw.agentscope.io/docs/persona) | エージェントのパーソナリティカスタマイズ(SOUL / PROFILE) |
| [メモリ](https://qwenpaw.agentscope.io/docs/memory) | ローカルで編集・検索可能かつ相互にリンクされた Markdown メモリによる自己進化型パーソナルナレッジベース。[ReMe](https://github.com/agentscope-ai/ReMe) を採用 |
| [ReMe ドキュメント](https://docs.agentscope.io/reme/latest/en/overview) | ReMe の公式概要とドキュメント |
| [記憶進化 & プロアクティブ](https://qwenpaw.agentscope.io/docs/memory-evolving-and-proactive) | エージェントの記憶進化とプロアクティブインタラクション |
| [コンテキスト](https://qwenpaw.agentscope.io/docs/context) | Scroll ベースのコンテキスト管理 |
| [魔法コマンド](https://qwenpaw.agentscope.io/docs/commands) | AI の応答を待たずに会話状態を制御 |
| [ハートビート](https://qwenpaw.agentscope.io/docs/heartbeat) | スケジュールされたチェックインとダイジェスト |
| [Cron / スケジュールタスク](https://qwenpaw.agentscope.io/docs/cron) | スケジュールタスクと自動化 |
| [マルチエージェント](https://qwenpaw.agentscope.io/docs/multi-agent) | 複数エージェントの作成と協調の有効化 |
| [セキュリティ](https://qwenpaw.agentscope.io/docs/security) | Sandbox、Tool Guard、File Guard、Skill Scanner、Access Policy |
| [バックアップ & 復元](https://qwenpaw.agentscope.io/docs/backup) | データバックアップと復旧 |
| [設定 & ワーキングディレクトリ](https://qwenpaw.agentscope.io/docs/config) | ワーキングディレクトリと設定ファイル |
| [REST API](https://qwenpaw.agentscope.io/docs/api-tutorial) | 統合と自動化のための HTTP API |
| [ACP 連携](https://qwenpaw.agentscope.io/docs/acp-integration) | Agent Communication Protocol 連携 |
| [CLI](https://qwenpaw.agentscope.io/docs/cli) | Init、cron ジョブ、スキル、クリーン |
| [エージェントチーム実践](https://qwenpaw.agentscope.io/docs/practice-agent-team) | マルチエージェントチームのデプロイガイド |
| [FAQ](https://qwenpaw.agentscope.io/docs/faq) | よくある質問とトラブルシューティング |
完全なドキュメント: [qwenpaw.agentscope.io/docs](https://qwenpaw.agentscope.io/docs)
---
## FAQ
よくある質問、トラブルシューティングのヒント、既知の問題については、**[FAQ ページ](https://qwenpaw.agentscope.io/docs/faq)** をご覧ください。
---
## ロードマップ
| 方向 | 項目 | 状態 |
| ------------------------------ | --------------------------------------------- | ------------ |
| **横展開** | チャネル、モデル、スキル、MCP の追加 | 貢献者募集中 |
| **既存機能の拡張** | 表示、ダウンロード、Windows 対応の改善 | 貢献者募集中 |
| **モデル** | マルチモデル切り替え | 進行中 |
| **安全と承認** | 操作の一括確認と承認 | 進行中 |
| **自動化** | 自動化タスク | 進行中 |
| **エージェント連携** | エージェント間のタスク引き継ぎ | 進行中 |
| | 実行中タスクの調整 | 進行中 |
| **ワークスペース** | マルチワークスペース | 進行中 |
| **コンテキスト** | システムプロンプト圧縮 | 進行中 |
| **ツールシステム** | 複数箇所のファイル変更 | 進行中 |
| | 永続ターミナルとバックグラウンドタスク | 進行中 |
| **Computer-use** | 画面上の対象特定と操作 | 進行中 |
| **音声対話** | リアルタイム音声タスク | 進行中 |
| **コンテキスト管理とメモリ** | ベクトルモデルと保存先のホット切り替え | 進行中 |
| | 個人ナレッジベース | 進行中 |
| **QwenPaw アプリケーション** | QwenPaw Insight | 進行中 |
| | QwenPaw Mail | 進行中 |
_状態:_ **進行中** — 積極的に開発中;**貢献者募集中** — コミュニティの参加を強く推奨。
---
## コントリビュート
QwenPaw はオープンな協働により進化を続けており、あらゆる形の貢献を歓迎しています!上記の [ロードマップ](#ロードマップ)(特に **貢献者募集中** の項目)から興味のある領域を選び、[CONTRIBUTING](https://github.com/agentscope-ai/QwenPaw/blob/main/CONTRIBUTING.md) を読んで始めてください。特に歓迎するのは:
- **横展開** — 新規チャネル、モデルプロバイダー、スキル、MCP。
- **既存機能の拡張 & 改善** — 表示と操作の最適化、ダウンロードヒント、Windows パス互換性など。
[GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions) でアイデアを議論したりタスクを引き受けたりしてください。
---
## ソースからインストール
```bash
git clone https://github.com/agentscope-ai/QwenPaw.git
cd QwenPaw
# まずコンソールフロントエンドをビルド(Web UI に必須)
cd console && npm ci && npm run build
cd ..
# コンソールのビルド出力をパッケージディレクトリにコピー
mkdir -p src/qwenpaw/console
cp -R console/dist/. src/qwenpaw/console/
# Python パッケージのインストール
pip install -e .
```
- **開発**(テスト、フォーマット): `pip install -e ".[dev,test,full]"`
- **その後**: `qwenpaw init --defaults` を実行し、次に `qwenpaw app`。
> **アップデート時の注意:** `git pull` 後に新しいメジャーバージョンにアップデートする場合は、フロントエンドの再ビルド、パッケージの再インストール(`pip install -e .`)、`qwenpaw app` の再起動、およびブラウザキャッシュの削除(`Ctrl+Shift+R` または macOS では `Cmd+Shift+R`)も行ってください。
---
## なぜ QwenPaw?
QwenPaw は Qwen Personal Agent Workstation(Qwen 個人エージェントワークステーション)の略であると同時に、Qwen の知性と Paw の温もりを体現しています。単なる冷たいツールではなく、いつでも手を差し伸べてくれる、賢くて温かい「小さな爪」でありたい — あなたのデジタルライフで最も息の合ったパートナーです。
---
## 開発元
[AgentScope team](https://github.com/agentscope-ai) · [AgentScope](https://github.com/agentscope-ai/agentscope) · [AgentScope Runtime](https://github.com/agentscope-ai/agentscope-runtime) · [ReMe](https://github.com/agentscope-ai/ReMe)
---
## お問い合わせ
| [Discord](https://discord.gg/eYMpfnkG8h) | [X (Twitter)](https://x.com/agentscope_ai) | [DingTalk](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [RedNote](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [<img src="https://gw.alicdn.com/imgextra/i1/O1CN01hhD1mu1Dd3BWVUvxN_!!6000000000238-2-tps-400-400.png" width="80" height="80" alt="Discord">](https://discord.gg/eYMpfnkG8h) | [<img src="https://img.shields.io/badge/X-black.svg?logo=x&logoColor=white" width="80" height="80" alt="X">](https://x.com/agentscope_ai) | [<img src="https://img.alicdn.com/imgextra/i2/O1CN01vCWI8a1skHtLGXEMQ_!!6000000005804-2-tps-458-460.png" width="80" height="80" alt="DingTalk">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [<img src="https://img.alicdn.com/imgextra/i3/O1CN016BoEPS1l33CE9mHb9_!!6000000004762-0-tps-160-160.jpg" width="80" height="80" alt="RedNote">](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
---
## 最新情報をいち早く
<a href="https://github.com/agentscope-ai/QwenPaw">
<img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" width="600" alt="Star QwenPaw" />
</a>
GitHub で QwenPaw にスターを付けて、新しいリリースの通知を即座に受け取りましょう。
---
## テレメトリ
QwenPaw は `qwenpaw init` 実行時に **匿名** の利用データを収集し、ユーザー環境の把握と製品改善に役立てています。データは **バージョンごとに 1 回** 送信されます — QwenPaw をアップグレードすると、バージョン分布を把握するために再収集されます。
**収集する情報:**
- QwenPaw バージョン(例: 1.1.12)
- インストール方法(pip、Docker、またはデスクトップアプリ)
- OS とバージョン(例: macOS 14.0、Ubuntu 22.04)
- Python バージョン(例: 3.13)
- CPU アーキテクチャ(例: x86_64、arm64)
- GPU の利用可否(はい/いいえ)
**収集しないもの:** 個人データ、ファイル、認証情報、IP アドレス、個人を特定できる情報は一切収集しません。
`qwenpaw init` を対話モードで実行すると、同意するかどうか尋ねられます。`--defaults` モードでは自動的に同意されます。プロンプトはバージョンごとに 1 回のみ表示され、QwenPaw の機能には影響しません。
---
## ライセンス
QwenPaw は [Apache License 2.0](LICENSE) の下でリリースされています。
---
## コントリビューター
QwenPaw をより良くするために貢献してくださったすべての方々に感謝します:
<a href="https://github.com/agentscope-ai/QwenPaw/graphs/contributors">
<img src="https://contrib.rocks/image?repo=agentscope-ai/QwenPaw" alt="コントリビューター" />
</a>
+566
View File
@@ -0,0 +1,566 @@
<div align="center">
# QwenPaw
[![GitHub Repo](https://img.shields.io/badge/GitHub-Repo-black.svg?logo=github)](https://github.com/agentscope-ai/QwenPaw)
[![PyPI](https://img.shields.io/pypi/v/qwenpaw?color=3775A9&label=PyPI&logo=pypi)](https://pypi.org/project/qwenpaw/)
[![Documentation](https://img.shields.io/badge/Docs-Website-green.svg?logo=readthedocs&label=Docs)](https://qwenpaw.agentscope.io/)
[![Python Version](https://img.shields.io/badge/python-3.11%20~%20%3C3.14-blue.svg?logo=python&label=Python)](https://www.python.org/downloads/)
[![Last Commit](https://img.shields.io/github/last-commit/agentscope-ai/QwenPaw)](https://github.com/agentscope-ai/QwenPaw)
[![License](https://img.shields.io/badge/license-Apache%202.0-red.svg?logo=apache&label=License)](LICENSE)
[![Code Style](https://img.shields.io/badge/code%20style-black-black.svg?logo=python&label=CodeStyle)](https://github.com/psf/black)
[![GitHub Stars](https://img.shields.io/github/stars/agentscope-ai/QwenPaw?style=flat&logo=github&color=yellow&label=Stars)](https://github.com/agentscope-ai/QwenPaw/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/agentscope-ai/QwenPaw?style=flat&logo=github&color=purple&label=Forks)](https://github.com/agentscope-ai/QwenPaw/network)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-Ask_Devin-navy.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/agentscope-ai/QwenPaw)
[![Discord](https://img.shields.io/badge/Discord-Join_Us-blueviolet.svg?logo=discord)](https://discord.gg/eYMpfnkG8h)
[![X](https://img.shields.io/badge/X-Follow_Us-black.svg?logo=x)](https://x.com/agentscope_ai)
[![DingTalk](https://img.shields.io/badge/DingTalk-Join_Us-orange.svg)](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11)
[![AgentScope Platform](https://img.shields.io/badge/%E2%98%81_AgentScope_Platform-%F0%9F%90%BE_7%2F24_Online_%26_Free-FF6B2B.svg)](https://platform.agentscope.io/)
<a href="https://trendshift.io/repositories/25882" target="_blank"><img src="https://trendshift.io/api/badge/trendshift/repositories/25882/daily" alt="agentscope-ai%2FQwenPaw | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[[Документация](https://qwenpaw.agentscope.io/)] [[English](README.md)] [[中文](README_zh.md)] [[日本語](README_ja.md)]
<p align="center">
<img src="https://gw.alicdn.com/imgextra/i1/O1CN01sens5C1TuwioeGexL_!!6000000002443-55-tps-771-132.svg" alt="QwenPaw Logo" width="120">
</p>
<p align="center"><b>Понимает вас, всегда с вами.</b></p>
</div>
Ваш персональный AI-ассистент — разверните локально или в облаке, расширяйте с помощью Skills и Plugins, подключайтесь через любые каналы.
| | |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Никогда не забывает** | Трёхуровневая память — рабочий контекст в реальном времени, полная дословная история и саморазвивающаяся персональная база знаний на базе [ReMe](https://github.com/agentscope-ai/ReMe). Диалоги и материалы непрерывно преобразуются в читаемые, редактируемые, доступные для поиска и связанные между собой записи Markdown. |
| **Локально или в облаке, бесплатно** | Модели QwenPaw-Flash (2B / 4B / 9B), обученные для агентных задач. Встроенный рантайм QwenPaw Local — без API-ключа, без зависимости от облака. Также работает с Ollama, LM Studio и 14+ облачными провайдерами. |
| **Безопасность из коробки** | Песочница на уровне ядра, Tool Guard, File Guard и Skill Scanner. Опасные команды блокируются до выполнения. |
| **Мультиагентность и параллелизм** | Создавайте независимых агентов со своей памятью и навыками. Субагенты во время выполнения. Agent Communication Protocol (ACP) для кросс-системной оркестрации. |
| **Файловое рабочее пространство** | Единые навигация, просмотр, редактирование, diff, загрузка и скачивание файлов проекта и агента. |
| **Расширяемость** | Skills для планирования, документов, браузера, новостей и многого другого. Архитектура плагинов с маркетплейсом. Интеграция MCP для внешних инструментов. Комбинируйте в целевые рабочие процессы. |
| **Доступен везде** | DingTalk, Lark, WeChat, Discord, Telegram, iMessage, QQ — один экземпляр, все каналы. Console, TUI и десктопное приложение для прямого доступа. |
| **Ваш, не наш** | Развертывание локально — данные остаются на вашей машине. Без стороннего хостинга, без загрузки данных. |
> <details>
> <summary><b>Что можно делать с QwenPaw</b></summary>
>
> <br>
>
> - **Автоматизация и планирование**: Настройте повторяющиеся задачи — дайджесты новостей, генерация отчётов, мультиканальная рассылка — всё по вашему расписанию.
> - **Код и разработка**: Читайте, редактируйте, проверяйте и тестируйте код в проектах в едином файловом рабочем пространстве.
> - **Обработка документов**: Чтение, запись и преобразование PDF, Word, Excel и PowerPoint.
> - **Сбор информации**: Поиск в интернете, отслеживание подписок, суммаризация видео и поиск в персональной базе знаний.
> - **Мультиканальные операции**: Отправка оповещений, дайджестов или AI-контента в DingTalk, Lark, Discord, Telegram и другие — одновременно или по каналам.
> - **Пользовательские сценарии**: Объединяйте встроенные возможности, плагины и запланированные задачи в сценарии под ваши задачи.
>
> </details>
---
## Новости
- [2026-08-13] **v2.1.0** | QwenPaw OS Shell, единое файловое пространство, QwenPaw Creator, интеграция агентов Codex/Qoder, Browser-use, Computer-use, контрольные точки и продолжение длительных задач в диалоге. [Release Notes v2.1.0 →](https://qwenpaw.agentscope.io/release-notes#v2.1.0)
- [2026-07-24] **v2.0.1** | Платформа мини-приложений PawApp, редактируемые Agent Mode, Oh-My-Paw plugins, улучшения памяти [ReMe](https://github.com/agentscope-ai/ReMe), улучшения UX десктопа и др. [v2.0.1 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v2.0.1)
- [2026-07-10] **v2.0.0 — QwenPaw 2.0 Official Release** 🎉 | Полностью переписанный на основе AgentScope 2.0: архитектура Agent OS, Loop Engineering, Scroll Context, саморазвивающаяся персональная база знаний [ReMe](https://github.com/agentscope-ai/ReMe) v0.4 и встроенный TUI.
| Основное | Что нового |
|----------|-----------|
| **Agent OS — Workspace** | Три столпа на агента: **Resources** (прозрачно на диске), **Governance** (allow/deny/ask/sandbox), **Sandbox** (macOS / Linux / Windows). |
| **Agent OS — Drivers** | Протокол-нейтральный слой коннекторов MCP / A2A / ACP с шифрованием учётных данных и политикой на вызов. |
| **Loop Engineering** | Продвинутые шаблоны циклов агента (Coding Mode, Mission Mode, далее — больше) с компонуемыми вентилями одобрения. |
| **Scroll Context** | Каждый ход сохраняется; вытесненные ходы индексируются с recall по запросу — ничего не суммаризуется. |
| **[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 — саморазвивающаяся персональная база знаний** | Непрерывно преобразует диалоги и материалы в читаемые, редактируемые, доступные для поиска и связанные между собой записи Markdown. |
| **Terminal UI (TUI)** | Полноэкранный терминальный чат — тот же агент, память и сессии, что в Console и каналах. |
На базе Agent OS мы будем выпускать готовые к использованию приложения QwenPaw — такие как **QwenPaw Creator** и **QwenPaw Insight** — следите за обновлениями. [v2.0.0 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v2.0.0)
- [2026-06-17] **v1.1.12 — Обновление страницы моделей и Простой режим** | Новый дизайн страницы моделей с агрегацией провайдеров; Простой режим для упрощённой навигации. [v1.1.12 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v1.1.12)
- [2026-06-11] **Запуск платформы AgentScope** — Бесплатный деплой QwenPaw, обмен плагинами и маркет Skill. [Попробовать →](https://platform.agentscope.io/)
- [2026-06-10] **v1.1.11** — Бесплатные модели OAuth, Маркет плагинов, Белый список MCP. [v1.1.11 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v1.1.11)
[Все release notes →](https://qwenpaw.agentscope.io/release-notes)
---
## Оглавление
- [Новости](#новости)
- [Быстрый старт](#быстрый-старт)
- [API Key](#api-key)
- [Локальные модели](#локальные-модели)
- [Функции безопасности](#функции-безопасности)
- [Документация](#документация)
- [FAQ](#faq)
- [Дорожная карта](#дорожная-карта)
- [Участие в проекте](#участие-в-проекте)
- [Установка из исходников](#установка-из-исходников)
- [Почему QwenPaw?](#почему-qwenpaw)
- [Кто разрабатывает](#кто-разрабатывает)
- [Лицензия](#лицензия)
---
## Быстрый старт
### Вариант 1: Pip Install
Если вы предпочитаете самостоятельно управлять Python (требуется Python >= 3.11, < 3.14):
```bash
pip install qwenpaw
qwenpaw init --defaults
qwenpaw app
```
Затем откройте консоль в браузере: **http://127.0.0.1:8088/** и настройте модель. Для чата в DingTalk, Lark, WeChat и других приложениях см. документацию [Настройка каналов](https://qwenpaw.agentscope.io/docs/channels).
![Console](https://img.alicdn.com/imgextra/i2/O1CN01EP1ra01iOAcBvF0TC_!!6000000004402-2-tps-3822-2070.png)
---
### Вариант 2: Установка через скрипт
Не требуется ручная настройка Python — одна команда устанавливает всё. Скрипт автоматически загрузит uv (менеджер пакетов Python), создаст виртуальное окружение и установит QwenPaw со всеми зависимостями (включая Node.js и frontend-ресурсы). Примечание: может не работать в ограниченных сетевых окружениях или при корпоративном контроле доступа.
**macOS / Linux:**
```bash
curl -fsSL https://qwenpaw.agentscope.io/install.sh | bash
```
**Windows (CMD):**
```CMD
curl -fsSL https://qwenpaw.agentscope.io/install.bat -o install.bat && install.bat
```
**Windows (PowerShell):**
```powershell
irm https://qwenpaw.agentscope.io/install.ps1 | iex
```
> **Примечание**: Установщик автоматически проверит статус uv. Если он не установлен, будет предпринята попытка автоматической загрузки и настройки. Если автоматическая установка не удалась, следуйте инструкциям на экране или выполните `python -m pip install -U uv`, затем повторно запустите установщик.
> **⚠️ Специальное уведомление для пользователей Windows Enterprise LTSC**
>
> Если вы используете Windows LTSC или корпоративную среду с строгими политиками безопасности, PowerShell может работать в **режиме ограниченного языка**, что может вызвать следующие проблемы:
> 1. **При использовании CMD (.bat): Скрипт выполняется успешно, но не может записать в `Path`**
>
> Скрипт завершает установку файлов. Из-за **режима ограниченного языка** он не может автоматически обновить переменные окружения. Настройте вручную следующим образом:
> - **Найдите директорию установки**:
> - Проверьте доступность `uv`: Введите `uv --version` в CMD. Если отображается номер версии, **настройте только путь QwenPaw**. Если появляется сообщение `'uv' is not recognized as an internal or external command, operable program or batch file,` настройте оба пути.
> - Путь uv (выберите один в зависимости от места установки; используйте, если `uv` недоступен): Обычно `%USERPROFILE%\.local\bin`, `%USERPROFILE%\AppData\Local\uv` или папка `Scripts` в директории установки Python
> - Путь QwenPaw: Обычно находится в `%USERPROFILE%\.qwenpaw\bin`.
> - **Вручную добавьте в системную переменную окружения Path**:
> - Нажмите `Win + R`, введите `sysdm.cpl` и нажмите Enter, чтобы открыть свойства системы.
> - Нажмите «Дополнительно» → «Переменные среды».
> - В «Системных переменных» найдите и выберите `Path`, затем нажмите «Изменить».
> - Нажмите «Создать», последовательно введите оба пути к директориям, затем нажмите OK для сохранения.
> 2. **При использовании PowerShell (.ps1): Выполнение скрипта прерывается**
>
> Из-за **режима ограниченного языка** скрипт может не суметь автоматически загрузить `uv`.
> - **Установите uv вручную**: Обратитесь к [GitHub Release](https://github.com/astral-sh/uv/releases), загрузите `uv.exe` и поместите его в `%USERPROFILE%\.local\bin` или `%USERPROFILE%\AppData\Local\uv`; или убедитесь, что Python установлен, и выполните `python -m pip install -U uv`.
> - **Настройте переменные окружения `uv`**: Добавьте директорию `uv` и `%USERPROFILE%\.qwenpaw\bin` в системную переменную `Path`.
> - **Повторно запустите установку**: Откройте новый терминал и снова выполните скрипт установки для завершения установки `QwenPaw`.
> - **Настройте переменную окружения `QwenPaw`**: Добавьте `%USERPROFILE%\.qwenpaw\bin` в системную переменную `Path`.
После установки откройте новый терминал и выполните:
```bash
qwenpaw init --defaults # или: qwenpaw init (интерактивный)
qwenpaw app
```
<details>
<summary><b>Опции установки</b></summary>
**macOS / Linux:**
```bash
# Установить конкретную версию
curl -fsSL ... | bash -s -- --version 1.1.0
# Установить из исходников (для разработки/тестирования)
curl -fsSL ... | bash -s -- --from-source
# Обновление — просто повторно запустите установщик
curl -fsSL ... | bash
# Удаление
qwenpaw uninstall # сохраняет конфигурацию и данные
qwenpaw uninstall --purge # удаляет всё
```
**Windows (PowerShell):**
```powershell
# Установить конкретную версию
irm ... | iex; .\install.ps1 -Version 1.1.12
# Установить из исходников (для разработки/тестирования)
.\install.ps1 -FromSource
# Обновление — просто повторно запустите установщик
irm ... | iex
# Удаление
qwenpaw uninstall # сохраняет конфигурацию и данные
qwenpaw uninstall --purge # удаляет всё
```
</details>
---
### Вариант 3: Docker
Образы доступны на **Docker Hub** (`agentscope/qwenpaw`). Теги образов: `latest` (стабильная версия); `pre` (предварительный релиз PyPI).
```bash
docker pull agentscope/qwenpaw:latest
docker run -p 127.0.0.1:8088:8088 \
-v qwenpaw-data:/app/working \
-v qwenpaw-secrets:/app/working.secret \
-v qwenpaw-backups:/app/working.backups \
agentscope/qwenpaw:latest
```
Для пользователей в Китае также доступен Alibaba Cloud Container Registry (ACR): `agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/qwenpaw` (те же теги).
Затем откройте **http://127.0.0.1:8088/** для доступа к консоли. Конфигурация, память и навыки сохраняются в томе `qwenpaw-data`; настройки провайдеров моделей и API-ключи — в томе `qwenpaw-secrets`; архивы резервных копий — в томе `qwenpaw-backups`. Для передачи API-ключей (например, `DASHSCOPE_API_KEY`) добавьте `-e VAR=value` или `--env-file .env` в команду `docker run`.
> **Подключение к Ollama или другим сервисам на хост-машине**
>
> Внутри Docker-контейнера `localhost` указывает на сам контейнер, а не на хост-машину. Если Ollama (или другие модельные сервисы) запущены на хосте и вы хотите, чтобы QwenPaw в Docker мог к ним обращаться, используйте один из следующих подходов:
>
> **Вариант A** — Явная привязка к хосту (все платформы):
> ```bash
> docker run -p 127.0.0.1:8088:8088 \
> --add-host=host.docker.internal:host-gateway \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> Затем в QwenPaw **Настройки → Модели** измените Base URL на `http://host.docker.internal:<порт>` — например, `http://host.docker.internal:11434` для Ollama или `http://host.docker.internal:1234/v1` для LM Studio.
>
> **Вариант B** — Сеть хоста (только Linux):
> ```bash
> docker run --network=host \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> Сопоставление портов (`-p`) не требуется; контейнер напрямую использует сеть хоста. Обратите внимание, что все порты контейнера будут доступны на хосте, что может вызвать конфликты, если порт уже занят.
>
Образ собирается с нуля. Если нужно собрать образ самостоятельно, см. раздел [Build Docker image](scripts/README.md#build-docker-image) в `scripts/README.md`, затем отправьте в свой реестр образов.
---
### Вариант 4: Развертывание на Alibaba Cloud ECS
Для запуска QwenPaw на Alibaba Cloud (ECS) используйте развертывание в один клик: откройте [ссылку развертывания QwenPaw на Alibaba Cloud ECS](https://computenest.console.aliyun.com/service/instance/create/cn-hangzhou?type=user&ServiceId=service-1ed84201799f40879884) и следуйте инструкциям. Пошаговые инструкции см. в [Сообщество разработчиков Alibaba Cloud: Развертывание вашего AI-ассистента за 3 минуты](https://developer.aliyun.com/article/1713682).
---
### Вариант 5: AgentScope Platform
[AgentScope Platform](https://platform.agentscope.io/) обеспечивает развертывание QwenPaw в облаке в один клик, обмен плагинами и маркет Skill. Бесплатно, работает 7/24 онлайн.
---
### Вариант 6: Использование ModelScope
[ModelScope Studio](https://modelscope.cn/studios/fork?target=AgentScope/QwenPaw) также поддерживает облачное развертывание QwenPaw. Примечание: установите свою студию как **непубличную**, иначе другие смогут управлять вашим QwenPaw.
---
### Вариант 7: Десктопное приложение (Beta)
> **Уведомление о Beta-версии**: Десктопное приложение в настоящее время находится на стадии Beta-тестирования со следующими известными ограничениями:
> - **Неполное тестирование совместимости**: Не полностью протестировано на всех версиях систем и конфигурациях оборудования
> - **Возможны проблемы с производительностью**: Время запуска, использование памяти и другие аспекты производительности могут требовать дополнительной оптимизации
> - **Функции продолжают совершенствоваться**: Некоторые функции могут быть нестабильными или отсутствовать
Если вы не привыкли использовать командную строку, можете загрузить и использовать десктопную версию QwenPaw без ручной настройки Python-окружения или выполнения команд.
#### Загрузка
Загрузите десктопное приложение (сборка Tauri) с [официальной страницы загрузки](https://qwenpaw.agentscope.io/downloads):
- **Windows**: `QwenPaw-Tauri-<version>-Windows-setup.exe`
- **macOS**: `QwenPaw-Tauri-<version>-macOS.zip` (рекомендуется для Apple Silicon)
#### Особенности
- ✅ **Нулевая настройка**: Загрузите и запустите двойным щелчком, не нужно устанавливать Python или настраивать переменные окружения
- ✅ **Кроссплатформенность**: Поддержка Windows 10+ и macOS 14+
- ✅ **Визуальный интерфейс**: Автоматически открывает окно приложения, не нужно вручную вводить адрес
- ⚠️ **Beta-стадия**: Функции продолжают совершенствоваться, приветствуется обратная связь
#### Первый запуск
**Важно**: Первый запуск может занять 10–60 секунд (в зависимости от конфигурации вашей системы). Приложению необходимо инициализировать Python-окружение и загрузить зависимости. Пожалуйста, дождитесь автоматического открытия окна.
#### macOS: Обход системных ограничений безопасности
Когда вы загружаете приложение QwenPaw для macOS, macOS может отобразить: *«Apple не может проверить, что "QwenPaw" не содержит вредоносного ПО»*. Это происходит потому, что приложение не нотаризовано. Вы все равно можете открыть его следующими способами:
- **Открытие через правый клик (рекомендуется)**
Щелкните правой кнопкой (или Control + щелчок) по приложению QwenPaw → **«Открыть»** → в диалоговом окне снова нажмите **«Открыть»**. Это сообщит Gatekeeper, что вы доверяете приложению; после этого можно запускать его двойным щелчком как обычно.
- **Разрешить в системных настройках**
Если всё ещё заблокировано, перейдите в **Системные настройки → Конфиденциальность и безопасность**, прокрутите до сообщения типа *«"QwenPaw" заблокирован, так как невозможно проверить разработчика»*, и нажмите **«Всё равно открыть»** или **«Разрешить»**.
- **Удалить атрибут карантина (не рекомендуется для большинства пользователей)**
В терминале выполните:
`xattr -cr "/Applications/QwenPaw Desktop.app"`
(или используйте путь к `.app` после распаковки). Это очистит флаг карантина «загружено из интернета», поэтому предупреждение обычно не появляется, но это менее безопасно и контролируемо, чем использование **Правый клик → Открыть**.
Подробные инструкции, устранение неполадок и частые вопросы см. в [Руководстве по десктопному приложению](https://qwenpaw.agentscope.io/docs/desktop).
---
### Что дальше?
После установки настройте модель в **Консоль → Настройки → Модели**, затем изучите:
- [Добавьте Skills](https://qwenpaw.agentscope.io/docs/skills) для расширения возможностей (PDF, Office, браузер, новости и т.д.)
- [Настройте каналы](https://qwenpaw.agentscope.io/docs/channels) для DingTalk, Lark, Discord и других
- [Настройте Cron](https://qwenpaw.agentscope.io/docs/cron) для запланированных задач и автоматизации
- Полное [руководство по быстрому старту](https://qwenpaw.agentscope.io/docs/quickstart) со всеми опциями и шагами проверки
---
## Терминальный интерфейс (TUI)
Предпочитаете оставаться в терминале? Запустите `qwenpaw` для полноэкранного чата в **TUI**, который управляет _тем же_ агентом, что и Консоль и IM-каналы — та же память, навыки, MCP-инструменты и сессии — без отрыва от клавиатуры.
```bash
qwenpaw # открыть чат с активным агентом
qwenpaw tui --resume <id> # возобновить предыдущую сессию
qwenpaw . # начать в текущем репозитории (Coding Mode)
```
Поддерживаются потоковые ответы, slash-команды (`/help`, `/resume`, `/theme`, а также собственные команды агента `/model`, `/clear`, …), вставка файлов/длинного текста как вложений и inline-запросы разрешений на инструменты. Подробности см. в [руководстве по Terminal UI](https://qwenpaw.agentscope.io/docs/tui).
![QwenPaw TUI](https://img.alicdn.com/imgextra/i2/O1CN01IULzib1TRAzigIcqG_!!6000000002378-2-tps-2350-1312.png)
---
## API Key
Если вы используете **облачный API для LLM** (например, DashScope / Qwen, OpenAI, Anthropic, Google Gemini, DeepSeek, Kimi, OpenRouter и другие), перед началом диалога необходимо настроить API Key. До настройки действительного ключа QwenPaw не будет работать. Подробности см. в [официальной документации](https://qwenpaw.agentscope.io/docs/models).
**Способы настройки:**
1. **Консоль (рекомендуется)** — После запуска `qwenpaw app` откройте **http://127.0.0.1:8088/** → **Настройки** → **Модели**. Выберите провайдера, введите **API Key** и активируйте этого провайдера и модель.
2. **`qwenpaw init`** — При запуске `qwenpaw init` вас проведут через настройку LLM-провайдера и API Key. Следуйте подсказкам, выберите провайдера и введите ключ.
3. **Переменная окружения** — Для DashScope можно установить `DASHSCOPE_API_KEY` в терминале или в файле `.env` в рабочей директории.
Ключи для других инструментов (например, `TAVILY_API_KEY` для веб-поиска) можно настроить в консоли **Настройки → Переменные окружения**, подробности см. в [Конфигурация](https://qwenpaw.agentscope.io/docs/config).
> **Используете только локальные модели?** Если вы используете [Локальные модели](#локальные-модели) (QwenPaw Local / Ollama / LM Studio), вам **не нужен** никакой API Key.
## Локальные модели
QwenPaw может полностью запускать LLM на вашей машине — без API-ключей и облачных сервисов. Подробности см. в [официальной документации](https://qwenpaw.agentscope.io/docs/models).
QwenPaw также предоставляет серию **QwenPaw-Flash** — специально обученные модели 2B / 4B / 9B для агентных сценариев с квантизациями Q4 и Q8. Доступны на [ModelScope](https://www.modelscope.cn/organization/AgentScope?tab=model) и [Hugging Face](https://huggingface.co/agentscope-ai/models).
| Бэкенд | Подходит для | Установка |
| ------------------- | ---------------------------------------- | ------------------------------------------------------------------------- |
| **QwenPaw Local** (llama.cpp) | Кроссплатформенный (macOS / Linux / Windows) | Встроен; нажмите «Download» в веб-интерфейсе. Поддержка QwenPaw-Flash с рекомендациями с учётом железа. |
| **Ollama** | Кроссплатформенный (требуется сервис Ollama) | Установите и запустите Ollama; установите длину контекста ≥ 32k. |
| **LM Studio** | Кроссплатформенный (требуется LM Studio) | Установите и запустите LM Studio; включите Local Server. |
---
## Функции безопасности
QwenPaw включает четыре основных уровня безопасности:
- **Sandbox** — Изоляция выполнения на уровне ядра с помощью Seatbelt (macOS), Bubblewrap / Landlock (Linux) и AppContainer (Windows). Shell-команды выполняются в ограниченном представлении файловой системы.
- **Tool Guard** — YAML-движок правил с `ShellEvasionGuardian` проверяет каждый вызов инструмента перед выполнением, обнаруживая инъекции команд, обход путей, reverse shells и обфусцированные атаки. Настраиваемые уровни одобрения: STRICT / SMART / AUTO / OFF.
- **File Guard** — Независимо от Tool Guard; блокирует доступ агента к чувствительным файлам и директориям (по умолчанию защищает `~/.qwenpaw.secret/`, `~/.ssh` и т.д.).
- **Skill Scanner** — Сканирование перед активацией с режимами block / warn / off и поддержкой белого списка. Обнаруживает инъекции промптов, жёстко закодированные секреты, утечку данных и другое.
- **Access Policy** — Декларативные правила доступа: разрешение, запрет или запрос подтверждения для каждого вызова с гранулярностью до уровня инструмента и учётом источника запроса.
Подробности см. в разделе [Безопасность](https://qwenpaw.agentscope.io/docs/security).
---
## Документация
| Тема | Описание |
| -------------------------------------------------------------------- | ----------------------------------------------- |
| [Введение](https://qwenpaw.agentscope.io/docs/intro) | Что такое QwenPaw и как его использовать |
| [Быстрый старт](https://qwenpaw.agentscope.io/docs/quickstart) | Установка и запуск (локально или ModelScope Studio) |
| [Консоль](https://qwenpaw.agentscope.io/docs/console) | Веб-интерфейс: чат и конфигурация агента |
| [Terminal UI (TUI)](https://qwenpaw.agentscope.io/docs/tui) | Полноэкранный терминальный чат, тот же агент, что и в Консоли |
| [Десктопное приложение](https://qwenpaw.agentscope.io/docs/desktop) | Установка и использование десктопного приложения |
| [Модели](https://qwenpaw.agentscope.io/docs/models) | Настройка облачных, локальных и пользовательских провайдеров |
| [Каналы](https://qwenpaw.agentscope.io/docs/channels) | DingTalk, Lark, QQ, Discord, iMessage и другие |
| [Skills](https://qwenpaw.agentscope.io/docs/skills) | Расширение и настройка возможностей |
| [Плагины](https://qwenpaw.agentscope.io/docs/plugins) | Система плагинов и Plugin Market |
| [MCP](https://qwenpaw.agentscope.io/docs/mcp) | Управление MCP-клиентами |
| [Persona](https://qwenpaw.agentscope.io/docs/persona) | Настройка личности агента (SOUL / PROFILE) |
| [Память](https://qwenpaw.agentscope.io/docs/memory) | Саморазвивающаяся персональная база знаний на основе локальных, редактируемых, доступных для поиска и связанных записей Markdown, работающая на [ReMe](https://github.com/agentscope-ai/ReMe) |
| [Документация ReMe](https://docs.agentscope.io/reme/latest/en/overview) | Официальный обзор и документация ReMe |
| [Память-эволюция и проактивное взаимодействие](https://qwenpaw.agentscope.io/docs/memory-evolving-and-proactive) | Эволюция памяти агента и проактивное взаимодействие |
| [Контекст](https://qwenpaw.agentscope.io/docs/context) | Управление контекстом на базе Scroll |
| [Магические команды](https://qwenpaw.agentscope.io/docs/commands) | Управление состоянием диалога без ожидания AI |
| [Heartbeat](https://qwenpaw.agentscope.io/docs/heartbeat) | Запланированная самопроверка и дайджест |
| [Cron / Запланированные задачи](https://qwenpaw.agentscope.io/docs/cron) | Запланированные задачи и автоматизация |
| [Мультиагенты](https://qwenpaw.agentscope.io/docs/multi-agent) | Создание нескольких агентов и совместная работа |
| [Безопасность](https://qwenpaw.agentscope.io/docs/security) | Sandbox, tool guard, file guard, skill scanner, access policy |
| [Резервное копирование и восстановление](https://qwenpaw.agentscope.io/docs/backup) | Резервное копирование и восстановление данных |
| [Конфигурация и рабочая директория](https://qwenpaw.agentscope.io/docs/config) | Рабочая директория и конфигурационный файл |
| [REST API](https://qwenpaw.agentscope.io/docs/api-tutorial) | HTTP API для интеграции и автоматизации |
| [Интеграция ACP](https://qwenpaw.agentscope.io/docs/acp-integration) | Интеграция Agent Communication Protocol |
| [CLI](https://qwenpaw.agentscope.io/docs/cli) | Init, cron-задачи, skills, очистка |
| [Практика агентных команд](https://qwenpaw.agentscope.io/docs/practice-agent-team) | Руководство по развертыванию мультиагентных команд |
| [FAQ](https://qwenpaw.agentscope.io/docs/faq) | Частые вопросы и устранение неполадок |
Полная документация: [qwenpaw.agentscope.io/docs](https://qwenpaw.agentscope.io/docs)
---
## FAQ
Для часто задаваемых вопросов, советов по устранению неполадок и известных проблем посетите **[страницу FAQ](https://qwenpaw.agentscope.io/docs/faq)**.
---
## Дорожная карта
| Направление | Задача | Статус |
| ----------------------------------------------- | ---------------------------------------------- | --------------- |
| **Горизонтальное расширение** | Больше каналов, моделей, навыков и MCP | Ищем участников |
| **Расширение существующих функций** | Улучшение интерфейса, загрузок и Windows | Ищем участников |
| **Модели** | Переключение между несколькими моделями | В работе |
| **Безопасность и подтверждения** | Пакетный просмотр и подтверждение | В работе |
| **Автоматизация** | Автоматизированные задачи | В работе |
| **Взаимодействие агентов** | Передача задач между агентами | В работе |
| | Корректировка выполняемой задачи | В работе |
| **Рабочие пространства** | Несколько рабочих пространств | В работе |
| **Контекст** | Сжатие системных подсказок | В работе |
| **Инструменты** | Изменение файлов в нескольких местах | В работе |
| | Постоянные терминалы и фоновые задачи | В работе |
| **Computer-use** | Поиск и управление целями на экране | В работе |
| **Голосовое взаимодействие** | Голосовое управление задачами | В работе |
| **Управление контекстом и памятью** | Горячая смена векторной модели и хранилища | В работе |
| | Персональная база знаний | В работе |
| **Приложения QwenPaw** | QwenPaw Insight | В работе |
| | QwenPaw Mail | В работе |
_Статусы:_ **В работе** — активно ведётся разработка; **Ищем участников** — мы настоятельно призываем к участию сообщества.
---
## Участие в проекте
QwenPaw развивается через открытую совместную работу, и мы приветствуем любые формы участия! Ознакомьтесь с [Дорожной картой](#дорожная-карта) выше (особенно с пунктами, отмеченными как **Ищем участников**), чтобы найти интересующие вас области, и прочитайте [CONTRIBUTING](https://github.com/agentscope-ai/QwenPaw/blob/main/CONTRIBUTING.md), чтобы начать. Мы особенно приветствуем:
- **Горизонтальное расширение** — новые каналы, провайдеры моделей, Skills, MCP.
- **Расширение и улучшение существующих функций** — оптимизация отображения и взаимодействия, подсказки при загрузке, совместимость путей Windows и т.д.
Присоединяйтесь к обсуждениям на [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions), чтобы обсуждать идеи или браться за задачи.
---
## Установка из исходников
```bash
git clone https://github.com/agentscope-ai/QwenPaw.git
cd QwenPaw
# Сначала соберите frontend консоли (необходимо для веб-интерфейса)
cd console && npm ci && npm run build
cd ..
# Скопируйте результат сборки консоли в директорию пакета
mkdir -p src/qwenpaw/console
cp -R console/dist/. src/qwenpaw/console/
# Установите Python-пакет
pip install -e .
```
- **Разработка** (тесты, форматирование): `pip install -e ".[dev,test,full]"`
- **Затем**: Выполните `qwenpaw init --defaults`, затем `qwenpaw app`.
> **Примечание при обновлении:** При обновлении до новой мажорной версии после `git pull` пересоберите frontend, переустановите пакет (`pip install -e .`), перезапустите `qwenpaw app` и очистите кэш браузера (`Ctrl+Shift+R` или `Cmd+Shift+R` на macOS).
---
## Почему QwenPaw?
QwenPaw расшифровывается как Qwen Personal Agent Workstation и воплощает мудрость Qwen и теплоту Paw. Мы хотим, чтобы это был не холодный инструмент, а умная и тёплая «маленькая лапка», всегда готовая прийти на помощь — самый интуитивный партнёр в вашей цифровой жизни.
---
## Кто разрабатывает
[Команда AgentScope](https://github.com/agentscope-ai) · [AgentScope](https://github.com/agentscope-ai/agentscope) · [AgentScope Runtime](https://github.com/agentscope-ai/agentscope-runtime) · [ReMe](https://github.com/agentscope-ai/ReMe)
---
## Связаться с нами
| [Discord](https://discord.gg/eYMpfnkG8h) | [X (Twitter)](https://x.com/agentscope_ai) | [DingTalk](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [RedNote](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [<img src="https://gw.alicdn.com/imgextra/i1/O1CN01hhD1mu1Dd3BWVUvxN_!!6000000000238-2-tps-400-400.png" width="80" height="80" alt="Discord">](https://discord.gg/eYMpfnkG8h) | [<img src="https://img.shields.io/badge/X-black.svg?logo=x&logoColor=white" width="80" height="80" alt="X">](https://x.com/agentscope_ai) | [<img src="https://img.alicdn.com/imgextra/i2/O1CN01vCWI8a1skHtLGXEMQ_!!6000000005804-2-tps-458-460.png" width="80" height="80" alt="DingTalk">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [<img src="https://img.alicdn.com/imgextra/i3/O1CN016BoEPS1l33CE9mHb9_!!6000000004762-0-tps-160-160.jpg" width="80" height="80" alt="RedNote">](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
---
## Будьте в курсе
<a href="https://github.com/agentscope-ai/QwenPaw">
<img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" width="600" alt="Star QwenPaw" />
</a>
Поставьте звезду QwenPaw на GitHub, чтобы мгновенно получать уведомления о новых релизах.
---
## Телеметрия
QwenPaw собирает **анонимные** данные об использовании при выполнении `qwenpaw init`, чтобы помочь нам понять пользовательскую базу и расставить приоритеты улучшений. Данные отправляются **один раз на версию** — при обновлении QwenPaw телеметрия собирается повторно для отслеживания распространения версий.
**Собираемая информация:**
- Версия QwenPaw (например, 1.1.12)
- Способ установки (pip, Docker или десктопное приложение)
- Операционная система и версия (например, macOS 14.0, Ubuntu 22.04)
- Версия Python (например, 3.13)
- Архитектура CPU (например, x86_64, arm64)
- Доступность GPU (да/нет)
**Не собирается:** Никакие персональные данные, файлы, ключи, IP-адреса или идентифицируемая информация.
При интерактивном запуске `qwenpaw init` вас спросят о согласии. При использовании `--defaults` согласие даётся автоматически. Запрос появляется один раз на версию и не влияет на функциональность QwenPaw.
---
## Лицензия
QwenPaw выпускается под лицензией [Apache License 2.0](LICENSE).
---
## Участники
Благодарим всех, кто внёс вклад в развитие QwenPaw:
<a href="https://github.com/agentscope-ai/QwenPaw/graphs/contributors">
<img src="https://contrib.rocks/image?repo=agentscope-ai/QwenPaw" alt="Участники" />
</a>
+565
View File
@@ -0,0 +1,565 @@
<div align="center">
# QwenPaw
[![GitHub Repo](https://img.shields.io/badge/GitHub-Repo-black.svg?logo=github)](https://github.com/agentscope-ai/QwenPaw)
[![PyPI](https://img.shields.io/pypi/v/qwenpaw?color=3775A9&label=PyPI&logo=pypi)](https://pypi.org/project/qwenpaw/)
[![Documentation](https://img.shields.io/badge/Docs-Website-green.svg?logo=readthedocs&label=Docs)](https://qwenpaw.agentscope.io/)
[![Python Version](https://img.shields.io/badge/python-3.11%20~%20%3C3.14-blue.svg?logo=python&label=Python)](https://www.python.org/downloads/)
[![Last Commit](https://img.shields.io/github/last-commit/agentscope-ai/QwenPaw)](https://github.com/agentscope-ai/QwenPaw)
[![License](https://img.shields.io/badge/license-Apache%202.0-red.svg?logo=apache&label=License)](LICENSE)
[![Code Style](https://img.shields.io/badge/code%20style-black-black.svg?logo=python&label=CodeStyle)](https://github.com/psf/black)
[![GitHub Stars](https://img.shields.io/github/stars/agentscope-ai/QwenPaw?style=flat&logo=github&color=yellow&label=Stars)](https://github.com/agentscope-ai/QwenPaw/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/agentscope-ai/QwenPaw?style=flat&logo=github&color=purple&label=Forks)](https://github.com/agentscope-ai/QwenPaw/network)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-Ask_Devin-navy.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/agentscope-ai/QwenPaw)
[![Discord](https://img.shields.io/badge/Discord-Join_Us-blueviolet.svg?logo=discord)](https://discord.gg/eYMpfnkG8h)
[![X](https://img.shields.io/badge/X-Follow_Us-black.svg?logo=x)](https://x.com/agentscope_ai)
[![DingTalk](https://img.shields.io/badge/DingTalk-Join_Us-orange.svg)](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11)
[![AgentScope Platform](https://img.shields.io/badge/%E2%98%81_AgentScope_Platform-%F0%9F%90%BE_7%2F24_Online_%26_Free-FF6B2B.svg)](https://platform.agentscope.io/)
<a href="https://trendshift.io/repositories/25882" target="_blank"><img src="https://trendshift.io/api/badge/trendshift/repositories/25882/daily" alt="agentscope-ai%2FQwenPaw | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[[Tài liệu](https://qwenpaw.agentscope.io/)] [[English](README.md)] [[中文](README_zh.md)] [[日本語](README_ja.md)] [[Русский](README_ru.md)]
<p align="center">
<img src="https://gw.alicdn.com/imgextra/i1/O1CN01sens5C1TuwioeGexL_!!6000000002443-55-tps-771-132.svg" alt="QwenPaw Logo" width="120">
</p>
<p align="center"><b>Phục vụ bạn, đồng hành cùng bạn.</b></p>
</div>
Trợ lý AI cá nhân của bạn — triển khai cục bộ hoặc trên đám mây, mở rộng bằng Skills & Plugins, kết nối trên mọi kênh.
| | |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Không bao giờ quên** | Bộ nhớ ba lớp — ngữ cảnh làm việc trực tiếp, lịch sử nguyên văn đầy đủ và cơ sở tri thức cá nhân tự tiến hóa được vận hành bởi [ReMe](https://github.com/agentscope-ai/ReMe). Hội thoại và tài liệu liên tục được chuyển thành bộ nhớ Markdown dễ đọc, chỉnh sửa, tìm kiếm và liên kết với nhau. |
| **Cục bộ hoặc đám mây, chạy tự do** | Mô hình QwenPaw-Flash (2B / 4B / 9B) huấn luyện cho tác vụ tác nhân. Runtime QwenPaw Local tích hợp sẵn — không cần API key, không phụ thuộc đám mây. Cũng hỗ trợ Ollama, LM Studio hoặc 14+ nhà cung cấp đám mây. |
| **Bảo mật tích hợp sẵn** | Sandbox cấp kernel, Tool Guard, File Guard và Skill Scanner. Lệnh nguy hiểm bị chặn trước khi chạy. |
| **Đa tác nhân & song song** | Tạo tác nhân độc lập với bộ nhớ và Skills riêng. Tác nhân con lúc chạy. Agent Communication Protocol (ACP) để điều phối liên hệ thống. |
| **Không gian làm việc tệp** | Điều hướng, xem trước, chỉnh sửa, diff, tải lên và tải xuống thống nhất cho tệp dự án và Agent. |
| **Mở rộng** | Skills cho lập lịch, tài liệu, trình duyệt, tin tức và hơn thế. Kiến trúc plugin kèm chợ. Tích hợp MCP cho công cụ bên ngoài. Kết hợp thành quy trình theo mục đích. |
| **Sẵn sàng mọi nơi** | DingTalk, Lark, WeChat, Discord, Telegram, iMessage, QQ — một instance, mọi kênh. Console, TUI và ứng dụng desktop để truy cập trực tiếp. |
| **Của bạn, không phải của chúng tôi** | Triển khai cục bộ — dữ liệu ở lại máy bạn. Không qua bên thứ ba lưu trữ, không tải dữ liệu lên. |
> <details>
> <summary><b>Bạn có thể làm gì với QwenPaw</b></summary>
>
> <br>
>
> - **Tự động hóa & lập lịch**: Thiết lập tác vụ định kỳ — tóm tắt tin tức, tạo báo cáo, phát sóng đa kênh — tất cả theo lịch của bạn.
> - **Mã nguồn & phát triển**: Đọc, chỉnh sửa, review và kiểm thử mã trong dự án bằng không gian làm việc tệp thống nhất.
> - **Xử lý tài liệu**: Đọc, ghi và chuyển đổi tệp PDF, Word, Excel và PowerPoint.
> - **Thu thập thông tin**: Tìm kiếm web, theo dõi nguồn đăng ký, tóm tắt video và tìm thông tin trong cơ sở tri thức cá nhân.
> - **Vận hành đa kênh**: Đẩy cảnh báo, tóm tắt hoặc nội dung do AI tạo tới DingTalk, Lark, Discord, Telegram, v.v. — đồng thời hoặc theo từng kênh.
> - **Quy trình tùy chỉnh**: Kết hợp khả năng tích hợp sẵn, plugin và tác vụ định kỳ thành quy trình phù hợp với nhu cầu của bạn.
>
> </details>
---
## Tin Tức
- [2026-08-13] **v2.1.0** | QwenPaw OS Shell, không gian làm việc Files hợp nhất, QwenPaw Creator, tích hợp agent Codex/Qoder, Browser-use, Computer-use, điểm khôi phục workspace và tiếp tục tác vụ hội thoại dài. [Ghi chú phát hành v2.1.0 →](https://qwenpaw.agentscope.io/release-notes#v2.1.0)
- [2026-07-24] **v2.0.1** | Nền tảng mini-app PawApp, Agent Mode do người dùng chỉnh sửa, Oh-My-Paw plugins, nâng cấp bộ nhớ [ReMe](https://github.com/agentscope-ai/ReMe), cải thiện UX desktop v.v. [Ghi chú phát hành v2.0.1 →](https://qwenpaw.agentscope.io/release-notes#v2.0.1)
- [2026-07-10] **v2.0.0 — QwenPaw 2.0 Official Release** 🎉 | Viết lại toàn bộ dựa trên AgentScope 2.0: kiến trúc Agent OS, Loop Engineering, Scroll Context, cơ sở tri thức cá nhân tự tiến hóa [ReMe](https://github.com/agentscope-ai/ReMe) v0.4 và TUI tích hợp.
| Nổi bật | Nội dung mới |
|-----------|------------|
| **Agent OS — Workspace** | Ba trụ cột mỗi agent: **Resources** (lưu trữ minh bạch trên đĩa), **Governance** (allow/deny/ask/sandbox), **Sandbox** (macOS / Linux / Windows). |
| **Agent OS — Drivers** | Lớp connector trung lập giao thức MCP / A2A / ACP với credentials mã hóa và policy gate mỗi lần gọi. |
| **Loop Engineering** | Mẫu vòng lặp agent nâng cao (Coding Mode, Mission Mode, thêm nhiều sắp tới) với cổng phê duyệt kết hợp. |
| **Scroll Context** | Mọi lượt được lưu trữ; lượt bị đẩy ra có chỉ mục, recall theo yêu cầu — không tóm tắt, không mất. |
| **[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 — Cơ sở tri thức cá nhân tự tiến hóa** | Liên tục chuyển hội thoại và tài liệu thành bộ nhớ Markdown dễ đọc, chỉnh sửa, tìm kiếm và liên kết với nhau. |
| **Terminal UI (TUI)** | Chat terminal toàn màn hình — cùng agent, bộ nhớ và phiên với Console và kênh. |
Dựa trên Agent OS, chúng tôi sẽ ra mắt các ứng dụng QwenPaw sẵn sàng sử dụng — như **QwenPaw Creator** và **QwenPaw Insight** — hãy theo dõi. [v2.0.0 Release Notes →](https://qwenpaw.agentscope.io/release-notes#v2.0.0)
- [2026-06-17] **v1.1.12 — Trang Mô Hình Đổi Mới & Chế Độ Đơn Giản** | Trang mô hình thiết kế lại với tổng hợp nhà cung cấp; Chế độ Đơn giản mới. [Ghi chú phát hành v1.1.12 →](https://qwenpaw.agentscope.io/release-notes#v1.1.12)
- [2026-06-11] **AgentScope Platform ra mắt** — Triển khai QwenPaw miễn phí, chia sẻ plugin và Chợ Skills. [Dùng thử ngay →](https://platform.agentscope.io/)
- [2026-06-10] **v1.1.11** — OAuth Mô hình Miễn phí, Chợ Plugin, Danh sách trắng MCP. [Ghi chú phát hành v1.1.11 →](https://qwenpaw.agentscope.io/release-notes#v1.1.11)
[Tất cả ghi chú phát hành →](https://qwenpaw.agentscope.io/release-notes)
---
## Mục Lục
- [Tin Tức](#tin-tức)
- [Bắt Đầu Nhanh](#bắt-đầu-nhanh)
- [API Key](#api-key)
- [Mô Hình Địa Phương](#mô-hình-địa-phương)
- [Tính Năng Bảo Mật](#tính-năng-bảo-mật)
- [Tài Liệu](#tài-liệu)
- [Câu Hỏi Thường Gặp](#câu-hỏi-thường-gặp)
- [Lộ Trình Phát Triển](#lộ-trình-phát-triển)
- [Đóng Góp](#đóng-góp)
- [Cài Đặt Từ Mã Nguồn](#cài-đặt-từ-mã-nguồn)
- [Tại Sao Là QwenPaw?](#tại-sao-là-qwenpaw)
- [Được Xây Dựng Bởi](#được-xây-dựng-bởi)
- [Giấy Phép](#giấy-phép)
---
## Bắt Đầu Nhanh
### Tùy Chọn 1: Pip Install
Nếu bạn thích tự quản lý Python (yêu cầu Python >= 3.11, < 3.14):
```bash
pip install qwenpaw
qwenpaw init --defaults
qwenpaw app
```
Sau đó mở Console trong trình duyệt tại **http://127.0.0.1:8088/** để cấu hình mô hình. Để chat trong DingTalk, Lark, WeChat, v.v., xem tài liệu [Thiết lập kênh](https://qwenpaw.agentscope.io/docs/channels).
![Console](https://img.alicdn.com/imgextra/i2/O1CN01EP1ra01iOAcBvF0TC_!!6000000004402-2-tps-3822-2070.png)
---
### Tùy Chọn 2: Cài Đặt Bằng Script
Không cần thiết lập Python thủ công, một lệnh duy nhất cài đặt mọi thứ. Script sẽ tự động tải xuống uv (trình quản lý gói Python), tạo môi trường ảo, và cài đặt QwenPaw với tất cả phụ thuộc (bao gồm Node.js và tài nguyên frontend). Lưu ý: Có thể không hoạt động trong môi trường mạng bị hạn chế hoặc tường lửa doanh nghiệp.
**macOS / Linux:**
```bash
curl -fsSL https://qwenpaw.agentscope.io/install.sh | bash
```
**Windows (CMD):**
```CMD
curl -fsSL https://qwenpaw.agentscope.io/install.bat -o install.bat && install.bat
```
**Windows (PowerShell):**
```powershell
irm https://qwenpaw.agentscope.io/install.ps1 | iex
```
> **Lưu ý**: Trình cài đặt sẽ tự động kiểm tra trạng thái của uv. Nếu chưa được cài đặt, nó sẽ cố gắng tải xuống và cấu hình tự động. Nếu quá trình cài đặt tự động thất bại, vui lòng làm theo hướng dẫn trên màn hình hoặc thực thi `python -m pip install -U uv`, sau đó chạy lại trình cài đặt.
> **⚠️ Thông báo đặc biệt cho người dùng Windows Enterprise LTSC**
>
> Nếu bạn đang sử dụng Windows LTSC hoặc môi trường doanh nghiệp bị ràng buộc bởi chính sách bảo mật nghiêm ngặt, PowerShell có thể chạy ở **Chế độ Ngôn ngữ Hạn chế (Constrained Language Mode)**, gây ra các vấn đề sau:
> 1. **Nếu dùng CMD (.bat): Script thực thi thành công nhưng không ghi được vào `Path`**
>
> Script đã hoàn tất cài đặt tệp. Do **Chế độ Ngôn ngữ Hạn chế**, nó không thể tự động cập nhật biến môi trường. Hãy cấu hình thủ công như sau:
> - **Xác định thư mục cài đặt**:
> - Kiểm tra `uv` có sẵn không: Nhập `uv --version` trong CMD. Nếu có số phiên bản, **chỉ cần cấu hình đường dẫn QwenPaw**. Nếu nhận được thông báo `'uv' không được nhận dạng là lệnh nội bộ hay bên ngoài, chương trình có thể thực thi hay tệp lệnh,` hãy cấu hình cả hai đường dẫn.
> - Đường dẫn uv (chọn một tùy vị trí cài đặt; dùng khi `uv` không khả dụng): Thường là `%USERPROFILE%\.local\bin`, `%USERPROFILE%\AppData\Local\uv`, hoặc thư mục `Scripts` trong thư mục cài đặt Python
> - Đường dẫn QwenPaw: Thường nằm tại `%USERPROFILE%\.qwenpaw\bin`.
> - **Thêm thủ công vào biến môi trường Path của hệ thống**:
> - Nhấn `Win + R`, gõ `sysdm.cpl` và nhấn Enter để mở System Properties.
> - Nhấp "Advanced" -> "Environment Variables".
> - Trong "System variables", tìm và chọn `Path`, sau đó nhấp "Edit".
> - Nhấp "New", lần lượt nhập cả hai đường dẫn thư mục, sau đó nhấp OK để lưu.
> 2. **Nếu dùng PowerShell (.ps1): Script bị gián đoạn**
>
> Do **Chế độ Ngôn ngữ Hạn chế**, script có thể không tự động tải xuống được `uv`.
> - **Cài đặt uv thủ công**: Tham khảo [GitHub Release](https://github.com/astral-sh/uv/releases) để tải `uv.exe` và đặt vào `%USERPROFILE%\.local\bin` hoặc `%USERPROFILE%\AppData\Local\uv`; hoặc đảm bảo Python đã được cài đặt và chạy `python -m pip install -U uv`.
> - **Cấu hình biến môi trường `uv`**: Thêm thư mục chứa `uv` và `%USERPROFILE%\.qwenpaw\bin` vào biến `Path` của hệ thống.
> - **Chạy lại trình cài đặt**: Mở terminal mới và thực thi lại script cài đặt để hoàn tất cài đặt `QwenPaw`.
> - **Cấu hình biến môi trường `QwenPaw`**: Thêm `%USERPROFILE%\.qwenpaw\bin` vào biến `Path` của hệ thống.
Sau khi cài đặt, mở terminal mới và chạy:
```bash
qwenpaw init --defaults # hoặc: qwenpaw init (tương tác)
qwenpaw app
```
<details>
<summary><b>Tùy chọn cài đặt</b></summary>
**macOS / Linux:**
```bash
# Cài đặt phiên bản cụ thể
curl -fsSL ... | bash -s -- --version 1.1.0
# Cài đặt từ mã nguồn (dev/testing)
curl -fsSL ... | bash -s -- --from-source
# Nâng cấp — chỉ cần chạy lại trình cài đặt
curl -fsSL ... | bash
# Gỡ cài đặt
qwenpaw uninstall # giữ lại cấu hình và dữ liệu
qwenpaw uninstall --purge # xóa mọi thứ
```
**Windows (PowerShell):**
```powershell
# Cài đặt phiên bản cụ thể
irm ... | iex; .\install.ps1 -Version 1.1.12
# Cài đặt từ mã nguồn (dev/testing)
.\install.ps1 -FromSource
# Nâng cấp — chỉ cần chạy lại trình cài đặt
irm ... | iex
# Gỡ cài đặt
qwenpaw uninstall # giữ lại cấu hình và dữ liệu
qwenpaw uninstall --purge # xóa mọi thứ
```
</details>
---
### Tùy Chọn 3: Docker
Image có trên **Docker Hub** (`agentscope/qwenpaw`). Tag image: `latest` (ổn định); `pre` (bản phát hành thử nghiệm PyPI).
```bash
docker pull agentscope/qwenpaw:latest
docker run -p 127.0.0.1:8088:8088 \
-v qwenpaw-data:/app/working \
-v qwenpaw-secrets:/app/working.secret \
-v qwenpaw-backups:/app/working.backups \
agentscope/qwenpaw:latest
```
Cũng có sẵn trên Alibaba Cloud Container Registry (ACR) cho người dùng tại Trung Quốc: `agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/qwenpaw` (cùng tag).
Sau đó mở **http://127.0.0.1:8088/** để truy cập Console. Cấu hình, bộ nhớ và Skills được lưu trong volume `qwenpaw-data`; cài đặt nhà cung cấp mô hình và API key được lưu trong volume `qwenpaw-secrets`; các bản sao lưu được lưu trong volume `qwenpaw-backups`. Để truyền API key (ví dụ: `DASHSCOPE_API_KEY`), thêm `-e VAR=value` hoặc `--env-file .env` vào lệnh `docker run`.
> **Kết nối với Ollama hoặc các dịch vụ khác trên máy chủ**
>
> Bên trong container Docker, `localhost` trỏ đến chính container, không phải máy chủ của bạn. Nếu bạn chạy Ollama (hoặc các dịch vụ mô hình khác) trên máy chủ và muốn QwenPaw trong Docker truy cập được, hãy sử dụng một trong các cách sau:
>
> **Cách A** — Gắn kết máy chủ rõ ràng (mọi nền tảng):
> ```bash
> docker run -p 127.0.0.1:8088:8088 \
> --add-host=host.docker.internal:host-gateway \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> Sau đó trong QwenPaw **Settings → Models**, thay đổi Base URL thành `http://host.docker.internal:<port>` — ví dụ: `http://host.docker.internal:11434` cho Ollama, hoặc `http://host.docker.internal:1234/v1` cho LM Studio.
>
> **Cách B** — Mạng máy chủ (chỉ Linux):
> ```bash
> docker run --network=host \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> Không cần ánh xạ cổng (`-p`); container chia sẻ trực tiếp mạng máy chủ. Lưu ý rằng tất cả cổng của container đều được lộ ra trên máy chủ, có thể gây xung đột nếu cổng đã được sử dụng.
>
Image được xây dựng từ đầu. Để tự xây dựng image, vui lòng tham khảo phần [Build Docker image](scripts/README.md#build-docker-image) trong `scripts/README.md`, sau đó đẩy lên registry của bạn.
---
### Tùy Chọn 4: Triển Khai Trên Alibaba Cloud ECS
Để chạy QwenPaw trên Alibaba Cloud (ECS), sử dụng triển khai một chạm: mở [đường dẫn triển khai QwenPaw trên Alibaba Cloud (ECS)](https://computenest.console.aliyun.com/service/instance/create/cn-hangzhou?type=user&ServiceId=service-1ed84201799f40879884) và làm theo hướng dẫn. Để biết hướng dẫn từng bước, xem [Alibaba Cloud Developer: Triển khai trợ lý AI trong 3 phút](https://developer.aliyun.com/article/1713682).
---
### Tùy Chọn 5: AgentScope Platform
[AgentScope Platform](https://platform.agentscope.io/) cung cấp triển khai QwenPaw trên đám mây một chạm, chia sẻ plugin và Chợ Skills. Miễn phí, trực tuyến 7/24.
---
### Tùy Chọn 6: Sử Dụng ModelScope
[ModelScope Studio](https://modelscope.cn/studios/fork?target=AgentScope/QwenPaw) cũng hỗ trợ triển khai QwenPaw trên đám mây. Lưu ý: đặt Studio của bạn ở chế độ **không công khai** để người khác không thể điều khiển QwenPaw của bạn.
---
### Tùy Chọn 7: Ứng Dụng Desktop (Beta)
> **Thông báo Beta**: Ứng dụng desktop hiện đang trong giai đoạn thử nghiệm Beta với các hạn chế đã biết sau:
> - **Kiểm tra tương thích chưa đầy đủ**: Chưa được kiểm tra đầy đủ trên tất cả các phiên bản hệ thống và cấu hình phần cứng
> - **Có thể có vấn đề về hiệu suất**: Thời gian khởi động, sử dụng bộ nhớ và các khía cạnh hiệu suất khác có thể cần tối ưu thêm
> - **Tính năng đang phát triển**: Một số tính năng có thể không ổn định hoặc bị thiếu
Nếu bạn không quen với công cụ dòng lệnh, bạn có thể tải xuống và sử dụng ứng dụng desktop của QwenPaw mà không cần cấu hình môi trường Python thủ công hay chạy lệnh.
#### Tải Xuống
Tải ứng dụng desktop (bản Tauri) từ [trang tải xuống chính thức](https://qwenpaw.agentscope.io/downloads):
- **Windows**: `QwenPaw-Tauri-<version>-Windows-setup.exe`
- **macOS**: `QwenPaw-Tauri-<version>-macOS.zip` (khuyên dùng Apple Silicon)
#### Tính Năng
- ✅ **Không cấu hình**: Tải về và nhấp đúp để chạy, không cần cài Python hay cấu hình biến môi trường
- ✅ **Đa nền tảng**: Hỗ trợ Windows 10+ và macOS 14+
- ✅ **Giao diện trực quan**: Tự động mở cửa sổ ứng dụng, không cần nhập địa chỉ thủ công
- ⚠️ **Giai đoạn Beta**: Các tính năng đang được liên tục cải thiện, rất mong nhận phản hồi
#### Lần Đầu Khởi Động
**Quan trọng**: Lần đầu khởi động có thể mất 10-60 giây (tùy thuộc vào cấu hình hệ thống của bạn). Ứng dụng cần khởi tạo môi trường Python và tải các phụ thuộc. Vui lòng kiên nhẫn chờ cửa sổ tự động mở.
#### macOS: Vượt Qua Rào Cản Bảo Mật Hệ Thống
Khi bạn tải ứng dụng macOS QwenPaw từ Releases, macOS có thể hiển thị: *"Apple không thể xác minh rằng 'QwenPaw' không chứa phần mềm độc hại"*. Điều này xảy ra vì ứng dụng chưa được notarization. Bạn vẫn có thể mở nó như sau:
- **Nhấp chuột phải để mở (khuyên dùng)**
Nhấp chuột phải (hoặc Control+click) vào ứng dụng QwenPaw → **Open** → trong hộp thoại, nhấp **Open** lần nữa. Thao tác này báo cho Gatekeeper rằng bạn tin tưởng ứng dụng; sau đó bạn có thể nhấp đúp để khởi chạy như bình thường.
- **Cho phép trong System Settings**
Nếu vẫn bị chặn, vào **System Settings → Privacy & Security**, cuộn đến thông báo như *"QwenPaw was blocked because it is from an unidentified developer"*, và nhấp **Open Anyway** hoặc **Allow**.
- **Xóa thuộc tính cách ly (không khuyên dùng cho hầu hết người dùng)**
Trong Terminal chạy:
`xattr -cr "/Applications/QwenPaw Desktop.app"`
(hoặc dùng đường dẫn tới tệp `.app` sau khi giải nén). Thao tác này xóa cờ cách ly "đã tải xuống từ internet" để cảnh báo thường không xuất hiện, nhưng kém an toàn và kiểm soát hơn so với dùng **Nhấp chuột phải → Open**.
Để biết hướng dẫn sử dụng chi tiết, khắc phục sự cố và các vấn đề thường gặp, xem [Hướng dẫn ứng dụng Desktop](https://qwenpaw.agentscope.io/docs/desktop).
---
### Tiếp Theo?
Sau khi cài đặt, cấu hình mô hình trong **Console → Settings → Models**, rồi khám phá:
- [Thêm Skills](https://qwenpaw.agentscope.io/docs/skills) để mở rộng khả năng (PDF, Office, trình duyệt, tin tức, v.v.)
- [Thiết lập Kênh](https://qwenpaw.agentscope.io/docs/channels) cho DingTalk, Lark, Discord, v.v.
- [Cấu hình Cron](https://qwenpaw.agentscope.io/docs/cron) cho tác vụ định kỳ và tự động hóa
- Xem [hướng dẫn Bắt đầu nhanh](https://qwenpaw.agentscope.io/docs/quickstart) đầy đủ cho mọi tùy chọn và bước xác minh
---
## Terminal UI (TUI)
Muốn ở lại terminal? Chạy `qwenpaw` để mở **TUI** chat toàn màn hình, điều khiển _cùng_ tác nhân với Console và các Kênh IM — cùng bộ nhớ, Skills, công cụ MCP và phiên — mà không rời bàn phím.
```bash
qwenpaw # mở chat với tác nhân đang hoạt động
qwenpaw tui --resume <id> # tiếp tục phiên trước
qwenpaw . # bắt đầu trong repo hiện tại (Coding Mode)
```
Hỗ trợ phản hồi streaming, lệnh slash (`/help`, `/resume`, `/theme`, cùng các lệnh riêng của tác nhân như `/model`, `/clear`, …), dán tệp/văn bản dài làm đính kèm, và nhắc quyền công cụ nội tuyến. Xem [hướng dẫn Terminal UI](https://qwenpaw.agentscope.io/docs/tui) để biết chi tiết.
![QwenPaw TUI](https://img.alicdn.com/imgextra/i2/O1CN01IULzib1TRAzigIcqG_!!6000000002378-2-tps-2350-1312.png)
---
## API Key
Nếu bạn sử dụng **API LLM đám mây** (ví dụ: DashScope / Qwen, OpenAI, Anthropic, Google Gemini, DeepSeek, Kimi, OpenRouter, v.v.), bạn phải cấu hình API key trước khi chat. QwenPaw sẽ không hoạt động cho đến khi có key hợp lệ. Xem [tài liệu chính thức](https://qwenpaw.agentscope.io/docs/models) để biết chi tiết.
**Cách cấu hình:**
1. **Console (khuyên dùng)** — Sau khi chạy `qwenpaw app`, mở **http://127.0.0.1:8088/** → **Settings** → **Models**. Chọn nhà cung cấp, nhập **API Key**, và kích hoạt nhà cung cấp cùng mô hình đó.
2. **`qwenpaw init`** — Khi chạy `qwenpaw init`, bạn sẽ được hướng dẫn cấu hình nhà cung cấp LLM và API key. Làm theo lời nhắc để chọn nhà cung cấp và nhập key.
3. **Biến môi trường** — Với DashScope bạn có thể đặt `DASHSCOPE_API_KEY` trong shell hoặc trong tệp `.env` trong thư mục làm việc.
Các công cụ cần key bổ sung (ví dụ: `TAVILY_API_KEY` cho tìm kiếm web) có thể được đặt trong Console **Settings → Environment variables**, xem [Config](https://qwenpaw.agentscope.io/docs/config) để biết chi tiết.
> **Chỉ dùng mô hình địa phương?** Nếu bạn sử dụng [Mô Hình Địa Phương](#mô-hình-địa-phương) (QwenPaw Local (llama.cpp) / Ollama / LM Studio), bạn **không** cần bất kỳ API key nào.
## Mô Hình Địa Phương
QwenPaw có thể chạy LLM hoàn toàn trên máy của bạn — không cần API key hoặc dịch vụ đám mây. Xem [tài liệu chính thức](https://qwenpaw.agentscope.io/docs/models) để biết chi tiết.
QwenPaw cũng cung cấp dòng **QwenPaw-Flash** — mô hình 2B / 4B / 9B huấn luyện chuyên biệt cho kịch bản tác nhân, với lượng tử hóa Q4 và Q8. Có sẵn trên [ModelScope](https://www.modelscope.cn/organization/AgentScope?tab=model) và [Hugging Face](https://huggingface.co/agentscope-ai/models).
| Backend | Phù hợp nhất cho | Cài đặt |
| -------------------- | ---------------------------------------------- | -------------------------------------------------------------------- |
| **QwenPaw Local** (llama.cpp) | Đa nền tảng (macOS / Linux / Windows) | Tích hợp sẵn; nhấp "Download" trong giao diện web. Hỗ trợ QwenPaw-Flash với gợi ý theo phần cứng. |
| **Ollama** | Đa nền tảng (cần dịch vụ Ollama) | Cài đặt và khởi động Ollama; đặt độ dài ngữ cảnh ≥ 32k. |
| **LM Studio** | Đa nền tảng (cần dịch vụ LM Studio) | Cài đặt và khởi động LM Studio; bật Local Server. |
---
## Tính Năng Bảo Mật
QwenPaw bao gồm bốn lớp bảo mật cốt lõi:
- **Sandbox** — Cách ly thực thi cấp kernel bằng Seatbelt (macOS), Bubblewrap / Landlock (Linux) và AppContainer (Windows). Lệnh shell chạy trong phạm vi hệ thống tệp bị hạn chế.
- **Tool Guard** — Công cụ quy tắc YAML với `ShellEvasionGuardian` kiểm tra mọi lệnh gọi công cụ trước khi thực thi, phát hiện command injection, path traversal, reverse shell và tấn công che giấu. Mức phê duyệt cấu hình được: STRICT / SMART / AUTO / OFF.
- **File Guard** — Độc lập với Tool Guard; chặn tác nhân truy cập tệp và thư mục nhạy cảm (mặc định bảo vệ `~/.qwenpaw.secret/`, `~/.ssh`, v.v.).
- **Skill Scanner** — Quét trước khi kích hoạt với chế độ block / warn / off và hỗ trợ danh sách trắng. Phát hiện prompt injection, khóa nhúng cứng, rò rỉ dữ liệu, v.v.
Xem [Bảo mật](https://qwenpaw.agentscope.io/docs/security) để biết chi tiết.
---
## Tài Liệu
| Chủ đề | Mô tả |
| --------------------------------------------------------------------- | --------------------------------------------------- |
| [Giới thiệu](https://qwenpaw.agentscope.io/docs/intro) | QwenPaw là gì và cách sử dụng |
| [Bắt đầu nhanh](https://qwenpaw.agentscope.io/docs/quickstart) | Cài đặt và chạy (cục bộ hoặc ModelScope Studio) |
| [Console](https://qwenpaw.agentscope.io/docs/console) | Giao diện Web: chat và cấu hình tác nhân |
| [Terminal UI (TUI)](https://qwenpaw.agentscope.io/docs/tui) | Chat terminal toàn màn hình, cùng tác nhân với Console |
| [Ứng dụng Desktop](https://qwenpaw.agentscope.io/docs/desktop) | Cài đặt và sử dụng ứng dụng desktop |
| [Mô hình](https://qwenpaw.agentscope.io/docs/models) | Cấu hình nhà cung cấp đám mây, cục bộ và tùy chỉnh |
| [Kênh](https://qwenpaw.agentscope.io/docs/channels) | DingTalk, Lark, QQ, Discord, iMessage, và hơn nữa |
| [Skills](https://qwenpaw.agentscope.io/docs/skills) | Mở rộng và tùy chỉnh khả năng |
| [Plugins](https://qwenpaw.agentscope.io/docs/plugins) | Hệ thống plugin và Chợ Plugin |
| [MCP](https://qwenpaw.agentscope.io/docs/mcp) | Quản lý máy khách MCP |
| [Persona](https://qwenpaw.agentscope.io/docs/persona) | Tùy chỉnh tính cách tác nhân (SOUL / PROFILE) |
| [Bộ nhớ](https://qwenpaw.agentscope.io/docs/memory) | Cơ sở tri thức cá nhân tự tiến hóa dựa trên bộ nhớ Markdown cục bộ, có thể chỉnh sửa, tìm kiếm và liên kết với nhau, được vận hành bởi [ReMe](https://github.com/agentscope-ai/ReMe) |
| [Tài liệu ReMe](https://docs.agentscope.io/reme/latest/en/overview) | Tổng quan và tài liệu chính thức của ReMe |
| [Bộ nhớ tiến hóa & Chủ động](https://qwenpaw.agentscope.io/docs/memory-evolving-and-proactive) | Tác nhân tiến hóa bộ nhớ và tương tác chủ động |
| [Ngữ cảnh](https://qwenpaw.agentscope.io/docs/context) | Quản lý ngữ cảnh dựa trên cuộn (scroll) |
| [Lệnh ma thuật](https://qwenpaw.agentscope.io/docs/commands) | Điều khiển trạng thái hội thoại mà không cần đợi AI |
| [Nhịp tim](https://qwenpaw.agentscope.io/docs/heartbeat) | Kiểm tra định kỳ và tóm tắt |
| [Cron / Tác Vụ Định Kỳ](https://qwenpaw.agentscope.io/docs/cron) | Tác vụ định kỳ và tự động hóa |
| [Đa tác nhân](https://qwenpaw.agentscope.io/docs/multi-agent) | Tạo nhiều tác nhân và kích hoạt hợp tác |
| [Bảo mật](https://qwenpaw.agentscope.io/docs/security) | Sandbox, tool guard, file guard, skill scanner, access policy |
| [Sao lưu & Khôi phục](https://qwenpaw.agentscope.io/docs/backup) | Sao lưu và khôi phục dữ liệu |
| [Cấu hình & thư mục làm việc](https://qwenpaw.agentscope.io/docs/config) | Thư mục làm việc và tệp cấu hình |
| [REST API](https://qwenpaw.agentscope.io/docs/api-tutorial) | HTTP API cho tích hợp và tự động hóa |
| [Tích hợp ACP](https://qwenpaw.agentscope.io/docs/acp-integration) | Tích hợp Agent Communication Protocol |
| [CLI](https://qwenpaw.agentscope.io/docs/cli) | Init, cron jobs, Skills, dọn dẹp |
| [Thực hành Nhóm Tác Nhân](https://qwenpaw.agentscope.io/docs/practice-agent-team) | Hướng dẫn triển khai nhóm đa tác nhân |
| [FAQ](https://qwenpaw.agentscope.io/docs/faq) | Câu hỏi thường gặp và khắc phục sự cố |
Tài liệu đầy đủ: [qwenpaw.agentscope.io/docs](https://qwenpaw.agentscope.io/docs)
---
## Câu Hỏi Thường Gặp
Đối với các câu hỏi thường gặp, mẹo khắc phục sự cố và các vấn đề đã biết, vui lòng truy cập **[trang FAQ](https://qwenpaw.agentscope.io/docs/faq)**.
---
## Lộ Trình Phát Triển
| Lĩnh vực | Mục | Trạng thái |
| ------------------------------ | --------------------------------------------- | --------------------- |
| **Mở rộng ngang** | Thêm kênh, mô hình, Skills và MCP | Đang kêu gọi đóng góp |
| **Mở rộng tính năng hiện có** | Cải thiện hiển thị, tải xuống và Windows | Đang kêu gọi đóng góp |
| **Mô hình** | Chuyển đổi đa mô hình | Đang thực hiện |
| **An toàn và phê duyệt** | Xem trước và phê duyệt hàng loạt | Đang thực hiện |
| **Tự động hóa** | Tác vụ tự động | Đang thực hiện |
| **Tương tác agent** | Bàn giao tác vụ giữa các agent | Đang thực hiện |
| | Điều chỉnh tác vụ đang chạy | Đang thực hiện |
| **Không gian làm việc** | Nhiều workspace | Đang thực hiện |
| **Ngữ cảnh** | Nén lời nhắc hệ thống | Đang thực hiện |
| **Hệ thống công cụ** | Thay đổi tệp ở nhiều vị trí | Đang thực hiện |
| | Terminal liên tục và tác vụ nền | Đang thực hiện |
| **Computer-use** | Xác định và thao tác mục tiêu trên màn hình | Đang thực hiện |
| **Tương tác giọng nói** | Tác vụ giọng nói thời gian thực | Đang thực hiện |
| **Quản lý ngữ cảnh và bộ nhớ** | Chuyển nóng mô hình vector và backend lưu trữ | Đang thực hiện |
| | Cơ sở tri thức cá nhân | Đang thực hiện |
| **Ứng dụng QwenPaw** | QwenPaw Insight | Đang thực hiện |
| | QwenPaw Mail | Đang thực hiện |
_Trạng thái:_ **Đang thực hiện** — đang tích cực phát triển; **Đang kêu gọi đóng góp** — chúng tôi khuyến khích đóng góp từ cộng đồng.
---
## Đóng Góp
QwenPaw phát triển thông qua hợp tác mở, và chúng tôi hoan nghênh mọi hình thức đóng góp! Xem [Lộ Trình Phát Triển](#lộ-trình-phát-triển) ở trên (đặc biệt là các mục được đánh dấu **Đang kêu gọi đóng góp**) để tìm lĩnh vực bạn quan tâm, và đọc [CONTRIBUTING](https://github.com/agentscope-ai/QwenPaw/blob/main/CONTRIBUTING.md) để bắt đầu. Chúng tôi đặc biệt hoan nghênh:
- **Mở rộng ngang** — kênh mới, nhà cung cấp mô hình, Skills, MCP.
- **Mở rộng & hoàn thiện tính năng hiện có** — cải thiện hiển thị và tương tác, gợi ý tải xuống, tương thích đường dẫn Windows, v.v.
Tham gia [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions) để thảo luận ý tưởng hoặc nhận nhiệm vụ.
---
## Cài Đặt Từ Mã Nguồn
```bash
git clone https://github.com/agentscope-ai/QwenPaw.git
cd QwenPaw
# Xây dựng frontend console trước (cần cho giao diện web)
cd console && npm ci && npm run build
cd ..
# Sao chép đầu ra build console vào thư mục gói
mkdir -p src/qwenpaw/console
cp -R console/dist/. src/qwenpaw/console/
# Cài đặt gói Python
pip install -e .
```
- **Dev** (kiểm thử, định dạng): `pip install -e ".[dev,test,full]"`
- **Sau đó**: Chạy `qwenpaw init --defaults`, rồi `qwenpaw app`.
> **Lưu ý khi cập nhật:** Khi cập nhật lên phiên bản chính mới sau `git pull`, vui lòng xây dựng lại frontend, cài đặt lại gói (`pip install -e .`), khởi động lại `qwenpaw app`, và xóa bộ nhớ đệm trình duyệt với `Ctrl+Shift+R` (hoặc `Cmd+Shift+R` trên macOS).
---
## Tại Sao Là QwenPaw?
QwenPaw là viết tắt của Qwen Personal Agent Workstation, đồng thời thể hiện trí tuệ của Qwen và hơi ấm của một Paw (bàn chân).
Chúng tôi hy vọng nó không phải là một công cụ lạnh lẽo, mà là một "bàn chân nhỏ" thông minh và ấm áp luôn sẵn sàng giúp đỡ — người bạn đồng hành trực quan nhất trong cuộc sống số của bạn.
---
## Được Xây Dựng Bởi
[Nhóm AgentScope](https://github.com/agentscope-ai) · [AgentScope](https://github.com/agentscope-ai/agentscope) · [AgentScope Runtime](https://github.com/agentscope-ai/agentscope-runtime) · [ReMe](https://github.com/agentscope-ai/ReMe)
---
## Liên Hệ
| [Discord](https://discord.gg/eYMpfnkG8h) | [X (Twitter)](https://x.com/agentscope_ai) | [DingTalk](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [RedNote](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [<img src="https://gw.alicdn.com/imgextra/i1/O1CN01hhD1mu1Dd3BWVUvxN_!!6000000000238-2-tps-400-400.png" width="80" height="80" alt="Discord">](https://discord.gg/eYMpfnkG8h) | [<img src="https://img.shields.io/badge/X-black.svg?logo=x&logoColor=white" width="80" height="80" alt="X">](https://x.com/agentscope_ai) | [<img src="https://img.alicdn.com/imgextra/i2/O1CN01vCWI8a1skHtLGXEMQ_!!6000000005804-2-tps-458-460.png" width="80" height="80" alt="DingTalk">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [<img src="https://img.alicdn.com/imgextra/i3/O1CN016BoEPS1l33CE9mHb9_!!6000000004762-0-tps-160-160.jpg" width="80" height="80" alt="RedNote">](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
---
## Theo Dõi Cập Nhật
<a href="https://github.com/agentscope-ai/QwenPaw">
<img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" width="600" alt="Star QwenPaw" />
</a>
Star QwenPaw trên GitHub để nhận thông báo ngay lập tức về các bản phát hành mới.
---
## Telemetry
QwenPaw thu thập dữ liệu sử dụng **ẩn danh** trong quá trình `qwenpaw init` để giúp chúng tôi hiểu cơ sở người dùng và ưu tiên cải tiến. Dữ liệu được gửi **mỗi phiên bản một lần** — khi bạn nâng cấp QwenPaw, telemetry được thu thập lại để chúng tôi có thể theo dõi mức độ áp dụng phiên bản.
**Những gì chúng tôi thu thập:**
- Phiên bản QwenPaw (ví dụ: 1.1.12)
- Phương pháp cài đặt (pip, Docker, hoặc ứng dụng desktop)
- Hệ điều hành và phiên bản (ví dụ: macOS 14.0, Ubuntu 22.04)
- Phiên bản Python (ví dụ: 3.13)
- Kiến trúc CPU (ví dụ: x86_64, arm64)
- Khả năng GPU (có/không)
**Những gì chúng tôi KHÔNG thu thập:** Không có dữ liệu cá nhân, không có tệp, không có thông tin đăng nhập, không có địa chỉ IP, không có thông tin nhận dạng.
Khi chạy `qwenpaw init` ở chế độ tương tác, bạn sẽ được hỏi có đồng ý tham gia hay không. Nếu bạn chọn `--defaults`, telemetry sẽ tự động được chấp nhận. Lời nhắc xuất hiện một lần mỗi phiên bản và không bao giờ ảnh hưởng đến chức năng của QwenPaw.
---
## Giấy Phép
QwenPaw được phát hành theo [Giấy phép Apache 2.0](LICENSE).
---
## Người Đóng Góp
Xin cảm ơn tất cả những người đã đóng góp:
<a href="https://github.com/agentscope-ai/QwenPaw/graphs/contributors">
<img src="https://contrib.rocks/image?repo=agentscope-ai/QwenPaw" alt="Người đóng góp" />
</a>
+566
View File
@@ -0,0 +1,566 @@
<div align="center">
# QwenPaw
[![GitHub 仓库](https://img.shields.io/badge/GitHub-仓库-black.svg?logo=github)](https://github.com/agentscope-ai/QwenPaw)
[![PyPI](https://img.shields.io/pypi/v/qwenpaw?color=3775A9&label=PyPI&logo=pypi)](https://pypi.org/project/qwenpaw/)
[![文档](https://img.shields.io/badge/文档-在线-green.svg?logo=readthedocs&label=Docs)](https://qwenpaw.agentscope.io/)
[![Python 版本](https://img.shields.io/badge/python-3.11%20~%20%3C3.14-blue.svg?logo=python&label=Python)](https://www.python.org/downloads/)
[![最后提交](https://img.shields.io/github/last-commit/agentscope-ai/QwenPaw)](https://github.com/agentscope-ai/QwenPaw)
[![许可证](https://img.shields.io/badge/license-Apache%202.0-red.svg?logo=apache&label=%E8%AE%B8%E5%8F%AF%E8%AF%81)](LICENSE)
[![代码风格](https://img.shields.io/badge/code%20style-black-black.svg?logo=python&label=%E4%BB%A3%E7%A0%81%E9%A3%8E%E6%A0%BC)](https://github.com/psf/black)
[![GitHub Star](https://img.shields.io/github/stars/agentscope-ai/QwenPaw?style=flat&logo=github&color=yellow&label=Star)](https://github.com/agentscope-ai/QwenPaw/stargazers)
[![GitHub Fork](https://img.shields.io/github/forks/agentscope-ai/QwenPaw?style=flat&logo=github&color=purple&label=Fork)](https://github.com/agentscope-ai/QwenPaw/network)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-Ask_Devin-navy.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/agentscope-ai/QwenPaw)
[![Discord](https://img.shields.io/badge/Discord-Join_Us-blueviolet.svg?logo=discord)](https://discord.gg/eYMpfnkG8h)
[![X](https://img.shields.io/badge/X-Follow_Us-black.svg?logo=x)](https://x.com/agentscope_ai)
[![钉钉群](https://img.shields.io/badge/DingTalk-Join_Us-orange.svg)](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11)
[![AgentScope 体验平台](https://img.shields.io/badge/%E2%98%81_AgentScope_Platform-%F0%9F%90%BE_7%2F24_Online_%26_Free-FF6B2B.svg)](https://platform.agentscope.io/)
<a href="https://trendshift.io/repositories/25882" target="_blank"><img src="https://trendshift.io/api/badge/trendshift/repositories/25882/daily" alt="agentscope-ai%2FQwenPaw | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[[文档](https://qwenpaw.agentscope.io/)] [[English](README.md)] [[日本語](README_ja.md)] [[Русский](README_ru.md)]
<p align="center">
<img src="https://gw.alicdn.com/imgextra/i1/O1CN01sens5C1TuwioeGexL_!!6000000002443-55-tps-771-132.svg" alt="QwenPaw Logo" width="120">
</p>
<p align="center"><b>懂你所需,伴你左右。</b></p>
</div>
你的个人 AI 助理 — 本地或云端部署,通过 Skills 与插件扩展能力,全频道连接。
| | |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **不遗忘对话** | 三层记忆 — 实时工作上下文、完整逐字历史,以及由 [ReMe](https://github.com/agentscope-ai/ReMe) 驱动的自进化个人知识库。对话与资料持续沉淀为可读、可编辑、可检索、相互链接的 Markdown 记忆。 |
| **本地云端,自由运行** | QwenPaw-Flash 模型(2B / 4B / 9B)面向 Agent 场景专项训练。内置 QwenPaw Local 运行时,无需 API Key、不依赖云端。同时支持 Ollama、LM Studio 及 14+ 云端模型供应商。 |
| **安全机制** | 内核级 Sandbox、Tool Guard、File Guard 与 Skill Scanner。危险命令在执行前即被拦截。 |
| **多智能体与并行** | 创建拥有独立记忆与技能的 Agent;运行时生成子 Agent;通过 Agent Communication Protocol(ACP)实现跨系统编排。 |
| **通用文件工作区** | 在项目文件与 Agent 文件中统一提供文件导航、预览、编辑、Diff、上传和下载。 |
| **能力扩展** | Skills 覆盖定时任务、文档、浏览器、新闻等。插件架构带 Plugin Market。MCP 集成外部工具。自由组合成面向场景的工作流。 |
| **随处可达** | 钉钉、飞书、微信、Discord、Telegram、iMessage、QQ — 一个实例,全频道连接。Console、TUI 与桌面应用可直接访问。 |
| **你的,不是我们的** | 本地部署,数据留在你的机器,无第三方托管,无数据上传。 |
<details>
<summary><b>你可以用 QwenPaw 做什么</b></summary>
<br>
- **自动化与定时任务**:设置定时任务 — 新闻摘要、报告生成、多频道广播 — 全部按你的时间表自动运行。
- **代码与开发**:通过通用文件工作区在项目中阅读、编辑、审查与测试代码。
- **文档处理**:读取、写入与转换 PDF、Word、Excel、PowerPoint 文件。
- **信息收集**:搜索网页、关注资讯订阅、总结视频内容,并从个人知识库中检索所需信息。
- **多频道运营**:向钉钉、飞书、Discord、Telegram 等推送告警、摘要或 AI 生成内容 — 可同时或按频道分发。
- **自定义工作流**:把内置能力、插件和定时任务组合起来,打造适合你的专属流程。
</details>
---
## 新闻
- [2026-08-13] **v2.1.0** | QwenPaw OS Shell、统一文件工作区、QwenPaw Creator、Codex/Qoder 智能体接入、Browser-use、Computer-use、工作区检查点和长对话任务续接等。[v2.1.0 发布说明 →](https://qwenpaw.agentscope.io/release-notes#v2.1.0)
- [2026-07-24] **v2.0.1** | PawApp 小程序平台、用户可编辑 Agent Mode、Oh-My-Paw plugins、[ReMe](https://github.com/agentscope-ai/ReMe) 记忆增强、桌面端用户体验增强等。[v2.0.1 发布说明 →](https://qwenpaw.agentscope.io/release-notes#v2.0.1)
- [2026-07-10] **v2.0.0 — QwenPaw 2.0 正式发布** 🎉 | 基于 AgentScope 2.0 全面重构,带来 Agent OS 架构、Loop Engineering、Scroll 上下文、[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 自进化个人知识库与内置终端界面。
| 亮点 | 更新内容 |
|------|----------|
| **Agent OS — 工作区** | 每个智能体三大支柱:**资源**(透明落盘)、**治理**(allow/deny/ask/sandbox)、**沙箱**(macOS / Linux / Windows)。 |
| **Agent OS — 驱动** | 协议中立的 MCP / A2A / ACP 连接器层,带加密凭据与逐次调用策略门控。 |
| **Loop Engineering** | 高级智能体循环模板(Coding Mode、Mission Mode,更多模板持续推出),配合可组合审批门控。 |
| **Scroll 上下文** | 每一轮都持久化;滚出窗口的轮次带索引,按需回放——不摘要、不丢失。 |
| **[ReMe](https://github.com/agentscope-ai/ReMe) v0.4 自进化个人知识库** | 持续将对话与资料转化为可读、可编辑、可检索、相互链接的 Markdown 记忆。 |
| **终端界面(TUI)** | 全屏终端对话——与控制台和频道共享同一智能体、记忆与会话。 |
基于 Agent OS,我们将陆续推出开箱即用的 QwenPaw 应用小程序——如 **QwenPaw Creator**、**QwenPaw Insight** 等,敬请期待。 [v2.0.0 发布说明 →](https://qwenpaw.agentscope.io/release-notes#v2.0.0)
- [2026-06-17] **v1.1.12 — 模型页面大改版 & 简洁模式** | 全新模型页面 Provider 聚合设计;新增简洁模式,扁平化导航。[v1.1.12 发布说明 →](https://qwenpaw.agentscope.io/release-notes#v1.1.12)
- [2026-06-11] **AgentScope 体验平台上线** — 支持免费部署 QwenPaw、插件分享与 Skill 市场。[立即体验 →](https://platform.agentscope.io/)
- [2026-06-10] **v1.1.11** — 免费模型 OAuth、插件市场、MCP 工具白名单。[v1.1.11 发布说明 →](https://qwenpaw.agentscope.io/release-notes#v1.1.11)
[全部发布说明 →](https://qwenpaw.agentscope.io/release-notes)
---
## 目录
- [新闻](#新闻)
- [快速开始](#快速开始)
- [API Key](#api-key)
- [本地模型](#本地模型)
- [安全特性](#安全特性)
- [文档](#文档)
- [常见问题](#常见问题)
- [路线图](#路线图)
- [参与贡献](#参与贡献)
- [从源码安装](#从源码安装)
- [为什么叫 QwenPaw?](#为什么叫-qwenpaw)
- [由谁构建](#由谁构建)
- [许可证](#许可证)
---
## 快速开始
### 方式一:pip 安装
如果你习惯自行管理 Python 环境(需 Python >= 3.11, < 3.14):
```bash
pip install qwenpaw
qwenpaw init --defaults
qwenpaw app
```
然后在浏览器中打开控制台 **http://127.0.0.1:8088/** 配置模型。若要在钉钉、飞书、微信等 app 内对话,请参考 [频道配置](https://qwenpaw.agentscope.io/docs/channels) 文档。
![Console](https://img.alicdn.com/imgextra/i2/O1CN01EP1ra01iOAcBvF0TC_!!6000000004402-2-tps-3822-2070.png)
---
### 方式二:脚本安装
无需手动配置 Python,一行命令自动完成安装。脚本会自动下载 uv(Python 包管理器)、创建虚拟环境、安装 QwenPaw 及其依赖(含 Node.js 和前端资源)。注意:部分网络环境或企业权限管控下可能无法使用。
**macOS / Linux:**
```bash
curl -fsSL https://qwenpaw.agentscope.io/install.sh | bash
```
**Windows (CMD):**
```CMD
curl -fsSL https://qwenpaw.agentscope.io/install.bat -o install.bat && install.bat
```
**Windows(PowerShell):**
```powershell
irm https://qwenpaw.agentscope.io/install.ps1 | iex
```
> **注意**:安装程序将自动检查 uv 状态,若未安装则尝试自动下载配置。如遇自动安装失败,请遵循屏幕提示操作,或执行 `python -m pip install -U uv`,然后重新运行安装程序。
> **⚠️ Windows 企业版 LTSC 用户特别提示**
>
> 如果您使用的是 Windows LTSC 或受严格安全策略管控的企业环境,PowerShell 可能运行在 **受限语言模式** 下,可能会遇到以下问题:
> 1. **如果你使用的是 CMD(.bat):脚本执行成功但无法写入 `Path`**
>
> 脚本已完成文件安装,由于 **受限语言模式**,脚本无法自动更新环境变量,此时只需手动配置:
> - **找到安装目录**:
> - 检查 `uv` 是否可用:在 CMD 中输入 `uv --version`,如果显示版本号,则**只需配置 QwenPaw 路径**;如果提示 `'uv' is not recognized as an internal or external command, operable program or batch file,`,则需同时配置两者。
> - uv 路径(任选其一,取决于安装位置,若 `uv` 不可用则填):通常在 `%USERPROFILE%\.local\bin`、`%USERPROFILE%\AppData\Local\uv` 或 Python 安装目录下的 `Scripts` 文件夹
> - QwenPaw 路径:通常在 `%USERPROFILE%\.qwenpaw\bin`。
> - **手动添加到系统的 Path 环境变量**:
> - 按 `Win + R`,输入 `sysdm.cpl` 并回车,打开「系统属性」。
> - 点击「高级」→「环境变量」。
> - 在「系统变量」中找到并选中 `Path`,点击「编辑」。
> - 点击「新建」,依次填入上述两个目录路径,点击确定保存。
> 2. **如果你使用的是 PowerShell(.ps1):脚本运行中断**
>
> 由于 **受限语言模式**,脚本可能无法自动下载 `uv`。
> - **手动安装 uv**:参考 [GitHub Release](https://github.com/astral-sh/uv/releases) 下载并将 `uv.exe` 放至 `%USERPROFILE%\.local\bin` 或 `%USERPROFILE%\AppData\Local\uv`;或者确保已安装 Python,然后运行 `python -m pip install -U uv`。
> - **配置 `uv` 环境变量**:将 `uv` 所在目录和 `%USERPROFILE%\.qwenpaw\bin` 添加到系统的 `Path` 变量中。
> - **重新运行**:打开新终端,再次执行安装脚本以完成 `QwenPaw` 安装。
> - **配置 `QwenPaw` 环境变量**:将 `%USERPROFILE%\.qwenpaw\bin` 添加到系统的 `Path` 变量中。
安装完成后,请打开新终端并运行:
```bash
qwenpaw init --defaults # 或:qwenpaw init(交互式)
qwenpaw app
```
<details>
<summary><b>安装选项</b></summary>
**macOS / Linux:**
```bash
# 安装指定版本
curl -fsSL ... | bash -s -- --version 1.1.0
# 从源码安装(开发/测试用)
curl -fsSL ... | bash -s -- --from-source
# 升级 — 重新运行安装命令即可
curl -fsSL ... | bash
# 卸载
qwenpaw uninstall # 保留配置和数据
qwenpaw uninstall --purge # 删除所有内容
```
**Windows(PowerShell):**
```powershell
# 安装指定版本
irm ... | iex; .\install.ps1 -Version 1.1.12
# 从源码安装(开发/测试用)
.\install.ps1 -FromSource
# 升级 — 重新运行安装命令即可
irm ... | iex
# 卸载
qwenpaw uninstall # 保留配置和数据
qwenpaw uninstall --purge # 删除所有内容
```
</details>
---
### 方式三:使用 Docker
镜像在 **Docker Hub**(`agentscope/qwenpaw`)。镜像 tag:`latest`(稳定版);`pre`(PyPI 预发布版)。
```bash
docker pull agentscope/qwenpaw:latest
docker run -p 127.0.0.1:8088:8088 \
-v qwenpaw-data:/app/working \
-v qwenpaw-secrets:/app/working.secret \
-v qwenpaw-backups:/app/working.backups \
agentscope/qwenpaw:latest
```
国内用户也可选用阿里云容器镜像服务 (ACR):`agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/qwenpaw`(tag 相同)。
然后在浏览器中打开 **http://127.0.0.1:8088/** 进入控制台。配置、记忆与 Skills 保存在 `qwenpaw-data` 卷中;模型提供商设置与 API Key 保存在 `qwenpaw-secrets` 卷中;备份归档保存在 `qwenpaw-backups` 卷中。如需传入 API Key(如 `DASHSCOPE_API_KEY`),在 `docker run` 时添加 `-e VAR=value` 或 `--env-file .env`。
> **从容器内连接宿主机上的 Ollama 或其他模型服务**
>
> Docker 容器内的 `localhost` 指向容器自身,而非宿主机。如果 Ollama(或其他模型服务)运行在宿主机上,可通过以下方式让容器内的 QwenPaw 访问:
>
> **方式 A** — 显式绑定宿主机地址(全平台通用):
> ```bash
> docker run -p 127.0.0.1:8088:8088 \
> --add-host=host.docker.internal:host-gateway \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> 然后在 QwenPaw **设置 → 模型** 中,将 Base URL 改为 `http://host.docker.internal:<端口>` — 例如 Ollama 填 `http://host.docker.internal:11434`,LM Studio 填 `http://host.docker.internal:1234/v1`。
>
> **方式 B** — 使用宿主机网络(仅限 Linux):
> ```bash
> docker run --network=host \
> -v qwenpaw-data:/app/working \
> -v qwenpaw-secrets:/app/working.secret \
> -v qwenpaw-backups:/app/working.backups \
> agentscope/qwenpaw:latest
> ```
> 无需端口映射(`-p`),容器直接共享宿主机网络。注意这会将容器的所有端口暴露在宿主机上,可能与已占用的端口产生冲突。
>
镜像从零构建。若需自行构建镜像,请参阅 `scripts/README.md` 中的 [Build Docker image](scripts/README.md#build-docker-image) 小节,构建后推送到你的镜像仓库。
---
### 方式四:部署到阿里云 ECS
若希望将 QwenPaw 部署在阿里云上,可使用阿里云 ECS 一键部署:打开 [QwenPaw 阿里云 ECS 部署链接](https://computenest.console.aliyun.com/service/instance/create/cn-hangzhou?type=user&ServiceId=service-1ed84201799f40879884) 按页面提示操作即可。详细步骤见 [阿里云开发者社区:3 分钟部署你的 AI 助理](https://developer.aliyun.com/article/1713682)。
---
### 方式五:AgentScope Platform 部署
[AgentScope Platform](https://platform.agentscope.io/) 提供一键云端 QwenPaw 部署、插件分享与 Skill 市场。完全免费,7/24 在线。
---
### 方式六:使用魔搭创空间
使用 [魔搭创空间](https://modelscope.cn/studios/fork?target=AgentScope/QwenPaw) 也可进行云端 QwenPaw 部署。注意:请将创空间设为 **非公开**,否则他人可能操纵你的 QwenPaw。
---
### 方式七:桌面应用(Beta)
> **Beta 版本说明**:桌面应用目前处于 Beta 测试阶段,存在以下已知限制:
> - **兼容性测试不完整**:未在所有系统版本和硬件配置上进行充分测试
> - **性能可能存在缺陷**:启动速度、内存占用等方面可能需要进一步优化
> - **功能持续完善中**:部分功能可能不稳定或缺失
如果你不习惯使用命令行,可以下载并使用 QwenPaw 的桌面应用版本,无需手动配置 Python 环境或执行命令。
#### 下载
从 [官方下载页](https://qwenpaw.agentscope.io/downloads) 下载桌面应用(Tauri 版):
- **Windows**:`QwenPaw-Tauri-<version>-Windows-setup.exe`
- **macOS**:`QwenPaw-Tauri-<version>-macOS.zip`(推荐 Apple Silicon)
#### 特点
- ✅ **零配置**:下载后双击即可运行,无需安装 Python 或配置环境变量
- ✅ **跨平台**:支持 Windows 10+ 和 macOS 14+
- ✅ **可视化**:自动打开应用界面,无需手动输入地址
- ⚠️ **Beta 阶段**:功能持续完善中,欢迎反馈问题
#### 首次启动
**重要提示**:首次启动可能需要 10-60 秒(取决于您的系统配置)。应用需要初始化 Python 环境和加载依赖,请耐心等待窗口自动打开。
#### macOS:绕过系统安全限制
当你从 Releases 下载 QwenPaw macOS 应用时,macOS 可能显示:*"Apple 无法验证 'QwenPaw' 不包含恶意软件"*。这是因为应用未经过公证。你仍然可以通过以下方式打开:
- **右键打开(推荐)**
右键点击(或 Control + 点击)QwenPaw 应用 → **「打开」** → 在对话框中再次点击 **「打开」**。这会告诉 Gatekeeper 你信任该应用;之后可以像往常一样双击启动。
- **在系统设置中允许**
如果仍被阻止,进入 **系统设置 → 隐私与安全性**,向下滚动找到类似 *「已阻止 'QwenPaw',因为无法验证开发者」* 的提示,点击 **「仍要打开」** 或 **「允许」**。
- **移除隔离属性(不推荐大多数用户)**
在终端运行:
`xattr -cr "/Applications/QwenPaw Desktop.app"`
(或使用解压后的 `.app` 路径)。这会清除「从互联网下载」的隔离标志,使警告通常不会出现,但不如使用 **右键 → 打开** 安全和可控。
详细使用说明、故障排除和常见问题,请参见 [桌面应用指南](https://qwenpaw.agentscope.io/docs/desktop)。
---
### 下一步?
安装完成后,在 **控制台 → 设置 → 模型** 中配置模型,然后探索:
- [添加 Skills](https://qwenpaw.agentscope.io/docs/skills) 扩展能力(PDF、Office、浏览器、新闻等)
- [配置频道](https://qwenpaw.agentscope.io/docs/channels) 连接钉钉、飞书、Discord 等
- [配置 Cron](https://qwenpaw.agentscope.io/docs/cron) 实现定时任务与自动化
- 查看完整 [快速开始指南](https://qwenpaw.agentscope.io/docs/quickstart) 了解所有选项与验证步骤
---
## 终端界面(TUI)
更喜欢待在终端里?运行 `qwenpaw` 即可打开一个全屏聊天 **TUI**,它驱动的是与控制台、IM 频道**完全相同**的智能体 — 同一份记忆、技能、MCP 工具与会话 — 无需离开键盘。
```bash
qwenpaw # 与当前激活的智能体开启对话
qwenpaw tui --resume <id> # 恢复之前的某个会话
qwenpaw . # 在当前代码仓库中启动(Coding 模式)
```
支持流式回复、斜杠命令(`/help`、`/resume`、`/theme`,以及智能体自身的 `/model`、`/clear` 等)、把文件 / 长文本作为附件粘贴,以及行内工具授权提示。详见 [终端界面指南](https://qwenpaw.agentscope.io/docs/tui)。
![QwenPaw 终端界面](https://img.alicdn.com/imgextra/i2/O1CN01IULzib1TRAzigIcqG_!!6000000002378-2-tps-2350-1312.png)
---
## API Key
若使用**云端大模型 API**(如 DashScope / 通义千问、OpenAI、Anthropic、Google Gemini、DeepSeek、Kimi、OpenRouter 等),在开始对话前必须配置 API Key。未配置有效 Key 前,QwenPaw 无法正常工作。详情请参考 [官方文档](https://qwenpaw.agentscope.io/docs/models)。
**配置方式:**
1. **控制台(推荐)** — 运行 `qwenpaw app` 后,打开 **http://127.0.0.1:8088/** → **设置** → **模型**。选择提供商、填写 **API Key**,并启用该提供商与模型。
2. **`qwenpaw init`** — 运行 `qwenpaw init` 时,会引导你配置 LLM 提供商与 API Key。按提示选择提供商并填写 Key 即可。
3. **环境变量** — 使用 DashScope 时,可在终端或工作目录下的 `.env` 文件中设置 `DASHSCOPE_API_KEY`。
其他工具所需密钥(如网页搜索的 `TAVILY_API_KEY`)可在控制台 **设置 → 环境变量** 中配置,详见 [配置](https://qwenpaw.agentscope.io/docs/config)。
> **仅用本地模型?** 若使用 [本地模型](#本地模型)(QwenPaw Local / Ollama / LM Studio),则**无需**任何 API Key。
## 本地模型
QwenPaw 可在本机完全本地运行大模型,无需 API Key 或云端服务。详情请见 [官方文档](https://qwenpaw.agentscope.io/docs/models)。
QwenPaw 还提供 **QwenPaw-Flash** 系列 — 面向 Agent 场景专项训练的 2B / 4B / 9B 模型,提供 Q4 与 Q8 量化版本。可在 [ModelScope](https://www.modelscope.cn/organization/AgentScope?tab=model) 与 [Hugging Face](https://huggingface.co/agentscope-ai/models) 获取。
| 后端 | 适用场景 | 安装 |
| --------------------------------- | ---------------------------------------- | -------------------------------------------------------------------- |
| **QwenPaw Local**(llama.cpp) | 跨平台(macOS / Linux / Windows) | 内置;在 Web 界面点击「Download」即可。支持 QwenPaw-Flash,并提供硬件感知推荐。 |
| **Ollama** | 跨平台(需要 Ollama 服务运行) | 安装并启动 Ollama;将上下文长度设为 ≥ 32k。 |
| **LM Studio** | 跨平台(需要 LM Studio 服务运行) | 安装并启动 LM Studio;启用 Local Server。 |
---
## 安全特性
QwenPaw 内置五层核心安全防护:
- **Sandbox** — 内核级执行隔离,macOS 使用 Seatbelt,Linux 使用 Bubblewrap / Landlock,Windows 使用 AppContainer。Shell 命令在受限文件系统视图中运行。
- **Tool Guard** — 带 `ShellEvasionGuardian` 的 YAML 规则引擎,在每次工具调用执行前进行检查,检测命令注入、路径遍历、反向 Shell 与混淆攻击。可配置审批级别:STRICT / SMART / AUTO / OFF。
- **File Guard** — 独立于 Tool Guard;阻止智能体访问敏感文件与目录(默认保护 `~/.qwenpaw.secret/`、`~/.ssh` 等)。
- **Skill Scanner** — 激活前扫描,支持 block / warn / off 模式与白名单。检测提示词注入、硬编码密钥、数据外泄等风险。
- **Access Policy** — 声明式访问策略,对每次能力调用裁定放行(allow)、拒绝(deny)或请求人工审批(ask),支持工具级粒度和来源感知匹配。
详见 [安全文档](https://qwenpaw.agentscope.io/docs/security)。
---
## 文档
| 主题 | 说明 |
| -------------------------------------------------------------------- | ------------------------------------------------ |
| [项目介绍](https://qwenpaw.agentscope.io/docs/intro) | QwenPaw 是什么、怎么用 |
| [快速开始](https://qwenpaw.agentscope.io/docs/quickstart) | 安装与运行(本地或魔搭创空间) |
| [控制台](https://qwenpaw.agentscope.io/docs/console) | Web 界面:对话与智能体配置 |
| [终端界面(TUI)](https://qwenpaw.agentscope.io/docs/tui) | 终端全屏对话,与控制台共用同一智能体 |
| [桌面应用](https://qwenpaw.agentscope.io/docs/desktop) | 桌面应用安装与使用 |
| [模型](https://qwenpaw.agentscope.io/docs/models) | 配置云端、本地与自定义提供商 |
| [频道配置](https://qwenpaw.agentscope.io/docs/channels) | 钉钉、飞书、QQ、Discord、iMessage 等 |
| [Skills](https://qwenpaw.agentscope.io/docs/skills) | 扩展与自定义能力 |
| [插件系统](https://qwenpaw.agentscope.io/docs/plugins) | 插件体系与 Plugin Market |
| [MCP 和工具](https://qwenpaw.agentscope.io/docs/mcp) | 管理 MCP 客户端 |
| [Persona](https://qwenpaw.agentscope.io/docs/persona) | 智能体人格定制(SOUL / PROFILE) |
| [记忆](https://qwenpaw.agentscope.io/docs/memory) | 基于本地、可编辑、可检索且相互链接的 Markdown 记忆构建自进化个人知识库,由 [ReMe](https://github.com/agentscope-ai/ReMe) 驱动 |
| [ReMe 文档](https://docs.agentscope.io/reme/latest/zh/overview) | ReMe 官方概览与文档 |
| [记忆进化与主动交互](https://qwenpaw.agentscope.io/docs/memory-evolving-and-proactive) | 智能体记忆进化与主动交互 |
| [上下文](https://qwenpaw.agentscope.io/docs/context) | 基于滚动的上下文管理 |
| [魔法命令](https://qwenpaw.agentscope.io/docs/commands) | 无需等待 AI 理解即可控制对话状态 |
| [心跳](https://qwenpaw.agentscope.io/docs/heartbeat) | 定时自检与摘要 |
| [Cron / 定时任务](https://qwenpaw.agentscope.io/docs/cron) | 定时任务与自动化 |
| [多智能体](https://qwenpaw.agentscope.io/docs/multi-agent) | 创建多个智能体并启用协作 |
| [安全](https://qwenpaw.agentscope.io/docs/security) | Sandbox、Tool Guard、File Guard、Skill Scanner、Access Policy |
| [备份与恢复](https://qwenpaw.agentscope.io/docs/backup) | 数据备份与恢复 |
| [配置与工作目录](https://qwenpaw.agentscope.io/docs/config) | 工作目录与配置文件 |
| [REST API](https://qwenpaw.agentscope.io/docs/api-tutorial) | 用于集成与自动化的 HTTP API |
| [ACP 集成](https://qwenpaw.agentscope.io/docs/acp-integration) | Agent Communication Protocol 集成 |
| [CLI](https://qwenpaw.agentscope.io/docs/cli) | 初始化、定时任务、Skills、清理 |
| [Agent 团队实践](https://qwenpaw.agentscope.io/docs/practice-agent-team) | 多智能体团队部署指南 |
| [FAQ](https://qwenpaw.agentscope.io/docs/faq) | 常见问题与故障排查 |
完整文档:[qwenpaw.agentscope.io/docs](https://qwenpaw.agentscope.io/docs)
---
## 常见问题
更多常见问题、故障排查技巧和已知问题,请访问 **[FAQ 页面](https://qwenpaw.agentscope.io/docs/faq)**。
---
## 路线图
| 方向 | 事项 | 状态 |
| ------------------------ | ----------------------------------------- | ------ |
| **横向拓展** | 更多频道、模型、技能、MCP | 征集中 |
| **已有功能扩展与完善** | 展示、下载与 Windows 兼容优化 | 征集中 |
| **模型** | 多模型切换 | 进行中 |
| **安全与审批** | 批量预览与批准 | 进行中 |
| **自动化** | 自动化任务 | 进行中 |
| **智能体交互** | 智能体任务交接 | 进行中 |
| | 运行中任务调整 | 进行中 |
| **工作区** | 多工作区 | 进行中 |
| **上下文** | 系统提示压缩 | 进行中 |
| **工具系统** | 多位置文件修改 | 进行中 |
| | 持久终端与后台任务 | 进行中 |
| **Computer-use** | 屏幕目标定位与操作 | 进行中 |
| **语音交互** | 实时语音任务 | 进行中 |
| **上下文管理与记忆** | 向量模型与存储热切换 | 进行中 |
| | 个人知识库 | 进行中 |
| **QwenPaw 应用** | QwenPaw Insight | 进行中 |
| | QwenPaw Mail | 进行中 |
_状态说明:**进行中** — 正在积极开发;**征集中** — 我们强烈鼓励社区参与。_
---
## 参与贡献
QwenPaw 在开放协作中持续演进,欢迎各种形式的参与!请参考上方 [路线图](#路线图)(尤其是标记为 **征集中** 的项)选择你感兴趣的方向,并阅读 [CONTRIBUTING](https://github.com/agentscope-ai/QwenPaw/blob/main/CONTRIBUTING_zh.md) 了解如何开始。我们特别欢迎:
- **横向拓展** — 新频道、模型提供商、Skills、MCP。
- **已有功能扩展与完善** — 展示与交互优化、下载提示、Windows 路径兼容等。
欢迎在 [GitHub Discussions](https://github.com/agentscope-ai/QwenPaw/discussions) 参与讨论、提出想法或认领任务。
---
## 从源码安装
```bash
git clone https://github.com/agentscope-ai/QwenPaw.git
cd QwenPaw
# 先构建前端控制台(Web 界面必需)
cd console && npm ci && npm run build
cd ..
# 将控制台构建产物复制到包目录
mkdir -p src/qwenpaw/console
cp -R console/dist/. src/qwenpaw/console/
# 安装 Python 包
pip install -e .
```
- **开发**(测试、格式化):`pip install -e ".[dev,test,full]"`
- **然后**:运行 `qwenpaw init --defaults`,再运行 `qwenpaw app`。
> **版本更新提示:** 当执行 `git pull` 更新到大版本后,请重新构建前端、重新安装 Python 包(`pip install -e .`)、重启 `qwenpaw app`,并清除浏览器缓存(`Ctrl+Shift+R` 或 macOS 上 `Cmd+Shift+R`)。
---
## 为什么叫 QwenPaw?
QwenPaw 既是 Qwen Personal Agent Workstation(千问个人智能体工作台),也寓意 Qwen 的智识与 Paw 的温度。我们希望它不是冰冷的工具,而是一只随时准备帮忙的智慧、温暖「小爪子」,是你数字生活中最默契的伙伴。
---
## 由谁构建
[AgentScope 团队](https://github.com/agentscope-ai) · [AgentScope](https://github.com/agentscope-ai/agentscope) · [AgentScope Runtime](https://github.com/agentscope-ai/agentscope-runtime) · [ReMe](https://github.com/agentscope-ai/ReMe)
---
## 联系我们
| [Discord](https://discord.gg/eYMpfnkG8h) | [X (Twitter)](https://x.com/agentscope_ai) | [钉钉](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [小红书](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [<img src="https://gw.alicdn.com/imgextra/i1/O1CN01hhD1mu1Dd3BWVUvxN_!!6000000000238-2-tps-400-400.png" width="80" height="80" alt="Discord">](https://discord.gg/eYMpfnkG8h) | [<img src="https://img.shields.io/badge/X-black.svg?logo=x&logoColor=white" width="80" height="80" alt="X">](https://x.com/agentscope_ai) | [<img src="https://img.alicdn.com/imgextra/i2/O1CN01vCWI8a1skHtLGXEMQ_!!6000000005804-2-tps-458-460.png" width="80" height="80" alt="钉钉">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,OmDlBXpjW+I2vWjKDsjvI9dhcXjGZi3bQiojOq3dlDw=&_dt_no_comment=1&origin=11) | [<img src="https://img.alicdn.com/imgextra/i3/O1CN016BoEPS1l33CE9mHb9_!!6000000004762-0-tps-160-160.jpg" width="80" height="80" alt="小红书">](https://www.xiaohongshu.com/user/profile/691c18db0000000037032be9) |
---
## 掌握最新动态
<a href="https://github.com/agentscope-ai/QwenPaw">
<img src="https://img.alicdn.com/imgextra/i1/O1CN01V8HYv61By0HYcIDaq_!!6000000000013-1-tps-1698-954.gif" width="600" alt="Star QwenPaw" />
</a>
在 GitHub 上 Star QwenPaw,第一时间收到新版本发布通知。
---
## 遥测数据
QwenPaw 在执行 `qwenpaw init` 时会收集**匿名**使用数据,帮助我们了解用户环境并优化产品。数据**每个版本收集一次** — 当你升级 QwenPaw 后,会重新收集以便我们了解版本分布。
**收集的信息:**
- QwenPaw 版本(如 1.1.12)
- 安装方式(pip、Docker 或桌面应用)
- 操作系统及版本(如 macOS 14.0、Ubuntu 22.04)
- Python 版本(如 3.13)
- CPU 架构(如 x86_64、arm64)
- GPU 是否可用(是/否)
**不收集:** 不涉及任何个人数据、文件、密钥、IP 地址或可识别信息。
交互式运行 `qwenpaw init` 时,会询问你是否同意。使用 `--defaults` 模式则自动同意。提示每个版本仅出现一次,且不影响 QwenPaw 的任何功能。
---
## 许可证
QwenPaw 采用 [Apache License 2.0](LICENSE) 开源协议。
---
## 贡献者
感谢所有为 QwenPaw 做出贡献的朋友们:
<a href="https://github.com/agentscope-ai/QwenPaw/graphs/contributors">
<img src="https://contrib.rocks/image?repo=agentscope-ai/QwenPaw" alt="贡献者" />
</a>
+134
View File
@@ -0,0 +1,134 @@
# Releasing QwenPaw
_中文版:[RELEASING_zh.md](RELEASING_zh.md)_
QwenPaw ships four artifacts from a single version — the **PyPI** wheel, the
**Docker** image, the **desktop** apps (Tauri, Windows + macOS) and the
**plugins** bundle. They are published together by one orchestrated workflow so
that a failure in any one of them blocks the whole release: you can never end up
with, e.g., a web release that has no matching desktop build.
> Orchestrator: [`.github/workflows/release.yml`](.github/workflows/release.yml).
> The older per-artifact workflows are kept as a fallback — see
> [Rollback to the legacy flow](#rollback-to-the-legacy-flow).
## TL;DR
1. Create a **draft** GitHub Release (tag + notes). Do **not** click *Publish*.
2. Actions → **Release (unified)** → *Run workflow* (leave `dry_run` off).
3. It builds + verifies everything; only if all of it passes does it publish all
artifacts and flip the release to *published*.
4. If anything fails, nothing is published and the draft is left untouched — fix
and re-run.
## How a release works
`release.yml` runs in three phases:
1. **Resolve** — finds the target draft (the `tag` input, or auto-detects the
single existing draft), resolves the draft's `target_commitish` to a concrete
SHA, and pins every downstream job to that SHA (so *what is built* == *what is
published*). On a real release it also fails fast if the DashScope secret is
missing.
2. **Prepare** (build + verify, publishes nothing) — in parallel:
- `build-wheel` — build the Python wheel (with the bundled console).
- `verify-web` — pip-install, Docker health-check and install-script checks.
- `build-desktop` — build the Tauri Windows + macOS apps and run the
install → launch → real-chat UI verification.
- `build-plugins` — pack the plugin bundle.
3. **Gate + Publish** — every publish job `needs` **all** prepare jobs, so a
single failure above skips the entire publish phase. When all prepare jobs are
green: publish to PyPI, push the multi-arch Docker image, attach the desktop
installers to the release + upload them to OSS, publish plugins — then, as the
**last** step, flip the draft to *published* (pinned to the built SHA). After
publishing, it promotes the desktop `latest`/updater, deploys the website
(stable/post only — betas are skipped), and opens the Release Duty verification
issue.
A full run is ~60–75 min, dominated by the desktop Tauri builds.
## Cutting a release
1. **Create the draft release**
- UI: Releases → *Draft a new release* → set the tag + notes → **Save draft**
(do **not** publish). For a pre-release, tick *Set as a pre-release*.
- CLI:
```bash
gh release create v2.0.0-beta.8 --draft --prerelease \
--target main --title "v2.0.0-beta.8" --notes "..."
```
- The tag should correspond to `src/qwenpaw/__version__.py` (`resolve`
validates this with `packaging` normalization and fails on a mismatch, e.g.
tag `v2.0.1-beta.1` must match version `2.0.1b1`).
- Prefer pinning the draft to a commit (`--target <sha>`). If you use
`--target main`, avoid merging to `main` between creating the draft and
running the workflow, otherwise the build uses the newer `main` HEAD.
2. **Run the workflow**: Actions → **Release (unified)** → *Run workflow* on
`main`. Leave `tag` empty to auto-detect the single draft (or set it
explicitly); leave `dry_run` **unchecked**.
3. **Watch it**: on success the release flips to *published* with all artifacts
attached and a Release Duty issue is opened. On failure, see
[Troubleshooting](#troubleshooting).
## Version types: beta / stable / post
The procedure is identical for all types — the type is inferred from the **tag**:
| Type | Example tag | Draft "pre-release"? | Docker tags | PyPI |
|------|-------------|----------------------|-------------|------|
| beta / rc / alpha / dev | `v2.0.0-beta.8` | yes | `<version>` + `pre` (no `latest`) | uploaded; treated as a pre-release by pip (`--pre`) |
| stable | `v2.0.0` | no | `<version>` + `pre` + `latest` | normal |
| post | `v2.0.0.post4` | no | `<version>` + `pre` + `latest` | post release |
Notes:
- Pre-release detection is **tag-based**: a tag containing `beta`/`alpha`/`rc`/`dev`
is a pre-release (so use the `-beta.N` form); `stable` and `.postN` tags also
update the Docker `latest` tag.
- The **website** (GitHub Pages, `qwenpaw.agentscope.io`) is deployed only for
**stable** and `.postN` releases; pre-releases are skipped so the public site
advertises only GA versions.
- The desktop OSS `latest` files and the Tauri auto-update manifest are currently
updated for **every** release, including betas (this matches the previous
`desktop-release.yml` behavior and is unchanged here). Making the desktop
`latest`/updater stable-only is a possible future improvement.
## Troubleshooting
**Guarantee:** the draft is flipped to *published* only after **all** publish
jobs succeed. If anything fails, the release stays a draft.
| Situation | What happened | What to do |
|-----------|---------------|------------|
| A prepare job fails (desktop / web verify / wheel / plugins) | All publish + `finalize` + `duty-issue` are **skipped**; nothing published; draft untouched | Read the failed job's logs and fix (or re-run if flaky) → **Re-run failed jobs**, or re-run the workflow. No cleanup needed. |
| A publish job fails after the gate (e.g. Docker push fails after PyPI already uploaded) | `finalize` needs all publishes, so the draft is **not** flipped; but some artifacts may already be live | **Re-run failed jobs** (already-succeeded jobs are not re-run; Docker re-push is idempotent, OSS uses `--force`) → the draft flips once they pass. If a published PyPI version is now taken and cannot be reused, cut a `.postN` instead. |
| `finalize` fails | All artifacts published but the release was not flipped | Re-run `finalize`, or manually `gh release edit <tag> --draft=false --target <sha>` (or click *Publish*). |
| `duty-issue` fails | Release is published; only the tracking issue is missing | Re-run the job, or dispatch `release-duty.yml` with the `tag`. Non-blocking. |
| `promote-desktop` fails | Release is published, but the desktop `latest` files / updater manifest / index were not refreshed (existing users' auto-updater does not see the new version yet; versioned downloads still work) | Re-run the job — it is idempotent (`ossutil cp --force`). Non-blocking for first-install users. |
| `deploy-website` fails (stable/post only) | Release is published, but the public site (`qwenpaw.agentscope.io`) still shows the previous version | Re-run the job, or manually dispatch `deploy-website.yml` (workflow_dispatch). Idempotent, non-blocking. |
| "Multiple draft releases found" | More than one draft exists | Re-run *Run workflow* with an explicit `tag`. |
| "No draft release found" / "not a draft" | No draft, or wrong tag | Create the draft / fix the tag, then re-run. |
| resolve rejects the tag (version mismatch) | The draft tag doesn't match `src/qwenpaw/__version__.py` | Align the tag with the version (packaging-normalized, e.g. `v2.0.1-beta.1` ↔ `2.0.1b1`), then re-run. |
## Rollback to the legacy flow
The pre-existing per-artifact workflows are intentionally retained. If the
orchestrator is broken, publish the release the old way — **Publish** the GitHub
Release (or `gh release create ...`), which triggers `publish-pypi` /
`docker-release` / `desktop-release` / `plugins-release` on `release: published`.
> **Warning:** the legacy flow does **not** gate the web release on the desktop
> build (the very problem this orchestrator fixes), so use it only as an
> emergency fallback.
## Fork / dry-run testing
Run **Release (unified)** with `dry_run: true` to exercise the gate and the
draft→published flip **without** touching production: PyPI upload, Docker push
and OSS upload become no-ops, while the desktop build/verify, the draft flip and
the duty issue still run for real. On a fork this only affects the fork's own
release page.
Note: the desktop build's install → launch → chat UI verification still runs
under `dry_run` and needs the `QWENPAW_DASHSCOPE_API_KEY` secret — `dry_run` only
skips the resolve-stage fail-fast check, not the verification itself.
+115
View File
@@ -0,0 +1,115 @@
# 发布 QwenPaw
_English: [RELEASING.md](RELEASING.md)_
QwenPaw 一个版本会发布四种产物——**PyPI** wheel、**Docker** 镜像、**桌面**应用
(Tauri,Windows + macOS)和**插件**包。它们由一个统一编排的 workflow 一起发布:
任一产物失败都会拦下整个发布,绝不会出现"Web 版发了、却没有对应桌面版"这种情况。
> 编排器:[`.github/workflows/release.yml`](.github/workflows/release.yml)。
> 旧的按产物拆分的 workflow 作为回退保留——见
> [回退到旧流程](#回退到旧流程)。
## 速览
1. 建一个**草稿** GitHub Release(tag + 说明),**不要**点 *Publish*。
2. Actions → **Release (unified)** → *Run workflow*(`dry_run` 不勾)。
3. 它会构建 + 验证所有产物;只有全部通过,才发布全部产物并把 release 翻成
*published*。
4. 任一步失败则什么都不发、草稿原样保留——修好后重跑即可。
## 发布流程原理
`release.yml` 分三个阶段:
1. **Resolve(解析草稿)**——按 `tag` 输入找到目标草稿(留空则自动识别唯一草稿),
把草稿的 `target_commitish` 解析成具体 SHA,并把后续所有 job 钉在该 SHA 上
(保证*构建的代码 == 发布的代码*)。正式发布时若缺 DashScope secret 会直接 fail。
2. **Prepare(构建 + 验证,不发布任何东西)**——并行:
- `build-wheel`——构建 Python wheel(含打包好的 console)。
- `verify-web`——pip 安装、Docker 健康检查、安装脚本三类验证。
- `build-desktop`——构建 Tauri Windows + macOS 应用,并跑
安装 → 启动 → 真实问答 的 UI 验证。
- `build-plugins`——打包插件。
3. **Gate + Publish(门禁 + 发布)**——每个 publish job 都 `needs` **全部** prepare
job,因此上面任一失败都会跳过整个发布阶段。全绿后:发布 PyPI、推多架构 Docker
镜像、把桌面安装包挂到 release 并上传 OSS、发布插件——然后**最后一步**才把草稿翻成
*published*(tag 钉到构建用的 SHA)。发布后再:推桌面 `latest`/更新清单、部署官网
(仅正式版/post,beta 跳过)、创建 Release Duty 验收 issue。
整体约 60–75 分钟,主要耗时在桌面 Tauri 构建。
## 发一个版本
1. **建草稿 Release**
- UI:Releases → *Draft a new release* → 填 tag + 说明 → **Save draft**
(**不要** publish)。预发布请勾 *Set as a pre-release*。
- CLI:
```bash
gh release create v2.0.0-beta.8 --draft --prerelease \
--target main --title "v2.0.0-beta.8" --notes "..."
```
- tag 应与 `src/qwenpaw/__version__.py` 对应(`resolve` 会用 `packaging` 归一化校验,
不一致直接 fail;如 tag `v2.0.1-beta.1` 须匹配版本 `2.0.1b1`)。
- 建议建草稿时用 `--target <sha>` 钉住 commit。若用 `--target main`,则建草稿到运行
workflow 之间**不要**再往 main 合入,否则构建的是更新后的 main HEAD。
2. **运行 workflow**:Actions → **Release (unified)** → *Run workflow*,选 `main`。
`tag` 留空可自动识别唯一草稿(也可显式填);`dry_run` **不勾**。
3. **观察**:成功后 release 翻成 *published*、资产齐全,并开出一个 Release Duty
issue。失败见 [故障处理](#故障处理)。
## 版本类型:beta / 正式 / post
流程完全一样——类型由 **tag** 推断:
| 类型 | tag 示例 | 草稿勾 pre-release? | Docker 标签 | PyPI |
|------|----------|---------------------|-------------|------|
| beta / rc / alpha / dev | `v2.0.0-beta.8` | 是 | `<version>` + `pre`(无 `latest`) | 上传;pip 视为预发布(`--pre`) |
| 正式 | `v2.0.0` | 否 | `<version>` + `pre` + `latest` | 正常 |
| post | `v2.0.0.post4` | 否 | `<version>` + `pre` + `latest` | post 版本 |
说明:
- 预发布判定是**基于 tag** 的:tag 含 `beta`/`alpha`/`rc`/`dev` 即为预发布
(所以用 `-beta.N` 写法);`stable` 与 `.postN` 会更新 Docker 的 `latest` 标签。
- **官网**(GitHub Pages,`qwenpaw.agentscope.io`)只在**正式版**与 `.postN` 部署;
预发布跳过,保证官网只展示 GA 版本。
- ⚠️ 桌面 OSS 的 `latest` 文件与 Tauri 自动更新清单目前对**每个**版本(含 beta)
都会更新(与之前 `desktop-release.yml` 行为一致,本次未改)。让桌面
`latest`/自动更新只在正式版更新,可作为后续改进。
## 故障处理
**保证**:只有**全部** publish job 成功后,草稿才会被翻成 *published*;任一步失败,
release 就仍是草稿。
| 场景 | 发生了什么 | 怎么办 |
|------|-----------|--------|
| 准备阶段某 job 失败(桌面 / web 验证 / wheel / 插件) | 所有 publish + `finalize` + `duty-issue` 全被 **skip**;什么都没发;草稿不动 | 看失败 job 日志修复(flake 就直接重跑)→ **Re-run failed jobs** 或重跑 workflow。无需清理。 |
| 发布阶段某 publish 失败(如 PyPI 已传、Docker 推失败) | `finalize` 需要全部 publish 成功,故草稿**未翻**;但部分产物可能已上线 | **Re-run failed jobs**(已成功的不会重跑;Docker 重推幂等、OSS 用 `--force`)→ 补齐后自动翻。若某个 PyPI 版本已被占用无法重用,改用 `.postN` 重发。 |
| `finalize` 失败 | 产物都发了但 release 没翻 | 重跑 `finalize`,或手动 `gh release edit <tag> --draft=false --target <sha>`(或 UI 点 *Publish*)。 |
| `duty-issue` 失败 | release 已发布,只是缺验收 issue | 重跑该 job,或用 `tag` 手动 dispatch `release-duty.yml`。不阻塞发布。 |
| `promote-desktop` 失败 | release 已发布,但桌面 `latest` 文件 / 更新清单 / index 未刷新(存量用户的自动更新暂时看不到新版;版本化下载仍可用) | 重跑该 job,幂等(`ossutil cp --force`)。对首装用户不阻塞。 |
| `deploy-website` 失败(仅正式/post) | release 已发布,但官网(`qwenpaw.agentscope.io`)仍是旧版本 | 重跑该 job,或手动 dispatch `deploy-website.yml`(workflow_dispatch)。幂等、不阻塞。 |
| "Multiple draft releases found" | 存在多个草稿 | 重跑 *Run workflow* 时显式填 `tag`。 |
| "No draft release found" / "not a draft" | 没有草稿,或 tag 填错 | 先建草稿 / 改正 tag,再重跑。 |
| resolve 拒绝该 tag(版本不匹配) | 草稿 tag 与 `src/qwenpaw/__version__.py` 不一致 | 让 tag 与版本对齐(`packaging` 归一化,如 `v2.0.1-beta.1` ↔ `2.0.1b1`),再重跑。 |
## 回退到旧流程
旧的按产物拆分的 workflow 是特意保留的。如果编排器坏了,就用旧方式发布——把 GitHub
Release **点 Publish**(或 `gh release create ...`),会在 `release: published` 上触发
`publish-pypi` / `docker-release` / `desktop-release` / `plugins-release`。
> **警告**:旧流程**不会**用桌面构建来 gate Web 发布(这正是本编排器要修的问题),
> 因此仅作应急回退使用。
## Fork / dry-run 测试
运行 **Release (unified)** 时勾 `dry_run: true`,可在**不触及生产**的前提下验证门禁与
草稿→published 翻牌:PyPI 上传、Docker 推送、OSS 上传都变成 no-op,而桌面构建/验证、
草稿翻牌、duty issue 仍会真实执行。(在 fork 上这些只影响 fork 自己的 release 页面。)
注意:桌面构建的 装 → 启 → 问答 UI 验证在 `dry_run` 下**仍会真跑**,需要
`QWENPAW_DASHSCOPE_API_KEY` secret——`dry_run` 只跳过 resolve 阶段的 fail-fast 检查,
不跳过验证本身。
+157
View File
@@ -0,0 +1,157 @@
# Security Policy
If you believe you've found a security issue in QwenPaw, please report it privately.
## Reporting
Report vulnerabilities of the QwenPaw repository:
If you discover a security issue in QwenPaw, please report it to us through the [Alibaba Security Response Center (ASRC)](https://security.alibaba.com/).
### Required in Reports
1. **Title**
2. **Severity assessment**
3. **Impact**
4. **Affected component** (e.g. channel adapter, skill, config loading)
5. **Technical reproduction steps**
6. **Demonstrated impact** (how it crosses a trust boundary, not just theoretical)
7. **Environment** (Python version, OS, how QwenPaw is run)
8. **Remediation advice** (if you have suggestions)
Reports without reproduction steps, demonstrated impact, and remediation advice will be deprioritized. Given the volume of scanner or AI-generated findings, we need vetted reports from researchers who understand the issues.
### Report Acceptance Gate
For fastest triage, include all of the following:
- Exact vulnerable path (file, function, and line range) on a current revision.
- Tested version details (QwenPaw version and/or commit SHA).
- Reproducible PoC against latest `main` or latest released version.
- Demonstrated impact tied to QwenPaw's documented trust boundaries (see below).
- For exposed-secret reports: proof the credential is QwenPaw-owned or grants access to QwenPaw-operated infrastructure/services.
- Scope check explaining why the report is **not** covered by the Out of Scope section below.
Reports that miss these requirements may be closed as `invalid` or `no-action`.
### Common False-Positive Patterns
- Prompt-injection-only chains without a boundary bypass (prompt injection is out of scope).
- Operator-intended local features (e.g. skills or commands the operator explicitly enabled) presented as remote injection.
- Authorized user–triggered actions presented as privilege escalation (e.g. an allowed sender triggering a skill that writes to an allowed path). In this trust model, authorized user actions are trusted unless you demonstrate an auth/sandbox/boundary bypass.
- Reports that only show a malicious skill executing privileged actions after a trusted operator installs/enables it.
- Reports that assume per-user multi-tenant authorization on a shared QwenPaw instance/config.
- ReDoS/DoS claims that require trusted operator configuration input without a trust-boundary bypass.
- Scanner-only claims against stale or nonexistent paths, or claims without a working repro.
### Duplicate Report Handling
- Search existing advisories and issues before filing.
- Include likely duplicate advisory IDs in your report when applicable.
- Maintainers may close lower-quality or later duplicates in favor of the earliest high-quality canonical report.
## Alignment with `qwenpaw init`
The security model and recommended baseline in this document are **aligned with** what users see and accept during **`qwenpaw init`**. The init flow shows a security notice that covers: single-operator boundary; shared delegated authority when multiple people message the same instance; restricting channels and users (allowlists); using separate config/credentials and OS users or hosts per trust boundary; least privilege and sandboxing; keeping secrets out of the working directory and skill-accessible paths; and reviewing config and skills regularly. When updating either this document or the `SECURITY_WARNING` in `src/qwenpaw/cli/init_cmd.py`, keep the **concepts and recommendations** consistent so operators get the same message in both places.
## Security & Trust
Security handling is owned by the QwenPaw maintainers. For sensitive reports, use the private advisory or a private channel as above.
## Bug Bounties
QwenPaw is a community open-source project. There is no bug bounty program and no budget for paid reports. Please still disclose responsibly so we can fix issues quickly. The best way to help the project right now is by sending PRs or clear, reproducible reports.
## Operator Trust Model
QwenPaw does **not** model one instance as a multi-tenant, adversarial user boundary.
- Authenticated callers to the same QwenPaw instance (same config, same channel workspace) are treated as **trusted operators** for that instance.
- Session identifiers and labels are routing/context controls, not per-user authorization boundaries.
- If one operator can see or trigger what another operator can on the same instance, that is expected in this trust model.
- **Recommended mode**: one user per machine/host (or per OS user), one QwenPaw config for that user, and one or more agents/skills inside that instance.
- If multiple users need QwenPaw, use one host/OS user (or VPS) per user, or strict isolation; sharing one instance by mutually untrusted users is not the recommended default.
- Skills run with the same privileges as the QwenPaw process; only install and enable skills you trust.
## Trusted Skills Concept
Skills/extensions are part of QwenPaw's **trusted computing base** for an instance.
- Installing or enabling a skill grants it the same trust level as local code running for that instance.
- Skill behavior such as reading env/files or running host commands is expected inside this trust boundary.
- Security reports must show a **boundary bypass** (e.g. unauthenticated skill load, allowlist/policy bypass, or path-safety bypass), not only malicious behavior from a trusted-installed skill.
## Out of Scope
- Public internet exposure of QwenPaw when the docs recommend against it.
- Using QwenPaw in ways that the docs recommend not to.
- Deployments where mutually untrusted/adversarial operators share one QwenPaw instance and config (e.g. reports expecting per-operator isolation for sessions, history, or similar).
- **Prompt-injection-only** attacks (without a policy/auth/sandbox boundary bypass).
- Reports that require write access to trusted local state (working directory, config, memory files) to achieve impact.
- Reports where the only demonstrated impact is an already-authorized user intentionally invoking a skill or command that writes to an allowed path, without bypassing auth, sandbox, or another documented boundary.
- Reports where the only claim is that a trusted-installed/enabled skill can execute with process/host privileges (documented trust model behavior).
- Any report whose only claim is that an operator-enabled “dangerous” or break-glass option weakens defaults (these are explicit tradeoffs by design).
- Reports that depend on trusted operator–supplied configuration to trigger availability impact (e.g. custom regex or patterns). These may still be fixed as defense-in-depth but are not security-boundary bypasses.
- Exposed secrets that are third-party or user-controlled credentials (not QwenPaw-owned and not granting access to QwenPaw-operated infrastructure) without demonstrated QwenPaw impact.
- Scanner-only claims against stale or nonexistent paths, or without a working repro.
## Deployment Assumptions
QwenPaw security guidance assumes:
- The host where QwenPaw runs is within a trusted OS/admin boundary.
- Anyone who can modify the QwenPaw working directory and config (including `config.json`) is effectively a trusted operator.
- A single instance shared by mutually untrusted people is **not** a recommended setup. Use separate configs and, at minimum, separate OS users or hosts per trust boundary.
- Authenticated callers to the same instance are treated as trusted operators; session or context identifiers are routing controls, not per-user authorization boundaries.
- Multiple instances can run on one machine, but the recommended model is clean per-user isolation (prefer one host/OS user per user).
## One-User Trust Model
QwenPaw's security model is **“personal assistant”** (one trusted operator, potentially many agents/skills), not “shared multi-tenant bus.”
- If multiple people can message the same tool-enabled QwenPaw instance (e.g. a shared channel workspace), they can all steer that agent within its granted permissions.
- Session or memory scoping reduces context bleed but does **not** create per-user host authorization boundaries.
- For mixed-trust or adversarial users, isolate by OS user/host and use separate config and credentials per boundary.
- A company-shared agent can be valid when users are in the same trust boundary and the agent is strictly business-only.
- For company-shared setups, use a dedicated machine/VM/container and dedicated accounts; avoid mixing personal data on that runtime.
- If that host or environment is logged into personal accounts (e.g. personal password manager, personal cloud), you have collapsed the boundary and increased personal-data exposure risk.
## Agent and Model Assumptions
- The model/agent is **not** a trusted principal. Assume prompt/content injection can manipulate behavior.
- Security boundaries come from host/config trust, channel/user allowlists, tool policy, and what skills are enabled.
- Prompt injection by itself is not a vulnerability report unless it crosses one of those boundaries.
## Working Directory and Config Trust Boundary
The QwenPaw working directory is treated as **trusted local operator state**.
- If someone can edit working directory files or config, they have already crossed the trusted operator boundary.
- Memory or context over those files is expected behavior, not a separate security boundary.
- Example out-of-scope pattern: “attacker writes malicious content into workspace files, then the agent uses it.” If you need isolation between mutually untrusted users, split by OS user or host and run separate instances.
- Keep secrets out of the working directory and skill-accessible paths; this is part of the baseline recommended in `qwenpaw init`.
## Skills Trust Boundary
Skills are loaded and run **in-process** (or under the same trust boundary) as the QwenPaw runtime and are treated as trusted code.
- Skills can execute with the same OS privileges as the QwenPaw process.
- Runtime helpers used by skills are convenience APIs, not a sandbox boundary.
- Only install skills you trust, and restrict which skills are enabled in config where possible.
## Operational Guidance
- **Channels and users**: Restrict which channels and users can trigger the agent; use allowlists where possible.
- **Multi-user or shared inbox**: Use separate config/credentials and ideally separate OS users or hosts per trust boundary.
- **Skills**: Run with least privilege; sandbox where you can; limit tool scope to what you need.
- **Secrets**: Keep them out of the agent's working directory and skill-accessible paths.
- **Model**: Use a capable model when the agent has tools or handles untrusted input.
- **Review**: Review your config and skills regularly.
For more operational and hardening guidance, see the [documentation](https://qwenpaw.agentscope.io/) and any security-related docs linked from the repo.
## Runtime Requirements
- **Python**: QwenPaw requires a supported Python version (see [README](README.md)). Use a version with current security updates.
- **Docker or restricted environments**: When running in containers, run as a non-root user when possible. Use read-only mounts where feasible and limit capabilities to what is needed.
+7
View File
@@ -0,0 +1,7 @@
# test coverage
coverage/
# ai related
.wiki/
graphify-out/
+1
View File
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
+15
View File
@@ -0,0 +1,15 @@
# Build output
dist/
build/
# Dependencies
node_modules/
# Cache
.cache/
*.cache
# Misc
coverage/
.vscode/
.idea/
+28
View File
@@ -0,0 +1,28 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
);
+67
View File
@@ -0,0 +1,67 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/online.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<title>QwenPaw Console</title>
<style>
.qwenpaw-boot {
align-items: center;
background: #f7f7f5;
color: #1f1f1f;
display: flex;
font-family:
Inter,
ui-sans-serif,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
sans-serif;
inset: 0;
justify-content: center;
position: fixed;
}
.qwenpaw-boot__content {
align-items: center;
display: flex;
flex-direction: column;
gap: 18px;
}
.qwenpaw-boot__logo {
height: 68px;
object-fit: contain;
width: 68px;
}
.qwenpaw-boot__label {
color: #70706c;
font-size: 13px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
@media (prefers-color-scheme: dark) {
.qwenpaw-boot {
background: #141414;
color: #f4f4f1;
}
.qwenpaw-boot__label {
color: #a6a6a0;
}
}
</style>
</head>
<body>
<div id="root">
<div class="qwenpaw-boot" role="status" aria-live="polite">
<div class="qwenpaw-boot__content">
<img class="qwenpaw-boot__logo" src="/qwenpaw.png" alt="QwenPaw" />
<span class="qwenpaw-boot__label">Loading Console</span>
</div>
</div>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
File diff suppressed because it is too large. Load diff
+102
View File
@@ -0,0 +1,102 @@
{
"name": "qwenpaw-console",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --host",
"build": "tsc -b && vite build && npm run verify:monaco-css && npm run precompress && npm run verify:initial-bundle",
"build:prod": "tsc -b && vite build --mode production && npm run verify:monaco-css && npm run precompress && npm run verify:initial-bundle",
"build:tauri-bootstrap": "tsc -b && vite build --mode tauri --config src-tauri/vite.bootstrap.config.ts && node ../scripts/pack-tauri/finalize_tauri_bootstrap.mjs",
"build:test": "tsc -b && vite build --mode test",
"format": "tsc -b --noEmit && prettier --write --cache .",
"format:check": "tsc -b --noEmit && prettier --check .",
"lint": "eslint .",
"verify:monaco-css": "node scripts/verify-monaco-css.mjs",
"precompress": "node scripts/precompress-assets.mjs",
"verify:initial-bundle": "node scripts/verify-initial-bundle.mjs",
"preview": "vite preview",
"preview:prod": "vite preview --mode production",
"preview:test": "vite preview --mode test",
"test": "vitest",
"test:run": "node --max-old-space-size=4096 ./node_modules/vitest/vitest.mjs run",
"test:coverage": "node --max-old-space-size=4096 ./node_modules/vitest/vitest.mjs run --coverage"
},
"dependencies": {
"@agentscope-ai/chat": "1.1.73-beta.1787638407498",
"@agentscope-ai/design": "1.0.29",
"@agentscope-ai/icons": "1.0.67",
"@ant-design/icons": "^5.0.1",
"@ant-design/plots": "^2.6.8",
"@ant-design/x-markdown": "^2.2.2",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@lexical/react": "0.48.0",
"@monaco-editor/react": "^4.7.0",
"@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-dialog": "^2.7.1",
"@types/react-window": "^1.8.8",
"@vvo/tzdb": "^6.198.0",
"3d-force-graph": "1.80.0",
"ahooks": "^3.9.6",
"antd": "5.29.3",
"antd-style": "^3.7.1",
"dayjs": "^1.11.13",
"i18next": "^25.8.4",
"jszip": "^3.10.1",
"katex": "^0.16.47",
"lexical": "0.48.0",
"lucide-react": "^0.562.0",
"mermaid": "^11.12.2",
"monaco-editor": "0.55.1",
"motion": "^12.42.2",
"pretty-bytes": "^7.1.0",
"react": "^18",
"react-dom": "^18",
"react-i18next": "^16.5.4",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^4.11.1",
"react-router-dom": "^7.13.0",
"react-syntax-highlighter": "^16.1.1",
"react-window": "^1.8.10",
"remark-gfm": "^4.0.1",
"three": "0.185.1",
"three-spritetext": "1.10.0",
"zustand": "^5.0.3"
},
"devDependencies": {
"@eslint/js": "^9.25.0",
"@tauri-apps/cli": "^2.10.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/babel__core": "^7.20.5",
"@types/babel__generator": "^7.27.0",
"@types/babel__template": "^7.4.4",
"@types/babel__traverse": "^7.28.0",
"@types/i18next": "^12.1.0",
"@types/node": "^25.0.3",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/three": "0.185.4",
"@vitejs/plugin-react": "^4.4.1",
"@vitest/coverage-v8": "^4.1.6",
"eslint": "^9.25.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^16.0.0",
"jsdom": "^29.0.2",
"less": "^4.5.1",
"prettier": "3.0.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.30.1",
"vite": "6.4.1",
"vitest": "^4.1.4"
},
"overrides": {
"@ant-design/x": "2.2.2"
},
"repository": "https://github.com/agentscope-ai/agentscope-runtime.git"
}
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="770.82177734375" height="132" viewBox="0 0 770.82177734375 132"><path d="M0,69.98228499999999C0,104.210785,27.535208,131.96455,61.494133,131.96455C69.605812,131.96455,77.3424,130.36953,84.434273,127.48661L74.130531,109.50395C70.145035,110.80365,65.901604,111.5125,61.494133,111.5125C38.776711,111.5125,20.290945,92.880051,20.290945,69.98228499999999C20.290945,47.084499,38.776711,28.452009,61.494133,28.452009C84.21154,28.452009,102.69729,47.084499,102.69729,69.98228499999999C102.69729,79.174469,99.719872,87.669563,94.679405,94.557785L90.764221,87.71682C90.248428,86.818863,89.287231,86.25174,88.255692,86.25174L78.010559,86.25174C76.979034,86.25174,76.017838,86.807045,75.502052,87.71682L72.899734,92.253815C72.383965,93.163589,72.383965,94.274223,72.899734,95.172188L76.33432,101.162422L79.780609,107.176353L89.955383,124.91094L94.022957,132L94.081589,132L116.09566,131.89367L105.452,113.30843C116.30666,102.13131,123,86.842484,123,69.970448L122.97652,69.98228499999999C122.97652,35.753796,95.453049,8,61.494133,8C27.535208,8,0,35.753796,0,69.98228499999999Z" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough"/><path d="M143.881132,41.7247092L160.76963,98.113136L177.64629,41.7246926L197.527504,41.7246926L214.41592400000002,98.113136L231.31606,41.7246926L250.82172,41.7246926L224.12186,130.384132L204.20535999999998,130.384132L187.375641,74.208698L170.475433,130.384132L150.559053,130.384132L124,41.7246926L143.881132,41.7247092ZM329.72427,121.437729C339.72360000000003,113.248665,343.40886,102.136669,343.40886,102.136669L320.93404,102.136669L320.86354,102.219498C316.66202,107.355415,310.7587,110.92923,304.22165,111.816788C291.32356,113.568199,279.61067,105.722321,275.94903999999997,93.71094099999999L345.56827,93.651752C345.56827,93.651752,347.12926,86.799946,345.62694999999997,78.421562L345.40407,77.17900800000001C341.09685,54.753792000000004,321.15697,38.8253944,298.13050999999996,40.067954525C275.09222,41.310518,256.373,60.150054999999995,255.09367,83.39178100000001C253.56799,110.964752,276.28932,133.709457,303.69336999999996,131.898865C311.42758000000003,131.389984,320.82835,128.727386,329.72427,121.437729ZM276.32463,77.17900800000001C279.97449,66.95453499999999,289.75079,59.948881,300.64189,59.948881C311.53322000000003,59.948881,321.29781,66.954515,324.95947,77.17900800000001L276.33624,77.17900800000001L276.32463,77.17900800000001ZM443.95316,79.427437C443.87088,76.622814,443.61279,73.983875,443.19019,71.522413C439.55203,53.712402,423.88419,40.28097099,405.02402,40.0087919338C403.15808,40.0087919338,401.37411,40.11529851,399.66058,40.29280615C392.71277,41.1330104,386.32834,43.7482977,380.97653,47.6889749C380.29584,48.2806702,379.66214,48.907851199999996,379.04005,49.558726300000004L379.04005,41.7247092L359.54613,41.7247092L359.54613,130.384132L379.14569,130.384132C379.14569,130.384132,379.16909999999996,82.551598,379.16909999999996,82.44509500000001C379.19258,70.04316299999999,389.46179,60.079066999999995,401.83182,60.079066999999995C414.20181,60.079066999999995,424.22455,70.055012,424.49451,82.44509500000001L424.51791,82.44509500000001L424.51791,130.384132L444,130.384132L444,81.40369799999999C444,80.729179,443.97656,80.078312,443.95316,79.427437Z" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough"/><path d="M641,41.724609375L667.559053,130.38404837500002L687.475433,130.38404837500002L704.375641,74.208614375L721.20536,130.38404837500002L741.12186,130.38404837500002L767.82172,41.724609375L748.31606,41.724609375L731.415924,98.113052375L714.527504,41.724609375L694.64629,41.724609375L677.76963,98.113052375L660.881132,41.724625945091L641,41.724609375Z" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough"/><path d="M587,132C612.405098,132,633,112.076668,633,87.5C633,62.923328,612.405098,43,587,43C561.594902,43,541,62.923328,541,87.5C541,112.076668,561.594902,132,587,132ZM587.00021,112.860184C601.478386,112.860184,613.215263,101.506027,613.215263,87.499966C613.215263,73.493906,601.478386,62.139751000000004,587.00021,62.139751000000004C572.522034,62.139751000000004,560.785156,73.493906,560.785156,87.499966C560.785156,101.506027,572.522034,112.860184,587.00021,112.860184Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/><path d="M478,7L458,7L458,131L478,131L478,84L500.5,84C521.762962,84,541,66.762962,541,45.5C541,24.237036,521.762962,7,500.5,7L478,7ZM478,27L478,64L500.5,64C511.26955399999997,64,522,56.269554,522,45.5C522,34.730446,511.26955399999997,27,500.5,27L478,27Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/><path d="M586.5629964,31.053010546875C587.6683826,32.129556546875,588.9830451,32.975797546875,590.5069752,33.591731546874996C592.0309057,34.207666546875004,593.683621,34.518310546875,595.46512,34.518310546875C597.246618,34.518310546875,598.942264,34.202308546875,600.460827,33.575664546875004C601.984756,32.943662546875004,603.304787,32.086711546875,Line truncated

After

Width:  |  Height:  |  Size: 9.4 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="770.82177734375" height="132" viewBox="0 0 770.82177734375 132"><path d="M0,69.98228499999999C0,104.210785,27.535208,131.96455,61.494133,131.96455C69.605812,131.96455,77.3424,130.36953,84.434273,127.48661L74.130531,109.50395C70.145035,110.80365,65.901604,111.5125,61.494133,111.5125C38.776711,111.5125,20.290945,92.880051,20.290945,69.98228499999999C20.290945,47.084499,38.776711,28.452009,61.494133,28.452009C84.21154,28.452009,102.69729,47.084499,102.69729,69.98228499999999C102.69729,79.174469,99.719872,87.669563,94.679405,94.557785L90.764221,87.71682C90.248428,86.818863,89.287231,86.25174,88.255692,86.25174L78.010559,86.25174C76.979034,86.25174,76.017838,86.807045,75.502052,87.71682L72.899734,92.253815C72.383965,93.163589,72.383965,94.274223,72.899734,95.172188L76.33432,101.162422L79.780609,107.176353L89.955383,124.91094L94.022957,132L94.081589,132L116.09566,131.89367L105.452,113.30843C116.30666,102.13131,123,86.842484,123,69.970448L122.97652,69.98228499999999C122.97652,35.753796,95.453049,8,61.494133,8C27.535208,8,0,35.753796,0,69.98228499999999Z" fill="#000000" fill-opacity="1" style="mix-blend-mode:passthrough"/><path d="M143.881132,41.7247092L160.76963,98.113136L177.64629,41.7246926L197.527504,41.7246926L214.41592400000002,98.113136L231.31606,41.7246926L250.82172,41.7246926L224.12186,130.384132L204.20535999999998,130.384132L187.375641,74.208698L170.475433,130.384132L150.559053,130.384132L124,41.7246926L143.881132,41.7247092ZM329.72427,121.437729C339.72360000000003,113.248665,343.40886,102.136669,343.40886,102.136669L320.93404,102.136669L320.86354,102.219498C316.66202,107.355415,310.7587,110.92923,304.22165,111.816788C291.32356,113.568199,279.61067,105.722321,275.94903999999997,93.71094099999999L345.56827,93.651752C345.56827,93.651752,347.12926,86.799946,345.62694999999997,78.421562L345.40407,77.17900800000001C341.09685,54.753792000000004,321.15697,38.8253944,298.13050999999996,40.067954525C275.09222,41.310518,256.373,60.150054999999995,255.09367,83.39178100000001C253.56799,110.964752,276.28932,133.709457,303.69336999999996,131.898865C311.42758000000003,131.389984,320.82835,128.727386,329.72427,121.437729ZM276.32463,77.17900800000001C279.97449,66.95453499999999,289.75079,59.948881,300.64189,59.948881C311.53322000000003,59.948881,321.29781,66.954515,324.95947,77.17900800000001L276.33624,77.17900800000001L276.32463,77.17900800000001ZM443.95316,79.427437C443.87088,76.622814,443.61279,73.983875,443.19019,71.522413C439.55203,53.712402,423.88419,40.28097099,405.02402,40.0087919338C403.15808,40.0087919338,401.37411,40.11529851,399.66058,40.29280615C392.71277,41.1330104,386.32834,43.7482977,380.97653,47.6889749C380.29584,48.2806702,379.66214,48.907851199999996,379.04005,49.558726300000004L379.04005,41.7247092L359.54613,41.7247092L359.54613,130.384132L379.14569,130.384132C379.14569,130.384132,379.16909999999996,82.551598,379.16909999999996,82.44509500000001C379.19258,70.04316299999999,389.46179,60.079066999999995,401.83182,60.079066999999995C414.20181,60.079066999999995,424.22455,70.055012,424.49451,82.44509500000001L424.51791,82.44509500000001L424.51791,130.384132L444,130.384132L444,81.40369799999999C444,80.729179,443.97656,80.078312,443.95316,79.427437Z" fill="#000000" fill-opacity="1" style="mix-blend-mode:passthrough"/><path d="M641,41.724609375L667.559053,130.38404837500002L687.475433,130.38404837500002L704.375641,74.208614375L721.20536,130.38404837500002L741.12186,130.38404837500002L767.82172,41.724609375L748.31606,41.724609375L731.415924,98.113052375L714.527504,41.724609375L694.64629,41.724609375L677.76963,98.113052375L660.881132,41.724625945091L641,41.724609375Z" fill="#000000" fill-opacity="1" style="mix-blend-mode:passthrough"/><path d="M587,132C612.405098,132,633,112.076668,633,87.5C633,62.923328,612.405098,43,587,43C561.594902,43,541,62.923328,541,87.5C541,112.076668,561.594902,132,587,132ZM587.00021,112.860184C601.478386,112.860184,613.215263,101.506027,613.215263,87.499966C613.215263,73.493906,601.478386,62.139751000000004,587.00021,62.139751000000004C572.522034,62.139751000000004,560.785156,73.493906,560.785156,87.499966C560.785156,101.506027,572.522034,112.860184,587.00021,112.860184Z" fill-rule="evenodd" fill="#000000" fill-opacity="1"/><path d="M478,7L458,7L458,131L478,131L478,84L500.5,84C521.762962,84,541,66.762962,541,45.5C541,24.237036,521.762962,7,500.5,7L478,7ZM478,27L478,64L500.5,64C511.26955399999997,64,522,56.269554,522,45.5C522,34.730446,511.26955399999997,27,500.5,27L478,27Z" fill-rule="evenodd" fill="#000000" fill-opacity="1"/><path d="M586.5629964,31.053010546875C587.6683826,32.129556546875,588.9830451,32.975797546875,590.5069752,33.591731546874996C592.0309057,34.207666546875004,593.683621,34.518310546875,595.46512,34.518310546875C597.246618,34.518310546875,598.942264,34.202308546875,600.460827,33.575664546875004C601.984756,32.943662546875004,603.304787,32.086711546875,Line truncated

After

Width:  |  Height:  |  Size: 9.4 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="175.35000610351562" height="235.4199981689453" viewBox="0 0 175.35000610351562 235.4199981689453"><defs><clipPath id="master_svg0_145_28391"><rect x="0" y="0" width="175.35000610351562" height="235.4199981689453" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_145_28391)"><path d="M83.10836,229.9998485546875C129.00784,229.9998485546875,166.21672,193.9784385546875,166.21672,149.5438075546875C166.21672,105.1091615546875,129.00784,69.0877685546875,83.10836,69.0877685546875C37.208885,69.0877685546875,0,105.1091615546875,0,149.5438075546875C0,193.9784385546875,37.208885,229.9998485546875,83.10836,229.9998485546875ZM83.108734,195.39502855468749C109.26651,195.39502855468749,130.47157,174.8667085546875,130.47157,149.5437395546875C130.47157,124.2207715546875,109.26651,103.6924515546875,83.108734,103.6924515546875C56.950966,103.6924515546875,35.745914,124.2207715546875,35.745914,149.5437395546875C35.745914,174.8667085546875,56.950966,195.39502855468749,83.108734,195.39502855468749Z" fill-rule="evenodd" fill="#000000" fill-opacity="1"/><path d="M80.31835555625,46.48915884375C82.31537815625,48.43563484375,84.69048165625,49.96570184375,87.44365765625,51.07936084375C90.19683265625,52.19301584375,93.18267265624999,52.75468784375,96.40117865625,52.75468784375C99.61968465625,52.75468784375,102.68308465625,52.18332684375,105.42656165625,51.05030784375C108.17973665625,49.90760084375,110.56454065625,48.35816584375,112.59064065625,46.38263684375C114.61674165625,44.40710784375,116.19691465625,42.11201084375,117.34083965625,39.49733884375C118.48477165624999,36.882665843750004,119.04704265625,34.064632843750005,119.04704265625,31.06260484375L119.04704265625,30.90766184375C119.04704265625,27.90563184375,118.47508265625001,25.08759984375,117.34083965625,22.47292784375C116.19691465625,19.84857384375,114.62644165625,17.57284164375,112.62942165625,15.626364743749999C110.63239665625,13.679887743750001,108.25728965625001,12.14982174375,105.50411765625,11.03616584375C102.75094265625,9.92250990375,99.76509865625,9.36083984375,96.54659465625,9.36083984375C93.32809265624999,9.36083984375,90.26469065625,9.93219375375,87.51151765624999,11.06521774375C84.75834165625,12.207925543750001,82.37353995625,13.757359543749999,80.34743685625,15.73288914375C78.32133435625,17.70841784375,76.74116035625,19.99383284375,75.59723355625,22.618188843749998C74.45330721625,25.23285984375,73.88134765625,28.05089384375,73.88134765625,31.05292284375L73.88134765625,31.20786484375C73.88134765625,34.21957984375,74.45330721625,37.02792784375,75.59723355625,39.65228284375C76.74116035625,42.26695984375,78.31163835625,44.55237584375,80.30865955625,46.48916284375L80.31835555625,46.48915884375Z" fill="#FF9D4D" fill-opacity="1" style="mix-blend-mode:passthrough" transform="matrix(0.9901291728019714,-0.14083673059940338,0.14062289893627167,0.9899662137031555,-0.5870784194339649,10.499132122735318)"/><path d="M21.69596002224121,58.3371813046875C23.692555422241213,60.2836573046875,26.06714692224121,61.8137283046875,28.81973592224121,62.9273833046875C31.57232092224121,64.0410383046875,34.55752192224121,64.60271030468749,37.77533692224121,64.60271030468749C40.99315292224121,64.60271030468749,44.05588892224121,64.0313493046875,46.79878192224121,62.8886373046875C49.55137092224121,61.7459373046875,51.93565192224121,60.1965023046875,53.96132492224121,58.2209703046875C55.98699792224121,56.2454453046875,57.566831922241214,53.9600293046875,58.71051192224121,51.3356743046875C59.854188922241214,48.7210023046875,60.42603492224121,45.9029693046875,60.42603492224121,42.900940304687495L60.42603492224121,42.745998304687504C60.42603492224121,39.7439723046875,59.854188922241214,36.935620304687504,58.71051192224121,34.3112663046875C57.566831922241214,31.6869113046875,55.996690922241214,29.4111795046875,54.00008992224121,27.4743867046875C52.00349992224121,25.5279102046875,49.628903922241214,23.9978435046875,46.87632192224121,22.8841878046875C44.12373592224121,21.7705321946875,41.138536922241215,21.2088623046875,37.920720922241216,21.2088623046875C34.702905922241214,21.2088623046875,31.640168922241212,21.7802163346875,28.88758192224121,22.9229246046875C26.134994922241212,24.0656326046875,23.75070952224121,25.6150675046875,21.725039022241212,27.5905948046875C19.69936752224121,29.5661259046875,18.11953732224121,31.8612243046875,16.97585702224121,34.4758963046875C15.832175972241211,37.0905673046875,15.260335922241211,39.9085983046875,15.260335922241211,42.9106273046875L15.260335922241211,43.065571304687495C15.260335922241211,46.0772853046875,15.832175972241211,48.8856313046875,16.97585702224121,51.5099883046875C18.11953782224121,54.1246603046875,19.689675822241213,56.4100763046875,21.68627162224121,58.3565523046875L21.69596002224121,58.3371813046875Z" fill="#FF9D4D" fill-opacity="1" style="mix-blend-mode:passthrough" transform="matrix(0.9901291728019714,-0.14083673059940338,0.14Line truncated

After

Width:  |  Height:  |  Size: 6.9 KiB

+55
View File
@@ -0,0 +1,55 @@
import { readdir, readFile, stat, writeFile } from "node:fs/promises";
import { extname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { promisify } from "node:util";
import { brotliCompress, constants, gzip } from "node:zlib";
const compressBrotli = promisify(brotliCompress);
const compressGzip = promisify(gzip);
const outputDirectory = new URL("../dist/", import.meta.url);
const compressibleExtensions = new Set([
".css",
".html",
".js",
".json",
".svg",
".txt",
".wasm",
]);
const minimumSize = 1024;
async function walk(directory) {
const entries = await readdir(directory, { withFileTypes: true });
const files = await Promise.all(
entries.map(async (entry) => {
const path = join(directory, entry.name);
return entry.isDirectory() ? walk(path) : [path];
}),
);
return files.flat();
}
async function compress(path) {
if (!compressibleExtensions.has(extname(path))) return false;
if ((await stat(path)).size < minimumSize) return false;
const source = await readFile(path);
const [brotli, gzipped] = await Promise.all([
compressBrotli(source, {
params: {
[constants.BROTLI_PARAM_QUALITY]: 6,
},
}),
compressGzip(source, { level: 6 }),
]);
await Promise.all([
writeFile(`${path}.br`, brotli),
writeFile(`${path}.gz`, gzipped),
]);
return true;
}
const outputPath = fileURLToPath(outputDirectory);
const files = await walk(outputPath);
const results = await Promise.all(files.map(compress));
const count = results.filter(Boolean).length;
console.log(`Precompressed ${count} Console assets.`);
+88
View File
@@ -0,0 +1,88 @@
import { readFile, stat } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const scriptDirectory = dirname(fileURLToPath(import.meta.url));
const outputDirectory = join(scriptDirectory, "..", "dist");
const indexPath = join(outputDirectory, "index.html");
const maximumRawBytes = 10 * 1024 * 1024;
const maximumBrotliBytes = 3 * 1024 * 1024;
const html = await readFile(indexPath, "utf-8");
const assets = new Set(
[...html.matchAll(/\/assets\/[^"' ]+\.(?:css|js)/g)].map(([asset]) => asset),
);
const initialJavaScriptAssets = [...assets].filter((asset) =>
asset.endsWith(".js"),
);
const initialJavaScriptNames = new Set(
initialJavaScriptAssets.map((asset) => asset.split("/").at(-1)),
);
const importGraph = new Map();
for (const asset of initialJavaScriptAssets) {
const source = await readFile(join(outputDirectory, asset), "utf-8");
const dependencies = new Set(
[...source.matchAll(/\b(?:from|import)\s*\(?["']\.\/([^"']+\.js)["']/g)]
.map((match) => match[1])
.filter((dependency) => initialJavaScriptNames.has(dependency)),
);
importGraph.set(asset.split("/").at(-1), dependencies);
}
const visited = new Set();
const active = new Set();
const stack = [];
function findImportCycle(asset) {
if (active.has(asset)) {
return [...stack.slice(stack.indexOf(asset)), asset];
}
if (visited.has(asset)) {
return null;
}
visited.add(asset);
active.add(asset);
stack.push(asset);
for (const dependency of importGraph.get(asset) ?? []) {
const cycle = findImportCycle(dependency);
if (cycle) {
return cycle;
}
}
stack.pop();
active.delete(asset);
return null;
}
for (const asset of initialJavaScriptNames) {
const cycle = findImportCycle(asset);
if (cycle) {
throw new Error(`Initial JavaScript import cycle: ${cycle.join(" -> ")}`);
}
}
let rawBytes = 0;
let brotliBytes = 0;
for (const asset of assets) {
const path = join(outputDirectory, asset);
rawBytes += (await stat(path)).size;
brotliBytes += (await stat(`${path}.br`)).size;
}
const toMiB = (bytes) => (bytes / 1024 / 1024).toFixed(2);
console.log(
`Initial bundle: ${toMiB(rawBytes)} MiB raw, ` +
`${toMiB(brotliBytes)} MiB Brotli across ${assets.size} assets.`,
);
if (rawBytes > maximumRawBytes) {
throw new Error(`Initial raw bundle exceeds ${toMiB(maximumRawBytes)} MiB.`);
}
if (brotliBytes > maximumBrotliBytes) {
throw new Error(
`Initial Brotli bundle exceeds ${toMiB(maximumBrotliBytes)} MiB.`,
);
}
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env node
/**
* Build guard: assert the console bundle still ships Monaco's stylesheet.
*
* Monaco keeps a hidden `<textarea class="inputarea">` for keyboard / IME
* input. Without `monaco-editor`'s CSS that textarea renders with browser
* default styles (a large white box floating over the code) and the editor
* loses its input-layer positioning, so clicks no longer land on the caret
* (issue #6547). That is exactly what happens when node_modules CSS is
* stubbed out during a real build, so fail loudly instead of shipping a
* broken Coding Mode editor.
*
* Usage: node scripts/verify-monaco-css.mjs [outDir] (default: dist)
*/
import { readdirSync, readFileSync } from "node:fs";
import path from "node:path";
// Substrings that only exist in monaco-editor's stylesheet. Deliberately not
// tied to hashed file names or minified whitespace.
const MARKERS = ["inputarea", "overflow-guard"];
function collectCssFiles(dir) {
const found = [];
for (const entry of readdirSync(dir, { withFileTypes: true })) {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) {
found.push(...collectCssFiles(full));
} else if (entry.name.endsWith(".css")) {
found.push(full);
}
}
return found;
}
const outDir = process.argv[2] ?? "dist";
let cssFiles;
try {
cssFiles = collectCssFiles(outDir);
} catch (err) {
console.error(`[verify-monaco-css] cannot read build output "${outDir}"`);
throw err;
}
const missing = MARKERS.filter(
(marker) =>
!cssFiles.some((file) => readFileSync(file, "utf8").includes(marker)),
);
if (cssFiles.length === 0 || missing.length > 0) {
console.error(
`[verify-monaco-css] Monaco stylesheet missing from ${outDir}: ` +
`${missing.join(", ") || "no CSS emitted at all"}.\n` +
"The Coding Mode editor will show a floating white textarea and " +
"misplaced cursor. Check that no plugin stubs node_modules CSS " +
"during builds (console/vite.config.ts).",
);
process.exit(1);
}
console.log(
`[verify-monaco-css] OK - Monaco stylesheet present in ${cssFiles.length} CSS file(s).`,
);
+8
View File
@@ -0,0 +1,8 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/
tauri.version.conf.json
# Generated PyInstaller backend sidecar copied by pack-tauri scripts.
/binaries/
+5921
View File
File diff suppressed because it is too large. Load diff
+103
View File
@@ -0,0 +1,103 @@
[package]
name = "qwenpaw-desktop"
version = "0.1.0"
description = "QwenPaw Desktop Tauri shell that wraps the QwenPaw Console frontend and runs the Python FastAPI backend as a local sidecar process."
authors = ["QwenPaw Contributors"]
license = "Apache-2.0"
repository = "https://github.com/agentscope-ai/QwenPaw"
edition = "2021"
rust-version = "1.77.2"
default-run = "qwenpaw-desktop"
autobins = false
[[bin]]
name = "qwenpaw-desktop"
path = "src/main.rs"
[[bin]]
name = "qwenpaw-computer-use-helper"
path = "src/bin/qwenpaw-computer-use-helper.rs"
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.5.6", features = [] }
[dev-dependencies]
tempfile = "3"
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
futures-util = "0.3"
reqwest = { version = "0.12", default-features = false, features = ["stream"] }
semver = "1"
base64 = "0.22"
minisign-verify = "0.2"
sha2 = "0.10"
rand = "0.9"
tauri = { version = "2.10.3", features = ["tray-icon", "devtools"] }
tauri-plugin-log = "2"
tauri-plugin-shell = "2"
tauri-plugin-dialog = "2"
tauri-plugin-updater = "2"
tokio = { version = "1", features = ["fs", "io-util", "sync", "time"] }
uuid = { version = "1", features = ["v4"] }
dirs = "5"
[target.'cfg(windows)'.dependencies]
webview2-com = "0.38.2"
windows = { version = "0.61.3", features = [
"Foundation",
"Foundation_Collections",
"Graphics",
"Graphics_Capture",
"Graphics_DirectX",
"Graphics_DirectX_Direct3D11",
"Graphics_Imaging",
"Storage_Streams",
"Win32_Foundation",
"Win32_Graphics_Direct3D",
"Win32_Graphics_Direct3D11",
"Win32_Graphics_Dwm",
"Win32_Graphics_Gdi",
"Win32_Graphics_Dxgi",
"Win32_Graphics_Dxgi_Common",
"Win32_System_WinRT",
"Win32_System_WinRT_Direct3D11",
"Win32_System_WinRT_Graphics_Capture",
"Win32_System_Pipes",
"Win32_System_IO",
"Win32_System_Com",
"Win32_System_SystemInformation",
"Win32_System_StationsAndDesktops",
"Win32_System_Threading",
"Win32_System_JobObjects",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_UI_HiDpi",
"Win32_UI_Accessibility",
"Win32_UI_Input_KeyboardAndMouse",
"Win32_UI_WindowsAndMessaging",
] }
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = { version = "0.10", features = ["link"] }
# `highsierra` gates the non-variadic scroll-event constructor, which is the
# only way to synthesise a scroll without hand-writing variadic FFI. It gates
# nothing else.
core-graphics = { version = "0.24", features = ["link", "highsierra", "elcapitan"] }
accessibility = "0.2"
accessibility-sys = "0.2"
jpeg-encoder = "0.6"
libc = "0.2"
block2 = "0.6"
objc2 = "0.6"
dispatch2 = "0.3"
objc2-app-kit = { version = "0.3.2", default-features = false, features = ["NSApplication", "NSRunningApplication", "NSWorkspace", "block2", "libc"] }
objc2-core-graphics = { version = "0.3.2", default-features = false, features = ["CGImage"] }
objc2-foundation = { version = "0.3.2", default-features = false, features = ["NSError", "NSString"] }
objc2-screen-capture-kit = { version = "0.3.2", default-features = false, features = ["SCShareableContent", "SCScreenshotManager", "SCStream", "block2", "objc2-core-graphics"] }
+16
View File
@@ -0,0 +1,16 @@
fn main() {
// The Tauri bootstrap is generated by `build:tauri-bootstrap`. Raw
// `cargo build` is also used by the packaging and local replacement
// flows, so make the generated frontend an explicit build input rather
// than silently reusing a binary that embedded an older (or empty)
// bootstrap directory.
println!("cargo:rerun-if-changed=../dist-tauri");
// `cargo check`/`cargo test` validate Tauri resources before the packaging
// scripts have generated the PyInstaller sidecar. Keep release builds strict
// while allowing local Rust checks to run in a clean checkout.
if std::env::var("PROFILE").as_deref() != Ok("release") {
let _ = std::fs::create_dir_all("binaries/qwenpaw-backend");
}
tauri_build::build()
}
@@ -0,0 +1,31 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"windows": ["main"],
"remote": {
"urls": ["http://127.0.0.1:*", "http://localhost:*"]
},
"permissions": [
"backend",
"backend-download",
"core:default",
"core:webview:allow-internal-toggle-devtools",
"desktop-updater-check",
"desktop-updater-install",
"devtools",
"dialog:allow-open",
"dialog:allow-save",
"open-external-link",
"tray",
"core:window:allow-set-position",
"core:window:allow-set-size",
"core:window:allow-outer-position",
"core:window:allow-outer-size",
"core:window:allow-set-always-on-top",
"core:window:allow-scale-factor",
"core:window:allow-current-monitor",
"core:window:allow-close",
"core:window:allow-destroy"
]
}
+167
View File
@@ -0,0 +1,167 @@
!include LogicLib.nsh
!include nsDialogs.nsh
Var QwenPawCliPathCheckbox
Var QwenPawCliPathState
Page custom QWENPAW_CLI_PATH_PAGE QWENPAW_CLI_PATH_PAGE_LEAVE
!macro QWENPAW_UPDATE_CLI_PATH ACTION
InitPluginsDir
File /oname=$PLUGINSDIR\qwenpaw-update-path.ps1 "..\..\..\..\nsis\update-qwenpaw-path.ps1"
nsExec::ExecToStack `powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PLUGINSDIR\qwenpaw-update-path.ps1" -Action "${ACTION}" -Path "$INSTDIR\binaries\qwenpaw-backend"`
Pop $0
Pop $1
!macroend
!macro QWENPAW_ADD_CLI_PATH_IF_SELECTED
${If} $QwenPawCliPathState == 0
DetailPrint "$(qwenpawCliPathSkipped)"
${Else}
IfFileExists "$INSTDIR\binaries\qwenpaw-backend\qwenpaw.exe" 0 qwenpaw_cli_path_missing
!insertmacro QWENPAW_UPDATE_CLI_PATH "Add"
${If} $0 == 0
DetailPrint "$(qwenpawCliPathAdded)"
${Else}
DetailPrint "$(qwenpawCliPathUpdateFailed)"
DetailPrint "$1"
${EndIf}
Goto qwenpaw_cli_path_done
qwenpaw_cli_path_missing:
DetailPrint "$(qwenpawCliPathMissing)"
qwenpaw_cli_path_done:
${EndIf}
!macroend
!macro QWENPAW_REMOVE_CLI_PATH
!insertmacro QWENPAW_UPDATE_CLI_PATH "Remove"
${If} $0 != 0
DetailPrint "$(qwenpawCliPathUpdateFailed)"
DetailPrint "$1"
${EndIf}
!macroend
!macro QWENPAW_INSTALL_DEBUG_LAUNCHER
SetOutPath "$INSTDIR"
File /oname=qwenpaw-desktop-debug.cmd "..\..\..\..\nsis\qwenpaw-desktop-debug.cmd"
File /oname=qwenpaw-desktop-debug.ps1 "..\..\..\..\nsis\qwenpaw-desktop-debug.ps1"
CreateShortcut "$SMPROGRAMS\QwenPaw Desktop (Debug).lnk" "$INSTDIR\qwenpaw-desktop-debug.cmd" "" "$INSTDIR\qwenpaw-desktop.exe" 0
!macroend
!macro QWENPAW_REMOVE_DEBUG_LAUNCHER
Delete "$SMPROGRAMS\QwenPaw Desktop (Debug).lnk"
Delete "$INSTDIR\qwenpaw-desktop-debug.cmd"
Delete "$INSTDIR\qwenpaw-desktop-debug.ps1"
!macroend
Function QWENPAW_CLI_PATH_PAGE
${GetOptions} $CMDLINE "/NO_QWENPAW_PATH" $0
${IfNot} ${Errors}
StrCpy $QwenPawCliPathState 0
Abort
${EndIf}
${GetOptions} $CMDLINE "/P" $0
${IfNot} ${Errors}
StrCpy $QwenPawCliPathState 1
Abort
${EndIf}
${If} ${Silent}
StrCpy $QwenPawCliPathState 1
Abort
${EndIf}
nsDialogs::Create 1018
Pop $0
${If} $0 == error
Abort
${EndIf}
!insertmacro MUI_HEADER_TEXT "$(qwenpawCliPathPageTitle)" "$(qwenpawCliPathPageSubtitle)"
${NSD_CreateLabel} 0 0 100% 28u "$(qwenpawCliPathPageDescription)"
Pop $0
${NSD_CreateCheckbox} 0 44u 100% 12u "$(qwenpawCliPathCheckbox)"
Pop $QwenPawCliPathCheckbox
${If} $QwenPawCliPathState == 0
SendMessage $QwenPawCliPathCheckbox ${BM_SETCHECK} 0 0
${Else}
SendMessage $QwenPawCliPathCheckbox ${BM_SETCHECK} 1 0
${EndIf}
nsDialogs::Show
FunctionEnd
Function QWENPAW_CLI_PATH_PAGE_LEAVE
${NSD_GetState} $QwenPawCliPathCheckbox $QwenPawCliPathState
FunctionEnd
!macro QWENPAW_DEFINE_INSTALL_FUNCTIONS PREFIX
Function ${PREFIX}QWENPAW_RESTORE_INSTALL_STATE
Push $0
Push $1
IfFileExists "$PLUGINSDIR\qwenpaw-manage-install-processes.ps1" 0 qwenpaw_restore_done
nsExec::ExecToStack `powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PLUGINSDIR\qwenpaw-manage-install-processes.ps1" -InstallDir "$INSTDIR" -Action Restore`
Pop $0
Pop $1
${If} $0 != 0
DetailPrint "$(qwenpawRestoreInstallStateFailed)"
DetailPrint "$1"
${EndIf}
qwenpaw_restore_done:
Pop $1
Pop $0
FunctionEnd
Function ${PREFIX}QWENPAW_PREPARE_INSTALL
Push $0
Push $1
Push $2
InitPluginsDir
File /oname=$PLUGINSDIR\qwenpaw-manage-install-processes.ps1 "..\..\..\..\nsis\manage-install-processes.ps1"
System::Call 'kernel32::GetCurrentProcessId() i .r2'
qwenpaw_prepare_retry:
nsExec::ExecToStack `powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PLUGINSDIR\qwenpaw-manage-install-processes.ps1" -InstallDir "$INSTDIR" -NsisProcessId $2`
Pop $0
Pop $1
${If} $0 == 0
Goto qwenpaw_prepare_done
${Else}
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(qwenpawStopProcessesPrompt)$\n$\n$1" /SD IDCANCEL IDRETRY qwenpaw_prepare_retry IDCANCEL qwenpaw_prepare_cancel
${EndIf}
qwenpaw_prepare_cancel:
Call ${PREFIX}QWENPAW_RESTORE_INSTALL_STATE
Quit
qwenpaw_prepare_done:
Pop $2
Pop $1
Pop $0
FunctionEnd
!macroend
!insertmacro QWENPAW_DEFINE_INSTALL_FUNCTIONS ""
!insertmacro QWENPAW_DEFINE_INSTALL_FUNCTIONS "un."
!macro NSIS_HOOK_PREINSTALL
Call QWENPAW_PREPARE_INSTALL
!macroend
!macro NSIS_HOOK_POSTINSTALL
Call QWENPAW_RESTORE_INSTALL_STATE
!insertmacro QWENPAW_ADD_CLI_PATH_IF_SELECTED
!insertmacro QWENPAW_INSTALL_DEBUG_LAUNCHER
!macroend
!macro NSIS_HOOK_PREUNINSTALL
Call un.QWENPAW_PREPARE_INSTALL
!insertmacro QWENPAW_REMOVE_DEBUG_LAUNCHER
!insertmacro QWENPAW_REMOVE_CLI_PATH
!macroend
!macro NSIS_HOOK_POSTUNINSTALL
Call un.QWENPAW_RESTORE_INSTALL_STATE
!macroend
@@ -0,0 +1,37 @@
LangString addOrReinstall ${LANG_ENGLISH} "Add/Reinstall components"
LangString alreadyInstalled ${LANG_ENGLISH} "Already Installed"
LangString alreadyInstalledLong ${LANG_ENGLISH} "${PRODUCTNAME} ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
LangString appRunning ${LANG_ENGLISH} "{{product_name}} is running! Please close it first then try again."
LangString appRunningOkKill ${LANG_ENGLISH} "{{product_name}} is running!$\nClick OK to kill it"
LangString chooseMaintenanceOption ${LANG_ENGLISH} "Choose the maintenance option to perform."
LangString choowHowToInstall ${LANG_ENGLISH} "Choose how you want to install ${PRODUCTNAME}."
LangString createDesktop ${LANG_ENGLISH} "Create desktop shortcut"
LangString dontUninstall ${LANG_ENGLISH} "Do not uninstall"
LangString dontUninstallDowngrade ${LANG_ENGLISH} "Do not uninstall (Downgrading without uninstall is disabled for this installer)"
LangString failedToKillApp ${LANG_ENGLISH} "Failed to kill {{product_name}}. Please close it first then try again"
LangString installingWebview2 ${LANG_ENGLISH} "Installing WebView2..."
LangString newerVersionInstalled ${LANG_ENGLISH} "A newer version of ${PRODUCTNAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
LangString older ${LANG_ENGLISH} "older"
LangString olderOrUnknownVersionInstalled ${LANG_ENGLISH} "An $R4 version of ${PRODUCTNAME} is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
LangString silentDowngrades ${LANG_ENGLISH} "Downgrades are disabled for this installer, can't proceed with the silent installer, please use the graphical interface installer instead.$\n"
LangString unableToUninstall ${LANG_ENGLISH} "Unable to uninstall!"
LangString uninstallApp ${LANG_ENGLISH} "Uninstall ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_ENGLISH} "Uninstall before installing"
LangString unknown ${LANG_ENGLISH} "unknown"
LangString webview2AbortError ${LANG_ENGLISH} "Failed to install WebView2! The app can't run without it. Try restarting the installer."
LangString webview2DownloadError ${LANG_ENGLISH} "Error: Downloading WebView2 Failed - $0"
LangString webview2DownloadSuccess ${LANG_ENGLISH} "WebView2 bootstrapper downloaded successfully"
LangString webview2Downloading ${LANG_ENGLISH} "Downloading WebView2 bootstrapper..."
LangString webview2InstallError ${LANG_ENGLISH} "Error: Installing WebView2 failed with exit code $1"
LangString webview2InstallSuccess ${LANG_ENGLISH} "WebView2 installed successfully"
LangString deleteAppData ${LANG_ENGLISH} "Clear app data (e.g. settings, drafts, cache; keeps agents/chats)"
LangString qwenpawCliPathPageTitle ${LANG_ENGLISH} "Command line"
LangString qwenpawCliPathPageSubtitle ${LANG_ENGLISH} "Choose whether qwenpaw is available in terminals."
LangString qwenpawCliPathPageDescription ${LANG_ENGLISH} "This adds the bundled qwenpaw command to your user PATH. You can change it later by reinstalling or uninstalling QwenPaw Desktop."
LangString qwenpawCliPathCheckbox ${LANG_ENGLISH} "Add qwenpaw to PATH"
LangString qwenpawCliPathAdded ${LANG_ENGLISH} "Added qwenpaw to user PATH"
LangString qwenpawCliPathSkipped ${LANG_ENGLISH} "Skipped adding qwenpaw to user PATH"
LangString qwenpawCliPathMissing ${LANG_ENGLISH} "qwenpaw.exe was not found; skipped PATH update"
LangString qwenpawCliPathUpdateFailed ${LANG_ENGLISH} "Failed to update user PATH"
LangString qwenpawStopProcessesPrompt ${LANG_ENGLISH} "QwenPaw processes are still using files the installer needs to replace.$\n$\nQuit QwenPaw and close related command-line sessions, then click Retry. Click Cancel to abort."
LangString qwenpawRestoreInstallStateFailed ${LANG_ENGLISH} "Could not restore the Native Messaging launcher; QwenPaw will retry recovery at startup"
@@ -0,0 +1,37 @@
LangString addOrReinstall ${LANG_INDONESIAN} "Tambah/instal ulang komponen"
LangString alreadyInstalled ${LANG_INDONESIAN} "Sudah terinstal"
LangString alreadyInstalledLong ${LANG_INDONESIAN} "${PRODUCTNAME} ${VERSION} sudah terinstal. Pilih operasi yang ingin dilakukan lalu klik Berikutnya untuk melanjutkan."
LangString appRunning ${LANG_INDONESIAN} "{{product_name}} sedang berjalan! Tutup terlebih dahulu, lalu coba lagi."
LangString appRunningOkKill ${LANG_INDONESIAN} "{{product_name}} sedang berjalan!$\nKlik OK untuk menghentikannya"
LangString chooseMaintenanceOption ${LANG_INDONESIAN} "Pilih opsi pemeliharaan yang akan dilakukan."
LangString choowHowToInstall ${LANG_INDONESIAN} "Pilih cara menginstal ${PRODUCTNAME}."
LangString createDesktop ${LANG_INDONESIAN} "Buat pintasan desktop"
LangString dontUninstall ${LANG_INDONESIAN} "Jangan hapus instalasi"
LangString dontUninstallDowngrade ${LANG_INDONESIAN} "Jangan hapus instalasi (downgrade tanpa uninstall dinonaktifkan untuk installer ini)"
LangString failedToKillApp ${LANG_INDONESIAN} "Gagal menghentikan {{product_name}}. Tutup terlebih dahulu, lalu coba lagi"
LangString installingWebview2 ${LANG_INDONESIAN} "Menginstal WebView2..."
LangString newerVersionInstalled ${LANG_INDONESIAN} "Versi ${PRODUCTNAME} yang lebih baru sudah terinstal! Tidak disarankan menginstal versi yang lebih lama. Jika tetap ingin menginstal versi lama ini, sebaiknya hapus instalasi versi saat ini terlebih dahulu. Pilih operasi yang ingin dilakukan lalu klik Berikutnya untuk melanjutkan."
LangString older ${LANG_INDONESIAN} "lebih lama"
LangString olderOrUnknownVersionInstalled ${LANG_INDONESIAN} "Versi $R4 dari ${PRODUCTNAME} sudah terinstal di sistem Anda. Disarankan menghapus instalasi versi saat ini sebelum menginstal. Pilih operasi yang ingin dilakukan lalu klik Berikutnya untuk melanjutkan."
LangString silentDowngrades ${LANG_INDONESIAN} "Downgrade dinonaktifkan untuk installer ini, tidak dapat melanjutkan silent installer. Gunakan installer dengan antarmuka grafis.$\n"
LangString unableToUninstall ${LANG_INDONESIAN} "Tidak dapat menghapus instalasi!"
LangString uninstallApp ${LANG_INDONESIAN} "Hapus instalasi ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_INDONESIAN} "Hapus instalasi sebelum menginstal"
LangString unknown ${LANG_INDONESIAN} "tidak diketahui"
LangString webview2AbortError ${LANG_INDONESIAN} "Gagal menginstal WebView2! Aplikasi tidak dapat berjalan tanpa WebView2. Coba mulai ulang installer."
LangString webview2DownloadError ${LANG_INDONESIAN} "Kesalahan: Gagal mengunduh WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_INDONESIAN} "Bootstrapper WebView2 berhasil diunduh"
LangString webview2Downloading ${LANG_INDONESIAN} "Mengunduh bootstrapper WebView2..."
LangString webview2InstallError ${LANG_INDONESIAN} "Kesalahan: Instalasi WebView2 gagal dengan kode keluar $1"
LangString webview2InstallSuccess ${LANG_INDONESIAN} "WebView2 berhasil diinstal"
LangString deleteAppData ${LANG_INDONESIAN} "Hapus data aplikasi (setelan, draf, dll.; agen/chat disimpan)"
LangString qwenpawCliPathPageTitle ${LANG_INDONESIAN} "Command line"
LangString qwenpawCliPathPageSubtitle ${LANG_INDONESIAN} "Choose whether qwenpaw is available in terminals."
LangString qwenpawCliPathPageDescription ${LANG_INDONESIAN} "This adds the bundled qwenpaw command to your user PATH. You can change it later by reinstalling or uninstalling QwenPaw Desktop."
LangString qwenpawCliPathCheckbox ${LANG_INDONESIAN} "Add qwenpaw to PATH"
LangString qwenpawCliPathAdded ${LANG_INDONESIAN} "Added qwenpaw to user PATH"
LangString qwenpawCliPathSkipped ${LANG_INDONESIAN} "Skipped adding qwenpaw to user PATH"
LangString qwenpawCliPathMissing ${LANG_INDONESIAN} "qwenpaw.exe was not found; skipped PATH update"
LangString qwenpawCliPathUpdateFailed ${LANG_INDONESIAN} "Failed to update user PATH"
LangString qwenpawStopProcessesPrompt ${LANG_INDONESIAN} "Proses QwenPaw masih menggunakan berkas yang perlu diganti oleh penginstal.$\n$\nTutup QwenPaw dan sesi baris perintah terkait, lalu klik Coba Lagi. Klik Batal untuk membatalkan."
LangString qwenpawRestoreInstallStateFailed ${LANG_INDONESIAN} "Peluncur Native Messaging tidak dapat dipulihkan; QwenPaw akan mencoba lagi saat dimulai"
@@ -0,0 +1,37 @@
LangString addOrReinstall ${LANG_JAPANESE} "コンポーネントの追加・再インストール"
LangString alreadyInstalled ${LANG_JAPANESE} "既にインストールされています"
LangString alreadyInstalledLong ${LANG_JAPANESE} "${PRODUCTNAME} ${VERSION} は既にインストールされています。実行したい操作を選択し、「次へ」をクリックして続行します。"
LangString appRunning ${LANG_JAPANESE} "{{product_name}} は動作中です。動作中のプログラムを終了し、もう一度やり直してください。"
LangString appRunningOkKill ${LANG_JAPANESE} "{{product_name}} は動作中です。$\n「OK」を押すと動作中のプログラムを終了します。"
LangString chooseMaintenanceOption ${LANG_JAPANESE} "メンテナンスオプションを選択して実行します。"
LangString choowHowToInstall ${LANG_JAPANESE} "${PRODUCTNAME} のインストール方法を選択してください。"
LangString createDesktop ${LANG_JAPANESE} "デスクトップショートカットを作成する"
LangString dontUninstall ${LANG_JAPANESE} "アンインストールしない"
LangString dontUninstallDowngrade ${LANG_JAPANESE} "アンインストールしない (このインストーラーでは、アンインストールをせずにダウングレードすることはできません)"
LangString failedToKillApp ${LANG_JAPANESE} "{{product_name}} の終了に失敗しました。動作中のプログラムを終了し、もう一度やり直してください。"
LangString installingWebview2 ${LANG_JAPANESE} "WebView2 をインストール中です..."
LangString newerVersionInstalled ${LANG_JAPANESE} "既に新しいバージョンの ${PRODUCTNAME} がインストールされています。古いバージョンをインストールすることは推奨されません。どうしてもこの旧バージョンをインストールしたい場合は、先に現行バージョンをアンインストールしておく方がよいでしょう。実行したい操作を選択し、「次へ」をクリックして続行します。"
LangString older ${LANG_JAPANESE} "旧"
LangString olderOrUnknownVersionInstalled ${LANG_JAPANESE} "お使いのシステムには、 ${PRODUCTNAME} のバージョン $R4 がインストールされています。インストールする前に、現在のバージョンをアンインストールすることをお勧めします。実行したい操作を選択し、「次へ」をクリックして続行します。"
LangString silentDowngrades ${LANG_JAPANESE} "このインストーラーではダウングレードはできません。サイレントインストーラーを続行できないので、代わりにグラフィカルインターフェースインストーラーを使用してください。$\n"
LangString unableToUninstall ${LANG_JAPANESE} "アンインストールできません。"
LangString uninstallApp ${LANG_JAPANESE} "${PRODUCTNAME} をアンインストールする"
LangString uninstallBeforeInstalling ${LANG_JAPANESE} "インストールする前にアンインストールする"
LangString unknown ${LANG_JAPANESE} "不明"
LangString webview2AbortError ${LANG_JAPANESE} "WebView2 のインストールに失敗しました。 WebView2 がないとアプリは実行できません。インストーラーを再起動してください。"
LangString webview2DownloadError ${LANG_JAPANESE} "エラー: WebView2 のダウンロードに失敗しました - $0"
LangString webview2DownloadSuccess ${LANG_JAPANESE} "WebView2 ブートストラップ が正常にダウンロードされました"
LangString webview2Downloading ${LANG_JAPANESE} "WebView2 ブートストラップ をダウンロード中です..."
LangString webview2InstallError ${LANG_JAPANESE} "エラー: WebView2 のインストールは終了コード $1 で失敗しました。"
LangString webview2InstallSuccess ${LANG_JAPANESE} "WebView2 が正常にインストールされました"
LangString deleteAppData ${LANG_JAPANESE} "アプリデータ消去(設定、キャッシュ等;Agent/会話は保持)"
LangString qwenpawCliPathPageTitle ${LANG_JAPANESE} "Command line"
LangString qwenpawCliPathPageSubtitle ${LANG_JAPANESE} "Choose whether qwenpaw is available in terminals."
LangString qwenpawCliPathPageDescription ${LANG_JAPANESE} "This adds the bundled qwenpaw command to your user PATH. You can change it later by reinstalling or uninstalling QwenPaw Desktop."
LangString qwenpawCliPathCheckbox ${LANG_JAPANESE} "Add qwenpaw to PATH"
LangString qwenpawCliPathAdded ${LANG_JAPANESE} "Added qwenpaw to user PATH"
LangString qwenpawCliPathSkipped ${LANG_JAPANESE} "Skipped adding qwenpaw to user PATH"
LangString qwenpawCliPathMissing ${LANG_JAPANESE} "qwenpaw.exe was not found; skipped PATH update"
LangString qwenpawCliPathUpdateFailed ${LANG_JAPANESE} "Failed to update user PATH"
LangString qwenpawStopProcessesPrompt ${LANG_JAPANESE} "QwenPaw のプロセスが、インストーラーで置き換えるファイルを使用しています。$\n$\nQwenPaw と関連するコマンドラインセッションを終了し、「再試行」をクリックしてください。「キャンセル」で中止します。"
LangString qwenpawRestoreInstallStateFailed ${LANG_JAPANESE} "Native Messaging ランチャーを復元できませんでした。QwenPaw の起動時に再試行します"
@@ -0,0 +1,37 @@
LangString addOrReinstall ${LANG_PORTUGUESEBR} "Adicionar/Reinstalar componentes"
LangString alreadyInstalled ${LANG_PORTUGUESEBR} "Já instalado"
LangString alreadyInstalledLong ${LANG_PORTUGUESEBR} "${PRODUCTNAME} ${VERSION} já está instalado. Selecione a operação que deseja realizar e clique Próximo para continuar."
LangString appRunning ${LANG_PORTUGUESEBR} "{{product_name}} está aberto! Por favor feche a janela dele e tente novamente."
LangString appRunningOkKill ${LANG_PORTUGUESEBR} "{{product_name}} está aberto!$\nClique OK para fechar ele."
LangString chooseMaintenanceOption ${LANG_PORTUGUESEBR} "Escolha a opção de manutenção a realizar."
LangString choowHowToInstall ${LANG_PORTUGUESEBR} "Escolha como deseja instalar ${PRODUCTNAME}."
LangString createDesktop ${LANG_PORTUGUESEBR} "Criar atalho na área de trabalho"
LangString dontUninstall ${LANG_PORTUGUESEBR} "Não desinstalar"
LangString dontUninstallDowngrade ${LANG_PORTUGUESEBR} "Não desinstalar (Instalar versão anterior sem desinstalar está desabilitado nesse instalador)"
LangString failedToKillApp ${LANG_PORTUGUESEBR} "Falha ao fechar {{product_name}}. Por favor feche a janela dele primeiro e tente novamente"
LangString installingWebview2 ${LANG_PORTUGUESEBR} "Instalando WebView2..."
LangString newerVersionInstalled ${LANG_PORTUGUESEBR} "Uma nova versão do ${PRODUCTNAME} já está instalado! Não é recomendado instalar uma versão anterior. Se realmente deseja instalar essa versão antiga, é recomendado desinstalar a versão atual primeirl. Selecione a operação que deseja executare clique Próximo para continuar."
LangString older ${LANG_PORTUGUESEBR} "mais antiga"
LangString olderOrUnknownVersionInstalled ${LANG_PORTUGUESEBR} "Uma versão $R4 do ${PRODUCTNAME} está instalada no seu sistema. É recomendado desinstalar a versão atual antes de prosseguir com a instalação. Selecione a operação que deseja executare clique Próximo para continuar."
LangString silentDowngrades ${LANG_PORTUGUESEBR} "Instalar versão anterior está desabilitado nesse instalador, não foi possível proceder com a instalação silenciosa, por favor use a interface gráfica.$\n"
LangString unableToUninstall ${LANG_PORTUGUESEBR} "Não foi possível instalar!"
LangString uninstallApp ${LANG_PORTUGUESEBR} "Desinstalar ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_PORTUGUESEBR} "Desinstalar antes de instalar"
LangString unknown ${LANG_PORTUGUESEBR} "desconhecida"
LangString webview2AbortError ${LANG_PORTUGUESEBR} "Falha ao instalar WebView2! O programa não pode executar sem ele. Tente reiniciar o instalador."
LangString webview2DownloadError ${LANG_PORTUGUESEBR} "Erro: Falha ao baixar WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_PORTUGUESEBR} "Bootstrapper do WebView2 baixado com sucesso"
LangString webview2Downloading ${LANG_PORTUGUESEBR} "Baixando o Bootstrapper do WebView2..."
LangString webview2InstallError ${LANG_PORTUGUESEBR} "Erro: Instalação do Webview2 falhou com código $1"
LangString webview2InstallSuccess ${LANG_PORTUGUESEBR} "WebView2 instalado com sucesso"
LangString deleteAppData ${LANG_PORTUGUESEBR} "Limpar dados do app (ajustes etc.; mantém agentes/chats)"
LangString qwenpawCliPathPageTitle ${LANG_PORTUGUESEBR} "Command line"
LangString qwenpawCliPathPageSubtitle ${LANG_PORTUGUESEBR} "Choose whether qwenpaw is available in terminals."
LangString qwenpawCliPathPageDescription ${LANG_PORTUGUESEBR} "This adds the bundled qwenpaw command to your user PATH. You can change it later by reinstalling or uninstalling QwenPaw Desktop."
LangString qwenpawCliPathCheckbox ${LANG_PORTUGUESEBR} "Add qwenpaw to PATH"
LangString qwenpawCliPathAdded ${LANG_PORTUGUESEBR} "Added qwenpaw to user PATH"
LangString qwenpawCliPathSkipped ${LANG_PORTUGUESEBR} "Skipped adding qwenpaw to user PATH"
LangString qwenpawCliPathMissing ${LANG_PORTUGUESEBR} "qwenpaw.exe was not found; skipped PATH update"
LangString qwenpawCliPathUpdateFailed ${LANG_PORTUGUESEBR} "Failed to update user PATH"
LangString qwenpawStopProcessesPrompt ${LANG_PORTUGUESEBR} "Processos do QwenPaw ainda usam arquivos que o instalador precisa substituir.$\n$\nFeche o QwenPaw e as sessões de linha de comando relacionadas e clique em Repetir. Clique em Cancelar para abortar."
LangString qwenpawRestoreInstallStateFailed ${LANG_PORTUGUESEBR} "Não foi possível restaurar o inicializador do Native Messaging; o QwenPaw tentará novamente na inicialização"
@@ -0,0 +1,37 @@
LangString addOrReinstall ${LANG_RUSSIAN} "Добавить/Переустановить компоненты"
LangString alreadyInstalled ${LANG_RUSSIAN} "Уже установлено"
LangString alreadyInstalledLong ${LANG_RUSSIAN} "${PRODUCTNAME} ${VERSION} уже установлен. Выберите действие, которое вы хотите выполнить и нажмите Далее для продолжения."
LangString appRunning ${LANG_RUSSIAN} "{{product_name}} запущен! Пожалуйста, закройте приложение и попробуйте еще раз."
LangString appRunningOkKill ${LANG_RUSSIAN} "{{product_name}} запущен!$\nНажмите OK чтобы закрыть приложение"
LangString chooseMaintenanceOption ${LANG_RUSSIAN} "Выберите действие, которое вы хотите выполнить."
LangString choowHowToInstall ${LANG_RUSSIAN} "Выберите, как вы хотите установить ${PRODUCTNAME}."
LangString createDesktop ${LANG_RUSSIAN} "Добавить ярлык на рабочий стол"
LangString dontUninstall ${LANG_RUSSIAN} "Не удалять"
LangString dontUninstallDowngrade ${LANG_RUSSIAN} "Не удалять (Установка более ранних версий без удаления невозможна)"
LangString failedToKillApp ${LANG_RUSSIAN} "Не удалось закрыть {{product_name}}. Пожалуйста, закройте приложение и попробуйте еще раз"
LangString installingWebview2 ${LANG_RUSSIAN} "Установка WebView2..."
LangString newerVersionInstalled ${LANG_RUSSIAN} "Более новая версия ${PRODUCTNAME} уже установлена! Не рекомендуется устанавливать более раннюю версию. Если вы действительно хотите установить эту версию, рекомендуется сначала удалить текущую. Выберите действие, которое вы хотите выполнить и нажмите Далее для продолжения."
LangString older ${LANG_RUSSIAN} "Более ранняя"
LangString olderOrUnknownVersionInstalled ${LANG_RUSSIAN} "$R4 версия ${PRODUCTNAME} уже установлена в вашей системе. Рекомендуется удалить текущую версию перед установкой. Выберите действие, которое вы хотите выполнить и нажмите Далее для продолжения."
LangString silentDowngrades ${LANG_RUSSIAN} "Установка более ранних версий в фоне невозможна, используйте установщик.$\n"
LangString unableToUninstall ${LANG_RUSSIAN} "Не удалось удалить!"
LangString uninstallApp ${LANG_RUSSIAN} "Удалить ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_RUSSIAN} "Удалить перед установкой"
LangString unknown ${LANG_RUSSIAN} "Неизвестная"
LangString webview2AbortError ${LANG_RUSSIAN} "Не удалось установить WebView2! Приложение не может работать без него. Попробуйте перезапустить установщик."
LangString webview2DownloadError ${LANG_RUSSIAN} "Ошибка: Не удалось загрузить WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_RUSSIAN} "WebView2 успешно загружен"
LangString webview2Downloading ${LANG_RUSSIAN} "Загрузка WebView2..."
LangString webview2InstallError ${LANG_RUSSIAN} "Ошибка: Не удалось установить WebView2, код выхода: $1"
LangString webview2InstallSuccess ${LANG_RUSSIAN} "WebView2 успешно установлен"
LangString deleteAppData ${LANG_RUSSIAN} "Удалить данные приложения (настр. и др.; не агенты/чаты)"
LangString qwenpawCliPathPageTitle ${LANG_RUSSIAN} "Command line"
LangString qwenpawCliPathPageSubtitle ${LANG_RUSSIAN} "Choose whether qwenpaw is available in terminals."
LangString qwenpawCliPathPageDescription ${LANG_RUSSIAN} "This adds the bundled qwenpaw command to your user PATH. You can change it later by reinstalling or uninstalling QwenPaw Desktop."
LangString qwenpawCliPathCheckbox ${LANG_RUSSIAN} "Add qwenpaw to PATH"
LangString qwenpawCliPathAdded ${LANG_RUSSIAN} "Added qwenpaw to user PATH"
LangString qwenpawCliPathSkipped ${LANG_RUSSIAN} "Skipped adding qwenpaw to user PATH"
LangString qwenpawCliPathMissing ${LANG_RUSSIAN} "qwenpaw.exe was not found; skipped PATH update"
LangString qwenpawCliPathUpdateFailed ${LANG_RUSSIAN} "Failed to update user PATH"
LangString qwenpawStopProcessesPrompt ${LANG_RUSSIAN} "Процессы QwenPaw всё ещё используют файлы, которые установщику нужно заменить.$\n$\nЗакройте QwenPaw и связанные сеансы командной строки, затем нажмите «Повторить». Нажмите «Отмена», чтобы прервать установку."
LangString qwenpawRestoreInstallStateFailed ${LANG_RUSSIAN} "Не удалось восстановить средство запуска Native Messaging; QwenPaw повторит попытку при запуске"
@@ -0,0 +1,37 @@
LangString addOrReinstall ${LANG_SIMPCHINESE} "添加/重新安装组件"
LangString alreadyInstalled ${LANG_SIMPCHINESE} "已安装"
LangString alreadyInstalledLong ${LANG_SIMPCHINESE} "${PRODUCTNAME} ${VERSION} 已经安装了。选择你想要执行的操作后点击下一步以继续。"
LangString appRunning ${LANG_SIMPCHINESE} "{{product_name}} 正在运行!请关闭后再试。"
LangString appRunningOkKill ${LANG_SIMPCHINESE} "{{product_name}} 正在运行!$\n点击确定以终止运行。"
LangString chooseMaintenanceOption ${LANG_SIMPCHINESE} "选择要执行的维护操作。"
LangString choowHowToInstall ${LANG_SIMPCHINESE} "选择你想要安装 ${PRODUCTNAME} 的方式。"
LangString createDesktop ${LANG_SIMPCHINESE} "创建桌面快捷方式"
LangString dontUninstall ${LANG_SIMPCHINESE} "请勿卸载"
LangString dontUninstallDowngrade ${LANG_SIMPCHINESE} "请勿卸载(此安装程序禁止未卸载就进行版本降级的操作)"
LangString failedToKillApp ${LANG_SIMPCHINESE} "无法终止 {{product_name}}。请关闭后再试。"
LangString installingWebview2 ${LANG_SIMPCHINESE} "正在安装 WebView2..."
LangString newerVersionInstalled ${LANG_SIMPCHINESE} "有一个更新版本的 ${PRODUCTNAME} 已经安装了!不推荐你安装旧的版本。如果你真的想要安装这个旧的版本,推荐先卸载当前版本。选择你想要执行的操作后点击下一步以继续。"
LangString older ${LANG_SIMPCHINESE} "旧的"
LangString olderOrUnknownVersionInstalled ${LANG_SIMPCHINESE} "系统中已存在版本为 $R4 的 ${PRODUCTNAME}。推荐先卸载当前版本后再进行安装。选择你想要执行的操作后点击下一步以继续。"
LangString silentDowngrades ${LANG_SIMPCHINESE} "降级操作在此安装程序上已禁用,无法进行安静安装,请使用图形操作界面。$\n"
LangString unableToUninstall ${LANG_SIMPCHINESE} "无法卸载!"
LangString uninstallApp ${LANG_SIMPCHINESE} "卸载 ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_SIMPCHINESE} "安装前卸载"
LangString unknown ${LANG_SIMPCHINESE} "未知"
LangString webview2AbortError ${LANG_SIMPCHINESE} "无法安装 WebView2!没有它,此应用就无法运行。尝试重启安装程序。"
LangString webview2DownloadError ${LANG_SIMPCHINESE} "错误:无法下载 WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_SIMPCHINESE} "WebView2 引导程序下载成功"
LangString webview2Downloading ${LANG_SIMPCHINESE} "正在下载 WebView2 引导程序..."
LangString webview2InstallError ${LANG_SIMPCHINESE} "错误:安装 WebView2 时失败,错误代码:$1"
LangString webview2InstallSuccess ${LANG_SIMPCHINESE} "成功安装 WebView2"
LangString deleteAppData ${LANG_SIMPCHINESE} "清除应用数据(如设置、草稿、登录、缓存等;保留 Agent/会话)"
LangString qwenpawCliPathPageTitle ${LANG_SIMPCHINESE} "命令行"
LangString qwenpawCliPathPageSubtitle ${LANG_SIMPCHINESE} "选择是否让终端可以直接使用 qwenpaw。"
LangString qwenpawCliPathPageDescription ${LANG_SIMPCHINESE} "这会把随包提供的 qwenpaw 命令加入你的用户 PATH。之后可通过重新安装或卸载 QwenPaw Desktop 变更。"
LangString qwenpawCliPathCheckbox ${LANG_SIMPCHINESE} "将 qwenpaw 添加到 PATH"
LangString qwenpawCliPathAdded ${LANG_SIMPCHINESE} "已将 qwenpaw 添加到用户 PATH"
LangString qwenpawCliPathSkipped ${LANG_SIMPCHINESE} "已跳过添加 qwenpaw 到用户 PATH"
LangString qwenpawCliPathMissing ${LANG_SIMPCHINESE} "未找到 qwenpaw.exe,已跳过 PATH 更新"
LangString qwenpawCliPathUpdateFailed ${LANG_SIMPCHINESE} "更新用户 PATH 失败"
LangString qwenpawStopProcessesPrompt ${LANG_SIMPCHINESE} "QwenPaw 进程仍在占用安装程序需要替换的文件。$\n$\n请退出 QwenPaw 并关闭相关命令行会话,然后点击“重试”;点击“取消”将中止安装。"
LangString qwenpawRestoreInstallStateFailed ${LANG_SIMPCHINESE} "无法恢复 Native Messaging 启动器;QwenPaw 将在下次启动时重试恢复"
@@ -0,0 +1,278 @@
param(
[Parameter(Mandatory = $true)]
[string]$InstallDir,
[ValidateSet("Prepare", "Restore")]
[string]$Action = "Prepare",
[int]$NsisProcessId = 0
)
# Prepare a recognized QwenPaw installation for NSIS replacement. The script
# intentionally uses only cmdlets, operators, and core type methods so it also
# works under WDAC/AppLocker ConstrainedLanguage mode.
$ErrorActionPreference = "Stop"
$gateMarker = "QWENPAW_INSTALL_MAINTENANCE"
$launcher = Join-Path $env:USERPROFILE ".qwenpaw\bin\qwenpaw-nm-host.bat"
$launcherBackup = "$launcher.qwenpaw-maintenance"
function Get-NormalizedPath {
param([string]$Path)
if (-not $Path) {
return ""
}
if ($Path.StartsWith("\\?\UNC\")) {
return "\\" + $Path.Substring(8)
}
if ($Path.StartsWith("\\?\")) {
return $Path.Substring(4)
}
return $Path
}
function Test-PathBelowRoot {
param(
[string]$Path,
[string]$Root
)
if (-not $Path -or $Path.Length -le $Root.Length) {
return $false
}
return (
$Path.Substring(0, $Root.Length) -ieq $Root -and
$Path.Substring($Root.Length, 1) -eq "\"
)
}
function Test-IsMaintenanceStub {
if (-not (Test-Path -LiteralPath $launcher -PathType Leaf)) {
return $false
}
return (Get-Content -LiteralPath $launcher -Raw).Contains($gateMarker)
}
function Test-LauncherTargetsRoot {
param([string]$Root)
$needles = @(
($Root + "\").ToLowerInvariant(),
($Root.Replace("%", "%%") + "\").ToLowerInvariant()
) | Sort-Object -Unique
foreach ($path in @($launcher, $launcherBackup)) {
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) {
continue
}
$content = Get-Content -LiteralPath $path -Raw
$lowerContent = $content.ToLowerInvariant()
foreach ($needle in $needles) {
if ($lowerContent.Contains($needle)) {
return $true
}
}
}
return $false
}
function Restore-NativeHostLauncher {
param([string]$Root)
if (-not $Root -or -not (Test-LauncherTargetsRoot -Root $Root)) {
return
}
if (-not (Test-Path -LiteralPath $launcherBackup -PathType Leaf)) {
return
}
if ((Test-Path -LiteralPath $launcher -PathType Leaf) -and
-not (Test-IsMaintenanceStub)) {
Remove-Item -LiteralPath $launcherBackup -Force
return
}
if (Test-Path -LiteralPath $launcher -PathType Leaf) {
Remove-Item -LiteralPath $launcher -Force
}
Move-Item -LiteralPath $launcherBackup -Destination $launcher -Force
}
function Enable-NativeHostGate {
param([string]$Root)
if (-not (Test-LauncherTargetsRoot -Root $Root)) {
return
}
if (Test-Path -LiteralPath $launcherBackup -PathType Leaf) {
if (-not (Test-Path -LiteralPath $launcher -PathType Leaf)) {
return
}
if (Test-IsMaintenanceStub) {
return
}
Remove-Item -LiteralPath $launcherBackup -Force
}
if (-not (Test-Path -LiteralPath $launcher -PathType Leaf)) {
return
}
Move-Item -LiteralPath $launcher -Destination $launcherBackup -Force
try {
Set-Content -LiteralPath $launcher -Encoding Ascii -Value @(
"@echo off",
"rem $gateMarker",
"exit /b 0"
)
} catch {
Move-Item -LiteralPath $launcherBackup -Destination $launcher -Force
throw
}
}
function Get-InstallRoot {
if (-not (Test-Path -LiteralPath $InstallDir -PathType Container)) {
return $null
}
$item = Get-Item -LiteralPath $InstallDir
return (Get-NormalizedPath -Path $item.FullName).TrimEnd("\")
}
function Test-IsQwenPawInstall {
param([string]$Root)
if (-not $Root) {
return $false
}
if (Test-LauncherTargetsRoot -Root $Root) {
return $true
}
$evidence = 0
foreach ($path in @(
(Join-Path $Root "qwenpaw-desktop.exe"),
(Join-Path $Root "binaries\qwenpaw-backend\qwenpaw-backend.exe"),
(Join-Path $Root "binaries\python-runtime\python\python.exe")
)) {
if (Test-Path -LiteralPath $path -PathType Leaf) {
$evidence++
}
}
return $evidence -ge 2
}
function Get-ScopedProcesses {
param(
[string]$Root,
[int[]]$ExcludedProcessIds = @()
)
$result = foreach ($process in @(Get-CimInstance Win32_Process)) {
if ($ExcludedProcessIds -contains $process.ProcessId) {
continue
}
$path = Get-NormalizedPath -Path "$($process.ExecutablePath)"
if (Test-PathBelowRoot -Path $path -Root $Root) {
@{
Name = "$($process.Name)"
ProcessId = $process.ProcessId
CommandLine = "$($process.CommandLine)"
ExecutablePath = $path
}
}
}
return @($result)
}
function Get-NsisProcessIds {
param([int]$ProcessId)
if ($ProcessId -le 0) {
return @()
}
$process = Get-CimInstance Win32_Process -Filter "ProcessId = $ProcessId"
return @($ProcessId, $process.ParentProcessId) |
Where-Object { $_ -gt 0 } |
Sort-Object -Unique
}
function Test-IsAutomaticProcess {
param(
[object]$Process,
[string]$Root
)
$relative = $Process.ExecutablePath.Substring($Root.Length).TrimStart("\")
if ($relative -ieq "qwenpaw-desktop.exe" -or
$relative -ieq "binaries\qwenpaw-backend\qwenpaw-backend.exe" -or
$relative -ieq "binaries\qwenpaw-backend\qwenpaw.exe") {
return $true
}
$isBundledPython = (
$relative -ieq "binaries\python-runtime\python\python.exe" -or
$relative -ieq "binaries\python-runtime\python\pythonw.exe"
)
if ($isBundledPython -and
$Process.CommandLine.ToLowerInvariant().Contains("qwenpaw-nm-host.py")) {
return $true
}
return $false
}
function Stop-ProcessRecords {
param([object[]]$Processes)
$ids = @($Processes | ForEach-Object { $_.ProcessId } | Sort-Object -Unique)
foreach ($processId in $ids) {
Stop-Process -Id $processId -Force -ErrorAction SilentlyContinue
}
if ($ids.Count -gt 0) {
Wait-Process -Id $ids -Timeout 8 -ErrorAction SilentlyContinue
}
}
function Write-ProcessList {
param(
[object[]]$Processes,
[string]$Root
)
foreach ($process in @($Processes | Sort-Object ExecutablePath, ProcessId)) {
$relative = $process.ExecutablePath.Substring($Root.Length).TrimStart("\")
Write-Output "$($process.Name) (PID $($process.ProcessId)): $relative"
}
}
try {
if ($Action -eq "Restore") {
$requestedRoot = (Get-NormalizedPath -Path $InstallDir).TrimEnd("\")
Restore-NativeHostLauncher -Root $requestedRoot
exit 0
}
$root = Get-InstallRoot
if (-not (Test-IsQwenPawInstall -Root $root)) {
exit 0
}
$rootItem = Get-Item -LiteralPath $InstallDir
if ("$($rootItem.Attributes)" -match "ReparsePoint") {
throw "Cannot safely manage processes for a reparse-point installation."
}
Enable-NativeHostGate -Root $root
$nsisProcessIds = Get-NsisProcessIds -ProcessId $NsisProcessId
$scoped = Get-ScopedProcesses -Root $root -ExcludedProcessIds $nsisProcessIds
$automatic = @(
$scoped | Where-Object {
Test-IsAutomaticProcess -Process $_ -Root $root
}
)
Stop-ProcessRecords -Processes $automatic
$remaining = Get-ScopedProcesses -Root $root -ExcludedProcessIds $nsisProcessIds
if ($remaining.Count -gt 0) {
Write-Output "Close these processes before continuing:"
Write-ProcessList -Processes $remaining -Root $root
exit 1
}
exit 0
} catch {
Write-Output $_.Exception.Message
exit 1
}
@@ -0,0 +1,26 @@
@echo off
setlocal
chcp 65001 >nul
cd /d "%~dp0"
if not defined QWENPAW_LOG_LEVEL set "QWENPAW_LOG_LEVEL=debug"
set "QWENPAW_DESKTOP_DEBUG=1"
set "RUST_BACKTRACE=1"
if not defined WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS set "WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9222"
set "QWENPAW_DEBUG_DIR=%QWENPAW_WORKING_DIR%"
if not defined QWENPAW_DEBUG_DIR if defined COPAW_WORKING_DIR set "QWENPAW_DEBUG_DIR=%COPAW_WORKING_DIR%"
if not defined QWENPAW_DEBUG_DIR if exist "%USERPROFILE%\.copaw" set "QWENPAW_DEBUG_DIR=%USERPROFILE%\.copaw"
if not defined QWENPAW_DEBUG_DIR set "QWENPAW_DEBUG_DIR=%USERPROFILE%\.qwenpaw"
set "QWENPAW_BACKEND_LOGS=%QWENPAW_DEBUG_DIR%\desktop.log;%QWENPAW_DEBUG_DIR%\qwenpaw.log"
set "QWENPAW_SHELL_LOGS=%LOCALAPPDATA%\io.agentscope.qwenpaw.desktop\logs\qwenpaw-desktop.log;%LOCALAPPDATA%\com.qwenpaw.desktop\logs\qwenpaw-desktop.log"
echo ====================================
echo QwenPaw Desktop - Debug Mode
echo ====================================
echo Log level: %QWENPAW_LOG_LEVEL%
echo Working directory: %QWENPAW_DEBUG_DIR%
echo Press Ctrl+C to stop watching logs.
echo.
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%~dp0qwenpaw-desktop-debug.ps1"
@@ -0,0 +1,96 @@
$ErrorActionPreference = "Continue"
$utf8 = [System.Text.UTF8Encoding]::new($false)
[Console]::InputEncoding = $utf8
[Console]::OutputEncoding = $utf8
$OutputEncoding = $utf8
$desktopExe = Join-Path $PSScriptRoot "qwenpaw-desktop.exe"
$stdoutLog = Join-Path $env:TEMP "qwenpaw-desktop-debug.stdout.log"
$stderrLog = Join-Path $env:TEMP "qwenpaw-desktop-debug.stderr.log"
Remove-Item -LiteralPath $stdoutLog, $stderrLog -ErrorAction SilentlyContinue
function Show-DesktopOutput {
foreach ($item in @(@("stdout", $stdoutLog), @("stderr", $stderrLog))) {
if (Test-Path -LiteralPath $item[1]) {
$text = Get-Content -Encoding UTF8 -LiteralPath $item[1] -Raw
if ($text) {
Write-Host ""
Write-Host "==> desktop $($item[0]) <=="
Write-Host $text
}
}
}
}
function Open-Log($label, $paths) {
$path = $paths | Where-Object { $_ -and (Test-Path -LiteralPath $_) } | Select-Object -First 1
if (-not $path) {
return $null
}
try {
$stream = [System.IO.File]::Open($path, "Open", "Read", "ReadWrite")
$reader = [System.IO.StreamReader]::new($stream, $utf8, $true)
while ($reader.ReadLine() -ne $null) {}
Write-Host ""
Write-Host "==> ${label}: $path <=="
[pscustomobject]@{ Label = $label; Reader = $reader; Stream = $stream }
} catch {
Write-Host "Failed to open ${label} log: $path"
Write-Host $_.Exception.Message
$null
}
}
$desktop = Get-Process -Name "qwenpaw-desktop" -ErrorAction SilentlyContinue |
Where-Object { $_.Path -eq $desktopExe } |
Select-Object -First 1
if ($desktop) {
Write-Host "Existing QwenPaw Desktop process detected; quit it from the tray before reproducing startup issues."
$desktop = $null
} else {
$desktop = Start-Process -FilePath $desktopExe `
-WorkingDirectory $PSScriptRoot `
-RedirectStandardOutput $stdoutLog `
-RedirectStandardError $stderrLog `
-PassThru
}
$specs = @(
[pscustomobject]@{ Label = "backend"; Paths = $env:QWENPAW_BACKEND_LOGS -split ";" },
[pscustomobject]@{ Label = "shell"; Paths = $env:QWENPAW_SHELL_LOGS -split ";" }
)
$states = @()
try {
Write-Host "Watching logs. Press Ctrl+C to stop."
while ($true) {
foreach ($spec in $specs) {
if ($states.Label -notcontains $spec.Label) {
$state = Open-Log $spec.Label $spec.Paths
if ($state) {
$states += $state
}
}
}
foreach ($state in $states) {
while (($line = $state.Reader.ReadLine()) -ne $null) {
Write-Host "[$($state.Label)] $line"
}
}
if ($desktop) {
$desktop.Refresh()
if ($desktop.HasExited) {
Write-Host "QwenPaw Desktop exited with code $($desktop.ExitCode)."
Show-DesktopOutput
Read-Host "Press Enter to exit"
break
}
}
Start-Sleep -Milliseconds 500
}
} finally {
foreach ($state in $states) {
$state.Reader.Dispose()
$state.Stream.Dispose()
}
}
@@ -0,0 +1,103 @@
param(
[Parameter(Mandatory = $true)]
[ValidateSet("Add", "Remove")]
[string] $Action,
[Parameter(Mandatory = $true)]
[string] $Path
)
$ErrorActionPreference = "Stop"
function Normalize-PathEntry {
param([string] $Value)
return $Value.Trim().TrimEnd('\', '/')
}
function Broadcast-EnvironmentChange {
if (-not ("Win32.NativeMethods" -as [type])) {
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
namespace Win32 {
public static class NativeMethods {
[DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static extern IntPtr SendMessageTimeout(
IntPtr hWnd,
uint Msg,
UIntPtr wParam,
string lParam,
uint fuFlags,
uint uTimeout,
out UIntPtr lpdwResult);
}
}
"@
}
$result = [UIntPtr]::Zero
[void] [Win32.NativeMethods]::SendMessageTimeout(
[IntPtr] 0xffff,
0x001a,
[UIntPtr]::Zero,
"Environment",
0x0002,
5000,
[ref] $result
)
}
$target = Normalize-PathEntry $Path
if (-not $target) {
exit 0
}
$environment = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey(
"Environment",
$true
)
if ($null -eq $environment) {
$environment = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey(
"Environment"
)
}
$current = [string] ($environment.GetValue("Path", "", "DoNotExpandEnvironmentNames"))
$valueKind = [Microsoft.Win32.RegistryValueKind]::ExpandString
try {
$valueKind = $environment.GetValueKind("Path")
} catch {
$valueKind = [Microsoft.Win32.RegistryValueKind]::ExpandString
}
$entries = @()
if ($current) {
$entries = $current -split ';' |
ForEach-Object { Normalize-PathEntry $_ } |
Where-Object { $_ }
}
$entries = @(
$entries |
Where-Object {
-not [string]::Equals(
$_,
$target,
[StringComparison]::OrdinalIgnoreCase
)
}
)
if ($Action -eq "Add") {
$entries += $target
}
if ($entries.Count -eq 0) {
$environment.DeleteValue("Path", $false)
} else {
$environment.SetValue("Path", ($entries -join ';'), $valueKind)
}
$environment.Close()
Broadcast-EnvironmentChange
@@ -0,0 +1,4 @@
[[permission]]
identifier = "backend-download"
description = "Allows the frontend to save files streamed from the local backend."
commands.allow = ["download_backend_file"]
@@ -0,0 +1,4 @@
[[permission]]
identifier = "backend"
description = "Allows the bootstrap page to monitor and restart the bundled backend sidecar."
commands.allow = ["backend_port", "backend_startup_error", "restart_backend"]
Loaded 100 of 4652 files, more files were not shown because too many files have changed in this diff. Show more