Class ExtensionManager

Coordinates discovery and lifecycle management for extension packs. Packs emit descriptors which are registered into kind-specific registries.

Constructors

Methods

  • Loads packs defined in the manifest, registering their descriptors in the appropriate registries. Supports factory-based packs as well as resolving packs from package and module manifest entries.

    Parameters

    Returns Promise<void>

  • Directly loads a pack instance (typically produced by an inline factory) and registers all of its descriptors.

    Parameters

    Returns Promise<void>

  • Load a single manifest entry at runtime, applying the same resolution, secret hydration, registration, and event emission logic as loadManifest.

    This enables schema-on-demand / lazy-loading flows where an agent can enable an extension pack mid-session.

    Parameters

    Returns Promise<{
        loaded: true;
        key: string;
        pack: {
            name: string;
            version?: string;
            identifier?: string;
        };
    } | {
        loaded: false;
        skipped: true;
        reason: "disabled" | "already_loaded" | "unresolved";
        key?: string;
    } | {
        loaded: false;
        skipped: false;
        reason: "failed";
        key?: string;
        error: Error;
        sourceName: string;
    }>

  • Convenience: load an extension pack by npm package name at runtime.

    Parameters

    • packageName: string
    • Optional options: Record<string, unknown>
    • Optional identifier: string
    • Optional lifecycleContext: ExtensionLifecycleContext

    Returns Promise<{
        loaded: true;
        key: string;
        pack: {
            name: string;
            version?: string;
            identifier?: string;
        };
    } | {
        loaded: false;
        skipped: true;
        reason: "disabled" | "already_loaded" | "unresolved";
        key?: string;
    } | {
        loaded: false;
        skipped: false;
        reason: "failed";
        key?: string;
        error: Error;
        sourceName: string;
    }>

  • Convenience: load an extension pack by local module specifier at runtime.

    Parameters

    • moduleSpecifier: string
    • Optional options: Record<string, unknown>
    • Optional identifier: string
    • Optional lifecycleContext: ExtensionLifecycleContext

    Returns Promise<{
        loaded: true;
        key: string;
        pack: {
            name: string;
            version?: string;
            identifier?: string;
        };
    } | {
        loaded: false;
        skipped: true;
        reason: "disabled" | "already_loaded" | "unresolved";
        key?: string;
    } | {
        loaded: false;
        skipped: false;
        reason: "failed";
        key?: string;
        error: Error;
        sourceName: string;
    }>

  • List pack metadata for packs loaded during this process lifetime.

    Returns {
        key: string;
        name: string;
        version?: string;
        identifier?: string;
        packageName?: string;
        module?: string;
        loadedAt: string;
    }[]

  • Deactivates all loaded descriptors and extension packs.

    This is intentionally best-effort: one failing deactivation should not prevent other packs/descriptors from shutting down.

    Parameters

    Returns Promise<void>