@agentuity/server
Server-side utilities for Node.js and Bun applications. This package is runtime-agnostic and contains common utilities that work across both runtimes.
Features
- Runtime Agnostic: Works with both Node.js and Bun
- Server-side focused: Not browser compatible
- Shared utilities: Common APIs used by @agentuity/runtime and standalone apps
Installation
bun add @agentuity/server
Usage
import { getServiceUrls, type ServiceUrls } from '@agentuity/server';
const urls: ServiceUrls = getServiceUrls(region);
console.log(urls.keyvalue);
console.log(urls.stream);
console.log(urls.vector);
Server Fetch Adapter
import { createServerFetchAdapter } from '@agentuity/server';
const adapter = createServerFetchAdapter({
headers: {
Authorization: 'Bearer YOUR_TOKEN',
'User-Agent': 'My App/1.0',
},
onBefore: async (url, options, callback) => {
console.log('Making request to:', url);
await callback();
},
onAfter: async (url, options, response, err) => {
console.log('Request completed:', url, response.response.status);
},
});
Development
See AGENTS.md for development guidelines.