import type { GjcBundleIdentity, GjcBundleSummary, GjcInstallResult, GjcLifecycleResult, GjcPluginRegistryEntry, GjcPluginRegistrySource, GjcPluginScope, GjcReviewedUpdateToken, GjcToggleResult, GjcUninstallPreview, GjcUpdateApplyResult, GjcUpdatePreview } from "./types"; /** * GJC bundle lifecycle service. * * This module is the ONLY policy and persistence writer for GJC bundles: fresh * install, update preview/apply, bundle enable/disable, and surface * enable/disable. Callers (CLI, Settings) never touch the registry writers or * the installer transaction directly. */ export interface GjcLifecycleContext { cwd: string; } export declare function redactSourceLocator(source: GjcPluginRegistrySource): string; /** Safe, redacted DTO for one installed bundle. */ export declare function toBundleSummary(entry: GjcPluginRegistryEntry): GjcBundleSummary; /** * Rebuild the exact locator an update must re-resolve from. A git ref is stored * separately from the URI, so re-resolving the bare URI would silently drop the * reviewed branch or tag and update from the default branch instead. */ declare function storedSourceLocator(source: GjcPluginRegistrySource): string; /** Exposed for locator-reconstruction tests; not part of the lifecycle API. */ export declare const storedSourceLocatorForTest: typeof storedSourceLocator; /** Exposed so a test can pin parity with the installer's source predicates. */ export declare const isLocalDirectorySourceForTest: typeof isLocalDirectorySource; /** All installed bundles across both scopes, deterministically ordered. */ export declare function listGjcBundles(ctx: GjcLifecycleContext): Promise; /** One bundle by exact (scope, name) identity. Opposite scope never matches. */ export declare function getGjcBundle(ctx: GjcLifecycleContext, identity: GjcBundleIdentity): Promise>; /** * What {@link uninstallGjcBundle} would remove, resolved and validated the same * way, without removing it. * * Strictly read-only: no registry lock is taken (acquiring it creates the scope * root and a lockfile) and no migration is persisted, while legacy-root * discovery and entry migration are still applied in memory so the preview sees * exactly the entries the real uninstall would act on. * * A malformed registry reads back as the internal `registry_unreadable` signal: * the CLI's classification uses it to fail closed, because the unreadable scope * may own the requested name and ownership must never be guessed. The exported * mutating {@link uninstallGjcBundle} keeps mapping the same condition to * `invalid_target`, its historical result contract. */ export declare function previewGjcBundleUninstall(ctx: GjcLifecycleContext, identity: GjcBundleIdentity): Promise>; export declare function uninstallGjcBundle(ctx: GjcLifecycleContext, identity: GjcBundleIdentity): Promise>; /** * True only for strings the installer would treat as a local path rather than * a remote locator. This deliberately mirrors the installer's own `looksLikeGit` * predicate: if the two ever disagreed, a remote locator could be read as a * relative path and shadowed by a local directory of the same shape. */ declare function isLocalDirectorySource(source: string): boolean; /** * Fresh install only. An existing target in the same scope is create-only and * is refused identically with or without force; upgrading is a separate, * scope-qualified operation. */ export declare function installGjcBundle(ctx: GjcLifecycleContext, scope: GjcPluginScope, source: string): Promise>; /** * Re-resolve the stored source descriptor and describe what an update would do. * The returned token binds the candidate, the exact installed baseline, and the * deterministic decision context; apply is a compare-and-swap on all three. */ export declare function previewGjcBundleUpdate(ctx: GjcLifecycleContext, identity: GjcBundleIdentity): Promise>; /** * Apply a previously reviewed update. Any drift in the candidate bytes, the * installed baseline, or the decision context returns a typed stale error with * zero mutation. */ export declare function applyGjcBundleUpdate(ctx: GjcLifecycleContext, token: GjcReviewedUpdateToken): Promise>; /** * Enable or disable a whole bundle. Deterministic quarantine blocks enabling; * disabling is always allowed so operators can always de-escalate. */ export declare function setGjcBundleEnabled(ctx: GjcLifecycleContext, identity: GjcBundleIdentity, enabled: boolean): Promise>; /** Enable or disable one surface of a bundle by its stable extension ID. */ export declare function setGjcBundleSurfaceEnabled(ctx: GjcLifecycleContext, identity: GjcBundleIdentity, surfaceId: string, enabled: boolean): Promise>; /** Deterministic activation generation for the current persisted state. */ export declare function currentActivationFingerprint(ctx: GjcLifecycleContext): Promise; export {};