/** * Shared extension directory path helpers. * * @experimental This API is unstable and may change without notice. */ import type { ExtensionTypePlural } from "./common.js"; import type { Handle } from "./handle.js"; import type { GitBasedSource, LocalSource, RegistrySource } from "../sources/types.js"; import { type AbsolutePath } from "../utils/path-types.js"; import type { WorkspaceLayout } from "../workspace/layout.js"; export type ExtensionPathSource = { readonly refType: "registry"; readonly owner: Handle; readonly source: RegistrySource; readonly portable?: false; } | { readonly refType: "workspace"; readonly owner: Handle; readonly portable?: false; } | { readonly refType: "git-hosted"; readonly source: GitBasedSource; readonly sourcePath?: string; readonly portable?: boolean; } | { readonly refType: "local"; readonly source: LocalSource; readonly sourcePath?: string; readonly portable?: boolean; }; export type ExtensionPathLockEntry = { readonly type: "registry"; readonly sourceName: string; readonly endpoint: URL; readonly owner: Handle; } | { readonly type: "local"; readonly path: string; readonly packageFormat: "agentxm" | "agent-skill"; } | { readonly type: "github" | "gitlab" | "bitbucket"; readonly sourceName: string; readonly endpoint: URL; readonly owner: string; readonly repo: string; readonly path?: string | undefined; readonly ref?: string | undefined; readonly packageFormat: "agentxm" | "agent-skill"; } | { readonly type: "azurerepos"; readonly sourceName: string; readonly endpoint: URL; readonly organization: string; readonly project: string; readonly repo: string; readonly path?: string | undefined; readonly ref?: string | undefined; readonly packageFormat: "agentxm" | "agent-skill"; } | { readonly type: "git"; readonly url: string; readonly path?: string | undefined; readonly ref?: string | undefined; readonly packageFormat: "agentxm" | "agent-skill"; }; export declare const extensionPathSourceFromLockEntry: (entry: ExtensionPathLockEntry) => Exclude; export interface ExtensionDirPaths { readonly canonicalPath: AbsolutePath; readonly extensionSrcPath: AbsolutePath; } export declare const extensionContentFilename: (name: string) => string; export declare const extensionContentPath: (join: (...paths: string[]) => string, root: string, name: string) => AbsolutePath; /** Render a portable display path for an acquired extension package. */ export declare const acquiredExtensionDisplayPath: (root: string, source: Exclude, type: ExtensionTypePlural, name: string) => string; /** Render the acquired display path proven by a persisted lock entry. */ export declare const acquiredExtensionDisplayPathFromLockEntry: (root: string, entry: ExtensionPathLockEntry, type: ExtensionTypePlural, name: string) => string; export declare const computeExtensionPathsForLayout: (join: (...paths: string[]) => string, layout: WorkspaceLayout, source: ExtensionPathSource, type: ExtensionTypePlural, sanitizedName: string) => ExtensionDirPaths; //# sourceMappingURL=extension-paths.d.ts.map