kiwi-catalog
当前源码候选:0.5.3;正式发布由 Kiwi Portfolio workflow 统一触发,见 Portfolio 发布管理。
独立部署的 Agent Catalog 服务——从 shopping-cli 抽离(
shopping-cli/docs/shopping-cli-agent-catalog-extraction-plan-v1.0.md,
切割分水岭:不含托管协商与 marketplace 域)。
能力
- 注册/发布(
POST /v1/agent-catalog/agents/register+ v1 面POST /v1/agents/register+ hosted 发布面GET /v1/hosted/agents/{id}/agent-card.json/ucp) - 验证(HTTPS domain-control / agent identity / commerce,持久验证队列)
- 发现/搜索(
GET /v1/agent-catalog/agents/search,CandidateAgent DTO; v1 面/v1/agents/search:三态域——VerificationLevel / FreshnessState / AdministrativeState——与 KTH destination_type 词表过滤) - Listing 域:
/v1/listings/publish|withdraw|reinstate|search|get- publisher 自查
/v1/agents/{id}/listings;已连接 Runtime 使用绑定签名, 注册商家自动获得可配置的免费商品名额(见 商品名额说明)。
- publisher 自查
- 商家接入(v0.5+):
/v1/merchants/*token 申请/审批/恢复 (Fernet 加密存储)+/v1/accounts/*商家账号 API;商家后台 HTML 由私有kiwi-catalog-admin扩展提供;注册即商家——注册即分配 merchant_id 与免费方案, 邮箱验证和 Runtime 连接后可在额度内发布。 - 商家门户和运营/审核后台(
/portal/*HTML)均由私有扩展提供;核心仅保留/v1/accounts/*、/v1/merchant-publications/*等业务 API。 - 治理(suspend/reinstate——owned Listings 联动置 SUSPENDED、双维度限流、 审计、§24 runtime metrics)
快速开始
pip install -e '.[api]'
export KIWI_CATALOG_ADMIN_TOKEN=change-me # moderation 用(运营后台在私有扩展里)
export KIWI_CATALOG_OWNER_TOKEN_SECRET=change-me
kiwi-catalog-api --db catalog.sqlite --host 127.0.0.1 --port 8600
商家后台页面由私有仓 kiwi-catalog-admin 提供;需要在同一 Python 环境安装该扩展,
并设置 KIWI_CATALOG_EXTENSIONS=kiwi_catalog_admin(部署步骤见
kiwi-catalog-admin 安装说明)。
认证
- admin token(
KIWI_CATALOG_ADMIN_TOKEN):moderation 动作 (suspend/reinstate)与 verify。运营/审核 API(/v1/admin/*、 商家审核 HTTP API)不在本包——以私有扩展kiwi-catalog-admin经KIWI_CATALOG_EXTENSIONS挂载(docs/extensions.md); - catalog-owner token(
KIWI_CATALOG_OWNER_TOKEN_SECRET派生 HMAC): owner 语义(claim/refresh)——kiwi_catalog.api.auth.owner_token(merchant_id)生成,请求体owner_token字段携带。
架构要点
- 独立 SQLite schema;当前迁移版本为
41(db/migrations.py)。 Listings 方案、商家权益和额度审计由 schema 40 增加;schema 41 将免费默认额度调整为 20,与 shopping-cli 分别演化。 - 账号与 Token:
merchant_accounts/account_sessions/merchant_tokens(Fernet 加密token_encrypted)/merchant_applications(申请+审批), 详见docs/accounts.md; - 持久验证队列(ledger 写穿 + crash recovery)随包;
- SSRF fetcher 的 socket 级防护(DNS→IP 校验 + 直连已验证 IP)原样保留 ——不要在无真实网络栈的 serverless 上部署(如 Cloudflare Workers), VM/容器(腾讯云/阿里云轻量等)是目标形态。
部署
- 容器:
docker build -t kiwi-catalog . && docker run -v catalog-data:/data ...(Dockerfile,SQLite 落持久卷); - VM:
deploy/systemd/kiwi-catalog.service(systemd 守护 + 环境文件); - 多实例:接 PG + Redis 限流(P3/P5 接缝,见 shopping-cli 接缝文档)。
测试
python3 -m unittest discover -s tests
License
Apache License 2.0 — wire 契约(权威在 kiwi 仓)与实现同许可 (与 Kiwi、shopping-cli 一致)。
Metadata
Release files for kiwi-catalog 0.5.10
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 |
|---|---|---|---|---|
| kiwi_catalog-0.5.10.tar.gz | 654.1 kB | Without provenance | Details for kiwi_catalog-0.5.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kiwi_catalog-0.5.10-py3-none-any.whl | Python 3 | none | any | Details for kiwi_catalog-0.5.10-py3-none-any.whl |
Total release size: 1.1 MB
Release files / kiwi_catalog-0.5.10.tar.gz
| Download URL | kiwi_catalog-0.5.10.tar.gz |
|---|---|
| Size | 654.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21b5265123ee8c6e1be34203d1f4eddedb1ade0b09db979d699e4013e25a41fe
|
|
BLAKE2b-256 checksum How to use checksums |
340e906666815b08a8c9e5139e6d5496354638c4bf7b6427eee8dfd94d3f3ba9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / kiwi_catalog-0.5.10-py3-none-any.whl
| Download URL | kiwi_catalog-0.5.10-py3-none-any.whl |
|---|---|
| Size | 481.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5f1460e0a8ecbf3bcef387473135bcd96e8d859b04afaecddf676ec2892bd96
|
|
BLAKE2b-256 checksum How to use checksums |
39b70941bcc1b67fa6d01364f512e7b2bd425699a0eb6795cea91cb0420d4130
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for kiwi-catalog 0.5.10
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.