@pilotoo/connections-server
Introduction
Section titled “Introduction”@pilotoo/connections-server is the NestJS adapter of Connections. It serves the user and admin routes, keeps connections in PostgreSQL, runs the maintenance that refreshes credentials, and registers connections_search and connections_execute in a tool registry. The host supplies its environment, a database pool, identity and the tool registry. A Pilotoo host does not need it directly: PilotooModule.forRoot({ connections }) wires it.
Installation
Section titled “Installation”@pilotoo/connections-server is at version 0.1.0, is marked private and is not published to a registry. It is also not part of the tarballs that pnpm release:check packs, so today it is used from the kit workspace:
pnpm installpnpm --filter @pilotoo/connections-server buildInside the workspace, depend on it with "@pilotoo/connections-server": "workspace:^". Its build first builds the kit packages it depends on.
Basic usage
Section titled “Basic usage”connectionProviders returns the providers to add to your module and connectionControllers the controllers:
import { githubProvider } from '@pilotoo/connections-core';import { connectionControllers, connectionProviders } from '@pilotoo/connections-server';
@Module({ controllers: [...connectionControllers], providers: [ ...connectionProviders( { providers: [githubProvider()], publicApi: true }, { env: 'ENV', postgres: DatabaseService, toolRegistry: 'TOOL_REGISTRY' }, ), ],})export class AppModule {}Using the library covers the ports and the identity guard.
Entry points
Section titled “Entry points”| Import | Provides |
|---|---|
@pilotoo/connections-server |
The only entry point. |
| Role | Names |
|---|---|
| Wiring | connectionProviders, connectionControllers, ConnectionsHostOptions, ConnectionsPorts. |
| Controllers | ConnectionController, ConnectionAdminController, ConnectionGatewayController, GatewayWorkerController, ConnectionToolsController. |
| Storage | PostgresConnectionStorage. |
| Tools | createConnectionTools, CONNECTION_TOOL_NAMES, createEmbeddedToolSource. |
| Identity | Anonymous, ANONYMOUS_ROUTE, CallerIdentity, IdentifiedRequest. |
| Gateways | createUrlGatewayClient. |
| Maintenance | ConnectionMaintenance. |
Peer dependencies
Section titled “Peer dependencies”@nestjs/common and @nestjs/core (^11.2.3), reflect-metadata (^0.2.2) and rxjs (^7.8.2).
Dependencies
Section titled “Dependencies”@pilotoo/connections-core, @pilotoo/agent-runtime, @pilotoo/chat-protocol, @langchain/core, @modelcontextprotocol/sdk, pg and zod.