Skip to main content

blues-lib-py

WebDriver 任务编排库:ww_* 工具 + action URI 简写 + CLI + Web 管理端。 一个任务 = 一个 meta.json5(流程)+ biz.json5(数据),可本地跑、可推库、可在 Web 端调度。

快速开始

uv sync                                  # 装依赖(.env 里配 LLM/DB 等变量)
uv run ww init                           # 初始化 config / sqlite / web / plugin
uv run ww web start                      # 起后端(开发端口 5200,前端 5201)
uv run ww task src/blues_lib/resources/samples/read/page-text/meta.json5 \
               src/blues_lib/resources/samples/read/page-text/biz.json5

开发阶段让 ww 全局可用(可选)

开发时通常用 uv run ww ...,但有些技能/脚本会直接调用 ww。可把工程 venv 的入口软链到 PATH 目录:跑的就是工程源码(可编辑安装),改代码即时生效,无需安装发布包。

# 在仓库根目录执行(Linux / macOS);先确保已 uv sync 生成 .venv
ln -sfn "$(pwd)/.venv/bin/ww" /usr/local/bin/ww

# 验证(任意目录均可)
cd /tmp && ww --version

# 撤销
rm /usr/local/bin/ww

需要目标目录在 PATH 中且有写权限;无 /usr/local/bin 权限时可改用 ~/.local/bin。 Windows:uv sync 后工程 .venv\Scripts\ 下有 ww.exe,把该目录加入 PATH(或做别名转发)即可。 以上为手动设置,适合开发阶段临时使用;日常在工程内仍推荐 uv run ww。

目录结构

src/blues_lib/
├── cli/                # ww 命令(run/push/browser/action/sqlite/migrate/web/…)
├── ability/
│   ├── atom/           # 原子能力(webdriver / sql / script / message / file / http / util)
│   ├── composite/      # 组合能力(loop / task / flow)
│   └── base/           # WwBase + 能力发现
├── runner/             # 执行层:AbilityClient / RunSession / pipeline / context
├── services/           # 服务层:sql / config / webdriver / cleaner / llm / match / agent
├── types/schemas/      # 工具入参 pydantic 模型(TOOL_ADAPTERS)+ catalog
├── web/                # FastAPI 后端(routers / services / worker / static 前端产物)
└── resources/          # 随包资源:config / descriptions / docs / prompt / samples
frontend/               # Vue3 + Element Plus 管理端(构建产物进 web/static)
tests/{unit,integration,e2e}/

测试

uv run pytest tests/unit                 # 单测(mock 外部依赖,秒级)
uv run pytest tests/integration          # 集成(真 CLI / 真库)
uv run pytest tests/e2e/samples          # 示例端到端(真浏览器,分钟级)
uv run pytest tests/e2e/samples/read/TestReadBriefs.py   # 单跑一个示例

示例与用例的对应关系由 tests/unit/blues_lib/resources/TestSamplesE2ECoverage.py 强制(缺用例或漏登记豁免即失败)。

文档

文档 内容
AGENTS.md 代码风格、测试规范、SQL/SQLite 约束(改代码前先看)
readme/cli.md CLI 命令分组与常用示例
readme/web.md Web 端:启动/端口/页面/API/鉴权/数据库
src/blues_lib/ability/readme.md 能力层结构,以及"新增一个工具"的四步
src/blues_lib/types/schemas/AGENTS.md 工具入参 schema 与 catalog 的编写规则

原则:能用代码表达的不写文档。示例(resources/samples/**)本身就是可执行文档; 工具参数看 ww tool show <tool>[/<action>],不要在这里抄第二份。

Metadata

Release files for blues-lib 1.31.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blues-lib 1.31.12
File Size Uploaded Provenance Actions
blues_lib-1.31.12.tar.gz 2.0 MB Without provenance Details for blues_lib-1.31.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for blues-lib 1.31.12
File Interpreter ABI Platform Actions
blues_lib-1.31.12-py3-none-any.whl Python 3 none any Details for blues_lib-1.31.12-py3-none-any.whl

Total release size: 4.5 MB

Release files / blues_lib-1.31.12.tar.gz

Download URL blues_lib-1.31.12.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b9a7dfc5541eab773e883d71b52b2c29c2180c0402964b155d1460dc88f395a3
BLAKE2b-256 checksum
How to use checksums
d4407b309945fc1c3c4660bbe626c614049ff0e99c26b84e95bd5f6956855594
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / blues_lib-1.31.12-py3-none-any.whl

Download URL blues_lib-1.31.12-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2a02eb0f080d861e493887e10532e19f44cf4c199428aba2c3b06b17afe5e842
BLAKE2b-256 checksum
How to use checksums
653dd564a1f7d7a868d559ad02e20558328ee6257a77d8745afc5d13ca178713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for blues-lib 1.31.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.31.12 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page