<!-- AANCER developer pages, part 2 of 16. All parts: https://aancer.ai/dev/llms.txt -->

## Quick start

The smallest useful pack holds one skill.

```text
my-pack/
  manifest.json
  content/
    vendor-review.json
```

`manifest.json`:

```json
{
  "v": 2,
  "kind": "bundle",
  "id": "acme.business-skills",
  "version": "1.0.0",
  "title": "Acme business skills",
  "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" },
  "requires": { "platform": ">=1.0.0" },
  "items": [
    {
      "kind": "skill",
      "schemaVersion": 1,
      "id": "vendor-review",
      "scope": "install",
      "spec": { "$ref": "content/vendor-review.json" }
    }
  ]
}
```

`content/vendor-review.json` is a skill spec (see [Skills](/developers/skills)). Sign it and import it:

```bash
aancer-pack keygen --out acme.key
aancer-pack sign manifest.json content/ -o acme.business-skills-1.0.0.ancpack --key acme.key
aancer-pack verify acme.business-skills-1.0.0.ancpack --pubkey acme.pub
```

Then an administrator adds your public key under **Platform Settings > Extensions > Trust keys** and imports the file with **Import pack**.

## File layout

What you write (the input to `aancer-pack sign`):

```text
my-pack/
  manifest.json            # the manifest; items point at content files with {"$ref": "content/<file>.json"}
  content/
    <item>.json            # one JSON object per item spec (or put the spec inline in manifest.json)
    logos/logo.png         # binary assets, only the allowed media types
```

What the installation reads (the signed archive):

```text
MANIFEST.json   # your manifest in signing form: every $ref gets a "$hash", binaries are listed in "assets"
MANIFEST.sig    # base64url Ed25519 signature over the canonical JSON of MANIFEST.json
content/...     # every file must be referenced by an item ($ref) or listed in assets
```

Rules for the archive:

- `MANIFEST.json` must be at the root.
- `MANIFEST.sig` must be present and not empty.
- Every other file must live under `content/`. No `..`, no backslashes in names.
- Every file under `content/` must be referenced by an item `$ref` or listed in `assets`. An extra file makes the whole pack fail the signature check.
- A `$ref` file must contain a JSON object.
- Use stored or deflate compression only. No encrypted entries.

## Field reference

JSON Schema: [pack-manifest.schema.json](https://aancer.ai/dev/schemas/pack-manifest.schema.json)

### Manifest

| Field | Type | Required | Rules |
|---|---|---|---|
| `v` | integer | yes | must be `2` |
| `kind` | string | yes | must be `"bundle"` |
| `id` | string | yes | `^[a-z0-9][a-z0-9._-]{2,63}$`. Use `<publisher>.<name>`, for example `acme.invoice-desk` |
| `version` | string | yes | strict semver: `MAJOR.MINOR.PATCH`, optional `-pre`. No `+build` part |
| `title` | string | no | shown in the admin screen. Required (1 to 120 characters) when `listing` is present |
| `publisher` | object | no | `{ "name": "...", "keyId": "..." }`. `keyId` names the key that signed the pack |
| `requires.platform` | string | no | `>=X.Y.Z`, optionally followed by ` <X.Y.Z` |
| `requires.points` | object | no | map of kind to schema version, for example `{"skill": "1"}`. Informational |
| `parameters` | array | no | values the administrator fills in at activation. See Parameters |
| `assets` | array | no | binary files with their hashes. `aancer-pack sign` writes this for you |
| `items` | array | yes | 1 to 256 items. See Items |
| `listing` | object | no | catalog listing. Needed for a certified catalog submission |
| `declarations` | object | no | licence, data flows, network access, AI use. Needed for a certified catalog submission |
| `certification` | object | no | added by AANCER certification. Never write it yourself |

### Items

| Field | Type | Required | Rules |
|---|---|---|---|
| `kind` | string | yes | one of `theme`, `locale`, `dataset`, `model`, `widget`, `dashboard`, `hook`, `app`, `link`, `card`, `skill`, `connector`, `template`, `agent-blueprint` |
| `schemaVersion` | integer | yes | the item format version. See the table below |
| `id` | string | yes | `^[a-z0-9][a-z0-9._-]{0,63}$`, unique within the pack |
| `scope` | string | no | `install` (default) or `workspace`. `agent-blueprint` and `connector` must be `install` |
| `workspace` | string | if scope is `workspace` | a workspace id or `{{param.<id>}}`. Not allowed with `install` scope |
| `spec` | object | yes | the item spec inline, or `{"$ref": "content/<file>.json"}` |

Supported schema versions:

| Kind | Versions | Page |
|---|---|---|
| `template` | 1 | [Templates](/developers/templates) |
| `agent-blueprint` | 1 | [Agents](/developers/agents) |
| `skill` | 1 | [Skills](/developers/skills) |
| `theme` | 2 (1 for simple branding) | [Themes](/developers/themes) |
| `locale` | 1 | [Themes](/developers/themes) |
| `connector` | 1 | [Connectors](/developers/connectors) |
| `dataset`, `model`, `widget`, `dashboard` | 1 | [Dashboards](/developers/dashboards) |
| `hook` | 1 | [Hooks](/developers/hooks) |
| `app` | 2 | [Embedded apps](/developers/apps) |
| `link`, `card` | 1 | [Embedded apps](/developers/apps) |

An item with a schema version that the installation does not support is staged as `unsupported`. It is not an error, but nothing is installed. `GET /api/extensions/schemas` returns the table for a given installation.

### Parameters

Parameters let one pack work in any installation. The administrator binds them at activation.

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | `^[a-z][a-z0-9_]{0,63}$`, unique |
| `type` | string | yes | `connection`, `workspace`, `dataset`, `string`, `secret`, `workflow`, `agent` |
| `label` | string | no | shown in the activation dialog |
| `required` | boolean | no | default `true` |
| `connector` | string | no | for `connection`: the connector the connection must belong to |
| `default` | any | no | used when no value is sent and none was bound before |

Reference a parameter as the whole string `{{param.<id>}}` anywhere in a spec or in an item's `workspace`. Every referenced parameter must be declared. At activation every value is a string. A `workspace` value must name an existing workspace. A `connection` value must name an existing connection. A `secret` is stored encrypted.

### Assets

| Field | Type | Rules |
|---|---|---|
| `path` | string | starts with `content/`, no `..` |
| `sha256` | string | 64 lower-case hex characters |
| `contentType` | string | `font/woff2`, `image/png`, `image/svg+xml`, `image/jpeg`, `image/x-icon`. `application/x-tar` only as the `archive` of a connector item |

`aancer-pack sign` lists every binary file for you. Each asset is at most 4 MiB. A connector archive is at most 96 MiB.

### Catalog blocks

You only need `listing` and `declarations` to submit a pack to the certified catalog. When they are present they are checked strictly and unknown fields are refused.

`listing`:

| Field | Rules |
|---|---|
| `v` | `1` |
| `summary` | required, 1 to 280 characters |
| `description` | plain text, at most 4000 characters |
| `category` | required. One of `operations`, `finance`, `hr`, `legal`, `sales`, `marketing`, `customer-service`, `it`, `devops`, `security`, `compliance`, `procurement`, `manufacturing`, `healthcare`, `retail`, `education`, `public-sector`, `productivity`, `analytics`, `other` |
| `tags` | at most 8, each `^[a-z0-9][a-z0-9-]{0,31}$` |
| `icon` | path of an image listed in `assets` |
| `screenshots` | at most 5 image paths listed in `assets` |
| `releaseNotes` | at most 4000 characters |
| `supportUrl` | https URL, at most 300 characters, no credentials |
| `locales` | keys `en`, `de`, `es`, `ar`; each `{ title?, summary?, description? }` |

`declarations`:

| Field | Rules |
|---|---|
| `v` | `1` |
| `licence` | one of `0BSD`, `AGPL-3.0-only`, `AGPL-3.0-or-later`, `Apache-2.0`, `BSD-2-Clause`, `BSD-3-Clause`, `BSL-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0`, `CC0-1.0`, `EPL-2.0`, `EUPL-1.2`, `GPL-2.0-only`, `GPL-2.0-or-later`, `GPL-3.0-only`, `GPL-3.0-or-later`, `ISC`, `LGPL-2.1-only`, `LGPL-2.1-or-later`, `LGPL-3.0-only`, `LGPL-3.0-or-later`, `MIT`, `MIT-0`, `MPL-2.0`, `OFL-1.1`, `Unlicense`, `Zlib`, or `LicenseRef-<name>` (`<name>`: 1 to 64 letters, digits, `.` or `-`) |
| `thirdParty` | at most 256 of `{ name, licence }`. `licence` follows the same rule |
| `egress` | at most 64 of `{ host, port, purpose }`. `host` is a lower-case DNS name, no wildcard, no IP address |
| `dataFlows` | at most 32 of `{ purpose, data[], personalData, destination, host? }`. `destination` is `installation`, `external` or `web-search`. An `external` flow names a `host` that is also listed in `egress` |
| `aiUse` | `{ intendedPurpose (1 to 500), annexIII (boolean), humanOversight (1 to 120) }` |
| `attestations` | `{ "ownsRights": true, "noProhibitedPractice": true }`. Both must be `true` |

### Pack id rules for the catalog

A catalog pack id is `<publisherId>.<name>`. `publisherId` matches `^[a-z0-9][a-z0-9-]{2,31}$`. These prefixes are reserved and cannot be used: anything starting with `aancer`, plus `platform`, `system`, `test`, `install`, `inst`, `pack`, `v1`, `template`, `solution`, `dashboard`, `export`, `conn`.

## Full examples

### A pack for the certified catalog

```json
{
  "v": 2,
  "kind": "bundle",
  "id": "acme.invoice-triage",
  "version": "1.0.0",
  "title": "Invoice triage",
  "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" },
  "requires": { "platform": ">=1.0.0" },
  "listing": {
    "v": 1,
    "summary": "Sorts incoming invoices and drafts the booking proposal.",
    "description": "Plain text, up to 4000 characters.",
    "category": "finance",
    "tags": ["invoices", "accounts-payable"],
    "icon": "content/listing/icon.png",
    "releaseNotes": "First release.",
    "supportUrl": "https://support.example.com/invoice-triage",
    "locales": {
      "de": { "title": "Rechnungssortierung", "summary": "Sortiert eingehende Rechnungen und entwirft den Buchungsvorschlag." }
    }
  },
  "declarations": {
    "v": 1,
    "licence": "LicenseRef-Acme-Commercial",
    "thirdParty": [{ "name": "amount-parser", "licence": "MIT" }],
    "dataFlows": [
      { "purpose": "Read invoice documents to extract amounts", "data": ["invoice-documents"], "personalData": true, "destination": "installation" },
      { "purpose": "Open the help page in the browser", "data": ["none"], "personalData": false, "destination": "external", "host": "support.example.com" }
    ],
    "egress": [{ "host": "support.example.com", "port": 443, "purpose": "Help page opened by the user" }],
    "aiUse": { "intendedPurpose": "Drafts a booking proposal a person approves", "annexIII": false, "humanOversight": "approval-step" },
    "attestations": { "ownsRights": true, "noProhibitedPractice": true }
  },
  "items": [
    { "kind": "skill", "schemaVersion": 1, "id": "invoice-triage", "scope": "install", "spec": { "$ref": "content/skill.json" } },
    { "kind": "link", "schemaVersion": 1, "id": "triage-help", "scope": "install",
      "spec": { "id": "triage-help", "label": "Invoice triage help", "url": "https://support.example.com/invoice-triage", "icon": "ExternalLink", "order": 90, "openIn": "new-tab" } }
  ]
}
```

`content/listing/icon.png` must be in the folder you sign. The signer adds it to `assets`.

### A workspace pack with parameters

```json
{
  "v": 2,
  "kind": "bundle",
  "id": "acme.sales-dashboard",
  "version": "1.2.0",
  "title": "Sales overview",
  "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" },
  "requires": { "platform": ">=1.0.0" },
  "parameters": [
    { "id": "target_workspace", "type": "workspace", "label": "Workspace", "required": true }
  ],
  "items": [
    { "kind": "dataset", "schemaVersion": 1, "id": "sales_orders", "scope": "workspace",
      "workspace": "{{param.target_workspace}}", "spec": { "$ref": "content/dataset.sales_orders.json" } },
    { "kind": "dashboard", "schemaVersion": 1, "id": "sales-overview", "scope": "workspace",
      "workspace": "{{param.target_workspace}}", "spec": { "$ref": "content/dashboard.sales-overview.json" } }
  ]
}
```

Next part: https://aancer.ai/dev/parts/pages/03-signing.md
