Interface ExtensionContext<TOptions>

Context passed to extension-pack factory helpers (e.g. createExtensionPack()).

AgentOS itself loads packs via manifest factories; this type exists to provide a common shape for extension packages that expose a createExtensionPack(context) function for direct, programmatic consumption.

interface ExtensionContext<TOptions> {
    logger?: ILogger;
    getSecret?: ((secretId) => undefined | string);
    services?: ISharedServiceRegistry;
    options?: TOptions;
    onActivate?: (() => void | Promise<void>);
    onDeactivate?: (() => void | Promise<void>);
}

Type Parameters

  • TOptions = Record<string, unknown>

Hierarchy (view full)

Properties

logger?: ILogger
getSecret?: ((secretId) => undefined | string)

Resolves a secret value registered with AgentOS / the host application. Returns undefined when a secret is not configured.

Type declaration

    • (secretId): undefined | string
    • Parameters

      • secretId: string

      Returns undefined | string

Shared singleton registry for lazy-loading heavyweight extension services.

options?: TOptions
onActivate?: (() => void | Promise<void>)

Type declaration

    • (): void | Promise<void>
    • Returns void | Promise<void>

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

Type declaration

    • (): void | Promise<void>
    • Returns void | Promise<void>