Toolkit for rapid AI and agent prototyping. Rapid gives you reusable building blocks so you can validate new agent architectures, memory systems, and workflows without rebuilding the interface layer every time.
- Terminal-first developer experience for iterating on prompts, memory, and control flows.
- Composable modules exposed as ESM entry points; mix and match what you need.
- TypeScript-first API with strong types for chat messages, event handlers, and controller handles.
Install the package with your preferred manager (Node.js 18+):
npm install @photon-ai/rapid
# or
pnpm add @photon-ai/rapid
# or
bun add @photon-ai/rapidRapid expects a TypeScript toolchain (typescript@^5.9.3 as a peer dependency). If you are running in CommonJS, bundle or load with a compatible transpiler such as ts-node/register.
This section will expand as new building blocks ship. Each module lives under an explicit export path so you can import only what you need.
| Category | Module | Description | Status |
|---|---|---|---|
| Chat TUI | @photon-ai/rapid/cli-chat |
Ink-powered terminal chat UI with message panel, input bar, and controller API. | Available |
Render the chat surface inside your CLI and connect it to your agent logic.
// demo.ts
import { renderChatUI } from "@photon-ai/rapid/cli-chat";
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
const chat = renderChatUI();
chat.sendMessage("Welcome to Rapid! Type anything and I'll echo it back.");
chat.onInput(async (prompt) => {
chat.sendMessage("Thinking...");
await delay(500);
chat.sendMessage(`Echo: ${prompt.toUpperCase()}`);
});
// Keep the Ink app alive. Press Ctrl+C to exit.
await new Promise(() => {});Run the example with your preferred TypeScript runner:
ts-node demo.tsrenderChatUI()mounts the Ink application and returns an imperative controller.chat.onInput(handler)registers listeners for user-submitted prompts (supports async handlers).chat.sendMessage(content)streams assistant messages back into the UI in real time.
- Add modules under
src/<module-name>and export them viapackage.json. - Document each module with a short description and example import path in the catalog above.
- Keep runnable snippets in this README so users can copy-paste and tinker.
Rapid uses Bun for scripts and dependency management:
bun install # install dependencies
bun run src/index.tsContributions, bug reports, and ideas are welcome—open an issue or PR when you build something others can reuse.
