NextGram/plugins Start here For AI agents

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#

  1. /llms.txt — the index and the hard constraints.
  2. /raw/authoring-checklist.md — the non-negotiable rules.
  3. /raw/package-format.md — the manifest and the verifier.
  4. The one capability page the task needs, for example /raw/screens.md or /raw/capabilities.md.
  5. /raw/build-sign.md before 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#

EndpointContents
/llms.txtCurated index, reading order and required facts
/llms-full.txtEvery page concatenated with page markers
/ai.jsonPage titles, descriptions, groups, URLs and Markdown paths
/search-index.jsonSection-level search records
/raw/<slug>.mdThe clean Markdown source of one page
/sitemap.xmlCanonical page URLs

Each rendered page also declares its Markdown source:

html
<link rel="alternate" type="text/markdown" href="/raw/package-format.md">

Canonical facts#

FactValue
Manifest formatformat: "ngp", formatVersion: 1, api: 1
Package kindsts (script), java (code), hybrid
Removed kindtheme is rejected with E_UNSUPPORTED_KIND; use ui.appearance
TypeScript payloadscript/main.js, one IIFE, max 8 MB
Java payloadandroid/dex/classes.dex, exactly one file, max 32 MB
Package limits64 MB file, 192 MB uncompressed, 4096 entries, 200:1 per entry
Manifest sizeplugin.json max 256 KB
SignatureJAR signing, SHA-256, RSA ≥ 2048 or EC ≥ P-256, self-signed certificate
Update identitySame plugin id and same signing key, strictly higher versionCode
UI limits10,000 nodes, depth 64, 10,000 characters per string, 10,000 canvas ops
Minimum hostminHost is required for ts, hybrid and every new capability

Rules that prevent rejection#

  • Use an immutable lowercase reverse-DNS id with at least two segments. app.nextgram.* is reserved and an external package with that prefix is rejected.
  • Keep format, formatVersion and api exactly at the values above. Do not invent fields.
  • Use semver version; use a positive integer versionCode that increases on every release.
  • A ts/script package must not contain android/. A java/code package must not contain script/. Only hybrid contains both.
  • Do not bundle dev.nextgram.plugin.v1.* classes; the SDK is compileOnly and the host provides it at runtime.
  • Do not define classes in java.*, javax.*, android.*, dalvik.*, org.telegram.*, dev.nextgram.plugin.* or dev.nextgram.builtin.*.
  • Do not declare Android components or use Android resources and R.*. Bundle assets as files under assets/.
  • TypeScript bundles must not use require, module.exports, runtime ESM imports, dynamic imports, node:* or bare Node built-ins. The output must assign globalThis.__ngp_plugin__.
  • Declare the minimum permissions. Unknown permissions reject the package. ui.screens is high risk and off at install.
  • internal.access and 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:

bash
nextgram-plugin build
nextgram-plugin pack --key key.pem --cert cert.pem
nextgram-plugin verify build/*.ngp

For Java and hybrid packages, from NextGram-android/:

bash
./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.