ReadonlydocumentationDocumentation of this contribution, grouping its routes under an OpenAPI tag in the OpenAPI document of the external API.
ReadonlypathAbsolute path under which this contribution's routes are mounted, e.g. /api/ai/sessions.
The server imposes no path conventions, but each contribution answers all requests below
its path, so contribution paths must not nest: a contribution whose path nests with the
path of another contribution is skipped with a warning. With samePort delivery the path
also must not nest with one of Theia's own routes on the main server, as it would shadow
them; the server cannot detect that case.
Protected ReadonlyregistryRegisters the contribution's routes, see ExternalApiRouter.
Called whenever the routing is (re)built, i.e. when the external API server
configuration changes. The router of the previous build, including everything
registered in its toDispose collection, is disposed beforehand, so build-scoped
state is set up here rather than held across builds.
ProtectedcreateProtectedsend
Contributes the AI session API to the external API server:
GET /api/ai/sessionslists all sessions (restored and persisted) with id, title, status, agent, workspace, last interaction time, and a short plain-text preview of the conversation.POST /api/ai/sessionscreates a session in a frontend matching the requested workspace, optionally pinning an agent and sending an initial prompt.GET /api/ai/sessions/eventsstreams the session list as server-sent events, pushing an updated list whenever sessions change.GET /api/ai/sessions/:idreturns a single session including its conversation reduced to plain-text messages (persisted sessions report metadata only until restored).POST /api/ai/sessions/:id/openshows the session in the chat view of a connected frontend.POST /api/ai/sessions/:id/restorerestores a persisted session and returns its detail.POST /api/ai/sessions/:id/promptsends a prompt to the session.The endpoints are served on the external API port and are token-protected when an external API token is configured (see
@theia/external-api).