Protected ReadonlyloggerReadonlyonFired when the set of connected frontends changes or a frontend reports a session change.
Protected ReadonlyonProtected ReadonlyprovidersProtected ReadonlyqueryTimeout 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.
Creates a session in a frontend matching the requested workspace. Without a requested
workspace, the session is created in the only connected frontend, and if the connected
frontends have different workspaces open, the request is rejected as ambiguous.
Rejected with noFrontend when no frontend is connected or none responds.
ProtectedgetReturns the providers that know the given session, most preferred report first.
ProtectedgetReturns the providers whose workspace matches the given one, or all providers if none is given.
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.
ProtectednormalizeNormalizes 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.
Announces that the sessions visible through this registry changed, see onDidChangeSessions.
Opens the session in the preferred frontend that knows it, restoring it if necessary.
Returns false if no connected frontend knows the session.
ProtectedpreferProtectedqueryRestores the session in the preferred frontend that knows it and returns its detail.
Returns undefined if no connected frontend knows the session.
Sends the prompt to the given session in the preferred frontend that knows it.
The first definitive answer wins: in particular, a busy rejection by the preferred
frontend is not retried against less preferred copies of the session.
Returns undefined if no connected frontend knows the session.
ProtectedwithRejects 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.
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.