Manifest & Packaging
A plugin ships two things the host validates: assets/plugin.json (what the plugin is and which host services it uses) and META-INF/plugin-signature.json (who published it and that the package was not modified). This page covers both, plus the .ddp archive that carries them.
Manifest location
The manifest always lives at assets/plugin.json inside the .ddp, sourced from src/main/assets/plugin.json in the plugin project. The host parses it before installation, validates it, and shows the result on the confirmation page.
Unknown fields are ignored. A field with the wrong JSON type falls back to its default before validation reports a problem.
Fields
Fields map one to one onto the host's PluginManifest interface:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Lowercase reverse-domain identity, regex ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$, at most 128 characters, e.g. io.github.sadami3066.sora.plugin.hello. Used as the install directory and the unique plugin identity |
version | string | Yes | major.minor.patch with an optional -suffix or +build; the host records it and decides upgrades. The current plugin suite uses 0.1.0 |
apiLevel | int | No | Contract level; defaults to BASELINE_API_LEVEL (7). The host accepts 7 only and rejects anything else with API_LEVEL_UNSUPPORTED |
minHostVersion | string | No | Lowest host version that supports the plugin, e.g. "0.1.0". Only major.minor.patch is compared; suffixes are ignored |
ui | object | No | Compose UI declaration: { "apiLevel": 3, "kotlin": "2.4", "compose": "1.x" } |
name | LocalizedText | Yes | Plugin name; must contain default |
summary | LocalizedText | Yes | One-line description; must contain default |
description | LocalizedText | No | Longer description |
homepage | string | No | Must be an http(s):// URL |
changelog | string | No | Release notes text |
icon | string | No | Asset reference: asset:<path inside the bundle>, e.g. asset:icon.png. Missing or unreadable icons fall back to a placeholder |
entryClass | string | Yes | Fully qualified class implementing SoraPlugin; valid class name up to 256 characters with a public no-arg constructor |
publisher | object | No | { "name": "Publisher Name", "keyId": "..." }. name is the display name on the import page; when absent the UI falls back to the first 12 characters of the signature keyId. keyId here is descriptive only — publisher identity comes from the signature |
provides | object | No | Pre-install declaration of contributions: { tools, skills, uiSlots, pages } |
capabilities | string[] | Yes | Host services the plugin uses. Must be present (an empty array is legal but the plugin can do almost nothing) |
permissions | string[] | No | Android runtime permissions and special grants the plugin requests |
components | object | No | Host-proxied platform components the plugin needs |
defaultEnabled | bool | No | Whether the plugin is enabled right after the first install; defaults to true |
Example manifest:
{
"id": "io.github.sadami3066.sora.plugin.hello",
"version": "0.1.0",
"apiLevel": 7,
"minHostVersion": "0.1.0",
"ui": { "apiLevel": 3 },
"entryClass": "io.github.sadami3066.sora.plugin.hello.HelloPlugin",
"name": { "default": "Hello", "zh": "你好", "en": "Hello" },
"summary": {
"default": "A minimal Sora plugin.",
"zh": "一个最小的 Sora 插件。",
"en": "A minimal Sora plugin."
},
"icon": "asset:icon.png",
"publisher": { "name": "Your Name" },
"capabilities": ["logs", "settings", "device"],
"provides": { "tools": ["hello"], "skills": [], "uiSlots": [], "pages": [] },
"defaultEnabled": true
}Localized text
Every text field is a LocalizedText. The object form requires a default key and accepts language tags; the app language selects zh or en and falls back to default:
"name": { "default": "Hello", "zh": "你好", "en": "Hello" }A plain string is also accepted and becomes default only. At runtime plugins read these values with host.text(source, *args), which also applies String.format placeholders (%s, %d); pass only strings and numbers.
Provides
provides is a pre-install declaration used for conflict checks and the confirmation page. It must match what the plugin actually returns from contributions() and ui().
| Key | Contents | Identifier rule |
|---|---|---|
tools | Tool names | ^[a-z][a-z0-9_]*$, unique, no conflict with host reserved names |
skills | Skill ids | ^[a-z][A-Za-z0-9_-]*$, unique; dots are not allowed |
uiSlots | Registered slot ids | Must pass SlotIds.matches: tool.card.content:<tool> or chat.message:<customType> |
pages | Plugin page ids | ^[a-z][a-z0-9_.-]*$, unique |
themes | Theme pack ids | ^[a-z][a-z0-9_-]*$, unique; must match the ids in assets/themes.json when present |
Capabilities
capabilities is required. Each entry names a host service group; the host injects only the declared services, and calling an undeclared accessor throws PluginServiceUnavailable. There are 39 capabilities: 18 base capabilities and 21 device/system capabilities.
Base capabilities
| Wire name | Accessor | Enables |
|---|---|---|
linux | host.linux() | Linux environment command execution and streaming output |
screen | host.screen() | Screen observation, screenshots, taps, gestures, virtual screen |
notifications | host.notifications() | Posting and updating notifications, notification listening and actions |
secrets | host.secrets() | Encrypted key-value storage isolated by plugin id |
network | host.network() | HTTP requests and downloads |
files | host.files() | Plugin data and workspace file access |
sessions | host.sessions() | Session list, history, prompt, create, rename, archive |
jobs | host.jobs() | Background job start, read, kill |
timers | host.timers() | One-shot and cron reminders |
goals | host.goals() | Goal create, edit, pause, resume, complete |
miniapp | host.miniapp() | Mini-app scan, load, create, edit, run, delete |
mcp | host.mcp() | MCP server probing, tool listing, tool calls |
ui | host.ui() | Open URLs, sharing, pages, pickers, dialogs, Snackbar, theme state |
app | host.app() | Read-only app and device metadata |
bus | host.bus() | Lightweight event bus between plugins |
logs | host.logs() | Host log output |
chat | host.chat() | Deliver messages, cards, and attachments to a session |
prompt | — | Allows PromptOverridePlugin to override prompt preamble and rules |
app and logs are always available; chat and images have default implementations that throw PluginServiceUnavailable when the host does not wire them.
Device and system capabilities
| Wire name | Accessor | Enables |
|---|---|---|
settings | host.settings() | Plugin key-value and JSON settings with a change stream |
device | host.device() | Device info, battery/network/screen state, vibration, system settings shortcuts |
clipboard | host.clipboard() | Clipboard text and URI access |
permissions | host.permissions() | Runtime permission requests, special-grant state, settings shortcuts |
packages | host.packages() | Installed app list, install/uninstall, launch, app info, icons |
privilege | host.privilege() | Current execution tier, Root/ADB state, tiered command execution, ADB pairing |
intents | host.intents() | Start activities and services, send broadcasts, resolve intents |
components | host.components() | Host-proxied plugin window and dynamic broadcast receivers (experimental) |
background | host.background() | Background tasks, boot callbacks, foreground services, battery optimization |
location | host.location() | Last location, single fix, update stream, geocoding |
contacts | host.contacts() | Contact query, search, create, update, delete |
sms | host.sms() | SMS threads and messages, send, mark read, delete |
calendar | host.calendar() | Calendar and event read/write |
media | host.media() | Downloads/gallery save, scan, open, share, preview, image read, URI import |
speech | host.speech() | Text-to-speech and speech recognition |
web | host.web() | Host web search and page fetch |
images | host.images() | Load a remote image into memory for cards |
credentials | host.credentials() | Read configured host provider and MCP credentials (experimental, read-only) |
accessibility | host.accessibility() | Accessibility event stream and global actions (experimental) |
share | — | Receive system shares through shareReceived |
deeplink | — | Receive deep link paths through deepLinkReceived |
share and deeplink have no accessor: they gate the matching hooks and require the corresponding components entry.
Permissions
permissions lists the Android permissions and special grants the plugin works with, using the constants from PluginPermission. The list is validated at install: a permission whose owning capability is not declared fails with PERMISSION_WITHOUT_CAPABILITY, and unknown or duplicate values fail with INVALID_PERMISSION.
Runtime permissions
| Wire name | Android permission | Capability |
|---|---|---|
location.coarse | ACCESS_COARSE_LOCATION | location |
location.fine | ACCESS_FINE_LOCATION + ACCESS_COARSE_LOCATION | location |
contacts.read | READ_CONTACTS | contacts |
contacts.write | READ_CONTACTS + WRITE_CONTACTS | contacts |
sms.read | READ_SMS | sms |
sms.send | SEND_SMS | sms |
calendar.read | READ_CALENDAR | calendar |
calendar.write | READ_CALENDAR + WRITE_CALENDAR | calendar |
camera | CAMERA | ui |
microphone | RECORD_AUDIO | ui |
notifications.post | POST_NOTIFICATIONS | notifications |
Request runtime permissions with host.permissions().request(...); the system dialog is shown by the host.
Special grants
Special grants have no runtime dialog. The user enables them in system settings; query state with host.permissions().special(...) and guide with openSettings(...).
| Wire name | Setting | Capability |
|---|---|---|
notifications.listen | Notification access | notifications |
accessibility | Accessibility service | accessibility |
overlay | Display over other apps | permissions |
usage-stats | Usage access | permissions |
battery-optimization | Ignore battery optimizations | permissions |
install-packages | Install unknown apps | packages |
manage-storage | All files access | media |
Components
components declares platform components that the host proxies. Plugins cannot register activities, services, or receivers in the manifest themselves.
| Field | Type | Purpose | Capability |
|---|---|---|---|
background | bool | Background tasks and boot callbacks | background |
foregroundService | bool | Host foreground service proxy with ongoing progress | background |
notificationListener | bool | Notification listening: notificationReceived, recent, received, removed | notifications |
accessibility | bool | Accessibility events and global actions | accessibility |
share | bool | Receive system shares through shareReceived | share |
deeplinks | string[] | Deep link paths to receive; matches an equal path or a path starting with the declared path plus / | deeplink |
Deep link paths use ^[a-z0-9][a-z0-9/._-]*$, at most 128 characters, and must be unique. Every enabled component needs its capability, otherwise the install fails with COMPONENT_WITHOUT_CAPABILITY.
{
"capabilities": ["notifications", "background", "share", "deeplink"],
"permissions": ["notifications.listen"],
"components": {
"notificationListener": true,
"foregroundService": true,
"share": true,
"deeplinks": ["sync", "sync/start"]
}
}UI declaration
"ui": { "apiLevel": 3 }| Field | Rule |
|---|---|
ui.apiLevel | Compose UI level. Accepted range is 1..HOST_UI_API_LEVEL (3). A value outside the range is a warning: only Compose bindings and pages are disabled, the plugin still loads |
ui.kotlin | Optional. Must match the host Kotlin major/minor version (e.g. "2.4"). A mismatch disables the plugin's UI |
ui.compose | Optional. Must equal the host Compose runtime version exactly (not the Compose BOM version). A mismatch disables the plugin's UI |
Write only ui.apiLevel unless you have a reason to pin the compiler versions. When UI is disabled the plugin's tools, skills, prompts, and hooks keep working.
Versioning rules
| Field | Rule | Current value |
|---|---|---|
version | major.minor.patch with an optional suffix. An update must be strictly newer than the installed version; the same version with different content is rejected as a conflict | 0.1.0 |
minHostVersion | Lowest host version supporting the plugin. Compared by major.minor.patch only, so 0.1.0-dev counts as 0.1.0 | "0.1.0" |
apiLevel | Contract level; the host accepts 7 only | 7 |
ui.apiLevel | Compose UI level; the host accepts up to 3 | 3 |
The host version comes from the Android app's BuildConfig.VERSION_NAME. Set minHostVersion to the lowest Sora app version the plugin supports, such as "0.1.0" after verifying it on that release. The host rejects higher requirements with HOST_VERSION_UNSUPPORTED. The API level describes the plugin contract, and the Maven artifacts plugin-api and design are versioned independently.
Publisher identity is separate from the version: updates under the same id must be signed with the same Ed25519 key. A new key is a new publisher, and installed users cannot upgrade to it.
The .ddp bundle
A .ddp is a ZIP archive with a fixed layout:
my-plugin.ddp
├── classes.dex # required, at least one
├── classes2.dex # optional, loaded in ordinal order
├── assets/
│ ├── plugin.json # required, exactly at this path
│ ├── icon.png # referenced by the manifest icon
│ └── skills/... # skill markdown and attached files
├── lib/<abi>/*.so # optional, included in the digest, not loaded by the host
└── META-INF/plugin-signature.json # required for installRules enforced by the host:
- At least one root
classes*.dexis required; entries load in ordinal order (classes.dex,classes2.dex, ...) and duplicate ordinals are rejected. assets/plugin.jsonmust exist at that exact path.- Entry names must be safe relative paths: no leading
/, no.., no\, no:, no NUL, at most 512 characters; duplicates are rejected. - The whole package may be at most 100 MB; the total uncompressed size may be at most 256 MB.
lib/**is included in the signature digest and unpacked, but the host does not add it to the classloader's library path, soSystem.loadLibrarydoes not work. Ship pure-Kotlin/JVM code instead.- The APK's Android manifest, resources, and APK signature are ignored; only dex and assets participate.
Signature specification (ddp-1)
Installing requires META-INF/plugin-signature.json, produced by the signing task. The algorithm is Ed25519 over a canonical digest of the archive contents.
Canonical entry digest
Take every non-directory entry whose name does not start with META-INF/. Sort them by the UTF-8 byte order of the entry name. For each entry emit one line:
<sha256-hex-lowercase><SP><uncompressed-size-decimal><SP><entry-name>\nsha256 is computed over the uncompressed entry contents. Concatenate the lines directly (the last line ends with \n) and encode as UTF-8. Those bytes are the message to sign, and the host recomputes them when verifying.
Signature file
{
"algorithm": "Ed25519",
"keyId": "ed25519:8bfc1ba034dbf5bc113d469ce1f1a6350bc4c104105aa92b104eda3896fad213",
"publicKey": "<base64(std) of the X.509 SubjectPublicKeyInfo DER>",
"signature": "<base64(std) of the 64-byte Ed25519 signature over the canonical digest>"
}| Field | Value |
|---|---|
algorithm | Always "Ed25519" |
keyId | ed25519: + lowercase hex SHA-256 of the DER-encoded public key |
publicKey | Base64 of the X.509 SubjectPublicKeyInfo DER |
signature | Base64 of the 64-byte Ed25519 signature over the canonical entry digest bytes |
The host rejects the package when the algorithm is not Ed25519, when keyId does not equal the SHA-256 of publicKey, when the signature does not verify, or when the entry digest changed after signing. The whole-package SHA-256 is recorded at install and re-checked before every load.
Packaging commands
The template and every official plugin rely on the same three tasks:
| Task | Input | Output |
|---|---|---|
assemblePlugin | build/outputs/apk/debug/<module>-debug.apk | build/plugin/<module>.unsigned.ddp |
signPlugin | .unsigned.ddp + Ed25519 key pair | build/plugin/<module>.ddp with META-INF/plugin-signature.json |
verifyPlugin | signed .ddp | Prints Signature OK or fails |
./gradlew assemblePlugin signPlugin verifyPluginsignPlugin prints the publisher keyId, the whole-package SHA-256, and the entry digest — record the keyId for the marketplace entry. verifyPlugin only proves the signature matches the package; manifest mistakes still surface at install time.
Signing keys resolve from a base path without extension (.pem private key and .pub public key sit next to it). The shared script used by official plugins resolves, in order:
-PpluginSigningKey=<base>SORA_PLUGIN_SIGNING_KEY$SORA_SECRETS_DIR/plugin-signing~/.config/sora/secrets/plugin-signing<rootProject>/keys/plugin-signing
The template task supports -PpluginSigningKey with the default keys/plugin-signing. Key generation, CI provisioning, and troubleshooting are covered in Testing & Signing.
Validation codes
The host validates the manifest at install time and reports the first failing checks on the confirmation page or the plugin row:
| Code | Meaning |
|---|---|
INVALID_ID | id is not lowercase reverse domain or exceeds 128 characters |
INVALID_VERSION | version is not major.minor.patch with an optional suffix |
INVALID_MIN_HOST_VERSION | minHostVersion cannot be parsed |
HOST_VERSION_UNSUPPORTED | The host is older than minHostVersion |
API_LEVEL_UNSUPPORTED | apiLevel is outside MIN_SUPPORTED_API_LEVEL..PLUGIN_API_LEVEL |
UI_API_LEVEL_UNSUPPORTED | ui.apiLevel is outside 1..HOST_UI_API_LEVEL; warning, UI is disabled |
ENTRY_CLASS_MISSING / INVALID_ENTRY_CLASS | entryClass missing, too long, or not a valid class name |
MISSING_TEXT / INVALID_TEXT | name/summary lacks default, or a text key is blank |
INVALID_ICON | icon is not a safe relative asset path |
INVALID_URL | homepage is not an http(s) URL |
INVALID_PROVIDES | A provides entry is invalid or duplicated |
MISSING_CAPABILITIES | capabilities is absent |
INVALID_CAPABILITY | capabilities contains an unknown wire name |
INVALID_UI_SLOT | A provides.uiSlots id fails SlotIds.matches |
INVALID_SKILL | A returned skill id, markdown, or file reference is invalid |
INVALID_PERMISSION | permissions contains an unknown or duplicate value |
PERMISSION_WITHOUT_CAPABILITY | A permission's capability is not declared |
COMPONENT_WITHOUT_CAPABILITY | An enabled component's capability is not declared |
INVALID_DEEPLINK | A deep link path is malformed or duplicated |
Install can also fail after validation:
| Failure | Cause and fix |
|---|---|
| Signature verification failed | The bundle was modified after signing, the key pair does not match, or the signature entry is missing. Re-run signPlugin from a clean assemblePlugin output |
| Publisher mismatch | The new version is signed with a different key. Updates must reuse the key of the first install |
| Version conflict | The version is not newer than the installed one, or the same version has different content |
| Tool name conflict | provides.tools collides with a host reserved name or another installed plugin |
ClassNotFoundException / NoSuchMethodException | entryClass is wrong or the class has no public no-arg constructor |
PluginServiceUnavailable at runtime | A service accessor is used without its capability in the manifest |
| Slot or page does not appear | Slot id fails SlotIds.matches, the page is not listed in ui(), or ui.apiLevel/ui.kotlin/ui.compose does not match the host |
