Observed since 21 Oct, 09:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Hermes-style messaging gateway for pi - multi-platform agent with sessions, security, and background tasks
Hermes-style messaging gateway for pi-coding-agent — multi-platform session management, security, and background tasks.
pi install npm:@0xkobold/pi-gateway
Or as part of the meta-extension:
pi install npm:@0xkobold/pi-kobold
┌──────────────────────────────────────────────────────┐
│ Pi-Gateway │
├──────────────┬──────────────┬────────────────────────┤
│ Sessions │ Security │ Background Tasks │
│ ────────── │ ────────── │ ────────────────── │
│ • Per-chat │ • Allowlist │ • Isolated sessions │
│ • Reset │ • Pairing │ • Progress tracking │
│ • Persist │ • Rate limit│ • Result delivery │
├──────────────┴──────────────┴────────────────────────┤
│ Platform Adapters │
│ Discord · Telegram · Slack · WhatsApp · Twitch │
├──────────────────────────────────────────────────────┤
│ SQLite via sql.js │
└──────────────────────────────────────────────────────┘
| Command | Description |
|---|---|
/gateway start [port] | Start the gateway |
/gateway stop | Stop the gateway |
/gateway status | Show status |
/gateway restart | Restart the gateway |
/gateway pair <code> | Approve a pairing code |
/gateway allow <platform> <userId> | Add user to allowlist |
/gateway sessions | List active sessions |
/gateway tasks | List background tasks |
/gateway config | Show configuration |
| Tool | Description |
|---|---|
gateway_status | Check gateway status |
gateway_sessions | List active sessions |
gateway_background_tasks | List and manage background tasks |
gateway_pairing | Generate, list, or approve pairing codes |
Pi-gateway now exports a programmatic API so it can be started from outside a pi session:
import { startGateway, stopGateway, isGatewayRunning, getStatus } from '@0xkobold/pi-gateway/api';
// Check if already running
const running = await isGatewayRunning(3847);
// Start the gateway
const status = await startGateway({ port: 3847, host: '0.0.0.0' });
// Get status
const current = getStatus();
// Stop
await stopGateway();
| Function | Description |
|---|---|
startGateway(opts?) | Start HTTP/WS server, adapters, and cron |
stopGateway() | Stop all adapters, close server, kill RPC process |
isGatewayRunning(port?) | Check if a gateway is already running on a port |
getStatus() | Get current status (running, adapters, clients, sessions) |
getConfig() | Get current gateway config |
isRunning() | Check if gateway is running (sync) |
getAdapter(platform) | Get a platform adapter by name |
getAdapters() | Get all active adapters |
sendMessage(platform, channelId, content) | Send a message through a platform adapter |
broadcast(event, data) | Broadcast to all connected WebSocket clients |
interface StartGatewayOptions {
port?: number; // Override config port
host?: string; // Override config host
noAgent?: boolean; // Don't spawn pi RPC process (when pi is already running)
}
By default, all users are allowed (allowAll: true). To restrict access:
allowAll: false in config/gateway allow to grant accessgateway_pairing (generate)/gateway pair <code>Stored at ~/.0xkobold/gateway/config.json:
{
"port": 3847,
"host": "localhost",
"tokens": [],
"corsOrigins": ["*"],
"enableWebSocket": true,
"enableHttp": true,
"security": {
"allowAll": true,
"requirePairing": false
},
"sessions": {
"resetPolicy": "idle",
"dailyHour": 4,
"idleMinutes": 1440
},
"platforms": {
"discord": {
"enabled": false,
"botToken": ""
}
}
}
Data is stored in SQLite via sql.js (WebAssembly) for cross-runtime compatibility (Node.js and Bun):
~/.0xkobold/gateway-sessions.db — Session data~/.0xkobold/gateway-security.db — Allowlist, pairing codes, rate limits~/.0xkobold/gateway-background-tasks.db — Background task recordsgit clone https://github.com/0xKobold/pi-gateway
cd pi-gateway
npm install
npm run build
pi install ./
MIT
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:d0cb6f7204d9c603f158aa6fe782fc850243011fc37b04116a631811a0d928b0