---
title: Dependency Resolution
description: Dependency Resolution protocol schemas
---

{/* ⚠️  AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

# Dependency Resolution Protocol

Defines schemas for runtime dependency resolution when installing,

upgrading, or managing packages. Provides a standardized way to

express dependency conflicts, resolution results, and installation order.

## Architecture Alignment

- **npm**: Dependency tree resolution with conflict detection

- **Helm**: Dependency management with version constraints

- **Salesforce**: Package dependency validation at install time

## Resolution Flow

```

1. Parse manifest.dependencies (SemVer ranges)

2. Check installed packages registry

3. Resolve each dependency → satisfied | needs_install | needs_upgrade | conflict

4. Detect circular dependencies

5. Compute topological install order

6. Return resolution result with required actions

```

<Callout type="info">
**Source:** `packages/spec/src/kernel/dependency-resolution.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { DependencyResolutionResult, DependencyStatusEnum, RequiredAction, ResolvedDependency } from '@objectstack/spec/kernel';
import type { DependencyResolutionResult, DependencyStatusEnum, RequiredAction, ResolvedDependency } from '@objectstack/spec/kernel';

// Validate data
const result = DependencyResolutionResult.parse(data);
```

---

## DependencyResolutionResult

Complete dependency resolution result

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **dependencies** | `Object[]` | ✅ | Resolution result for each dependency |
| **canProceed** | `boolean` | ✅ | Whether installation can proceed |
| **requiredActions** | `Object[]` | ✅ | Actions required before proceeding |
| **installOrder** | `string[]` | ✅ | Topologically sorted package IDs for installation |
| **circularDependencies** | `string[][]` | optional | Circular dependency chains detected (e.g. [["A", "B", "A"]]) |


---

## DependencyStatusEnum

Resolution status for a dependency

### Allowed Values

* `satisfied`
* `needs_install`
* `needs_upgrade`
* `conflict`


---

## RequiredAction

Action required before installation can proceed

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'install' \| 'upgrade' \| 'confirm_conflict'>` | ✅ | Type of action required |
| **packageId** | `string` | ✅ | Target package identifier |
| **description** | `string` | ✅ | Human-readable action description |


---

## ResolvedDependency

Resolution result for a single dependency

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **packageId** | `string` | ✅ | Dependency package identifier |
| **requiredRange** | `string` | ✅ | SemVer range required (e.g. "^2.0.0") |
| **resolvedVersion** | `string` | optional | Actual version resolved from registry |
| **installedVersion** | `string` | optional | Currently installed version |
| **status** | `Enum<'satisfied' \| 'needs_install' \| 'needs_upgrade' \| 'conflict'>` | ✅ | Resolution status |
| **conflictReason** | `string` | optional | Explanation of the conflict |


---

