Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

bradie

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bradie

Bradie

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Bradie Client

A Node.js client for the Bradie LLM service, providing project initialization, messaging, streaming responses, and log retrieval.

Installation

npm install @agentic-kit/bradie
# or
yarn add @agentic-kit/bradie

Usage

import { Bradie } from '@agentic-kit/bradie';

// 1. Configure callbacks and create client
const client = new Bradie({
  domain: 'http://localhost:3000',
  onSystemMessage: (msg) => console.log('[system]', msg),
  onAssistantReply: (msg) => console.log('[assistant]', msg),
  onError: (err) => console.error('[error]', err),
  onComplete: () => console.log('[complete]'),
});

// 2. Initialize a project (creates session & project IDs)
const { sessionId, projectId } = await client.initProject(
  'my-project',
  '/path/to/project'
);
console.log('Session ID:', sessionId, 'Project ID:', projectId);

// 3. Send a message and get a request ID
const requestId = await client.sendMessage('Hello, Bradie!');
console.log('Request ID:', requestId);

// 4. Subscribe to streaming logs (chat messages & system events)
await client.subscribeToResponse(requestId);

fetchOnce

Retrieve the complete array of command logs for a given request:

const logs = await client.fetchOnce(requestId);
console.log(logs);

npm Subscribe Script

A helper script is included to subscribe to a request from the command line:

cd packages/bradie
npm run subscribe -- \
  --sessionId <SESSION_ID> \
  --requestId <REQUEST_ID> \
  [--domain http://localhost:3000]

API Reference

  • new Bradie(config: { domain: string; onSystemMessage: (msg: string) => void; onAssistantReply: (msg: string) => void; onError?: (err: Error) => void; onComplete?: () => void; })
  • .initProject(projectName: string, projectPath: string): Promise<{ sessionId: string; projectId: string }>
  • .sendMessage(message: string): Promise<string>
  • .subscribeToResponse(requestId: string, opts?: { pollInterval?: number; maxPolls?: number }): Promise<void>
  • .fetchOnce(requestId: string): Promise<AgentCommandLog[]>

Contributing

Please open issues or pull requests on GitHub.

© Hyperweb (formerly Cosmology). See LICENSE for full licensing and disclaimer.

FAQs

Package last updated on 09 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts