Publishing extensions

Publishing extensions

Publishing extensions

Function

Official extension metadata, editor contracts, and documentation have one maintained source in bt-lang/extension/<name>/: manifest.json, bindings.json, README.md, and README.zh-CN.md. Publishing copies those exact committed files and filenames into an immutable website version directory.

The website-owned db/ext/index.json stores only registry state that cannot belong to a source manifest: the latest published version, package filename, download URL, SHA-256, byte size, publication time, withdrawal state, and download count. There is no info.json or readme-source.json.

Syntax

The resulting version directory is:

The command requires all four source files to be committed on github/main, validates manifest/bindings consistency and Markdown formatting, copies the exact files, verifies the package digest and size, and updates db/ext/index.json. Generated snapshots must not be edited by hand.

Manifest catalog fields

The extension runtime fields are documented in manifest.json. Official publication additionally requires these source-owned catalog fields:

FieldTypeRequiredDefaultValid valueMeaning
summaryStringYesNoneNon-empty textShort English catalog summary.
descriptionStringYesNoneNon-empty textFull English description.
authorStringYesNoneTextSource author.
developerObjectYesNoneFields belowPublic developer or publisher identity.
repositoryStringYesNonePublic GitHub or Gitee HTTPS URLReviewable source directory.
licenseStringYesNoneSPDX expressionPackage license.
localesObjectYes{}Canonical BCP 47 keysLocalized display metadata only.

developer fields

FieldTypeRequiredDefaultValid valueMeaning
idStringYesNoneLowercase identifierStable machine identity.
nameStringYesNoneNon-empty textDefault English display name.
homepageStringNoNonePublic URLDeveloper homepage.

locales.<tag> fields

FieldTypeRequiredDefaultValid valueMeaning
summaryStringNoTop-level summaryNon-empty textLocalized short summary.
descriptionStringNoTop-level descriptionNon-empty textLocalized full description.
developer_nameStringNodeveloper.nameNon-empty textLocalized developer display name.

Language keys use canonical BCP 47 casing. Simplified Chinese is always zh-CN, matching README.zh-CN.md; aliases such as zh-cn, zh-hans, and zh-Hans must not be stored in the manifest. The public Chinese URL remains /zh-hans/ and maps internally to zh-CN.

Public metadata APIs

URLResponseCache policy
/api/ext/<name>Latest manifest plus registry release recordsRevalidated
/api/ext/<name>/<version>Requested manifest plus registry release recordsRevalidated
/api/ext/<name>/<version>/manifest.jsonExact published manifest.jsonImmutable
/api/ext/<name>/<version>/bindings.jsonExact published bindings.json for editor completion and diagnosticsImmutable
/api/ext/<name>/<version>/README.mdExact English READMEImmutable
/api/ext/<name>/<version>/README.zh-CN.mdExact Simplified Chinese READMEImmutable
/api/ext/<name>/readme/<version>English README.mdRevalidated
/api/ext/<name>/download/<version>Exact .bts packageImmutable

All exact version-file responses allow cross-origin GET requests. Tooling should resolve a version through /api/ext/<name>, then cache the immutable versioned manifest.json and bindings.json URLs.

Return value and fallback

English uses the top-level manifest display fields and README.md. The /zh-hans/ext/<name> page resolves manifest.locales['zh-CN'] and README.zh-CN.md, falling back to the English values when a translation is absent. Machine identifiers, API names, versions, hashes, ABI names, filenames, and download URLs are never localized.

Notes

  • Changes on bt-lang/main do not alter the website until a newer extension version is explicitly published.
  • Registry review and package integrity apply to the exact published version and SHA-256.
  • bindings.json is the canonical machine-readable API surface for runtime validation, VS Code completion, parameter hints, object methods, return types, and lifecycle metadata.
  • Loading a local .bts does not query the website; the registry is a distribution catalog, not a runtime allowlist.