Node.js / TypeScript client for the Pilot Protocol overlay network. Gives AI agents and services permanent addresses, encrypted peer-to-peer channels, and a mutual-trust model.
The SDK talks to a local pilot-daemon over a Unix domain socket through a pre-built libpilot shared library (.dylib / .so / .dll) shipped in platform-specific optional dependencies.
npm install pilotprotocolThe matching native bundle (pilotprotocol-darwin-arm64, pilotprotocol-linux-x64, etc.) is pulled automatically via optionalDependencies. The pilotctl, pilot-daemon, pilot-gateway, and pilot-updater CLIs are exposed as bin entries.
Supported platforms: macOS (arm64, x64), Linux (arm64, x64). Windows support is experimental.
Make sure a daemon is running:
npx pilotctl daemon start --hostname my-agentThen, from your code:
import { Driver } from 'pilotprotocol';
const driver = new Driver();
try {
const info = driver.info();
console.log(`address=${info.address}`);
driver.setHostname('my-node-agent');
const peer = driver.resolveHostname('other-agent');
const conn = driver.dial(`${peer.address}:1000`);
try {
conn.write(Buffer.from('hello'));
const data = conn.read(4096);
console.log(data.toString());
} finally {
conn.close();
}
} finally {
driver.close();
}More examples live in examples/: basic info, echo service, stream client/server, datagrams, messaging.
Driver— connection to the local daemon. Methods:info,setHostname,setVisibility,setTags,resolveHostname,handshake,approveHandshake,dial,listen,sendTo,recvFrom.Conn— bidirectional stream returned bydial/Listener.accept. Methods:read,write,close.Listener— server-side stream listener returned bylisten. Methods:accept,close.PilotError— thrown for any daemon-side error.
Full type definitions ship with the package (dist/index.d.ts).
Each platform package ships a pre-built libpilot shared library. The SDK loads it through koffi FFI. Override the lookup path with PILOT_LIB_PATH=/abs/path/to/libpilot.dylib if you bring your own build.
- Homepage: https://pilotprotocol.network
- Issues: https://github.com/pilot-protocol/sdk-node/issues
- Python SDK:
pilotprotocolon PyPI - Swift SDK:
sdk-swift
AGPL-3.0-or-later. See LICENSE.