Observed since 21 Oct, 09:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xkobold/pi-gateway
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.
| Package / target | Requirement | Relationship |
|---|---|---|
sql.jsEnvironment{
"local_name": "sql.js",
"alias": false,
"peer_metadata": null
} | ^1.14.1 | runtime |
wsEnvironment{
"local_name": "ws",
"alias": false,
"peer_metadata": null
} | ^8.18.0 | runtime |
@types/sql.jsEnvironment{
"local_name": "@types/sql.js",
"alias": false,
"peer_metadata": null
} | ^1.4.11 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^20.19.37 | development |
@types/wsEnvironment{
"local_name": "@types/ws",
"alias": false,
"peer_metadata": null
} | ^8.18.1 | development |
bun-typesEnvironment{
"local_name": "bun-types",
"alias": false,
"peer_metadata": null
} | ^1.3.11 | development |
tsxEnvironment{
"local_name": "tsx",
"alias": false,
"peer_metadata": null
} | ^4.19.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^6.0.2 | development |
@mariozechner/pi-coding-agentEnvironment{
"local_name": "@mariozechner/pi-coding-agent",
"alias": false,
"peer_metadata": null
} | >=0.65.0 | peer |
@sinclair/typeboxEnvironment{
"local_name": "@sinclair/typebox",
"alias": false,
"peer_metadata": null
} | >=0.32.0 | peer |
Source distribution
{
"integrity": "sha512-NcSuR+46Ro3HZ4V+2BIql0GlwFj3GyeTS+OhsDMUCKOs0BeO832fc6IMFfCkJtbqPCHXWpRkYNQf96oTM1Ldeg==",
"shasum": "fb391dcf2a85cca117edba7ea061527e4e6f5588",
"tarball": "https://registry.npmjs.org/@0xkobold/pi-gateway/-/pi-gateway-0.6.0.tgz",
"fileCount": 70,
"unpackedSize": 338523,
"signatures": [
{
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
"sig": "MEQCIE0AkziWsDiYt+jyH5qIQabT0ye3t9TsygC/sc0zqKT2AiAP+0Skt8dRgd3LuD+IZu/CavzmNFEO8UcRSsIhU6YtIw=="
}
]
}Observed since 21 Oct, 09:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:e025407d0640fc170e4b7da8436fa92fe1bbd6cac7fb0aa9728c9b576cf67a63