Interface ExtensionDescriptor<TPayload>

Unified descriptor contract consumed by the extension registry. Concrete descriptor types (e.g., tools, guardrails) extend this shape with payloads specific to their domain.

interface ExtensionDescriptor<TPayload> {
    id: string;
    kind: string;
    priority?: number;
    enableByDefault?: boolean;
    metadata?: Record<string, unknown>;
    payload: TPayload;
    source?: ExtensionSourceMetadata;
    onActivate?: ((context) => void | Promise<void>);
    onDeactivate?: ((context) => void | Promise<void>);
    requiredSecrets?: ExtensionSecretRequirement[];
}

Type Parameters

  • TPayload = unknown

Hierarchy (view full)

Properties

id: string

Unique identifier for the descriptor within its kind. Subsequent descriptors with the same id stack on top of previous entries.

kind: string

High-level category of the descriptor (tool, guardrail, etc.).

priority?: number

Optional priority used during manifest loading. Higher numbers load later, allowing them to supersede earlier descriptors with the same id.

enableByDefault?: boolean

Flag indicating whether the descriptor should be enabled by default when discovered. Manifests or overrides can still disable it explicitly.

metadata?: Record<string, unknown>

Arbitrary metadata for tooling or pack-specific usage.

payload: TPayload

The payload consumed by the runtime (e.g., tool factory function).

Provenance information for the descriptor.

onActivate?: ((context) => void | Promise<void>)

Optional lifecycle hook invoked when the descriptor becomes the active entry for its id.

Type declaration

onDeactivate?: ((context) => void | Promise<void>)

Optional lifecycle hook invoked when the descriptor is superseded or removed.

Type declaration

requiredSecrets?: ExtensionSecretRequirement[]

Declares the secrets (API keys, credentials) the descriptor needs in order to function.