Skip to main content

hh-wonderfish-ai-sdk

文書概要

項目 内容
目的 Product ServiceがWonderfish Control Planeと連携するためのPythonライブラリwonderfish-cp-sdkの、取得方法、ローカル検証手順、リポジトリ構成を示す
対象読者 SDKの開発者、SDKを組み込むProduct Serviceの開発者、レビュー担当者
対象範囲 本リポジトリのPythonソース、テスト、契約文書、設計書
対象外 Control Plane本体の実装、各Product Service本体の実装、Azureへのデプロイ、Secret値

wonderfish-cp-sdkは、すべてのProduct Serviceが同じ内容を実装することになる連携処理だけを担います。Control Planeを呼び出す側と、Control Planeから呼び出される側の両方を提供します。責務の境界はProduct Service SDK仕様書3章に定めます。

ディレクトリ

src/wonderfish_cp/           SDKのPythonソース
src/wonderfish_cp/inbound/   Control Planeから呼び出されるPS-inbound router
src/wonderfish_cp/external/  Product Serviceの外部API middleware
src/wonderfish_cp/discovery.py Product Service間の業務Resource検索Token検証
src/wonderfish_cp/adapters/  保存先Portの実装(インメモリ、SQLAlchemy)
tests/                       テスト
contracts/                   Control Planeから取り込んだOpenAPI(契約の正本の写し)
docs/DetailDesign/           SDK仕様書
docs/サンプルアプリ機能一覧.md  疎通確認用サンプルアプリの機能一覧
docs/サンプルアプリ開発手順書.md  同アプリの作成順序
docs/サンプルアプリシステム構成図.md  同アプリの配置と通信経路
docs/サンプルアプリ結合試験項目書.md  同アプリを使うDEV結合試験の入力、順序、期待結果、証跡
deployment/                  DEV環境での疎通確認用サンプルProduct Serviceの構築・削除資材

deployment/は配布物に含めません。手順はサンプルProduct Serviceデプロイ手順に定めます。

主な公開インターフェースを次に示します。詳細はProduct Service SDK仕様書に定めます。

用途 入口 仕様書
Control Planeの呼び出し ControlPlaneClient 9章
Integration App、Identity、API Role Assignmentの管理 ControlPlaneClientの9 method 5.3、9.2
認可から消費の確定まで ControlPlaneClient.authorize、AuthorizationSession 10章
外部API経路の消費 ControlPlaneClient.verify_decision、DecisionView.build_usage_log 10.5
Usageの送信・確定 UsageLogSender、UsageFactFinalizer 10.4
Catalog snapshotと接続先の解決 CatalogCache 11章
Control Planeからの5 endpoint wonderfish_cp.inbound.create_control_plane_router 12章
通知のハンドラ wonderfish_cp.inbound.NotificationRouter 13章
外部APIの認証・認可 wonderfish_cp.external.ExternalAuthorizationMiddleware 8.4
業務Resource検索Tokenの検証 wonderfish_cp.discovery.ResourceDiscoveryTokenVerifier 5.6
保存先 wonderfish_cp.portsの5 Protocol、wonderfish_cp.adapters 14章
準備完了の報告と起動時検査 ReadinessReporter、wonderfish_cp.conformance 6.2、6.3
試験用のControl Plane wonderfish_cp.testing.FakeControlPlane 17章

wonderfish_cpのimportはextraを必要としません。wonderfish_cp.inbound、wonderfish_cp.external、wonderfish_cp.testingはextra inboundを、wonderfish_cp.adapters.sqlalchemyはextra sqlalchemyを必要とします。

契約の正本はcontracts/README.mdが示すControl Planeリポジトリの2つのOpenAPIです。本リポジトリのcontracts/はその写しであり、手で編集しません。

前提

開発者はPython 3.12を使用します。

導入

Product Serviceは、Public PyPIからversionを固定して取得します。範囲指定にしません。連携仕様の変更をSDKのversion更新として検知するためです。

pip install "wonderfish-cp-sdk[inbound,sqlalchemy]==7.1.0"

extraのinboundはPS-inbound routerに、sqlalchemyは保存先Portの参照実装に必要です。組み込み手順はProduct Service SDK仕様書6章に定めます。

Python 3.12以上を使用します。versionの意味はProduct Service SDK仕様書18章に定めます。

セキュリティ上の問題の連絡

脆弱性または秘密情報の露出を発見した場合は、公開のIssueへ詳細を書かず、support@happyhack.co.jpへ連絡してください。

本SDKはApache License 2.0で提供します。ライセンス本文は配布wheelに含まれます。

ローカル検証

開発者はリポジトリルートで次を実行します。

python -m pip install --require-hashes -r requirements-dev.lock
python -m ruff check src tests deployment .github/scripts
python -m compileall -q src tests deployment .github/scripts
python -m pytest
python -m pip install -e . "uvicorn[standard]"
python deployment/sample/smoke.py

テストはネットワーク、外部データベース、コンテナのいずれも必要としません。SQLAlchemy adapterの契約テストは一時ディレクトリのSQLiteファイルを使用します。

Control Plane側の前提

SDKをリリースする前に、Control Planeが満たしていなければならない条件はProduct Service SDK仕様書19章に定めます。

7.1.0はAgentツール接続候補を含む41 operation版です。contracts/に取り込んだControl PlaneのOpenAPIを正本とし、契約にない要求・応答をSDK側で補完しません。

Metadata

Release files for wonderfish-cp-sdk 7.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for wonderfish-cp-sdk 7.1.0
File Interpreter ABI Platform Actions
wonderfish_cp_sdk-7.1.0-py3-none-any.whl Python 3 none any Details for wonderfish_cp_sdk-7.1.0-py3-none-any.whl

Release files / wonderfish_cp_sdk-7.1.0-py3-none-any.whl

Download URL wonderfish_cp_sdk-7.1.0-py3-none-any.whl
Size 115.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3aa06ad95932a420debb6c6e20cdc8ae3da021a32032e4ec940fdcc96c0815e
BLAKE2b-256 checksum
How to use checksums
23d38e89b996e571cd034dd09316642a8feb235527eb3df9a0a50df04a69abc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Security for wonderfish-cp-sdk 7.1.0

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.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for wonderfish_cp_sdk-7.1.0-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

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.

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