@intisy/bayonet
    Preparing search index...

    Interface ContextSurface

    The context a plugin's activate receives.

    interface ContextSurface {
        config: unknown;
        events: EventBusShape;
        host: HostDescriptorShape;
        log: unknown;
        manifest: unknown;
        paths: PluginPathsShape;
        services: ServiceRegistryShape;
        capability(id: string): unknown;
        homes(): HomeDescriptorShape[];
        provide(key: unknown, implementation: unknown): void;
        service(id: string): unknown;
        topic(id: string): unknown;
    }
    Index
    config: unknown

    The plugin's resolved configuration, as the runtime supplied it.

    Publish and subscribe, attributed to this plugin.

    What the plugin may know about the host.

    log: unknown

    The plugin's logger, as the runtime supplied it.

    manifest: unknown

    The plugin's own manifest, by identity, as it was parsed.

    The storage directories of the home the plugin runs in.

    The service registry, fenced to this plugin's namespace.

    • The typed key for a capability id.

      Parameters

      • id: string

        the capability id to mint a key for

      Returns unknown

      the typed key

      Untyped return rather than a key shape, mirroring provide: the engine works in ids, and the contract is where the phantom type is attached.

    • Registers the plugin's implementation of a capability.

      Parameters

      • key: unknown

        the typed capability key, or a bare id, to register against

      • implementation: unknown

        the value the plugin provides for that capability

      Returns void

      The key is untyped rather than a String because the contract's provide hands over a typed key object and a host hands over a bare id, and this one function serves both. The engine still works in ids: the id is read off the key here, at the boundary, which is where every other shape difference is resolved.

    • The typed key for a service id.

      Parameters

      • id: string

        the service id to mint a key for

      Returns unknown

      the typed key

      Same shape and same reason as capability(String): a key is an id at run time, so the three key kinds differ only in the phantom type the contract attaches.

    • The typed key for an event topic id.

      Parameters

      • id: string

        the topic id to mint a key for

      Returns unknown

      the typed key