For AI agents
How an AI coding agent should read this site, validate a plugin and avoid rejected packages.
This site is built to be read by an agent without scraping HTML. Every page has a Markdown source, a stable URL and a description. The rules below are the ones that most often decide whether a generated package installs or is rejected.
Reading order#
/llms.txt— the index and the hard constraints./raw/authoring-checklist.md— the non-negotiable rules./raw/package-format.md— the manifest and the verifier.- The one capability page the task needs, for example
/raw/screens.mdor/raw/capabilities.md. /raw/build-sign.mdbefore producing an artifact.
Do not read the whole site by default. Fetch llms.txt, then the page that matches the task. Use llms-full.txt only when a question spans several pages.
Machine endpoints#
| Endpoint | Contents |
|---|---|
/llms.txt | Curated index, reading order and required facts |
/llms-full.txt | Every page concatenated with page markers |
/ai.json | Page titles, descriptions, groups, URLs and Markdown paths |
/search-index.json | Section-level search records |
/raw/<slug>.md | The clean Markdown source of one page |
/sitemap.xml | Canonical page URLs |
Each rendered page also declares its Markdown source:
<link rel="alternate" type="text/markdown" href="/raw/package-format.md">Canonical facts#
| Fact | Value |
|---|---|
| Manifest format | format: "ngp", formatVersion: 1, api: 1 |
| Package kinds | ts (script), java (code), hybrid |
| Removed kind | theme is rejected with E_UNSUPPORTED_KIND; use ui.appearance |
| TypeScript payload | script/main.js, one IIFE, max 8 MB |
| Java payload | android/dex/classes.dex, exactly one file, max 32 MB |
| Package limits | 64 MB file, 192 MB uncompressed, 4096 entries, 200:1 per entry |
| Manifest size | plugin.json max 256 KB |
| Signature | JAR signing, SHA-256, RSA ≥ 2048 or EC ≥ P-256, self-signed certificate |
| Update identity | Same plugin id and same signing key, strictly higher versionCode |
| UI limits | 10,000 nodes, depth 64, 10,000 characters per string, 10,000 canvas ops |
| Minimum host | minHost is required for ts, hybrid and every new capability |
Rules that prevent rejection#
- Use an immutable lowercase reverse-DNS
idwith at least two segments.app.nextgram.*is reserved and an external package with that prefix is rejected. - Keep
format,formatVersionandapiexactly at the values above. Do not invent fields. - Use semver
version; use a positive integerversionCodethat increases on every release. - A
ts/scriptpackage must not containandroid/. Ajava/codepackage must not containscript/. Onlyhybridcontains both. - Do not bundle
dev.nextgram.plugin.v1.*classes; the SDK iscompileOnlyand the host provides it at runtime. - Do not define classes in
java.*,javax.*,android.*,dalvik.*,org.telegram.*,dev.nextgram.plugin.*ordev.nextgram.builtin.*. - Do not declare Android components or use Android resources and
R.*. Bundle assets as files underassets/. - TypeScript bundles must not use
require,module.exports, runtime ESM imports, dynamic imports,node:*or bare Node built-ins. The output must assignglobalThis.__ngp_plugin__. - Declare the minimum permissions. Unknown permissions reject the package.
ui.screensis high risk and off at install. internal.accessand the internal facade are trusted-memory access. Do not request them unless the task explicitly requires native internals.
Validation loop#
Run these before handing a package to a person:
nextgram-plugin build
nextgram-plugin pack --key key.pem --cert cert.pem
nextgram-plugin verify build/*.ngpFor Java and hybrid packages, from NextGram-android/:
./gradlew :nextgram-plugin-sdk:compileJava :nextgram-plugin-sdk-android:assembleDebug
docs/plugins/tools/build-ngp.sh <plugin-dir> <output.ngp>
jarsigner -verify <output.ngp>verify mirrors the host checks: allowed roots, manifest fields, package and entry limits, prohibited extensions, nested archives, icon dimensions, DEX magic and signature coverage. A package that fails verify will fail the installer.
When information is missing#
The site describes the shipped API 1 surface. If a symbol, permission or field is not on this site, do not guess it. Check the SDK sources under NextGram-android/nextgram-plugin-sdk, nextgram-plugin-sdk-android and nextgram-plugin-ts/packages/plugin/src. Ask for the missing contract instead of emitting a plausible-looking API that the host does not implement.
Reporting a result#
When an agent finishes a plugin, report:
- the plugin id and version;
- the package kind and payload paths;
- the exact permissions;
- the signing fingerprint or the fact that the package is unsigned for developer mode;
- the commands that produced and verified the artifact;
- any host contract that could not be verified from the sources.