Version 1.4.0 (current)
Extension format and lifecycle
Use the device-report declaration to register a trusted local extension, define its call scope and Android permissions, and learn the community plugin format.
Use this reference after writing a working device tool, when you want the existing CLI to discover and call it. A standalone script does not need registration.
Taku OS has two forms that are easy to confuse. The first part of this page covers local extensions. To share with others, go straight to Community plugin format.
| Local extension | Community plugin | |
|---|---|---|
| What it is | A Node module registered in the system repository and run by the CLI | A folder the Agent can load, containing Skills, MCP servers or both |
| Who calls it | A developer, through the CLI | The Agent on the phone |
| Declaration file | spec/extensions.json | .codex-plugin/plugin.json |
| Needs system source | Yes | No |
| Execution boundary | Trusted local code with no process sandbox | Runs with the Agent's own privileges, with no sandbox |
Goal and prerequisites
The current registry is spec/extensions.json in the system repository. Create examples/extensions/<id>/index.mjs and export run(client); the CLI accepts only entry points in that pattern. IDs use lowercase letters, digits, and hyphens. You need Node.js 20+; device permissions depend on the methods you call.
client.call() invokes an SDK method and returns its result, throwing on failure. This entry point keeps per-method errors so that one failed query does not discard the others:
export async function run(client) {
const report = { extension: 'my-report', observations: {}, errors: {} };
for (const method of ['system.info', 'displays.status']) {
try {
report.observations[method] = await client.call(method);
} catch (error) {
report.errors[method] = { code: error.code, message: error.message, retryable: error.retryable };
}
}
return report;
}What callable interfaces should deliver
Document the tool's purpose, required Android identity and permissions, actual output, failure behavior, and one reproducible example. Keep implementation, declaration, and on-device results together. Interfaces with UI should share the same business state so that either path can verify the result.
The current CLI runs the extension's run(client) without a separate business-parameter argument. Do not add undocumented flags as if a general extension-input API already existed. New parameters, event callbacks, or hardware methods need an implementation and tests before they become part of the contract.
Example declaration
{
"id": "device-report",
"title": "设备能力实况报告",
"entrypoint": "examples/extensions/device-report/index.mjs",
"capabilities": [
"system.info",
"displays.status",
"tasks.status"
],
"permissions": [
"authorized-adb-shell-or-on-device-shell",
"root-for-task-metadata"
],
"status": "experimental",
"version": "0.1.0"
}This is the actual device-report declaration, not a remote-install manifest. Method names and permission descriptions should agree with the implementation and actual Android privileges. The Chinese title is preserved from the source declaration.
| Field | Meaning |
|---|---|
id | Extension ID: lowercase letters, digits, and hyphens |
title | Display name |
entrypoint | Entry file, in the form examples/extensions/<id>/index.mjs |
capabilities | SDK methods the extension may call; methods not listed are rejected |
permissions | Documents prerequisites without granting Android access |
status | Extension status, experimental here |
version | Declared version; it does not arrange updates |
Invocation lifecycle
- The CLI reads the same registry and locates the extension.
- It validates the entry-point path, imports the trusted local module, and calls
run(client). - The scoped client rejects undeclared capabilities, then passes allowed methods to the existing SDK call path.
- The extension returns its result. The CLI wraps that report in a protocol response. Nonempty
result.errorsmakes it exit with1, even when the outer response hasok:true.
Outputs, errors, and events
device-report returns generatedAt, observations, errors, and boundaries inside the CLI response's result. Check both the per-method errors and the exit code; see the walkthrough.
| Error code | Meaning |
|---|---|
EXTENSION_NOT_FOUND | The extension is not in the registry |
INVALID_EXTENSION | The entry point is invalid |
CAPABILITY_NOT_DECLARED | An undeclared method was called |
The scoped client restricts calls made through that SDK object. The module itself runs in the same trusted Node process; this does not isolate arbitrary third-party code. Unified event subscriptions, marketplace installation/removal, and dependency upgrades are not available.
Next: Reproduce the example, then add implementation and tests according to the contribution standard.
Community plugin format
Community plugins are shared in the public Taku-OS/taku-os-plugins repository and do not need the system source. This section summarizes that repository's documentation; its manifest format and contributing guide are authoritative for details.
What a plugin contains
A plugin is a folder containing at least one of Skills (one SKILL.md per skill) or MCP servers (tools the Agent can call). Its manifest is .codex-plugin/plugin.json:
{
"name": "status-tip",
"version": "1.0.0",
"description": "Shows a short reminder",
"skills": "./skills/",
"taku": {
"capabilities": ["show a reminder"],
"permissions": []
}
}| Field | Rule |
|---|---|
name | Lowercase letters, digits, and hyphens; 1–64 characters, starting with a letter or digit |
version | major.minor.patch |
description | Must not be empty |
skills | Relative path inside the plugin to a folder with at least one subfolder containing SKILL.md |
mcpServers | Relative path inside the plugin to a JSON file with an mcpServers object |
taku.capabilities | What the plugin can do |
taku.permissions | What access it needs; use an empty array if none |
At least one of skills or mcpServers is required, and paths must stay inside the plugin folder.
Install a plugin
On Taku OS, download the plugin ZIP, check it against the SHA-256 in the matching file under index/, unzip it into a working folder under /data/local/agentos/work, and read through it. Then run:
taku-plugin validate <unzipped-folder>
taku-plugin pack <unzipped-folder> <output-folder>
taku-plugin catalog-add <output-folder>
taku-plugin install <marketplace-path-from-previous-step> <plugin-name>Plugins run with the Agent's own privileges. The permission list is an honest declaration, not a sandbox, so install only plugins you have read or trust.
Share a plugin
You can ask the Agent on your phone to publish it, for example “Turn what we just did into a plugin and publish it to the community.” To submit by hand:
- Run
taku-plugin validateandpack, install the plugin, use it once for real, then uninstall it. - Commit what
packproduced, unchanged:packages/<name>-<version>.zipandindex/<name>/<version>.json. Do not edit the hash or strip executable bits. - Submit one version per PR. Never overwrite a released version; bump the version instead.
- List every capability and permission in the manifest. If the plugin uses the network or depends on an external service, say so in the PR.
- Do not include credentials, tokens, private keys, personal data, build caches, or unrelated files.
CI checks the package structure, paths, and that the ZIP matches its index record. Passing CI is required, and maintainers also review usefulness, origin, and whether declared permissions match what the code does. They may ask for changes or decline a submission.
Research preview · Current availability
Report an issue or give feedback
Delivery to the maintenance queue does not mean it has been handled. Feedback is retained for 90 days.
Built with Fumadocs