|
2 | 2 |
|
3 | 3 | ### UAAPS Registry |
4 | 4 |
|
5 | | -Packages are published to and installed from a **UAAPS registry** — an HTTP server implementing the UAAPS registry protocol. The official public registry is `registry.agentpkg.io`; organizations can self-host a private registry. |
| 5 | +UAAPS supports two registry types that share the same package format (`.aam` archives) but differ in transport: |
| 6 | + |
| 7 | +| Type | When to use | |
| 8 | +|------|-------------| |
| 9 | +| **Local filesystem** | Offline use, air-gapped environments, CI mirrors, monorepos | |
| 10 | +| **HTTP remote** | Public registry, private org registry, hosted SaaS | |
| 11 | + |
| 12 | +The `aam` CLI auto-detects the registry type from the URL scheme: |
6 | 13 |
|
7 | 14 | ```bash |
8 | | -# Install from the default registry |
9 | | -aam install @myorg/code-review |
| 15 | +# HTTP remote registry |
| 16 | +aam install @myorg/code-review --registry https://aamregistry.io |
10 | 17 |
|
11 | | -# Install from a private registry |
12 | | -aam install @myorg/code-review --registry https://pkg.myorg.internal/aam |
| 18 | +# Local filesystem registry |
| 19 | +aam install @myorg/code-review --registry file:///opt/aam-registry |
13 | 20 |
|
14 | | -# Publish to a registry |
15 | | -aam pkg publish --registry https://pkg.myorg.internal/aam |
| 21 | +# Default registry (HTTP, configured in ~/.aam/config.yaml) |
| 22 | +aam install @myorg/code-review |
16 | 23 | ``` |
17 | 24 |
|
18 | 25 | Registry configuration is managed in `~/.aam/config.yaml` or `.aam/config.yaml`: |
19 | 26 |
|
20 | 27 | ```yaml |
21 | 28 | registries: |
22 | | - default: https://registry.agentpkg.io |
| 29 | + default: https://aamregistry.io |
23 | 30 | sources: |
24 | | - - name: myorg |
| 31 | + - name: myorg-remote |
25 | 32 | url: https://pkg.myorg.internal/aam |
| 33 | + auth: token # see §12.6 for auth types |
| 34 | + - name: myorg-local |
| 35 | + url: file:///opt/aam-registry |
26 | 36 | ``` |
27 | 37 |
|
28 | 38 | > Other distribution channels (Git marketplace, npm bridge, direct install, project-bundled) are supported by the `aam` CLI — see `aam_cli_new.md`. |
29 | 39 |
|
| 40 | +### 12.5 Local Filesystem Registry |
| 41 | + |
| 42 | +A local filesystem registry is a **directory tree** on disk following a defined layout. No server process is required. It is suitable for offline installs, CI artifact mirrors, and air-gapped enterprise environments. |
| 43 | + |
| 44 | +#### Directory Layout |
| 45 | + |
| 46 | +``` |
| 47 | +<registry-root>/ |
| 48 | +├── index.json # Full package index (all packages + versions) |
| 49 | +├── packages/ |
| 50 | +│ ├── code-review/ # Unscoped package |
| 51 | +│ │ ├── meta.json # Package metadata (all versions) |
| 52 | +│ │ └── versions/ |
| 53 | +│ │ ├── 1.0.0.aam |
| 54 | +│ │ ├── 1.0.0.aam.sha256 # Detached SHA-256 checksum |
| 55 | +│ │ ├── 1.1.0.aam |
| 56 | +│ │ └── 1.1.0.aam.sha256 |
| 57 | +│ └── myorg--code-review/ # Scoped package (@myorg/code-review) |
| 58 | +│ ├── meta.json |
| 59 | +│ └── versions/ |
| 60 | +│ ├── 2.0.0.aam |
| 61 | +│ └── 2.0.0.aam.sha256 |
| 62 | +└── dist-tags.json # Global dist-tag → version map |
| 63 | +``` |
| 64 | +
|
| 65 | +#### `index.json` |
| 66 | +
|
| 67 | +A flat list of all packages in the registry. Implementations MUST regenerate this file after every publish or unpublish operation. |
| 68 | +
|
| 69 | +```json |
| 70 | +{ |
| 71 | + "formatVersion": 1, |
| 72 | + "updatedAt": "2026-02-22T14:00:00Z", |
| 73 | + "packages": [ |
| 74 | + { "name": "code-review", "latest": "1.1.0", "versions": ["1.0.0", "1.1.0"] }, |
| 75 | + { "name": "@myorg/code-review", "latest": "2.0.0", "versions": ["2.0.0"] } |
| 76 | + ] |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +#### `packages/<name>/meta.json` |
| 81 | + |
| 82 | +Per-package metadata covering all published versions. |
| 83 | + |
| 84 | +```json |
| 85 | +{ |
| 86 | + "name": "@myorg/code-review", |
| 87 | + "versions": { |
| 88 | + "2.0.0": { |
| 89 | + "version": "2.0.0", |
| 90 | + "description": "Code review skills for myorg", |
| 91 | + "author": "myorg", |
| 92 | + "publishedAt": "2026-02-20T10:00:00Z", |
| 93 | + "integrity": "sha256-abc123...", |
| 94 | + "tarball": "versions/2.0.0.aam" |
| 95 | + } |
| 96 | + }, |
| 97 | + "dist-tags": { |
| 98 | + "latest": "2.0.0", |
| 99 | + "stable": "2.0.0" |
| 100 | + } |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +#### `dist-tags.json` |
| 105 | + |
| 106 | +Registry-wide dist-tag snapshot for fast tag resolution without reading every `meta.json`. |
| 107 | + |
| 108 | +```json |
| 109 | +{ |
| 110 | + "code-review": { "latest": "1.1.0", "stable": "1.0.0" }, |
| 111 | + "@myorg/code-review": { "latest": "2.0.0" } |
| 112 | +} |
| 113 | +``` |
| 114 | + |
| 115 | +#### Filesystem Registry Rules |
| 116 | + |
| 117 | +| Rule | Requirement | |
| 118 | +|------|-------------| |
| 119 | +| Package directory name MUST use the `scope--name` mapping (§12.2) | MUST | |
| 120 | +| Every `.aam` file MUST have a sibling `.aam.sha256` file | MUST | |
| 121 | +| `index.json` MUST be regenerated atomically after each mutation | MUST | |
| 122 | +| Symlinks outside the registry root are forbidden | MUST NOT | |
| 123 | +| The registry root MAY be read-only (install-only mirror) | MAY | |
| 124 | + |
| 125 | +#### CLI Commands for Local Registries |
| 126 | + |
| 127 | +```bash |
| 128 | +# Initialise a new local registry |
| 129 | +aam registry init file:///opt/aam-registry |
| 130 | + |
| 131 | +# Publish a package to a local registry |
| 132 | +aam pkg publish --registry file:///opt/aam-registry |
| 133 | + |
| 134 | +# Rebuild index.json after manual archive placement |
| 135 | +aam registry reindex file:///opt/aam-registry |
| 136 | + |
| 137 | +# List all packages in a local registry |
| 138 | +aam registry ls file:///opt/aam-registry |
| 139 | +``` |
| 140 | + |
| 141 | +--- |
| 142 | + |
| 143 | +### 12.6 HTTP Registry Protocol |
| 144 | + |
| 145 | +> **Status: Skeleton** — endpoint signatures and auth model are defined below. Full request/response schemas, pagination rules, rate-limit headers, and error codes will be detailed in a dedicated Registry Protocol document in a future spec revision. |
| 146 | +
|
| 147 | +An HTTP registry is an HTTPS server implementing the UAAPS Registry Protocol. The official public registry is `https://aamregistry.io`. Organizations MAY self-host a private registry. |
| 148 | + |
| 149 | +#### Base URL |
| 150 | + |
| 151 | +All endpoints are relative to the registry base URL. Implementations MUST serve the API over HTTPS. Plain HTTP MUST NOT be used for registries handling private packages or authentication tokens. |
| 152 | + |
| 153 | +#### Endpoint Index |
| 154 | + |
| 155 | +> **TODO**: This is a preliminary endpoint list and is not final. Additional endpoints (e.g. search, package transfer, org management, audit log) will be added in the Registry Protocol document. |
| 156 | +
|
| 157 | +| Method | Path | Purpose | Auth required | |
| 158 | +|--------|------|---------|--------------| |
| 159 | +| `GET` | `/` | Registry metadata & capabilities | No | |
| 160 | +| `GET` | `/packages` | List all packages (paginated) | No (public) / Yes (private) | |
| 161 | +| `GET` | `/packages/:name` | Package metadata (all versions) | No (public) / Yes (private) | |
| 162 | +| `GET` | `/packages/:name/:version` | Single version metadata | No (public) / Yes (private) | |
| 163 | +| `GET` | `/packages/:name/:version/tarball` | Download `.aam` archive | No (public) / Yes (private) | |
| 164 | +| `GET` | `/packages/:name/:version/signature` | Fetch signature bundle | No | |
| 165 | +| `GET` | `/packages/:name/dist-tags` | List dist-tags for package | No | |
| 166 | +| `PUT` | `/packages/:name/dist-tags/:tag` | Set a dist-tag | Yes | |
| 167 | +| `DELETE` | `/packages/:name/dist-tags/:tag` | Remove a dist-tag | Yes | |
| 168 | +| `POST` | `/packages` | Publish a new package version | Yes | |
| 169 | +| `DELETE` | `/packages/:name/:version` | Unpublish a version | Yes | |
| 170 | +| `GET` | `/approvals` | List pending approval requests | Yes | |
| 171 | +| `POST` | `/approvals/:id/approve` | Approve a publish request | Yes | |
| 172 | +| `POST` | `/approvals/:id/reject` | Reject a publish request | Yes | |
| 173 | + |
| 174 | +#### Authentication |
| 175 | + |
| 176 | +HTTP registries MAY require authentication. The `aam` CLI supports the following auth types, configured per registry in `~/.aam/config.yaml`: |
| 177 | + |
| 178 | +| Auth type | Config value | Transport | |
| 179 | +|-----------|-------------|-----------| |
| 180 | +| No auth (public) | `auth: none` | — | |
| 181 | +| Static token | `auth: token` | `Authorization: Bearer <token>` header | |
| 182 | +| OIDC / Sigstore keyless | `auth: oidc` | Short-lived token via OIDC provider | |
| 183 | +| Basic (legacy, not recommended) | `auth: basic` | `Authorization: Basic <base64>` header | |
| 184 | + |
| 185 | +```yaml |
| 186 | +# ~/.aam/config.yaml |
| 187 | +registries: |
| 188 | + sources: |
| 189 | + - name: myorg |
| 190 | + url: https://pkg.myorg.internal/aam |
| 191 | + auth: token |
| 192 | + token: "${MYORG_AAM_TOKEN}" # resolved from environment variable |
| 193 | +``` |
| 194 | +
|
| 195 | +Tokens MUST be stored in environment variables or a secrets manager. Tokens MUST NOT be committed to version control. The `aam login` command handles interactive token acquisition and secure local storage. |
| 196 | + |
| 197 | +```bash |
| 198 | +aam login --registry https://pkg.myorg.internal/aam # interactive login |
| 199 | +aam logout --registry https://pkg.myorg.internal/aam # remove stored credential |
| 200 | +aam whoami --registry https://pkg.myorg.internal/aam # show current identity |
| 201 | +``` |
| 202 | + |
| 203 | +#### Error Response Format |
| 204 | + |
| 205 | +All error responses MUST use `application/json` with this structure: |
| 206 | + |
| 207 | +```json |
| 208 | +{ |
| 209 | + "error": { |
| 210 | + "code": "PACKAGE_NOT_FOUND", |
| 211 | + "message": "Package @myorg/code-review@3.0.0 does not exist.", |
| 212 | + "docs": "https://aamregistry.io/errors/PACKAGE_NOT_FOUND" |
| 213 | + } |
| 214 | +} |
| 215 | +``` |
| 216 | + |
| 217 | +#### Standard Status Codes |
| 218 | + |
| 219 | +| Code | Meaning | |
| 220 | +|------|---------| |
| 221 | +| `200` | Success | |
| 222 | +| `201` | Published successfully | |
| 223 | +| `400` | Malformed request | |
| 224 | +| `401` | Authentication required | |
| 225 | +| `403` | Insufficient permissions | |
| 226 | +| `404` | Package or version not found | |
| 227 | +| `409` | Version already exists (publish conflict) | |
| 228 | +| `422` | Validation failed (manifest schema error) | |
| 229 | +| `429` | Rate limit exceeded | |
| 230 | +| `503` | Registry temporarily unavailable | |
| 231 | + |
| 232 | +> Full pagination headers, rate-limit headers, conditional request support (`ETag`, `If-None-Match`), and approval workflow request/response bodies will be defined in the Registry Protocol document. |
| 233 | + |
30 | 234 | ### 12.1 Archive Distribution Format |
31 | 235 |
|
32 | 236 | Packages are distributed as **`.aam` archives** (gzipped tar), providing a binary-safe, single-file distribution unit. |
|
0 commit comments