xiaohongshu-matrices-cli 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xiaohongshu_matrices_cli-0.9.0/.gitattributes +12 -0
- xiaohongshu_matrices_cli-0.9.0/.github/workflows/ci.yml +30 -0
- xiaohongshu_matrices_cli-0.9.0/.github/workflows/publish.yml +38 -0
- xiaohongshu_matrices_cli-0.9.0/.gitignore +43 -0
- xiaohongshu_matrices_cli-0.9.0/AI_OPERATIONS.md +143 -0
- xiaohongshu_matrices_cli-0.9.0/CAPABILITIES.md +66 -0
- xiaohongshu_matrices_cli-0.9.0/DASHBOARD.md +90 -0
- xiaohongshu_matrices_cli-0.9.0/INTERACTION_RULES.md +31 -0
- xiaohongshu_matrices_cli-0.9.0/LICENSE +201 -0
- xiaohongshu_matrices_cli-0.9.0/NOTICE +21 -0
- xiaohongshu_matrices_cli-0.9.0/PKG-INFO +599 -0
- xiaohongshu_matrices_cli-0.9.0/PLATFORMS.md +62 -0
- xiaohongshu_matrices_cli-0.9.0/README.md +560 -0
- xiaohongshu_matrices_cli-0.9.0/SCHEMA.md +30 -0
- xiaohongshu_matrices_cli-0.9.0/SKILL.md +249 -0
- xiaohongshu_matrices_cli-0.9.0/UI.md +112 -0
- xiaohongshu_matrices_cli-0.9.0/orchestrator_goals.example.json +21 -0
- xiaohongshu_matrices_cli-0.9.0/pyproject.toml +72 -0
- xiaohongshu_matrices_cli-0.9.0/scripts/install.ps1 +46 -0
- xiaohongshu_matrices_cli-0.9.0/scripts/install.sh +51 -0
- xiaohongshu_matrices_cli-0.9.0/scripts/install_camoufox_zip.py +119 -0
- xiaohongshu_matrices_cli-0.9.0/scripts/sync-upstream.sh +22 -0
- xiaohongshu_matrices_cli-0.9.0/tests/__init__.py +0 -0
- xiaohongshu_matrices_cli-0.9.0/tests/conftest.py +5 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_account_bridge.py +129 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_anti_detection.py +103 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_cli.py +595 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_client.py +278 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_cookies.py +190 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_creator.py +114 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_creator_signing.py +77 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_app.py +24 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_collector.py +109 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_db.py +41 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_extension_pages.py +19 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_importer.py +43 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_materials.py +101 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_operations.py +221 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_p0.py +182 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_publisher.py +227 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_dashboard_utils.py +16 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_formatter.py +62 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_integration.py +443 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_orchestrator.py +253 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_qr_login.py +287 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_signing.py +82 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_smoke.py +212 -0
- xiaohongshu_matrices_cli-0.9.0/tests/test_topics.py +64 -0
- xiaohongshu_matrices_cli-0.9.0/uv.lock +1949 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/LICENSE +21 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/README.md +306 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/__init__.py +15 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/__main__.py +1050 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/__version__.py +19 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/_warnings.py +44 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/addons.py +92 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/async_api.py +196 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/browserforge.yml +68 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/exceptions.py +196 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/fingerprint-presets-v150.json +16513 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/fingerprint-presets.json +6033 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/fingerprints.py +742 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/fonts.json +11 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/geolocation.py +264 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/gui/__init__.py +16 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/gui/assets/SegUIVar.ttf +0 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/gui/assets/icon.ico +0 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/gui/assets/segmdl2.ttf +0 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/gui/backend.py +1250 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/gui/qml/main.qml +1400 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/ip.py +120 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/launchServer.js +51 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/locales.py +284 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/multiversion.py +545 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/pkgman.py +912 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/py.typed +1 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/repos.yml +68 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/server.py +74 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/setup.cfg +3 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/sync_api.py +188 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/territoryInfo.xml +2024 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/utils.py +787 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/virtdisplay.py +137 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/voices.json +250 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/warnings.yml +51 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/webgl/__init__.py +3 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/camoufox/webgl/sample.py +108 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/publish.sh +14 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/pyproject.toml +55 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/tests/test_server.py +104 -0
- xiaohongshu_matrices_cli-0.9.0/vendor/camoufox-python/tests/test_virtdisplay.py +131 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/__init__.py +8 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/__main__.py +6 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/account_bridge.py +143 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/cli.py +153 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/client.py +264 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/client_mixins.py +786 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/command_normalizers.py +112 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/__init__.py +0 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/_common.py +116 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/auth.py +231 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/creator.py +173 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/interactions.py +120 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/notifications.py +60 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/reading.py +304 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/commands/social.py +112 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/constants.py +33 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/cookies.py +512 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/creator_signing.py +73 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/__init__.py +5 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/__main__.py +24 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/ai.py +291 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/analytics.py +142 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/api_health.py +100 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/app.py +434 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/browser.py +389 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/collector.py +323 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/config.py +49 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/db.py +234 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/engagement.py +364 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/exporter.py +120 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/extension.py +368 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/governance.py +80 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/image_gen.py +140 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/importer.py +122 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/materials.py +95 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/migrate.py +54 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/operation_queue.py +61 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/operations.py +542 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/orchestrator.py +536 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/persistence.py +339 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/publisher.py +476 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/queue.py +143 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/rate_limit.py +24 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/research_extension.py +124 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/static/style.css +1 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/accounts.html +8 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/analytics.html +111 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/api_health.html +76 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/base.html +30 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/dashboard.html +18 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/engagement.html +29 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/library.html +4 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/materials.html +15 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/personas.html +22 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/publish.html +8 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/research.html +17 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/rules.html +11 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/templates/searches.html +12 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/utils.py +81 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/dashboard/vision.py +124 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/error_codes.py +39 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/exceptions.py +64 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/formatter.py +68 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/formatter_normalizers.py +199 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/formatter_renderers.py +313 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/formatter_utils.py +192 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/html_parser.py +73 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/note_refs.py +60 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/py.typed +0 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/qr_login.py +550 -0
- xiaohongshu_matrices_cli-0.9.0/xhs_cli/signing.py +93 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- run: pip install uv
|
|
25
|
+
|
|
26
|
+
- run: uv sync --extra dev
|
|
27
|
+
|
|
28
|
+
- run: uv run ruff check . --exclude vendor
|
|
29
|
+
|
|
30
|
+
- run: uv run pytest -m "not smoke" --ignore=tests/test_integration.py
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
verify:
|
|
11
|
+
uses: ./.github/workflows/ci.yml
|
|
12
|
+
|
|
13
|
+
publish:
|
|
14
|
+
needs: verify
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
# Trusted Publishing (OIDC) — no API token required.
|
|
17
|
+
# Configure once on PyPI: project "xiaohongshu-matrices-cli" →
|
|
18
|
+
# Publishing → Add trusted publisher (GitHub, owner alanl1234,
|
|
19
|
+
# repo xiaohongshu-matrices-cli, workflow publish.yml, environment pypi).
|
|
20
|
+
environment: pypi
|
|
21
|
+
permissions:
|
|
22
|
+
id-token: write
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
- name: Setup uv
|
|
32
|
+
uses: astral-sh/setup-uv@v6
|
|
33
|
+
|
|
34
|
+
- name: Build package
|
|
35
|
+
run: uv build
|
|
36
|
+
|
|
37
|
+
- name: Publish to PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
.venv/
|
|
4
|
+
dist/
|
|
5
|
+
*.egg-info/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.playwright-mcp/
|
|
10
|
+
xhs_login_page.png
|
|
11
|
+
|
|
12
|
+
# ── Open-source hygiene ──
|
|
13
|
+
.pytest-p0-desktop/
|
|
14
|
+
.pytest-tmp/
|
|
15
|
+
orchestrator_goals.json
|
|
16
|
+
.coverage
|
|
17
|
+
*.log
|
|
18
|
+
|
|
19
|
+
# ── Runtime artifacts (never commit) ──
|
|
20
|
+
data/
|
|
21
|
+
*.db
|
|
22
|
+
*.sqlite
|
|
23
|
+
*.sqlite3
|
|
24
|
+
.DS_Store
|
|
25
|
+
Thumbs.db
|
|
26
|
+
|
|
27
|
+
# ── Local / agent artifacts (never commit) ──
|
|
28
|
+
.workbuddy/
|
|
29
|
+
cookies.backup.json
|
|
30
|
+
|
|
31
|
+
# ── AI research / local analysis products (local data, never commit) ──
|
|
32
|
+
# 账号编号、源账号、风格绑定、图片指令词等均为本地数据,禁止入库。
|
|
33
|
+
AI_RESEARCH_PLAN.md
|
|
34
|
+
PROJECT_REVIEW.md
|
|
35
|
+
wordcard_*.md
|
|
36
|
+
erchuang_*.md
|
|
37
|
+
template_analysis_*.md
|
|
38
|
+
note_*.json
|
|
39
|
+
elegant_publish_image.jpg
|
|
40
|
+
|
|
41
|
+
# ── Build / packaging artifacts (regenerable) ──
|
|
42
|
+
build/
|
|
43
|
+
.buildenv/
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# AI 素材研究与互动运营扩展
|
|
2
|
+
|
|
3
|
+
面向多账号矩阵运营:在统一治理下,把自然语言目标拆解为检索子任务,并跨账号编排发布与互动。
|
|
4
|
+
|
|
5
|
+
## 启动
|
|
6
|
+
|
|
7
|
+
在项目根目录下设置环境变量后启动后台。Windows 使用 `$env:VAR="值"`,macOS / Linux 使用 `export VAR=值`。
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 方式一:依赖同步完成后(uv sync 之后)
|
|
11
|
+
xhs-dashboard
|
|
12
|
+
|
|
13
|
+
# 方式二:使用项目虚拟环境
|
|
14
|
+
# macOS / Linux: .venv/bin/xhs-dashboard
|
|
15
|
+
# Windows: .venv\Scripts\xhs-dashboard
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
export OPENAI_API_KEY="你的 API Key"
|
|
20
|
+
export XHS_AGENT_TOKEN="自行生成的长随机字符串"
|
|
21
|
+
export XHS_ENGAGEMENT_MODE="shadow" # shadow / inbound / reviewed
|
|
22
|
+
xhs-dashboard
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
后台默认地址为 `http://127.0.0.1:8765`,仅监听本机。Camoufox 不需要一直打开;绑定、同步或执行任务时会按账号打开,完成后关闭,后台进程需保持运行。
|
|
26
|
+
|
|
27
|
+
模型均可通过环境变量替换:
|
|
28
|
+
|
|
29
|
+
默认 `shadow` 只生成和审核,不执行发送;第二阶段改为 `inbound`,只开放自有评论回复和入站私信;完成专用测试账号验收后才能人工改为 `reviewed`。
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
export XHS_AI_FAST_MODEL="低成本分类模型"
|
|
33
|
+
export XHS_AI_BALANCED_MODEL="日常研究和起草模型"
|
|
34
|
+
export XHS_AI_QUALITY_MODEL="复杂研究升级模型"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
API Key 和 Agent Token 不写入 SQLite、任务包或日志。
|
|
38
|
+
|
|
39
|
+
## 推荐使用顺序
|
|
40
|
+
|
|
41
|
+
1. 在“账号人设”中建立真实账号的人设版本。
|
|
42
|
+
2. 在“AI 研究”中把自然语言目标拆成多个检索角度(每个角度带检索词与筛选标准),完成后每个角度生成一个采集任务。
|
|
43
|
+
3. 在“授权素材与二创”中登记来源。只有 `owned` 或 `authorized` 可以进入二创。
|
|
44
|
+
4. 在线下完成二创,成品目录放置 `post.md` 和本地图片,再人工声明使用权并导入。
|
|
45
|
+
5. 在“互动工作台”登记不含消息正文的会话索引,创建评论或私信任务。
|
|
46
|
+
6. 每条任务先批准,再单独点击执行。批准与执行是两个不同动作。
|
|
47
|
+
|
|
48
|
+
## Agent Gateway
|
|
49
|
+
|
|
50
|
+
OpenAPI 文档位于 `http://127.0.0.1:8765/api/docs`。所有 `/api/agent/*` 请求必须携带:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
X-Agent-Token: <XHS_AGENT_TOKEN>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
外部 Agent 可以创建 AI 任务、草稿和待审核互动任务,但没有批准、发送、Cookie、浏览器档案或敏感会话读取接口。
|
|
57
|
+
|
|
58
|
+
创建草稿示例:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"kind": "comment",
|
|
63
|
+
"account_id": 1,
|
|
64
|
+
"content": "针对当前笔记内容的具体观点",
|
|
65
|
+
"sources": ["note:abc"]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
创建互动任务示例:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"kind": "dm_reply",
|
|
74
|
+
"account_id": 1,
|
|
75
|
+
"thread_id": 3,
|
|
76
|
+
"content": "可以,我们继续在站内把需求确认清楚。"
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Agent 也可将 UTF-8 JSON 文件放入数据目录的 `agent-inbox`,由操作者在“AI 研究”页手动导入。成功导入后扩展名变为 `.imported`。
|
|
81
|
+
|
|
82
|
+
## 隐私和停止规则
|
|
83
|
+
|
|
84
|
+
- 系统在内容进入模型和数据库前检测手机号、微信号及地址。
|
|
85
|
+
- 同步私信时一旦检测到敏感信息,只写入不含原文的事件,停止 AI 和自动发送,并要求到原账号查看。
|
|
86
|
+
- 拒绝、投诉或举报会把目标加入跨账号停止触达名单。
|
|
87
|
+
- 验证码、登录失效、账号限制和发送结果不明确会停止队列,不自动重发。
|
|
88
|
+
- 详细规则参见 `INTERACTION_RULES.md`,后台“互动规则”页展示当前生效版本。
|
|
89
|
+
|
|
90
|
+
## 外部 AI Agent / 自动化工具
|
|
91
|
+
|
|
92
|
+
优先使用 OpenAPI 连接器;如果工具只能访问本地文件,则只授权 `agent-inbox` 目录。不要把后台数据根目录、浏览器档案目录或账号 Cookie 暴露给外部 Agent。
|
|
93
|
+
|
|
94
|
+
## Agent 发布门禁
|
|
95
|
+
|
|
96
|
+
Agent 通过 `PUT /api/agent/drafts/{draft_id}/publish-gate` 填充门禁:素材权属(自有或已授权)、来源引用、二创完成声明、1–18 个成品图片绝对路径、权属证据,以及可选话题。编排器仅使用这些明确登记的成品图片,并且只能生成 `pending_review` 任务,不能批准。
|
|
97
|
+
|
|
98
|
+
## 全自动编排(Orchestrator)
|
|
99
|
+
|
|
100
|
+
编排层在**不改动任何手动流程**的前提下,把已有的两套队列(采集/发布、AI/互动)串成闭环,
|
|
101
|
+
并一律经过治理引擎(限流、opt-out、敏感词、相似度)把关。默认关闭,需显式开启。
|
|
102
|
+
|
|
103
|
+
### 环境变量
|
|
104
|
+
|
|
105
|
+
| 变量 | 取值 | 作用 |
|
|
106
|
+
|------|------|------|
|
|
107
|
+
| `XHS_ORCHESTRATOR` | `1` | 启动编排常驻线程:目标调度 + 流水线串联 + 自动发布 + 自动执行已批准互动 |
|
|
108
|
+
| `XHS_AUTO_PUBLISH` | `1` / `approve` | `1`=门禁完整的 AI 草稿转待审核发布任务;旧值 `approve` 行为相同,始终需要人工批准 |
|
|
109
|
+
| `XHS_ASSET_POOL_DIR` | 目录路径 | 旧版兼容变量;新流程只使用发布门禁明确填入的成品图片 |
|
|
110
|
+
| `XHS_ENGAGEMENT_MODE` | `shadow`/`inbound`/`reviewed` | 复用既有互动灰度,决定哪些**已批准**任务被自动执行 |
|
|
111
|
+
| `XHS_AUTO_ENGAGE` | `1` | 额外开启入站会话的定期同步(dm_sync) |
|
|
112
|
+
| `XHS_DAILY_PUBLISH_LIMIT` | 整数(默认 5) | 每账号每日最多自动发布数 |
|
|
113
|
+
| `XHS_ORCHESTRATOR_TICK` | 秒(默认 60) | 编排线程轮询间隔 |
|
|
114
|
+
|
|
115
|
+
### 目标文件
|
|
116
|
+
|
|
117
|
+
在数据目录 `orchestrator_goals.json` 放置运营目标列表(可参考 `orchestrator_goals.example.json`)。
|
|
118
|
+
编排器按各自 `cadence_hours` 周期性把目标转成 `search_brief` AI 任务,之后自动串联:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
目标(orchestrator_goals.json)
|
|
122
|
+
→ search_brief(AI 把目标拆成多个检索子任务,各带检索词与筛选标准,产出 SearchPlan)
|
|
123
|
+
→ 每个子任务一个采集任务(自动入库爆款笔记)
|
|
124
|
+
→ screen_results(AI 按各角度筛选标准做相关性筛选,选中/落选给理由,非热度前 N)
|
|
125
|
+
→ material_research(AI 分析选中素材、产出二创洞察)
|
|
126
|
+
→ agent_draft(AI 按人设起草草稿,状态 pending_review)
|
|
127
|
+
→ Agent 填充来源、授权、二创完成和成品图片门禁
|
|
128
|
+
→ [XHS_AUTO_PUBLISH] 门禁完整后转为 pending_review(人工批准)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 互动侧的"全自动"
|
|
132
|
+
|
|
133
|
+
互动任务仍需先 `pending_review → approved`(Agent Gateway 只能创建,批准必须由人工在后台完成)。
|
|
134
|
+
编排器在 `reviewed`/`inbound` 模式下,把**已批准**任务自动排队执行,并再次经 `GovernanceService.preflight`
|
|
135
|
+
把关(预算、冷却、opt-out、敏感词)。`shadow` 模式下不自动执行任何发送。
|
|
136
|
+
|
|
137
|
+
### 状态与手动触发
|
|
138
|
+
|
|
139
|
+
- `GET /api/orchestrator/status`:查看是否启用、当前模式、已加载目标数、是否运行中。
|
|
140
|
+
- `POST /api/orchestrator/trigger`:立即跑一轮编排(即使常驻线程未启用也会执行一次)。
|
|
141
|
+
|
|
142
|
+
> 设计原则:编排器只做"串联与排期",不绕过任何既有闸门。发布与主动触达的最终放行,
|
|
143
|
+
> 始终由治理引擎与 `XHS_ENGAGEMENT_MODE` 决定;命中敏感信息 / opt-out / 预算上限会自动转人工。
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# 能力总览与系统架构
|
|
2
|
+
|
|
3
|
+
`xiaohongshu-matrices-cli` 是一套**本地优先、多账号矩阵化**的小红书运营工具,提供命令行(CLI)与本地运营后台(Dashboard)两种使用方式。矩阵化的核心在于:把多个账号纳入统一纳管,按账号设定独立人设,并在同一治理引擎(限流 / 去重 / 问责)下跨账号编排发布与互动。本项目基于 [jackwener/xiaohongshu-cli](https://github.com/jackwener/xiaohongshu-cli)(Apache-2.0)fork,在保留原版采集与互动能力的基础上,新增了受治理的自动化编排层,可运行于 Windows / macOS / Linux。
|
|
4
|
+
|
|
5
|
+
## 能力分层
|
|
6
|
+
|
|
7
|
+
系统按职责分为五层。所有自动化行为均经过治理层把关,不会绕过任何既有闸门。
|
|
8
|
+
|
|
9
|
+
### 1. 采集层
|
|
10
|
+
- 按关键词 / 话题 / 作者 / 热榜 / Feed 抓取爆款笔记与评论,写入本地 SQLite 持久化存储,支持断点恢复。
|
|
11
|
+
- 适用场景:选题挖掘、竞品监控、爆款素材库建设。
|
|
12
|
+
|
|
13
|
+
### 2. AI 层(可选)
|
|
14
|
+
- 把自然语言运营目标拆解为多个检索子任务(不同角度),每个子任务自带检索词与筛选标准(`search_brief` 产出 `SearchPlan`)。
|
|
15
|
+
- 采集完成后,先按各角度的筛选标准做**相关性筛选**(`screen_results`,LLM 判定选中/落选并给理由,而非机械取前 N 条),再对选中素材做二创洞察分析(`material_research`)。
|
|
16
|
+
- 按账号人设起草草稿(`agent_draft`),默认进入 `pending_review` 状态等待人工批准。
|
|
17
|
+
- 走 OpenAI Responses API 兼容协议,通过 `OPENAI_API_KEY` + `OPENAI_BASE_URL` 接入任意兼容模型。
|
|
18
|
+
|
|
19
|
+
### 3. 执行层
|
|
20
|
+
- **浏览器发布**:`BrowserPublisher` 使用 Camoufox(Firefox 抗检测分支)以真实浏览器发布图文笔记,需 1–18 张图片。
|
|
21
|
+
- **互动执行**:评论、回复、私信、点赞、收藏、关注、取关。
|
|
22
|
+
- 任务队列:`DurableTaskQueue`(采集 / 发布)与 `OperationQueue`(AI / 互动)均为持久化队列,进程重启不丢失任务。
|
|
23
|
+
|
|
24
|
+
### 4. 治理层(核心价值与硬约束)
|
|
25
|
+
- 限流 / 预算上限、opt-out(退出触达)、敏感信息过滤、相似度去重、账号级问责。
|
|
26
|
+
- 互动灰度三段式:`shadow`(仅记录不发送)→ `inbound`(仅回复与入站私信)→ `reviewed`(全部放开)。
|
|
27
|
+
- 所有发布默认 `pending_review`,必须人工批准;自动化不得绕过审核。
|
|
28
|
+
|
|
29
|
+
### 5. 编排层(Orchestrator)
|
|
30
|
+
- 将以上四层串成 **目标 → 采集 → 研究 → 起草 → 发布 → 互动** 的闭环,完全复用既有治理引擎。
|
|
31
|
+
- 采用常驻轮询模型(默认 60s),目标与节奏由 `orchestrator_goals.json` 配置,全部通过环境变量 opt-in,默认关闭。
|
|
32
|
+
- 详见 [AI_OPERATIONS.md](./AI_OPERATIONS.md)。
|
|
33
|
+
|
|
34
|
+
## 典型场景
|
|
35
|
+
|
|
36
|
+
| 场景 | 用法 |
|
|
37
|
+
|------|------|
|
|
38
|
+
| 选题挖掘 | 目标拆成多角度检索 → 按各角度筛选标准做相关性筛选 → AI 分析「为什么火」→ 产出二创方向 |
|
|
39
|
+
| 内容生产 | 自然语言目标 → AI 按人设起草草稿 → 人工配图后发布 |
|
|
40
|
+
| 多账号矩阵 | 多账号统一纳管、按账号设定人设,治理层统一限流 / 去重 / 问责,跨账号编排发布与互动 |
|
|
41
|
+
| 互动运营 | `inbound` 模式自动回复评论 / 私信,受治理引擎把控 |
|
|
42
|
+
| 全自动闭环 | 编写目标文件,后台常驻自动跑完整条流水线 |
|
|
43
|
+
|
|
44
|
+
## 安全与合规边界
|
|
45
|
+
1. 自动发布必须配图:AI 仅产出文字,发布需要 1–18 张图片;未配图时草稿自动跳过、留人工处理。
|
|
46
|
+
2. `shadow` 模式绝不自动发送;任何触达的最终放行由 `XHS_ENGAGEMENT_MODE` 与治理引擎决定。
|
|
47
|
+
3. 命中敏感信息 / opt-out / 预算上限时自动转人工,不会硬闯。
|
|
48
|
+
4. 运行数据(Cookie / Token / 笔记库)默认落在用户主目录(`~/.xiaohongshu-cli`),不进入仓库。
|
|
49
|
+
|
|
50
|
+
## 快速开始
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 安装依赖(项目内)
|
|
54
|
+
uv sync
|
|
55
|
+
# 启动后台
|
|
56
|
+
xhs-dashboard --port 8765 --data-dir ./data
|
|
57
|
+
# 常用 CLI
|
|
58
|
+
xhs search "<关键词>" # 搜索笔记
|
|
59
|
+
xhs hot # 热榜
|
|
60
|
+
xhs comment <note_id> "<内容>"
|
|
61
|
+
xhs follow <user_id>
|
|
62
|
+
xhs post --title "..." --body "..." --images a.jpg b.jpg
|
|
63
|
+
xhs login / status / whoami # 账号绑定与状态
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
后台地址:`http://127.0.0.1:8765`(仅本机监听)。编排器状态:`GET /api/orchestrator/status`。
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# 小红书爆款采集与多账号发布后台
|
|
2
|
+
|
|
3
|
+
## 启动
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
uv sync --extra dev
|
|
7
|
+
# macOS / Linux: .venv/bin/xhs-dashboard
|
|
8
|
+
# Windows: .venv\Scripts\xhs-dashboard
|
|
9
|
+
xhs-dashboard # 启动后台(uv sync 后可用)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Camoufox 浏览器(跨平台)
|
|
13
|
+
|
|
14
|
+
项目通过本地 `vendor/camoufox-python` 接口使用 Camoufox(Firefox 抗检测分支)。
|
|
15
|
+
Camoufox 二进制按操作系统下载,使用对应平台的安装命令即可,无需修改版本号:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 拉取当前系统的 Camoufox 二进制(自动识别架构)
|
|
19
|
+
python -m camoufox fetch
|
|
20
|
+
|
|
21
|
+
# 或:从已下载的 ZIP 重新安装(路径按实际位置填写)
|
|
22
|
+
# macOS / Linux: python scripts/install_camoufox_zip.py "/path/to/camoufox-<version>-<os>.zip"
|
|
23
|
+
# Windows: .venv\Scripts\python.exe scripts\install_camoufox_zip.py "C:\path\to\camoufox-<version>-win.x86_64.zip"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
安装器会根据同步索引校验 SHA-256,并在确认二进制存在后才切换活动版本。
|
|
27
|
+
打开 `http://127.0.0.1:8765`。后台只允许监听本机地址,数据默认保存在
|
|
28
|
+
用户主目录下的 `.xiaohongshu-cli/dashboard`(Windows 为 `%USERPROFILE%\.xiaohongshu-cli\dashboard`)。
|
|
29
|
+
可用 `--data-dir` 修改位置。
|
|
30
|
+
|
|
31
|
+
## P0 可靠性与安全
|
|
32
|
+
|
|
33
|
+
- 搜索和发布任务写入 SQLite 持久化队列,使用租约与心跳;服务重启后搜索可断点恢复。
|
|
34
|
+
- 同一账号严格串行,不同账号默认最多两个低并发工作线程。
|
|
35
|
+
- 发布线程在提交阶段中断时直接转为 `verification_pending`,不会自动再次点击发布。
|
|
36
|
+
- 搜索候选逐篇落库,已完成候选不会在恢复后重复抓取。
|
|
37
|
+
- 每账号默认读取间隔 1 秒、每日最多 2500 次读取请求;验证、限流或账号限制会暂停账号。
|
|
38
|
+
- 发布前校验标题、正文加话题总长度、1–18 张图片、单图 20MB 和重复内容指纹。
|
|
39
|
+
- 发布核验要求本次提交后出现新的笔记 ID,不再只按相同标题判断。
|
|
40
|
+
- 浏览器档案按平台隔离:Windows 下档案 ACL 仅授予当前用户与 SYSTEM;其他系统使用 `0o700` 权限,并拒绝同一小红书身份绑定到两个档案。
|
|
41
|
+
- 数据库首次升级到 P0 架构时,会在数据目录的 `backups` 中自动保存迁移前备份。
|
|
42
|
+
|
|
43
|
+
可通过环境变量调整:`XHS_WORKERS`、`XHS_REQUEST_INTERVAL`、
|
|
44
|
+
`XHS_DAILY_REQUEST_LIMIT`、`XHS_QUEUE_LEASE` 和 `XHS_PUBLISH_COOLDOWN`。
|
|
45
|
+
|
|
46
|
+
## 首次使用
|
|
47
|
+
|
|
48
|
+
1. 在“账号管理”创建档案,点击“扫码绑定”,在弹出的独立浏览器中登录。
|
|
49
|
+
2. 绑定状态变为 `ready` 后,在“爆款搜索”创建采集任务。
|
|
50
|
+
3. 任务命中的笔记会连同图片和最多 100 条评论写入本地素材库。
|
|
51
|
+
4. 在“审核与发布”上传内容,或导入批量目录;批准后才能执行发布。
|
|
52
|
+
|
|
53
|
+
旧版单账号 Cookie 可一次性迁移:
|
|
54
|
+
|
|
55
|
+
```powershell
|
|
56
|
+
python -m xhs_cli.dashboard.migrate
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 批量发布目录
|
|
60
|
+
|
|
61
|
+
每篇内容一个文件夹:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
待发布素材/
|
|
65
|
+
帖子一/
|
|
66
|
+
post.md
|
|
67
|
+
01.jpg
|
|
68
|
+
02.jpg
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`post.md` 示例:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
---
|
|
75
|
+
title: 周末城市漫步
|
|
76
|
+
account: 品牌主账号
|
|
77
|
+
topics: [城市漫步, 周末去哪]
|
|
78
|
+
images: [01.jpg, 02.jpg]
|
|
79
|
+
---
|
|
80
|
+
正文内容。
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 安全与风控
|
|
84
|
+
|
|
85
|
+
- 浏览器会话按账号隔离,数据库不保存明文 Cookie。
|
|
86
|
+
- 所有发布任务默认是 `pending_review`,必须人工批准。
|
|
87
|
+
- 同账号发布串行,默认间隔至少 10 分钟。
|
|
88
|
+
- 验证码、登录失效、限流和访问限制会暂停任务,不进行自动绕过。
|
|
89
|
+
- `verification_pending` 表示页面可能提示成功但作品列表未确认,系统不会自动重发。
|
|
90
|
+
- 首次真实发布建议使用测试账号或仅自己可见内容。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 小红书互动与客户沟通规则(v1)
|
|
2
|
+
|
|
3
|
+
本规则用于合规运营、减少误操作和保护沟通对象,不用于规避平台安全机制,也不保证账号不会受到限制。
|
|
4
|
+
|
|
5
|
+
## 允许触达
|
|
6
|
+
|
|
7
|
+
- 回复自有笔记评论、品牌提及和对方主动私信。
|
|
8
|
+
- 暖线索仅包括:主动私信、自有笔记明确表达需求、品牌提及、约定咨询关键词。
|
|
9
|
+
- 关注和点赞本身不构成主动私信依据。
|
|
10
|
+
- 外部主动评论仅限人工选择的少量高相关笔记,且必须逐条审核。
|
|
11
|
+
|
|
12
|
+
## 沟通与隐私
|
|
13
|
+
|
|
14
|
+
- 默认引导继续站内私信,不主动索取微信、手机号或地址。
|
|
15
|
+
- 检测到手机号、微信号或地址后,不保存具体内容,停止 AI 和自动发送,提示操作者到原账号人工查看。
|
|
16
|
+
- 对方要求停止联系、投诉或举报时,立即跨账号停止触达。
|
|
17
|
+
|
|
18
|
+
## 禁止行为
|
|
19
|
+
|
|
20
|
+
- 禁止骚扰、批量复制、无关广告、虚假身份、虚假资质、虚假案例和效果承诺。
|
|
21
|
+
- 禁止让模型或自动化绕过验证码、登录验证、账号限制或审核。
|
|
22
|
+
- 医疗、金融、未成年人等高风险内容默认转人工处理。
|
|
23
|
+
|
|
24
|
+
## 试运行频率
|
|
25
|
+
|
|
26
|
+
- 回复评论:每账号 8 条/天。
|
|
27
|
+
- 外部主动评论:每账号 8 条/天;两类评论合计最多 2 条/小时。
|
|
28
|
+
- 暖线索主动私信:每账号 5 条/天,最小间隔 60 分钟。
|
|
29
|
+
- 入站私信回复:每账号 30 条/天、同会话 10 条/天,同会话最小间隔 5 分钟。
|
|
30
|
+
- 同一用户默认跨账号冷却 30 天;相似度超过 0.85 的近期内容禁止发送。
|
|
31
|
+
- 14 天内不得自动提升额度,任何修改必须产生新的规则版本并人工启用。
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work, excluding
|
|
103
|
+
those notices that do not pertain to any part of the Derivative
|
|
104
|
+
Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and do
|
|
117
|
+
not modify the License. You may add Your own attribution notices
|
|
118
|
+
within Derivative Works that You distribute, alongside or as an
|
|
119
|
+
addendum to the NOTICE text from the Work, provided that such
|
|
120
|
+
additional attribution notices cannot be construed as modifying
|
|
121
|
+
the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 jackwener
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|