     /// The path of the workspace data.
     public let dataPath: AbsolutePath
 
+    /// The current state of managed dependencies.
+    public let managedDependencies: ManagedDependencies
+
+    /// The Pins store. The pins file will be created when first pin is added to pins store.
+    public let pinsStore: LoadableResult<PinsStore>
+
     /// The path for working repository clones (checkouts).
     let checkoutsPath: AbsolutePath
 

            return requiredURLs.subtracting(availableURLs)
        }

        /// Find a package given its name.
        public func lookup(package name: String) -> (manifest: Manifest, dependency: ManagedDependency)? {
            return dependencies.first(where: { $0.manifest.name == name })
        }

        /// Find a manifest given its name.
        public func lookup(manifest name: String) -> Manifest? {
            return lookup(package: name)?.manifest
        }

        /// Returns constraints of the dependencies.
        func createDependencyConstraints() -> [RepositoryPackageConstraint] {
            var constraints = [RepositoryPackageConstraint]()
            // Iterate and add constraints from dependencies.
            for (externalManifest, managedDependency) in dependencies {

        }
    }

    /// Cleans the build artefacts from workspace data.
    ///
    /// - Parameters:
    ///     - diagnostics: The diagnostics engine that reports errors, warnings
    ///       and notes.
    public func clean(with diagnostics: DiagnosticsEngine) {

        // These are the things we don't want to remove while cleaning.
        let protectedAssets = Set<String>([
            repositoryManager.path,
            checkoutsPath,
            managedDependencies.statePath,
            ].map({ path in
                // Assert that these are present inside data directory.
                assert(path.parentDirectory == dataPath)
                return path.basename
            }))

        // If we have no data yet, we're done.
        guard fileSystem.exists(dataPath) else {
            return
        }

        guard let contents = diagnostics.wrap({ try fileSystem.getDirectoryContents(dataPath) }) else {
            return
        }

        // Remove all but protected paths.
        let contentsToRemove = Set(contents).subtracting(protectedAssets)
        for name in contentsToRemove {
            fileSystem.removeFileTree(dataPath.appending(RelativePath(name)))
        }
    }

    /// Resets the entire workspace by removing the data directory.
    ///
    /// - Parameters:
    ///     - diagnostics: The diagnostics engine that reports errors, warnings
    ///       and notes.
    public func reset(with diagnostics: DiagnosticsEngine) {
        let removed = diagnostics.wrap({
            // Make all checkouts mutable.
            try fileSystem.set(attribute: .mutable, path: checkoutsPath, recursive: true)

            // Reset manaked dependencies.
            try managedDependencies.reset()
        })

        guard removed else { return }

        repositoryManager.reset()
        fileSystem.removeFileTree(dataPath)
    }

    /// Updates the current dependencies.
