<br />

Added: 7

## **PROTOCOLS**

## Resolver

*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=19)*

An interface for resolving a URL to a component.

This interface is implemented by components that provide support
for loading components with a particular URL scheme. For example,
the Fuchsia package component resolver exposes a service with this
interface to resolve component URLs using the "fuchsia-pkg://" scheme.

To use a resolver to resolve URLs within your realm, register it
in your realm's manifest.

Note: The component manager is the only intended direct client of this
interface.

<br />

### Resolve

Resolves a component with the given absolute URL.

`component_url` is the unescaped URL of the component to resolve.

If successful, returns information about the component
that was resolved.

On failure, returns a `ResolverError` error.

#### Request

| Name | Type |
|---|---|
| `component_url` | `string:2083` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Resolver_Resolve_Result` |

### ResolveWithContext

Resolves a component with the absolute or relative URL. If relative, the
component will be resolved relative to the supplied `context`.

`component_url` is the unescaped URL of the component to resolve, the
format of which can be either:

- a fully-qualified absolute component URL; or
- a subpackaged-component reference, prefixed by a URI relative path to its containing subpackage (for example, `child_package#meta/some_component.cm`)

`context` is the `resolution_context` of a previously-resolved
`Component`, providing the context for resoving a relative URL.

#### Request

| Name | Type |
|---|---|
| `component_url` | `string:2083` |
| `context` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Context` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Resolver_ResolveWithContext_Result` |

## **STRUCTS**

### Context

*Defined in [fuchsia.component.resolution/component.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/component.fidl;l=79)*

A component resolution context, used when resolving component URLs relative
to another component. The context is stored in a byte array that persists a
value used by the target `Resolver` to locate and resolve a component by
relative path (for example, by a subpackage name).

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `bytes` | `vector<uint8>:8192` |   | No default |

### Resolver_ResolveWithContext_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=50)*

| Field | Type | Description | Default |
|---|---|---|---|
| `component` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Component` |   | No default |

### Resolver_Resolve_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=30)*

| Field | Type | Description | Default |
|---|---|---|---|
| `component` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Component` |   | No default |

## **ENUMS**

### ResolverError [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=58)*

The possible error conditions returned by ComponentResolver.

<br />

| Name | Value | Description |
|---|---|---|
| ### INTERNAL | `1` | An unexpected error occurred. |
| ### IO | `2` | A general IO error occurred. |
| ### INVALID_ARGS | `3` | The component URL was malformed. |
| ### NOT_SUPPORTED | `4` | The repository specified in the URL is unsupported. |
| ### MANIFEST_NOT_FOUND | `5` | The component manifest was not found. |
| ### PACKAGE_NOT_FOUND | `6` | The component's package was not found. |
| ### NO_SPACE | `7` | Insufficient space on device to store component's package. |
| ### RESOURCE_UNAVAILABLE | `8` | The component is temporarily unavailable. |
| ### INVALID_MANIFEST | `9` | The component manifest could not be parsed or it contained invalid configuration. |
| ### CONFIG_VALUES_NOT_FOUND | `10` | The component specifies configuration fields but the values were not found. |
| ### ABI_REVISION_NOT_FOUND | `11` | The ABI revision file could not be found. Added: 12 |
| ### INVALID_ABI_REVISION | `12` | The ABI revision value could not be parsed. Added: 12 |

## **TABLES**

### Component [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.component.resolution/component.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/component.fidl;l=13)*

A component is a unit of executable software.

This object provides the component's declaration, access to its package's
content, and relevant metadata as resolved `fuchsia.component.resolution.Resolver`.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 2 | `decl` | `https://fuchsia.dev/reference/fuchsia.mem//https://fuchsia.dev/reference/fuchsia.mem#Data` | Binary representation of the component's declaration (`fuchsia.component.decl.Component`). This information is typically obtained from the component's manifest or generated by the component resolver. |
| ### 3 | `package` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Package` | The package that contains the component. By convention, the component's package is mapped to "/pkg" in its namespace at runtime. This is null if the component is not represented as a package. In that case, it is the runner's responsibility to load the component's resource from the `url`. This mechanism is used for web applications. Most runners, including but not limited to the builtin ELF runner, require the package's directory connection to have OPEN_RIGHT_EXECUTABLE rights in order to run the resolved component. |
| ### 4 | `config_values` | `https://fuchsia.dev/reference/fuchsia.mem//https://fuchsia.dev/reference/fuchsia.mem#Data` | Binary representation of the component's configuration values (`fuchsia.component.config.ValuesData`). |
| ### 5 | `resolution_context` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Context` | The context used to resolve `component_url`s relative to this component. Pass this value to `Resolver::ResolveWithContext()` when resolving a component URL that *may* be relative to this `Component`. The `resolution_context` is an opaque value (from the perspective of component resolution) that is provided by a component `Resolver` to save with a parent `Component`. `Resolver`s that can resolve relative path component URLs, via `ResolveWithContext`, should return a `resolution_context` from both `Resolve` and `ResolveWithContext`. Relative path component URLs can only be resolved via `ResolveWithContext`, which requires a valid resolution `Context`. |
| ### 6 | `abi_revision` | `https://fuchsia.dev/reference/fuchsia.version//https://fuchsia.dev/reference/fuchsia.version#AbiRevision` | The target ABI revision of the resolved component. Added: 10 |

### Package [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.component.resolution/package.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/package.fidl;l=14)*

A package is a signed collection of immutable files.

This object provides access to a package's content and relevant metadata.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `url` | `string:2083` | The URL of the package itself. |
| ### 2 | `directory` | `client_end:https://fuchsia.dev/reference/fuchsia.io//https://fuchsia.dev/reference/fuchsia.io#Directory` | The package's content directory. |

## **UNIONS**

### Resolver_ResolveWithContext_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=50)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Resolver_ResolveWithContext_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#ResolverError` |   |

<br />

### Resolver_Resolve_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=30)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#Resolver_Resolve_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.component.resolution#ResolverError` |   |

<br />

## **CONSTANTS**

| Name | Value | Type | Description |
|---|---|---|---|
| [MAX_COMPONENT_URL_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/package.fidl;l=9) | `2083` | `uint32` | Max length of component URL. |
| [MAX_RESOLUTION_CONTEXT_SIZE](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/component.fidl;l=73) | `8192` | `uint32` | The maximum number of bytes for a `Context`. |