Skip to main content

SDK for building, validating, signing, and packaging Nutria plugins

Project description

nutria-plugin SDK

SDK for building, validating, signing, and packaging Nutria plugins.

This release also supports declarative admin extensions, allowing plugins to expose safe, host-rendered operator views inside ChatBotNutralia.

Install

pip install nutria-plugin
# or with uv
uv add nutria-plugin

Quickstart

1. Scaffold a new plugin

nutria-plugin new my-workspace-plugin --name "My Workspace Plugin"

This creates:

my-workspace-plugin/
  plugin.json          # manifest — edit this
  README.md
  connections/         # one JSON file per connection
  skills/              # SKILL.md files
  context_docs/        # Markdown docs injected into persona prompts
  specs/               # OpenAPI/WSDL specs
  hooks/hooks.json     # declarative hooks
  settings.schema.json # config schema shown in admin UI

2. Edit plugin.json

{
  "schema_version": "1.0",
  "id": "my-workspace-plugin",
  "name": "My Workspace Plugin",
  "version": "0.1.0",
  "description": "Connects Nutria to My Workspace tool",
  "author": "Your Name",
  "runtime_types": ["declarative_api"],
  "required_secrets": ["API_KEY"],
  "remote_endpoints": ["https://api.myworkspace.com"]
}

3. Validate

nutria-plugin validate .
# OK

4. Pack

nutria-plugin pack . --output my-workspace-plugin-0.1.0.zip
# Packed: my-workspace-plugin-0.1.0.zip

5. Sign (optional)

Generate a key pair once:

nutria-plugin keygen --out my-signing-key
# Private key: my-signing-key.pem
# Public key:  my-signing-key.pub.pem

Sign before packing:

nutria-plugin sign plugin.json --key my-signing-key.pem
nutria-plugin pack . --output my-workspace-plugin-0.1.0.zip

Or sign during pack:

nutria-plugin pack . --key my-signing-key.pem --output my-workspace-plugin-0.1.0.zip

Configure the Nutria instance to trust your public key:

export NUTRIA_PLUGIN_TRUSTED_KEYS='["-----BEGIN PUBLIC KEY-----\n..."]'

Python API

from nutria_plugin import (
    PluginManifest,
    load_plugin_bundle,
    extract_plugin_bundle,
    validate_zip,
    scaffold_plugin,
    pack_plugin,
    validate_plugin_dir,
    generate_keypair,
    sign_manifest,
    verify_manifest,
    SignatureStatus,
)

# Parse a manifest
manifest = PluginManifest.from_file(Path("plugin.json"))

# Load from ZIP bytes
manifest = load_plugin_bundle(zip_bytes)

# Extract to disk
manifest = extract_plugin_bundle(zip_bytes, target_dir)

# Sign and verify
private_pem, public_pem = generate_keypair()
sig = sign_manifest(manifest.model_dump(), private_pem)
status = verify_manifest(manifest.model_dump())
assert status == SignatureStatus.VERIFIED

Plugin ZIP format

Path Description
plugin.json Manifest (required)
README.md Human-readable description
connections/*.json Connection definitions
skills/<name>/SKILL.md Skill instructions
context_docs/*.md Docs injected into persona prompts
specs/openapi.json OpenAPI spec (for openapi_bridge runtime)
specs/service.wsdl WSDL spec (for soap_bridge runtime)
hooks/hooks.json Declarative hooks
settings.schema.json JSON Schema for configuration
assets/icon.png Plugin icon

Admin frontend extensions

Plugins can declare host-rendered admin UI extensions through plugin.json -> admin_extensions.

These extensions are:

  • declared in plugin metadata
  • rendered by the Nutria host
  • safer than shipping arbitrary frontend code

See docs/admin-extensions.md for the full contract.

Security rules

  • No executable files (.py, .js, .sh, etc.) allowed in the ZIP.
  • No hidden files or directories.
  • No absolute paths or path traversal in ZIP entries.
  • Maximum bundle size: 20 MB.
  • Secrets are never stored in the ZIP — they are configured after install.

Runtime types

Value Description
remote_mcp Plugin connects to a separately deployed MCP server
declarative_api Plugin uses declarative connection JSON files (no server needed)
openapi_bridge Nutria auto-generates tools from an OpenAPI/Swagger spec
soap_bridge Nutria auto-generates tools from a WSDL/SOAP spec

License

MIT

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

nutria_plugin-0.0.1.5b0.tar.gz (71.1 kB view details)

Uploaded Source

Built Distribution

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

nutria_plugin-0.0.1.5b0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file nutria_plugin-0.0.1.5b0.tar.gz.

File metadata

  • Download URL: nutria_plugin-0.0.1.5b0.tar.gz
  • Upload date:
  • Size: 71.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nutria_plugin-0.0.1.5b0.tar.gz
Algorithm Hash digest
SHA256 12ed75097eabbe96e99cb542cf850d7f25d939c50df51281bffd5d9b4ca603ea
MD5 823bcfd8a0715332eb1329fcaa8c476b
BLAKE2b-256 1725b06fb4fe6eddd02caaebc3afc3a486cb34afceb0f50ccc6d701df87c1812

See more details on using hashes here.

Provenance

The following attestation bundles were made for nutria_plugin-0.0.1.5b0.tar.gz:

Publisher: publish.yml on AlRos14/nutria-plugin-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 nutria_plugin-0.0.1.5b0-py3-none-any.whl.

File metadata

File hashes

Hashes for nutria_plugin-0.0.1.5b0-py3-none-any.whl
Algorithm Hash digest
SHA256 657b46e7c6ba217ac1706b72828b35b30e1ab494d7ed222b191bf55100ff3134
MD5 24627adc478db58138619a017589b56c
BLAKE2b-256 eac3354ecaeaceeac9a407236baa6a9b5d4d2b179da47cfe133381341b2c2cef

See more details on using hashes here.

Provenance

The following attestation bundles were made for nutria_plugin-0.0.1.5b0-py3-none-any.whl:

Publisher: publish.yml on AlRos14/nutria-plugin-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