> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# veryfront/extensions

> Public extension API surface. Types used when authoring extensions (the scaffold template generated by `veryfront extension init` imports from this module), plus the runtime helpers consumers need to load, validate, and orchestrate extensions.

# veryfront/extensions

Public extension API surface. Types used when authoring extensions (the scaffold template generated by `veryfront extension init` imports from this module), plus the runtime helpers consumers need to load, validate, and orchestrate extensions.

## Import

```ts theme={null}
import {
  auditCapabilities,
  detectConflicts,
  discoverLocalExtensions,
  discoverPackageExtensions,
  discoverProjectExtensions,
  formatCapabilities,
} from "veryfront/extensions";
```

## Examples

```ts theme={null}
import { orchestrateExtensions } from "veryfront/extensions";

const loader = await orchestrateExtensions({
  projectDir: Deno.cwd(),
  config,
  logger,
});

// Later, on shutdown:
await loader.teardownAll();
```

## Exports

### Components

| Name                         | Description |
| ---------------------------- | ----------- |
| `CIRCULAR_DEPENDENCY_ERROR`  |             |
| `EXTENSION_CONFLICT_ERROR`   |             |
| `EXTENSION_VALIDATION_ERROR` |             |
| `MISSING_EXTENSION_ERROR`    |             |

### Functions

| Name                        | Description                                                                 |
| --------------------------- | --------------------------------------------------------------------------- |
| `auditCapabilities`         | Log capabilities for a named extension at startup.                          |
| `detectConflicts`           | Detect contract conflicts between resolved extensions.                      |
| `discoverLocalExtensions`   | Find `*.extension.ts` files in the project root.                            |
| `discoverPackageExtensions` | Scan `node_modules` (including `@scoped` packages) for packages             |
| `discoverProjectExtensions` | Discover project extensions living under `extensions/` in the project root. |
| `formatCapabilities`        | Format capabilities as human-readable strings for logging.                  |
| `getRecommendation`         |                                                                             |
| `loadExtensionFactory`      | Dynamically import an extension factory from `path` and resolve it.         |
| `mapToDenoPermissions`      | Map capabilities to Deno CLI permission flags.                              |
| `mergeExtensions`           | Merge extensions from all four sources in priority order.                   |
| `orchestrateExtensions`     | Run the full extension pipeline against a resolved project config.          |
| `parsePackageMetadata`      | Parse veryfront extension metadata from a package.json-like object.         |
| `resolve`                   |                                                                             |
| `tryResolve`                |                                                                             |
| `validateExtension`         | Validate the shape of an extension object.                                  |

### Classes

| Name              | Description |
| ----------------- | ----------- |
| `ExtensionLoader` |             |

### Types

| Name                   | Description                                                 |
| ---------------------- | ----------------------------------------------------------- |
| `Capability`           | Declares a system capability an extension requires.         |
| `ConflictInfo`         | Information about a contract conflict between extensions.   |
| `Extension`            |                                                             |
| `ExtensionConfigEntry` |                                                             |
| `ExtensionContext`     |                                                             |
| `ExtensionFactory`     |                                                             |
| `ExtensionLogger`      |                                                             |
| `ExtensionSource`      |                                                             |
| `OrchestrateOptions`   | Options for `orchestrateExtensions`.                        |
| `PackageMetadata`      | Metadata extracted from a package.json that declares itself |
| `ResolvedExtension`    |                                                             |
