/** * SourceHostProviders Effect service. * * Provides a unified interface for discovering and fetching extensions * across all source types, plus clone URL and source display building. * * @experimental This API is unstable and may change without notice. * @packageDocumentation */ import * as FileSystem from "effect/FileSystem"; import * as HttpClient from "effect/unstable/http/HttpClient"; import * as Path from "effect/Path"; import * as ServiceMap from "effect/Context"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; import type * as Scope from "effect/Scope"; import { type AppError } from "../app-error/index.js"; import { WorkspaceMutations } from "../workspace/index.js"; import type { ExtensionRef } from "../extensions/index.js"; import type { ExtensionFiles, FindOptions, NamedRegistryFindOptions, NamedRegistryResolution, RegistrySource, Source } from "../sources/index.js"; /** * Service interface for source host providers. * * Dependencies (FileSystem, Path, WorkspaceMutations) are resolved at layer creation — * callers only see the service, not its implementation details. * * @experimental This API is unstable and may change without notice. */ export interface SourceHostProvidersService { /** Find extensions matching the given source and search criteria. */ readonly find: (source: Source, options: FindOptions) => Effect.Effect, AppError, Scope.Scope>; /** Resolve one explicit Registry target with a typed selection outcome. */ readonly resolveNamedRegistry: (source: RegistrySource, options: NamedRegistryFindOptions) => Effect.Effect; /** Fetch and materialize extension files for a discovered ref. */ readonly fetch: (ref: ExtensionRef) => Effect.Effect; /** Build a git clone URL for this source. Returns None for non-git sources. */ readonly cloneUrl: (source: Source) => Option.Option; /** Canonical origin string for display/comparison. */ readonly origin: (source: Source) => string; } declare const SourceHostProviders_base: ServiceMap.ServiceClass; /** * Effect service tag for source host providers. * * @experimental This API is unstable and may change without notice. */ export declare class SourceHostProviders extends SourceHostProviders_base { } /** * Creates a registry meta-provider that delegates find/fetch to the * resolved registry host encoded in the provided `RegistrySource`. * * @internal */ export declare const createRegistryMetaProvider: () => { type: "registry"; find: (source: RegistrySource, options: FindOptions) => Effect.Effect; resolveNamed: (source: RegistrySource, options: NamedRegistryFindOptions) => Effect.Effect; fetch: (source: RegistrySource, ref: ExtensionRef) => Effect.Effect; }; /** * Live layer for SourceHostProviders. * * Constructs the provider registry with all source type providers. * Captures FileSystem, Path, HttpClient, and WorkspaceMutations at creation * time so the service interface doesn't leak these dependencies. * * @experimental This API is unstable and may change without notice. */ export declare const SourceHostProvidersLive: Layer.Layer; export {}; //# sourceMappingURL=service.d.ts.map