<!-- © 2026 Evntx FZCO, Dubai, UAE. All rights reserved. -->

# AANCER Developer Guide

Step by step: build, sign, install and publish your own extensions

AANCER 1.0.0-rc2.3 · 27 November 2026 · Draft

## Before you start

### What you can build

You can extend AANCER without changing its code. Every extension is plain data in a signed file. This file is called a **pack** and ends in `.ancpack`.

| You want to | Build | Chapter |
|-|-|-|
| Give the AI a fixed way of working | a skill | 4 |
| Offer a ready-made workflow | a workflow template | 5 |
| Offer a ready-made agent | an agent blueprint | 6 |
| Show figures | a dashboard | 7 |
| Start something when something happens | a hook | 8 |
| Use your own look | a theme | 9 |
| Show your own web application | an embedded app | 10 |
| Connect another system | a connector | 11 |
| Call AANCER from a program | the API or the MCP server | 12 |

This guide shows the way, step by step. Every field, limit and error is in the **AANCER Developer Reference** and at [aancer.ai/developers](https://aancer.ai/developers).

### What you need

- A text editor
- The `aancer-pack` program. It comes in the developer kit: one program each for macOS (Apple Silicon and Intel), Windows and Linux, with everything it needs inside. You install nothing else
- A test installation of AANCER: the developer edition on your own machine (see "Your developer setup"), or a test system of your company. Never try a pack for the first time in a live system
- On a test system that is not your developer edition: somebody there with the right `extensions.manage`

### Your developer setup

The developer edition is AANCER on your own machine: one user, or up to 3 users once you activate the free developer licence; local only, a small local AI model, no GPU needed.

1. Unpack the developer edition from the kit and start it:

```bash
tar -xzf aancer-dev-<version>.tar.gz
cd aancer-dev-<version>
bash setup.sh --dev
```

2. Answer its questions: the administrator e-mail and password.
3. Open `http://localhost` and sign in.

You need: 16 GB of memory, 40 GB of free disk and a container runtime. On a Mac, use a container runtime for macOS. On Windows, install the developer edition inside the Linux subsystem for Windows. The kit's README has the exact steps for both.

> tip: The AI model is downloaded during the install, sized to your machine's memory. `bash setup.sh --dev --dev-model 3b` picks the size yourself (`1.5b`, `3b` or `7b`).

### The development loop

Once you are signed in, one command builds, signs, imports and activates your pack on every save:

```bash
aancer-pack login --target http://localhost --email you@example.com
aancer-pack init skill my-skill --id acme.my-skill --publisher "Acme Example Ltd"
aancer-pack dev my-skill --target http://localhost --watch
```

| Command | What it does |
|-|-|
| `login` | Signs in through the installation's own sign-in steps. The password is asked, or taken from `AANCER_PASSWORD` |
| `init <kind> [folder]` | Writes the smallest working pack of a kind: `skill`, `agent-blueprint`, `template`, `theme`, `dashboard`, `hook`, `app` or `bundle` |
| `dev [folder]` | Gives the pack a new test version, signs it with your developer key, imports and activates it. `--watch` repeats this on every save |
| `trust-key --print` | Prints your developer key, for the administrator of another installation |

The first `dev` makes your developer key on your machine. It never leaves the machine. On your developer edition the key is trusted at once. On any other installation an administrator adds it as a trust key first, so that a laptop key never becomes trusted in a live system by mistake.

> warn: The developer key is for testing. A pack you give to anybody else is signed with your publisher key (chapter 3, step 4).

### What the tool sends

`aancer-pack` sends usage reports to us, always: how the tool is used and the packs you build (by build id). It never sends file contents, pack contents, prompts, data, addresses or local paths. Add `--show-telemetry` to any command to see the report; nothing is sent then. `aancer-pack telemetry status` shows how many reports wait.

### The words

| Word | Meaning |
|-|-|
| Pack | The signed file you deliver |
| Manifest | `manifest.json`. It says what is in the pack |
| Item | One thing in the pack, for example one skill |
| Spec | The content of an item, as JSON |
| Parameter | A value the administrator fills in, for example the workspace |
| Trust key | Your public key, entered once by the administrator |
| Import | AANCER checks the pack. Nothing changes yet |
| Activate | The items are installed |
| Retire | The items are removed |

### Get the examples

1. Open [github.com/Aancer-ai/aancer-developers](https://github.com/Aancer-ai/aancer-developers).
2. Choose **Code** > **Download ZIP**, or run:

```bash
git clone https://github.com/Aancer-ai/aancer-developers.git
```

3. Look into `examples/`. There is a complete pack for every kind.

Or let the tool write one: `aancer-pack init <kind>` makes the smallest pack of a kind that imports as it is.

Examples and schemas may be used freely (MIT licence). The platform itself may not.

> tip: Start every new pack by copying an example. All names there, such as `acme` and `example.com`, are placeholders.

## Let an AI assistant help you

### Connect your assistant to the builder server

The builder server knows all guides and checks your files. It only reads and needs no account.

1. Open the connector or MCP settings of your assistant.
2. Add a new server with the address `https://aancer.ai/mcp` (type HTTP, no sign-in).
3. Ask, for example:

```text
Use the AANCER builder tools to make a workflow template that sorts
supplier invoices with a human approval, and validate it.
```

| Assistant | How |
|-|-|
| Claude | Settings > Connectors > add a custom connector |
| Claude Code | `claude mcp add --transport http aancer-builder https://aancer.ai/mcp` |
| ChatGPT | Switch on developer mode, create a connector without sign-in |
| Gemini | Open the [AANCER Builder Gem](https://gemini.google.com/gem/1-QrMUAZtHW0-ooIxLo6OXNqbvnTuxO0C?usp=sharing). Nothing to connect |
| Cursor, VS Code | Add an HTTP server with the address |

### Without a connection

1. Paste this into the assistant:

```text
Read https://aancer.ai/dev/llms.txt and the schema for the extension type at
https://aancer.ai/dev/schemas/ first. Then build an AANCER pack that
<what it should do>. Output manifest.json and every content/ file, and the
aancer-pack commands to sign it.
```

2. Say what kind you want: "a skill", "a workflow template", "an embedded app".
3. If the import shows an error, paste the exact text back.

> warn: The address `https://aancer.ai/mcp` is for building. Never give an assistant passwords, private keys or customer data.

## Your first pack

This chapter takes you once through the whole way. All other chapters use the same steps.

### Step 1: Make the folder

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

### Step 2: Write the manifest

Save this as `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" } }
  ]
}
```

| Field | What to write |
|-|-|
| `id` | your company, a dot, a name. Small letters only |
| `version` | three numbers, such as `1.0.0` |
| `publisher.keyId` | your key id from step 4 |
| `scope` | `install` for everybody, `workspace` for one workspace |

### Step 3: Write the content

Save this as `content/vendor-review.json`:

```json
{
  "id": "vendor-review",
  "name": "Vendor review",
  "description": "Structured review of a new supplier: risk, contract terms, data protection.",
  "instructions": "# Vendor review\n\n1. Name the vendor and the service.\n2. Score financial, operational and data-protection risk (low, medium, high) with one reason each.\n3. List contract terms to negotiate.\n4. End with a recommendation.",
  "triggers": ["vendor review", "new supplier"]
}
```

### Step 4: Make your key

1. Run this once:

```bash
aancer-pack keygen --out acme.key
```

2. Copy the key id it prints, such as `pub-0123456789ab`, into the manifest.
3. Keep `acme.key` secret. Give out only `acme.pub`.

> warn: Do not put `acme.key` into the pack folder, an e-mail or a code repository. Whoever has it can sign in your name.

### Step 5: Sign and check

```bash
cd my-pack
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
```

If `verify` prints OK, the pack is ready. Sign again after every change.

### Step 6: Enter your key in the test installation

Once for each publisher:

1. Choose **Platform Settings** > **Extensions**.
2. Go to **Trust keys** and choose **Add trust key**.
3. Enter your key id under **Key id** and the content of `acme.pub` under **Public key (PEM)**.
4. Choose **Save key**.

### Step 7: Import and activate

1. Choose **Import pack** and pick the `.ancpack` file.
2. Read the summary: items, parameters, warnings.
3. Choose **Configure & activate**, fill in the parameters and choose **Activate**.

A skill from a pack starts switched off. Chapter 4 shows how to switch it on.

> tip: On your developer edition, `aancer-pack dev my-pack --target http://localhost --watch` does steps 4 to 7 for you, on every save.

### Deliver a new version

1. Change the files.
2. Raise `version` in the manifest. The same version can never have other content.
3. Sign, import, activate.

To go back, open the pack and choose **Roll back to this** at the old version.

### Remove a pack

1. Open the pack and choose **Retire pack**.
2. Confirm.

A pack other things depend on cannot be removed. The message names them.

### Use parameters

Never write the id of a workspace or connection into a pack. Use a parameter:

```json
"parameters": [
  { "id": "target_workspace", "type": "workspace", "label": "Workspace", "required": true }
]
```

Then write `{{param.target_workspace}}` wherever the value belongs. The types are `connection`, `workspace`, `dataset`, `string`, `secret`, `workflow` and `agent`.


## Build a skill

A skill tells the AI how to do a certain job, always in the same way.

### The quick way: upload a file

> need: the right `skills.manage_own`.

1. Write a file named `SKILL.md`:

```
---
name: Vendor review
description: Structured review of a new supplier: risk, contract terms, data protection.
---
# Vendor review

1. Identify the vendor and the service.
2. Score financial, operational and data-protection risk with one reason each.
3. List contract terms to negotiate.
4. End with a recommendation: proceed, proceed with conditions, or stop.
```

2. Choose **Library** > **Skills**.
3. Upload the file.
4. Open a chat and ask something that fits the description.

`name` and `description` must each fit on one line.

### As a pack

1. Follow chapter 3. It uses exactly this example.
2. After activating, choose **Library** > **Skills** and switch the skill on for the workspaces.
3. If it must always apply, choose **Require**. Tick **Also apply in agent chats** if agents should use it too.

> tip: The AI decides by the description whether a skill fits. If it is not used, describe more clearly **when** it applies.

## Build a workflow template

### The quick way: make it from a workflow

> need: the right `templates.author_own`.

1. Build and test the workflow in **Automations**.
2. Make a template from it under **Templates**.
3. Give every fixed value, such as connection or approver, a parameter.
4. Submit it for review. Another person approves it.
5. To take it to another installation, open the template and choose **Export as signed pack**.

For the other installation to accept the file, it needs the key of yours: choose **Extensions** > **Trust keys** > **Show key for another installation** and enter that key there.

### Write it by hand

1. Put this item into the manifest of chapter 3:

```
{ "kind": "template", "schemaVersion": 1, "id": "invoice-summary", "scope": "install",
  "spec": {
    "id": "tpl-acme-invoice-summary", "version": 1,
    "workspace": "{{param.target_workspace}}",
    "record": {
      "name": "Invoice summary with approval",
      "description": "Summarises an invoice, asks a person, then posts it.",
      "icon": "receipt", "industry": "financial", "complexity": "intermediate", "locale": "en",
      "aiAct": { "riskClass": "limited", "annexIiiCategory": "none",
        "intendedPurpose": "Summarise supplier invoices for a person who approves them.",
        "humanOversight": "A person approves every summary before it is posted.",
        "transparencyNote": "The summary is written by an AI model." },
      "compliance": { "dataCategories": ["invoice data"], "dataSubjects": [],
        "lawfulBasis": "contract", "retentionDays": 90 },
      "parameters": [
        { "id": "approvers_1", "type": "approvers", "label": "Who approves",
          "required": true },
        { "id": "conn_1", "type": "connection", "label": "Chat connection",
          "required": true, "connector": "connector-chat" } ],
      "bindings": [
        { "parameterId": "approvers_1", "stepId": "approve", "path": "approvers" },
        { "parameterId": "conn_1", "stepId": "post", "path": "connectorAuth" } ],
      "translations": {},
      "flow": { "name": "Invoice summary with approval", "rootStepId": "t", "steps": [
        { "id": "t", "type": "trigger", "name": "Invoice received",
          "position": { "x": 0, "y": 0 }, "triggerType": "webhook", "nextStepId": "sum" },
        { "id": "sum", "type": "aancer-ai", "name": "Summarise",
          "position": { "x": 0, "y": 120 }, "modelTier": "local-standard",
          "dataClassification": "internal",
          "systemPrompt": "Summarise the invoice: supplier, amount, due date.",
          "userPromptTemplate": "{{trigger.body.text}}", "nextStepId": "approve" },
        { "id": "approve", "type": "approval", "name": "Approve summary",
          "position": { "x": 0, "y": 240 },
          "approvalMessage": "Approve this invoice summary?",
          "approvalReasoning": "{{sum}}", "nextStepId": "post" },
        { "id": "post", "type": "connector", "name": "Post to channel",
          "position": { "x": 0, "y": 360 }, "connectorPiece": "connector-chat",
          "connectorAction": "send",
          "connectorInputs": { "channel": "finance", "text": "{{sum}}" } } ] },
      "createdAt": "2026-11-20T00:00:00.000Z" } } }
```

2. Replace `connector-chat` and `send` by a connector and an action of the target installation.
3. Add the parameter `target_workspace` (type `workspace`, not required) to the manifest. If it stays empty, the template is for everybody.
4. Sign, import, activate.
5. Try it: choose the template in the gallery, fill in the fields, run it.

### Rules you must follow

- Exactly one step is the trigger. `rootStepId` is its id
- `nextStepId` names the next step
- Earlier results: `{{trigger.body.text}}` or `{{stepId}}`
- No ids of connections, knowledge sets, agents or approvers in the steps. Bind a parameter
- No passwords or keys, not even in texts
- Templates with AI steps need a risk class and a purpose
- Words such as "employ", "exam" or "screen" make a template high risk, also inside other words. Then it needs an oversight text too

> warn: In release 1.0.0-rc2.3 scheduled workflows run in UTC even if you set a time zone. Approver lists and time limits of approval steps are not enforced. Plan for both.

## Build an agent blueprint

A blueprint is the plan of an agent. People make their own agent from it.

### The quick way: export an agent

> need: the right `agents.publish_own`.

1. Build, test and publish the agent.
2. Export it with the API call `POST /api/agents/{id}/export-for-submission` (see the reference).

Connections, forms, limits, memory and persona are not exported.

### Write it by hand

1. Put this item into the manifest:

```
{ "kind": "agent-blueprint", "schemaVersion": 1, "id": "invoice-triage", "scope": "install",
  "spec": {
    "name": "Invoice triage",
    "description": "Sorts incoming invoices and drafts the booking proposal.",
    "instructions": "You sort incoming invoices. Name supplier, amount and cost centre. Never book.",
    "starters": ["Sort today's invoices"],
    "model": { "tier": "local-standard" },
    "tools": [ { "kind": "knowledge", "ref": "{{param.policies}}" } ],
    "skills": [], "riskHint": null } }
```

2. Add a parameter `policies` (type `string`, not required). The administrator enters the id of a knowledge set there.
3. Sign, import, activate.
4. Choose **Agents** > **Create agent** and pick the blueprint.
5. Read what was left out, for example because a parameter is empty.
6. Test and publish the agent.

### Rules you must follow

- Name a tier (`local-standard`, `local-advanced`, `cloud-reasoning`), never a model
- Knowledge is always a parameter
- Workflows and other agents must be in the same pack, or be a parameter
- Web search must be declared under `declarations.dataFlows` with `web-search`
- Code and MCP tools are not possible

> tip: Workflows that start by web call, schedule or event only work with certified agents. Use a manual or form start if you can.

## Build a dashboard

### The quick way: on the screen

1. Choose **Dashboards** > **New dashboard**.
2. Choose **Add widget**, or **Help me build** and describe what you want.
3. Choose **Save draft**, then **Publish**.
4. Choose **Export as pack** to take it to another installation.

### Write it by hand

A dashboard has four layers: **dataset** (the table), **model** (what is counted), **widget** (one chart) and **dashboard** (the page).

1. Write four files. The lines with `//` only show the file name; leave them out:

```
// content/dataset.json
{ "id": "sales_orders", "title": "Sales orders",
  "columns": [
    { "id": "date", "type": "date", "required": true },
    { "id": "region", "type": "string", "required": true },
    { "id": "amount", "type": "number", "min": 0 } ],
  "retention": { "maxAgeDays": 730 } }

// content/model.json
{ "id": "sales",
  "entities": { "orders": { "dataset": "sales_orders" } },
  "dimensions": { "region": { "entity": "orders", "column": "region", "label": "Region" } },
  "measures": { "revenue": { "entity": "orders", "agg": "sum", "column": "amount",
                             "label": "Revenue", "format": "currency" } } }

// content/widget.json
{ "id": "revenue_by_region", "type": "chart", "title": "Revenue by region",
  "source": { "model": "sales",
              "query": { "measures": ["revenue"], "dimensions": ["region"] } },
  "chart": { "mark": "bar", "encoding": {
    "x": { "field": "region", "type": "nominal" },
    "y": { "field": "revenue", "type": "quantitative" } } } }

// content/dashboard.json
{ "id": "sales-overview", "title": "Sales overview", "icon": "BarChart3",
  "layout": [ { "widget": "revenue_by_region", "x": 0, "y": 0, "w": 12, "h": 8 } ] }
```

2. Put them into the manifest:

```
"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.json" } },
  { "kind": "model", "schemaVersion": 1, "id": "sales", "scope": "workspace",
    "workspace": "{{param.target_workspace}}", "spec": { "$ref": "content/model.json" } },
  { "kind": "widget", "schemaVersion": 1, "id": "revenue_by_region", "scope": "workspace",
    "workspace": "{{param.target_workspace}}", "spec": { "$ref": "content/widget.json" } },
  { "kind": "dashboard", "schemaVersion": 1, "id": "sales-overview", "scope": "workspace",
    "workspace": "{{param.target_workspace}}", "spec": { "$ref": "content/dashboard.json" } } ]
```

3. Sign, import, activate and choose the workspace.
4. Fill the dataset: with a publish step in a workflow, with an agent, or with an app.

### Rules you must follow

- A page is 12 columns wide. Widgets must not overlap
- A chart contains no data, no web address and no `$schema`
- Every dataset needs a limit: `maxAgeDays` or `maxRows`
- A dataset with rows is never deleted when the pack is removed

## Build a hook

A hook starts a workflow or an agent when something happens in AANCER.

### The events

| Event | Happens when |
|-|-|
| `run.completed`, `run.failed` | a workflow ended well or badly |
| `approval.requested`, `approval.decided` | an approval is asked for or decided |
| `dataset.rows.published` | a dataset got new rows |
| `dashboard.published` | a dashboard was published |
| `document.ingested` | a document was read into a knowledge set |
| `user.provisioned`, `workspace.member.changed` | people were added or changed |
| `schedule.run.completed` | a scheduled chat task ran |

`GET /api/events/catalog` shows the list of your installation with sample data.

### The quick way: on the screen

> need: the right `hooks.manage_own`.

1. Build a workflow that starts with the AANCER event trigger, and publish it.
2. Choose **Automations** > **Hooks** > **New hook**.
3. Choose the event and the workflow or agent.
4. Add conditions with **Add clause**.
5. Choose **Test filter**. Nothing is started by this.
6. Choose **Create hook**.

### Write it by hand

1. Put this item into the manifest:

```
{ "kind": "hook", "schemaVersion": 1, "id": "rejected_approvals", "scope": "workspace",
  "workspace": "{{param.target_workspace}}",
  "spec": {
    "id": "rejected_approvals", "title": "Rejected approvals",
    "event": { "name": "approval.decided", "version": 1 },
    "filter": [ { "path": "payload.outcome", "op": "eq", "value": "rejected" } ],
    "handler": { "type": "workflow", "ref": "flow_notify_requester" } } }
```

2. The workflow must already exist in the target workspace. Its id goes into `ref`.
3. Sign, import, activate.

### When it does not start

1. Open **Hooks** and choose **Deliveries**.
2. Read the error.
3. Repair the workflow and choose **Retry**.

> tip: A hook calls no web address. Let the workflow do that.

## Build a theme

### Write it

1. Put this item into the manifest:

```
{ "kind": "theme", "schemaVersion": 2, "id": "acme-ci", "scope": "install",
  "spec": {
    "id": "acme-ci", "platformName": "Acme Cloud", "tagline": "Your data. Your AI.",
    "defaultTheme": "light",
    "typography": { "ui": "system-ui, sans-serif" },
    "themes": {
      "light": { "--bg": "#FAFAF7", "--s1": "#FAFAF7", "--s2": "#FFFFFF",
                 "--t0": "#1B2430", "--ac": "#0F6E74", "--aci": "#FFFFFF", "--pr": "#0B1F3A" },
      "dark":  { "--bg": "#0E1420", "--s1": "#0E1420", "--s2": "#151C2A",
                 "--t0": "#E9EDF3", "--ac": "#5CC6C9", "--aci": "#0B1F22" } },
    "login": { "backgroundColor": "#0B1F3A", "tagline": "Welcome to Acme Cloud" } } }
```

2. For your own fonts (`.woff2`) and logos (`.png`, `.svg`), make the folders `content/fonts/` and `content/logos/` and name the files in `fonts` and `logos`.
3. Sign and import.
4. Read the contrast warnings and correct the colours.
5. Activate and reload the browser.

### Switch between looks

1. Choose **Platform Settings** > **Look & feel**.
2. Choose **Apply** at a look.

### Rules you must follow

- No web addresses, not even in the tagline or footer
- Colours as `#rrggbb` or `rgba(…)`
- Every file at most 2 MiB
- A theme for one workspace has no login page and no e-mail colours

### Rename words on the screen

1. Add an item of the kind `locale` with the scope `install`:

```json
{ "kind": "locale", "schemaVersion": 1, "id": "en-words", "scope": "install",
  "spec": { "locale": "en", "keys": { "nav.knowledge": "Handbooks" } } }
```

2. Sign, import, activate.

## Build an embedded app

Your own web application appears inside AANCER. It stays on your own server.

> need: the licence feature Embedded apps.

### Prepare your server

1. Give the app its own https address, for example `https://planner.example.com`.
2. Let its pages send this header, with the address of AANCER:

```text
Content-Security-Policy: frame-ancestors https://aancer.example.com
```

3. Remove `X-Frame-Options` if your server sends it.

### Write the pack

1. Put this item into the manifest:

```
{ "kind": "app", "schemaVersion": 2, "id": "shift-board", "scope": "workspace",
  "workspace": "{{param.target_workspace}}",
  "spec": {
    "id": "shift-board", "title": "Shift board", "icon": "Table",
    "group": "Operations", "order": 31,
    "url": "https://planner.example.com/board.html",
    "origin": "https://planner.example.com",
    "sso": { "mode": "none" },
    "capabilities": ["read:dataset:shift_plan"],
    "egress": { "hosts": [] },
    "embed": { "sandbox": ["allow-scripts", "allow-same-origin"] } } }
```

2. Ask only for what the app needs:

| Capability | Allows the app to |
|-|-|
| `read:me` | know who the user is |
| `read:dataset:<id>` | read a dataset |
| `write:dataset:<id>` | write into a dataset |
| `query:model:<id>` | ask a model of a dashboard |
| `navigate` | open another page |
| `notify` | show a short message |

### Read data in your page

1. Take `bridge.js` from the example `examples/apps/shift-board`.
2. Connect and read:

```
const PLATFORM = 'https://aancer.example.com';
const bridge = await AancerBridge.connect({ platformOrigin: PLATFORM });
const result = await bridge.call('read:dataset', { datasetId: 'shift_plan', limit: 100 });
render(result.rows);
```

### Install and approve

1. Sign, import, activate.
2. Open the pack and choose **Manage app**.
3. Read what the app wants and choose **Approve**.
4. If it uses sign-in, choose **Create app secret** and give the secret to the person who runs the app server. It is shown once.
5. Open the app under **Dashboards**.

### Know who the user is (sign-in)

Use `"sso": { "mode": "code" }`. The complete program is in `examples/apps/shift-planner`. This is what happens:

1. Your server makes a secret pair (PKCE) and gives one half to the page.
2. The page says hello to AANCER and receives a code. It is valid for 60 seconds, once.
3. Your server exchanges the code for a token at `/api/apps/oauth/token`.
4. Your server checks the token at `/api/apps/introspect`. The answer says who it is.

> warn: Keep the app secret and the token on the server. Never send them to the browser. Do not use the role to decide what somebody may do.

## Build a connector

A connector links another system. It runs inside AANCER, so AANCER signs it, not you.

### Write it

1. Copy `examples/connectors/example-echo`.
2. Change `src/index.ts`:

```
import { createConnector, createAction, Property, ConnectorAuth } from '@aancer/connector-framework';

const echo = createAction({
  name: 'echo',
  displayName: 'Echo',
  description: 'Returns the text you send.',
  props: { text: Property.ShortText({ displayName: 'Text', required: true }) },
  async run({ propsValue }) { return { text: propsValue.text }; },
});

export const connector = createConnector({
  displayName: 'Example echo',
  auth: ConnectorAuth.None(),
  minimumSupportedRelease: '0.82.0',
  logoUrl: 'https://cdn.example.com/echo.png',
  authors: ['acme'],
  actions: [echo],
  triggers: [],
});
```

3. Name the hosts it calls in `pack.json` under `egressHosts`. A `*` alone is not allowed.
4. If every customer runs the system themselves, use `egressFromConnection` instead.
5. Build and test it with the connector kit on your own computer.

### Check before you submit

- No install scripts in any dependency
- No native add-ons
- `npm audit --omit=dev` finds nothing
- Only these licences: MIT, ISC, BSD-2-Clause, BSD-3-Clause, Apache-2.0, 0BSD
- `package-lock.json` is included

### Submit and install

1. Submit the source through [aancer.ai/partners](https://aancer.ai/partners).
2. You get back a signed `.ancpack` file.
3. Choose **Connectivity** > **Connectors** > **Add from files** and pick it.
4. Choose **Enable**. Only now may it reach its hosts.
5. Create a connection and use it.

## Use the API and the MCP server

### Call the API

Every page of AANCER uses the API under `/api`. You sign in with a token from your sign-in service.

1. Put the token into `TOKEN`.
2. Call, for example:

```
export AANCER=https://aancer.example.com

# import a pack
curl -X POST "$AANCER/api/extensions/packs/import" \
  -H "Authorization: Bearer $TOKEN" \
  --data-binary @acme.business-skills-1.0.0.ancpack

# activate it
curl -X POST "$AANCER/api/extensions/packs/acme.business-skills/activate" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"version":"1.0.0"}'
```

| What | Where |
|-|-|
| Packs | `/api/extensions` |
| Agents | `/api/agents` |
| Workflows | `/api/automations` |
| Skills | `/api/skills` |
| Dashboards | `/api/dashboards`, `/api/models`, `/api/widgets` |
| Hooks | `/api/event-hooks` |
| Apps | `/api/apps` |

If a right is missing, the answer is 403 and names it.

### Let another AI program use your agents

> need: the licence features for the MCP server and chat surfaces, and the right `mcp.tokens_own`.

1. Create a personal MCP token (right `mcp.tokens_own`), or ask an administrator for one.
2. Copy it. It is shown once.
3. Enter this in the other program:

```
{ "mcpServers": {
    "aancer": {
      "type": "http",
      "url": "https://aancer.example.com/mcp/v1",
      "headers": { "Authorization": "Bearer mcp_..." } } } }
```

4. Ask there: "Use find_agent to find the invoice agent, then ask it to summarise this week's open invoices."

If an agent wants to change something, the answer is "approval required" with a link. A person decides in AANCER.

## Publish in the certified catalog

1. Become a partner at [aancer.ai/partners](https://aancer.ai/partners).
2. Add these two blocks to the manifest:

```
"listing": { "v": 1, "summary": "Sorts incoming invoices.", "category": "finance" },
"declarations": {
  "v": 1, "licence": "LicenseRef-Acme-Commercial",
  "dataFlows": [ { "purpose": "Read invoices to extract amounts", "data": ["invoice-documents"],
                   "personalData": true, "destination": "installation" } ],
  "egress": [],
  "aiUse": { "intendedPurpose": "Drafts a proposal a person approves",
             "annexIII": false, "humanOversight": "approval-step" },
  "attestations": { "ownsRights": true, "noProhibitedPractice": true } }
```

3. Check the pack:

```bash
aancer-pack lint manifest.json content/
```

4. Correct every line it prints.
5. Submit the pack. AANCER checks and certifies it.

> warn: The two statements under `attestations` are legally important: you own the rights, and there is no prohibited practice. Only confirm what is true.

## When something does not work

| Message | What to do |
|-|-|
| `PACK_UNSIGNED` | Sign the pack |
| `PACK_SIGNATURE_INVALID` | A file changed after signing, or an unused file is in `content/`. Sign again |
| `PACK_SIGNER_UNKNOWN` | The administrator adds your public key |
| `PACK_SIGNER_NOT_ALLOWED` | It is a connector. Submit it |
| `PACK_SCHEMA_INVALID` | Read the path in the message and correct that field |
| `PACK_VERSION_CONFLICT` | Raise `version` |
| `PACK_PLATFORM_INCOMPATIBLE` | Correct `requires.platform`, or update the installation |
| `PACK_PARAMETER_MISSING` | Fill in the parameters when activating |
| `EXTENSION_REFERENCED` | Remove what depends on it first |
| `TPL_RESIDUAL_BINDING` | A step still holds an id. Use a parameter |
| `TPL_SECRET_FOUND` | Remove the password or key |
| `TPL_AIACT_REQUIRED` | Set risk class and purpose |
| `AGENT_BLUEPRINT_REF` | Knowledge must be a parameter; workflow and agent must be in the pack |
| `HOOK_HANDLER_INACTIVE` | Publish the workflow with an event trigger, then enable the hook |
| `THEME_ILLEGIBLE` | Choose colours with more contrast |
| `APP_EMBED_REFUSED` | Correct the header of the app |
| `APP_ORIGIN_UNAPPROVED` | An administrator approves the app |
| 403 Permission denied | The answer names the missing right |

All messages are in the **AANCER Developer Reference**.

### Checklist before you deliver

- The pack was tested in a test installation
- `aancer-pack verify` prints OK
- `version` was raised
- No passwords, keys or ids of an installation inside
- Workspaces and connections are parameters
- Removing and installing again works
- The customer has your public key and key id
- You told the customer which rights and licence features are needed
