Theia API Documentation v1.76.0
    Preparing search index...

    Aggregates the ExternalChatSessionProviders of all connected frontends.

    Providers register when a frontend connects and are removed when its connection closes. Queries fan out to all providers; a failing or unresponsive provider is logged and skipped so that a broken, busy, or disconnecting frontend does not break the external API. Sessions reported by more than one provider (e.g. a session restored in several frontends) are deduplicated, preferring restored over persisted-only, in-progress over finished, and more recent over older reports. Session actions (open, restore) are routed to the preferred provider in the same order.

    Index

    Constructors

    Properties

    logger: ILogger
    onDidChangeSessions: Event<void> = ...

    Fired when the set of connected frontends changes or a frontend reports a session change.

    onDidChangeSessionsEmitter: Emitter<void> = ...
    providers: Set<ExternalChatSessionProvider> = ...
    queryTimeout: 10000 = 10_000

    Timeout in milliseconds after which an unresponsive provider is skipped in the query fan-outs. Only the read-only queries are bounded: an action call may legitimately take longer, and abandoning it could send it twice.

    Methods

    • Returns the detail of the session from the preferred frontend that knows it, or undefined if no connected frontend knows it. The frontends are ranked by their session summaries, so that only the preferred frontend has to report the conversation.

      Parameters

      • sessionId: string

      Returns Promise<undefined | ExternalChatSessionDetail>

    • Normalizes a workspace URI for comparison: URIs that denote the same workspace but differ in their path encoding or in a trailing separator normalize to the same string.

      Parameters

      • workspace: string

      Returns string

    • Opens the session in the preferred frontend that knows it, restoring it if necessary. Returns false if no connected frontend knows the session.

      Parameters

      • sessionId: string

      Returns Promise<boolean>

    • Rejects when the query does not answer within queryTimeout. Theia's RPC has no request timeout of its own, so an unresponsive frontend would otherwise stall the external API request that fans out to it indefinitely.

      Type Parameters

      • T

      Parameters

      • query: Promise<T>
      • description: string

      Returns Promise<T>