bensz-router 1.0.4 提供 Python SDK、CLI、Harness adapter 与公开 Agent Skill。服务端负责目录、设备授权和步骤契约;客户端继续使用本地工具和自己的模型,不代理模型请求。需要 Python 3.9+ 和可用的系统 keyring。
1.0.4 兼容服务端 RFC3339Nano 过期时间,修复 hooks 对非受管检查命令的误报,并在有效上下文中保留命中提醒、工作流名称与清单结束标记。
安装与登录
python3 -m pip install --upgrade bensz-router==1.0.4
bensz-router --version
bensz-router skill sync --harness all
bensz-router login --harness codex
bensz-router catalog --json
设备登录打开浏览器授权页,批准后把短期 brw_ Token 保存到系统 keyring。Claude Code 用户使用 --harness claude-code。CLI 默认地址为 https://router.benszresearch.com;--server <地址> 优先于 BENSZ_ROUTER_URL,登录和预检须使用同一站点。
也可运行 uv tool install bensz-router==1.0.4。在 Harness 的 Shell 中执行 command -v bensz-router 检查路径;macOS 图形界面启动的 Harness 可能缺少终端 PATH,Skill 会有界检查用户级与 Homebrew 命令目录。keyring 不可用时命令明确失败,不保存明文凭据。
bensz-router --version(或 -V)无需登录或联网,预期输出 bensz-router 1.0.4。持有源码的开发者也可在仓库根目录使用 uv tool install --force ./packages/bensz-router 安装本地版本。
发现与预检
bensz-router catalog --json
bensz-router profiles --json
# AI 根据公开元数据选择模板,再提交 ID;不传用户 Prompt
bensz-router preflight --harness codex --selected-template-id software-development --manifest
bensz-router workflow list
bensz-router workflow hide <workflow-id>
bensz-router workflow show <workflow-id>
AI 在默认智能方案候选范围内本地选择工作流,服务器复核权限、依赖、冲突与版本。--manifest 提供可见应用清单,--json 用于机器读取;同时指定时 manifest 优先。模板 ID 必须来自当前目录。
成功命中的预检记录表示契约已返回,不证明任务完成。Harness 应逐项执行、核对证据;无匹配、无权限或远程不可用时有界停止并继续原任务。客户端拒绝 HTTP 重定向,不转发凭据。
可选 hooks 与恢复
bensz-router hooks install --harness codex --scope project --dry-run --json
bensz-router hooks install --harness codex --scope project
bensz-router hooks doctor --harness codex --scope project --json
Codex 需通过 /hooks 信任。hooks 提供跨进程单次预检、认证/项目/子代理隔离和当前契约恢复;SessionStart 给出的 --session-ref 必须原样传入受管命令。Codex 接入 developer 上下文,Claude hooks 接入 system reminder。配置注册不代表实际送达或执行完成。
每个受管 preflight、run、current、advance 或 session release 必须是一次 Shell 调用中的唯一单行命令,使用确认过的 CLI 路径、字面参数并保留完整输出。组合 cd、变量、管道、重定向或其他命令会阻断 hook 桥接核验。
Codex 的受管上下文 handler 设置 additionalContextLimit: 0,完整传入正文,adapter 不设正文长度上限。更新包后按原 scope 重复执行 hooks install 并在 /hooks 审核新定义,已有配置才会获得该设置。Claude 上下文仍限制为 9,000 字符,超限明确降级。
受保护工作流必须以预检的 resolution_id 启动,再读取或显式推进本人运行:
bensz-router run <workflow-id> --harness codex --resolution-id <resolution-id>
bensz-router current <run-id>
bensz-router advance <run-id> <step-id> --outcome completed
受管命令另加 --session-ref <session-ref>;任务结束或切换用 session release,本地文件条件用 session verify --require-file <项目内相对文件>。这些检查不替代质量判断。claude-start 只用于新会话的固定 system 快照;hooks 无法删除宿主历史指令。详见 Harness 接入(需要私有仓库访问权限)。
管理自动化与安全
bensz-router automation login
bensz-router automation capabilities --json
bensz-router automation validate workflow.json --json
bensz-router automation save-draft workflow.json --base-revision 3 --json
管理员在管理台“API 密钥”创建 brm_,由隐藏输入保存到独立 keyring 并交换短期 bra_。默认 Workflow 预检不使用管理凭据;管理失败立即停止,候选版本不会自动激活。管理协议与审批见 管理自动化(需要私有仓库访问权限)。
默认不上传用户 Prompt、历史上下文或本地文件正文;服务端只记录低敏状态。已下发正文可能保存在宿主历史。外部副作用始终需人工确认;bug-report --scan 仅在明确授权时上传同目录配对的 bug-context.json 与 BUG_REPORT.md 脱敏记录。
开发与许可证
持有源码的开发者在包目录执行:
python3 -m pip install -e '.[test]' pytest
python3 -m pytest tests -q
Skill 源码位于 skills/bensz-router,随包分发;skill sync 支持首次安装、更新和 --dry-run,skill status --json 检查漂移。SDK 入口为 bensz_router.client.WorkflowClient。本包采用 MIT License。
Metadata
Release files for bensz-router 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bensz_router-1.0.4.tar.gz | 96.1 kB | Without provenance | Details for bensz_router-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bensz_router-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for bensz_router-1.0.4-py3-none-any.whl |
Total release size: 171.1 kB
Release files / bensz_router-1.0.4.tar.gz
| Download URL | bensz_router-1.0.4.tar.gz |
|---|---|
| Size | 96.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fb0d4174a9b106456cdb3a5104b16b06588ecd70eaf2f297f151435e2069e75
|
|
BLAKE2b-256 checksum How to use checksums |
8bba93d20237a9318829262082edbbf4a4d812917f263182fc6c737125cd5a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / bensz_router-1.0.4-py3-none-any.whl
| Download URL | bensz_router-1.0.4-py3-none-any.whl |
|---|---|
| Size | 75.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16a47cdec895379d1f624846509976c8178a84625cf67872c5e8b89d2f7e173c
|
|
BLAKE2b-256 checksum How to use checksums |
ece5ad480b111a67e7b8c8197286fd4d473da7efb578e3a89249e96a498d0684
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for bensz-router 1.0.4
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.