# JSR

Recommend AXM extensions from a JSR (Deno, TypeScript) package and target JSR packages from an extension.

AXM reads JSR extension metadata from a top-level `agentExtensions` field in
`deno.json` (`deno.jsonc` is also read). This is the
[two-way linking](/docs/package-ecosystems/overview) model applied to the JSR
ecosystem.

## Recommend extensions from a package

Add an `agentExtensions` array to `deno.json`. Each entry is an extension
reference (`@owner/<type>/<name>`):

```jsonc
// deno.json
{
  "name": "@agentxm/example-tinyflags",
  "version": "0.1.1",
  "agentExtensions": [{ "ref": "@examples/packs/typescript-jsr-tinyflags" }],
}
```

Keep recommendations **identity-only** — omit `versionRange`. AXM resolves the
reference to the newest matching extension version and pins it in the user's
`axm.lock`. Prefer recommending a single **pack** so you keep one stable
reference while its contents evolve.

Add a semver `versionRange` only when your package genuinely pairs with a
bounded major line of the extension:

```jsonc
{
  "agentExtensions": [
    {
      "ref": "@examples/packs/typescript-jsr-tinyflags",
      "versionRange": "^1.0.0",
    },
  ],
}
```

## Target JSR packages from an extension

On the extension manifest (`skill.json`, `pack.json`, `subagent.json`, …), add a
`packages` array with a JSR [purl](https://github.com/package-url/purl-spec).
JSR package names are scoped, and the leading `@` of the scope is
percent-encoded as `%40`; the scope separator stays a literal `/`:

```jsonc
// pack.json
{
  "packages": [{ "purl": "pkg:jsr/%40agentxm/example-tinyflags" }],
}
```

### Version ranges

Default to identity-only. Add a [VERS](https://github.com/package-url/vers-spec)
`versionRange` with the `jsr` scheme only when the extension depends on package
APIs introduced or removed in a known range:

```jsonc
{
  "packages": [
    {
      "purl": "pkg:jsr/%40agentxm/example-tinyflags",
      "versionRange": "vers:jsr/>=0.1.0|<1.0.0",
    },
  ],
}
```

## Official status

When the JSR package recommends an extension through the AgentXM Registry
**and** that extension names the package as a companion via its purl, AXM
derives **official** status for the pair — no extra flag. See
[Official extensions](/docs/package-ecosystems/overview#official-extensions).

## Reference fixture

The
[`typescript-jsr-lib`](https://github.com/agentxm/polyglot-examples/tree/main/typescript-jsr-lib)
and
[`typescript-jsr-app`](https://github.com/agentxm/polyglot-examples/tree/main/typescript-jsr-app)
directories in `polyglot-examples` are the working fixtures for everything
above. The package publishes a TinyFlags companion pack and recommends it from
the `agentExtensions` field in `deno.json`; the pack and each skill declare the
package's scoped `pkg:jsr` purl as an identity-only companion package.