Skip to main content

Kestrel Sovereign SDK — lightweight interfaces and protocols for feature packages

Project description

kestrel-sovereign-sdk

Lightweight SDK providing base interfaces, protocols, and utilities for Kestrel Sovereign feature package development. Feature packages depend on this SDK instead of the full framework, keeping dependencies minimal and development fast.

Installation

uv pip install git+https://github.com/KestrelSovereignAI/kestrel-sovereign-sdk.git

With encryption helpers:

uv pip install "kestrel-sovereign-sdk[crypto] @ git+https://github.com/KestrelSovereignAI/kestrel-sovereign-sdk.git"

Dependencies

  • pydantic>=2.0
  • Optional: cryptography>=42.0 (via [crypto] extra)

Usage

from kestrel_sdk.features.base import Feature, Tool

class MyFeature(Feature):
    name = "my-feature"

    def get_tools(self):
        return [Tool(name="my-tool", description="Does something", handler=self.handle)]

Database surface (entity feature packages)

Feature packages that need raw SQL or ORM access (e.g. kestrel-feature-entities) develop against kestrel_sdk.storage.database:

from kestrel_sdk.storage.database import (
    DatabaseBackend,           # async ABC: execute / fetch_* / transaction
    PrivacyMode,               # 5-mode enum
    EngineTarget,              # frozen dataclass: url, persistent, description
    resolve_engine_target,     # PrivacyMode + fallback_url -> EngineTarget
)

target = resolve_engine_target(PrivacyMode.NORMAL, "postgresql+asyncpg://...")
# target.url is the SQLAlchemy URL the feature should bind its ORM engine to.
# Volatile modes (EPHEMERAL/ISOLATED) ignore fallback_url and return
# in-memory or tempfile sqlite URLs with persistent=False.

To get the active DatabaseBackend instance at runtime, features access it through the agent context they already receive in their Feature.__init__:

class MyEntityFeature(Feature):
    def __init__(self, agent):
        super().__init__(agent)
        self.db: DatabaseBackend = agent.db   # provided by sovereign

The SDK declares the DatabaseBackend ABC; sovereign provides the concrete SQLiteBackend / PostgresBackend instance via agent.db. Feature packages should never instantiate their own backend — that creates a parallel connection pool and bypasses the agent's privacy enforcement.

Configuration

No environment variables required. This is a development-time dependency only.

Development

uv pip install kestrel-sovereign-sdk && uv pip install -e .
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kestrel_sovereign_sdk-0.13.0.tar.gz (85.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kestrel_sovereign_sdk-0.13.0-py3-none-any.whl (106.0 kB view details)

Uploaded Python 3

File details

Details for the file kestrel_sovereign_sdk-0.13.0.tar.gz.

File metadata

  • Download URL: kestrel_sovereign_sdk-0.13.0.tar.gz
  • Upload date:
  • Size: 85.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kestrel_sovereign_sdk-0.13.0.tar.gz
Algorithm Hash digest
SHA256 b02b701e582b59d262be37c01593f03a05c33b90e8cd0685ddaaa58046660af3
MD5 0069e18d2d6af2487df7798bdf485486
BLAKE2b-256 2ed3b53997f9cd81075d3638d64f0d51f3e140f66c669a18940906671f5658b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for kestrel_sovereign_sdk-0.13.0.tar.gz:

Publisher: publish.yml on KestrelSovereignAI/kestrel-sovereign-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kestrel_sovereign_sdk-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kestrel_sovereign_sdk-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0034b5376ee1be5e967c0a21f023f1f6d01c919fa837ebe5b7b0d8c2cab75cf
MD5 afb5a86792c99a04dde609df80a4dc2b
BLAKE2b-256 d6d6a75d1b8e73fb7fe443556fab5b35343540504040e2a498cfb6bd73ca21f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for kestrel_sovereign_sdk-0.13.0-py3-none-any.whl:

Publisher: publish.yml on KestrelSovereignAI/kestrel-sovereign-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page