kiwi-catalog
独立部署的 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 域(v0.4):
/v1/listings/publish|withdraw|reinstate|search|get- publisher 自查
/v1/agents/{id}/listings(行级幂等 upsert、服务端 digest、fresh_until TTL、owner token 双路径认证)
- publisher 自查
- 商家接入(v0.5+):
/v1/merchants/*token 申请/审批/恢复 (Fernet 加密存储)+/v1/accounts/*与/portal商家门户(账号注册/ 登录/Token 管理) - 治理(suspend/reinstate——owned Listings 联动置 SUSPENDED、双维度限流、 审计、§24 runtime metrics)
快速开始
pip install -e '.[api]'
export KIWI_CATALOG_ADMIN_TOKEN=change-me
export KIWI_CATALOG_OWNER_TOKEN_SECRET=change-me
kiwi-catalog-api --db catalog.sqlite --host 127.0.0.1 --port 8600
认证
- admin token(
KIWI_CATALOG_ADMIN_TOKEN):moderation 动作 (suspend/reinstate)与 verify; - catalog-owner token(
KIWI_CATALOG_OWNER_TOKEN_SECRET派生 HMAC): owner 语义(claim/refresh)——kiwi_catalog.api.auth.owner_token(merchant_id)生成,请求体owner_token字段携带。
架构要点
- 独立 SQLite schema:20 张表(
db/models.py单一 SCHEMA 源: catalog 域 6 + 治理域 4 + listing 域 + 商家接入/账号域 7 + 影子域 3),CURRENT_SCHEMA_VERSION = 16(db/migrations.py,与 shopping-cli 各自 演化);弱引用——对 merchants/agents 外部表无 FK; - 账号与 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 一致)。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kiwi_catalog-0.1.0.tar.gz
(245.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
kiwi_catalog-0.1.0-py3-none-any.whl
(256.7 kB
view details)
File details
Details for the file kiwi_catalog-0.1.0.tar.gz.
File metadata
- Download URL: kiwi_catalog-0.1.0.tar.gz
- Upload date:
- Size: 245.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bf9ef41d15be0a0090a6b794e309616879aca5d1a42b65c27febf88172a9b57
|
|
| MD5 |
8f3797067fe8183c309f6a7da7d5e6f1
|
|
| BLAKE2b-256 |
704460d736377fc1880d3d0dd364324b88cbcf751f44aac37e748ffc0881a48d
|
File details
Details for the file kiwi_catalog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kiwi_catalog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 256.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3cb7713c23e8d0610f623e5e4965a8d76a39a572479200f0abb8813f69b0174
|
|
| MD5 |
6f7dfa0b09c0515feb28f8e8685c1002
|
|
| BLAKE2b-256 |
0fa395a98de9607e683f9d8246fa1ef358a9acc3daa8587775203d09d956b1e2
|