Skip to content
Pilotoo
v0.1

@pilotoo/server

@pilotoo/server is the backend as a NestJS module. You import PilotooModule, give it your tools and any ports you want to replace, and it serves the REST and socket.io API that the clients talk to. Use it when you host the backend yourself on Node 22 with PostgreSQL. For a user’s own machine, use @pilotoo/local-server.

@pilotoo/server is at version 0.1.0 and is not published to a registry yet. A host gets it today by packing the tarballs from the kit repository:

Terminal window
pnpm install
pnpm release:check

release:check builds the release packages and writes one .tgz per package to node_modules/.cache/release-check/. Copy the tarballs you need into your project (for example vendor/) and depend on them as files:

package.json
{
"dependencies": {
"@pilotoo/server": "file:vendor/pilotoo-server-0.1.0.tgz"
}
}

The release set (chat-protocol, chat-core, chat-ui, ui, agent-runtime, server, local-server) is versioned together: install every kit package you use at the same version. See Installation for the full setup.

This is the demo API (apps/api/src/app.module.ts):

src/app.module.ts
import { createAskHumanTool } from '@pilotoo/agent-runtime';
import { PilotooModule } from '@pilotoo/server';
import { webSearch } from './web-search';
@Module({
imports: [
PilotooModule.forRoot({
env: process.env,
tools: (registry) => {
registry.register(webSearch);
registry.register(createAskHumanTool(), { optIn: true });
},
}),
],
})
export class AppModule {}
src/main.ts
import { configureBodyLimit } from '@pilotoo/server';
configureBodyLimit(app);
app.enableCors({ origin: true, credentials: false });
Import Provides
@pilotoo/server The only entry point. PilotooModule and PilotooModuleOptions, configureBodyLimit, the identity helpers (Anonymous, CallerIdentity, IDENTITY_RESOLVER), StreamingGateway, BackgroundTaskService, ScheduleService, createUsagePriceList, the storage port types and the injection tokens.

@nestjs/common, @nestjs/core, @nestjs/platform-express, @nestjs/platform-socket.io and @nestjs/websockets (^11.2.3), reflect-metadata (^0.2.2) and rxjs (^7.8.2). They are peers so your app never loads two copies of NestJS.