Skip to content
Taku Docs

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 extensionCommunity plugin
What it isA Node module registered in the system repository and run by the CLIA folder the Agent can load, containing Skills, MCP servers or both
Who calls itA developer, through the CLIThe Agent on the phone
Declaration filespec/extensions.json.codex-plugin/plugin.json
Needs system sourceYesNo
Execution boundaryTrusted local code with no process sandboxRuns 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.

FieldMeaning
idExtension ID: lowercase letters, digits, and hyphens
titleDisplay name
entrypointEntry file, in the form examples/extensions/<id>/index.mjs
capabilitiesSDK methods the extension may call; methods not listed are rejected
permissionsDocuments prerequisites without granting Android access
statusExtension status, experimental here
versionDeclared version; it does not arrange updates

Invocation lifecycle

  1. The CLI reads the same registry and locates the extension.
  2. It validates the entry-point path, imports the trusted local module, and calls run(client).
  3. The scoped client rejects undeclared capabilities, then passes allowed methods to the existing SDK call path.
  4. The extension returns its result. The CLI wraps that report in a protocol response. Nonempty result.errors makes it exit with 1, even when the outer response has ok: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 codeMeaning
EXTENSION_NOT_FOUNDThe extension is not in the registry
INVALID_EXTENSIONThe entry point is invalid
CAPABILITY_NOT_DECLAREDAn 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": []
  }
}
FieldRule
nameLowercase letters, digits, and hyphens; 1–64 characters, starting with a letter or digit
versionmajor.minor.patch
descriptionMust not be empty
skillsRelative path inside the plugin to a folder with at least one subfolder containing SKILL.md
mcpServersRelative path inside the plugin to a JSON file with an mcpServers object
taku.capabilitiesWhat the plugin can do
taku.permissionsWhat 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:

  1. Run taku-plugin validate and pack, install the plugin, use it once for real, then uninstall it.
  2. Commit what pack produced, unchanged: packages/<name>-<version>.zip and index/<name>/<version>.json. Do not edit the hash or strip executable bits.
  3. Submit one version per PR. Never overwrite a released version; bump the version instead.
  4. 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.
  5. 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

Documentation retrieval

Search the published documentation for excerpts and citations. This uses full-text retrieval, not LLM-generated answers.

Every result links to the original article. Read research ideas separately from verified capabilities.

Help and troubleshooting →
Was this article helpful?
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

On this page