Skip to main content

kiwi-catalog

当前源码候选:0.5.15;正式发布由 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 使用绑定签名, 注册商家自动获得可配置的免费商品名额(见 商品名额说明)。
  • 商家接入(v0.5+):/v1/merchants/* token 申请/审批/恢复 (Fernet 加密存储)+ /v1/accounts/* 商家账号 API;商家后台 HTML 由私有 kiwi-catalog-admin 扩展提供;注册即商家——注册即分配 merchant_id 与免费方案, 邮箱验证和 Runtime 连接后可在额度内发布。
  • 公开商家主页:GET /m/{merchant_id}(别名 /merchants/{merchant_id}、 /merchant/{merchant_id})由目录托管,匿名展示商家已发布的公开资料与 ACTIVE 商品;按客户端 IP 接入公开读限流,?page=N 分页(单页 50 件)。 没有外部 shop_url 的商家也有稳定主页。页面只读公开投影,不含账号/联系人/凭据/ 分享码;无可公开内容时 404。
  • 商家门户和运营/审核后台(/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;源码当前 CURRENT_SCHEMA_VERSION = 49(db/migrations.py)。 部署/发布前必须读取线上实际 PRAGMA user_version 并核对 migration 链,不能假定线上 schema 与源码一致;schema 40/41 的历史额度调整见迁移记录,与 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.15

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

Source distribution (sdist)

Source distribution for kiwi-catalog 0.5.15
File Size Uploaded Provenance Actions
kiwi_catalog-0.5.15.tar.gz 737.0 kB Without provenance Details for kiwi_catalog-0.5.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kiwi-catalog 0.5.15
File Interpreter ABI Platform Actions
kiwi_catalog-0.5.15-py3-none-any.whl Python 3 none any Details for kiwi_catalog-0.5.15-py3-none-any.whl

Total release size: 1.3 MB

Release files / kiwi_catalog-0.5.15.tar.gz

Download URL kiwi_catalog-0.5.15.tar.gz
Size 737.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4bb43dc825b815669768a900a0aad32e2f186a221d673322e6c1c5e0904ba3ac
BLAKE2b-256 checksum
How to use checksums
447a3aa0c765104d131797d82b2288000df104ea2f22fd26dc4866a48d8247f1
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":"26.04","id":"resolute","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.15-py3-none-any.whl

Download URL kiwi_catalog-0.5.15-py3-none-any.whl
Size 526.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
053055bbb130466ec4c654c66497e50f7771287af142d56122fc7c56d7f86be5
BLAKE2b-256 checksum
How to use checksums
797b9687fc83f15d21901e43a963df1a0099282c403a316b3cb22bad7b744047
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":"26.04","id":"resolute","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.15

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

0.5.15 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