Piilot plugin SDK — public primitives (connectors, tools, modules, agents, HTTP, DB, scheduler, cache, storage, access, knowledge) for building Piilot plugins.
Project description
piilot-sdk
Public SDK for building Piilot plugins — the AI cockpit with data sovereignty.
What is it
piilot-sdk is the stable, narrow public contract Piilot plugins import
from. A plugin MUST only import from piilot.sdk.* — any import from
backend.* is refused at boot by the loader's AST check.
The SDK exposes primitives for:
- Connectors — credentials storage with manifest-driven auto-encrypt
- Tools — agent tool registration with namespace isolation
- Modules — dashboards and workflow surfaces (
register_module) - Agents — session scope + templates (
register_template) + system prompt builders - HTTP —
register_router/register_webhook_routerwith auth deps - DB — RLS-aware
cursor,run_in_thread,execute_values,Json - Scheduler —
register_sync_handlerfor per-provider sync dispatch - Cache — async Redis primitives with namespace auto-prefix
- Storage — async S3 primitives with namespace auto-prefix
- Access —
check_grantpassthrough - Crypto —
mask_api_keyhelper
Install
pip install piilot-sdk
Quick start
Create a plugin entry point:
# piilot_pack_hello/__init__.py
from piilot.sdk import Plugin, Context
from piilot.sdk import tools, http
class Plugin(Plugin):
def register(self, ctx: Context) -> None:
tools.register_tool({
"id": "hello.greet",
"label_key": "hello.tools.greet.label",
"description_key": "hello.tools.greet.description",
"callable": lambda name: f"Hello, {name}!",
})
http.register_router(
routes=[...],
prefix="/api/hello",
)
Declare it as a Piilot plugin in your pyproject.toml:
[project.entry-points."piilot.plugins"]
hello = "piilot_pack_hello:Plugin"
[tool.piilot.plugin]
manifest_version = 1
namespace = "hello"
sdk_compat = ">=0.2.0,<1.0.0"
# ...
Documentation
Full guide: PLUGIN_DEVELOPMENT.md.
Changelog: SDK_CHANGELOG.md.
Template repo: piilot-plugin-template.
Versioning
Semver. Breaking changes bump the major. Plugins pin a compatible range
via sdk_compat in their manifest.
License
Apache-2.0. See LICENSE.
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
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
File details
Details for the file piilot_sdk-0.6.0.tar.gz.
File metadata
- Download URL: piilot_sdk-0.6.0.tar.gz
- Upload date:
- Size: 39.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
605998c378eb61fc218480d5717c66a8650cf3a1a8416b971ae5c33df7ee99f2
|
|
| MD5 |
37931277f1ef002009e8cc5c8b04e39d
|
|
| BLAKE2b-256 |
3f10c5c1a15d25b6f93bd706ae94e466d0e71e24522df649810fd55427f898ca
|
File details
Details for the file piilot_sdk-0.6.0-py3-none-any.whl.
File metadata
- Download URL: piilot_sdk-0.6.0-py3-none-any.whl
- Upload date:
- Size: 50.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32772a85563bbbec9443f97bb5b0c13fd5c51eed43832c78a43c6736accad46a
|
|
| MD5 |
c9e405a45dc548bf38582d19a97f529b
|
|
| BLAKE2b-256 |
10c7af809e4c51b65ec4c168c219a5bd3994d92e866fff5fb25142450001f19e
|