/** * Registry client types and factory. * * Domain types for registry search and extension entries, * independent of any source provider abstraction. * * @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 Effect from "effect/Effect"; import * as Option from "effect/Option"; import type { AppError } from "../app-error/index.js"; import type { PublishVisibility, VisibilityEvaluation, VisibilityIntent, VisibilityMutationRequest, VisibilityMutationResult } from "../publish/index.js"; import type { SuggestedAction } from "../cli-runtime/suggested-action.js"; import type { Author, ExtensionDependencyConstraintMap, ExtensionName, ExtensionType } from "../extensions/index.js"; import type { Handle } from "../extensions/handle.js"; import type { DeprecationView, ExtensionIndex, VersionEntry } from "./schema.js"; import type { Bugs, Repository } from "../extensions/common.js"; import type { DiscoverPackagesResponse } from "./discover-schema.js"; import type { PackageUrlParts } from "../packaging/package-url.js"; import type { PackageExtensionDeclaration } from "../packaging/axm-package-meta.js"; import type { RegistryRequestPolicy } from "./request-policy.js"; import type { Version, VersionRange } from "../version-constraints/version-constraints.js"; import type { PreviewPublicationSetRequest, PreviewPublicationSetResponse, PublicationVisibilityInput, Sha256Hex } from "./publication-set.js"; export { MAX_PUBLICATION_SET_CANDIDATES, PUBLICATION_SET_CONTRACT, PackDependencyFindingSchema, PreviewPublicationSetRequestSchema, PreviewPublicationSetResponseSchema, Sha256HexSchema, archiveSha256Hex, comparePublicationTargets, evaluateProspectivePackDependencyState, evaluateProspectivePackDependencies, normalizePublicationDescriptor, normalizePublicationSet, publicationDescriptorDigest, publicationSetDigest, publicationTargetKey, validatePublicationDescriptors, validatePublicationSetResponse, type PackDependencyDescriptor, type PackDependencyFinding, type ProspectivePublicationCandidate, type ProspectivePackDependencyState, type PublicationDependencySnapshot, type PublicationDependencyVersionSnapshot, type PreviewPublicationSetRequest, type PreviewPublicationSetResponse, type PublicationCandidateResult, type PublicationDescriptor, type PublicationPackResult, type PublicationTarget, type Sha256Hex, } from "./publication-set.js"; /** * Options for searching extensions within a specific registry owner. * * - `owner`: owner to search (e.g. `"@acme"`) * - `names`: extension names to match (empty = all) * - `types`: extension types to include (empty = all) * - `limit`: max results to return (default: all) * - `offset`: number of results to skip (default: 0) */ export interface GetExtensionsByOwnerArgs { readonly owner: Handle | "*"; readonly names: ReadonlyArray; readonly types: ReadonlyArray; readonly limit: Option.Option; readonly offset: number; } /** * Options for fetching a specific extension version from a registry. * * - `owner`: owner in the registry path (e.g. `"@acme"`) * - `type`: extension type * - `name`: extension name * - `version`: specific version to fetch, or `None` for latest */ export interface GetExtensionPackageArgs { readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; readonly version: Option.Option; /** Marks an archive read used only to verify compatibility before selection. */ readonly usagePurpose?: "verification"; } /** * Options for fetching extension index metadata from a registry. * * - `owner`: owner in the registry path (e.g. `"@acme"`) * - `type`: extension type * - `name`: extension name */ export interface GetExtensionIndexArgs { readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; } /** * Options for publishing an extension version to a registry. * * - `owner`: owner in the registry path (e.g. `"@acme"`) * - `type`: extension type * - `name`: extension name * - `version`: version string to publish * - `archive`: zip archive bytes * - `metadata`: version entry metadata */ export interface PublishExtensionArgs { readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; readonly version: Version; readonly archive: Uint8Array; readonly metadata: VersionEntry; /** Exact repository/CLI visibility input bound by the publication descriptor digest. */ readonly visibilityInput: PublicationVisibilityInput; /** Authoritative establishment value and provenance from publication preview. */ readonly visibility?: PublishVisibility; /** Ephemeral exact publish capability. Never persisted by the registry client. */ readonly accessToken?: string; /** Opaque authoritative preview condition, sent as If-Match. */ readonly condition?: string; /** Digest of the complete publication set authorized by the preview. */ readonly publicationSetDigest?: Sha256Hex; /** Digest of this exact publication descriptor. */ readonly publicationDescriptorDigest?: Sha256Hex; } export type ExtensionVisibility = "public" | "private"; export interface PublishPreviewTarget { readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; readonly version: Version; } export type PreviewExtensionPublishesArgs = PreviewPublicationSetRequest; export type PublishPreviewResult = PreviewPublicationSetResponse; export interface GetExtensionVisibilityArgs { readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; readonly intent: VisibilityIntent | null; } export type UpdateExtensionVisibilityArgs = VisibilityMutationRequest; /** * Options for checking whether an extension exists in a registry. * * - `owner`: owner in the registry path (e.g. `"@acme"`) * - `type`: extension type * - `name`: extension name */ export interface ExtensionExistsArgs { readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; } /** * Result from a registry extension search. */ export interface GetExtensionsByOwnerResponse { readonly extensions: ReadonlyArray>; readonly total: number; } /** * Response from fetching a specific extension version archive. */ export interface GetExtensionPackageResponse { readonly archive: Uint8Array; readonly warnings?: ReadonlyArray; } /** * Response from publishing an extension version. */ export interface ExtensionLinks { readonly html: string; } export interface PublishExtensionResponse { readonly published: true; readonly owner: Handle; readonly type: ExtensionType; readonly name: ExtensionName; readonly version: Version; readonly integrity: string; readonly status: "pending" | "available" | "failed"; readonly visibility: PublishVisibility; readonly links?: ExtensionLinks; readonly warnings: ReadonlyArray; } export interface RegistryPublishWarning { readonly ruleId: string; readonly severity: "warning"; readonly message: string; readonly suggestions: ReadonlyArray; } /** * Response from checking whether an owner exists in a registry. */ export interface OwnerExistsResponse { readonly exists: boolean; } /** * Response from checking whether an extension exists in a registry. */ export interface ExtensionExistsResponse { readonly exists: boolean; } /** * Options for discovering extensions compatible with detected packages * and workspace recommendations. * * - `packages`: detected package purls to match against extension compatibility * - `declaredExtensions`: extension refs declared by the package's native AXM metadata */ export interface DiscoverPackageInput { readonly purl: PackageUrlParts; readonly version: string; readonly declaredExtensions: ReadonlyArray; } export interface DiscoverPackagesArgs { readonly packages: ReadonlyArray; } /** * A discovered extension entry from a registry search. * * Represents a single matched extension with its resolved version and integrity. */ export interface RegistryExtensionManifest { readonly owner: Handle; readonly type: T; readonly name: ExtensionName; /** Immutable publisher epoch for this coordinate. */ readonly publisherBindingId: string; readonly description: Option.Option; readonly repository: Option.Option; readonly bugs: Option.Option; readonly license: Option.Option; readonly authors: ReadonlyArray; readonly dependencies: ExtensionDependencyConstraintMap; readonly version: Version; readonly integrity: string; /** Package URLs this extension is compatible with. Empty when absent in registry metadata. */ readonly packages: ReadonlyArray; readonly deprecation?: DeprecationView; readonly lifecycleWarnings?: ReadonlyArray; } /** * Client interface for interacting with a registry. * * All operations are scoped to a registry root provided at construction time. * Uses registry-domain types only — no source provider dependencies. * * @experimental This API is unstable and may change without notice. */ export interface RegistryClient { readonly getExtensionsByScope: (args: GetExtensionsByOwnerArgs) => Effect.Effect; readonly ownerExists: (owner: Handle) => Effect.Effect; readonly getExtensionIndex: (args: GetExtensionIndexArgs) => Effect.Effect, AppError>; readonly getExtensionPackage: (args: GetExtensionPackageArgs) => Effect.Effect; readonly publishExtension: (args: PublishExtensionArgs) => Effect.Effect; readonly previewExtensionPublishes: (args: PreviewExtensionPublishesArgs) => Effect.Effect; readonly getExtensionVisibility: (args: GetExtensionVisibilityArgs) => Effect.Effect; readonly updateExtensionVisibility: (args: UpdateExtensionVisibilityArgs) => Effect.Effect; readonly extensionExists: (args: ExtensionExistsArgs) => Effect.Effect; readonly discoverPackages: (args: DiscoverPackagesArgs) => Effect.Effect; } /** * Create the appropriate registry client based on location scheme. * * - Local paths and `file://` URLs -> `LocalRegistryClient` * - `http://` and `https://` URLs -> `RemoteRegistryClient` * * @param location - Registry location (local path, file:// URL, or https:// URL) * * @experimental This API is unstable and may change without notice. */ export declare const createRegistryClient: (location: string, options?: { readonly requestPolicy?: RegistryRequestPolicy; }) => Effect.Effect; //# sourceMappingURL=client.d.ts.map