@rozenite/agent-sdk
v2.2.0
Published
Programmatic SDK for Rozenite agent sessions and domain tools
Readme

A TypeScript SDK for driving Rozenite Agent sessions and tools programmatically.
@rozenite/agent-sdk provides a programmatic interface for the same agent workflow exposed by the rozenite agent CLI. The default API is automation-first: open or scope a session, inspect domains from the session handle, and call tools from the session handle.
Features
- Automation-First Client: Use
withSession(...)for the default lifecycle - Explicit Session Handles: Use
openSession()/attachSession()when you need manual control - Domain Resolution: Discover static and runtime plugin domains from session tools
- Tool Resolution: Call tools by name or via typed descriptors
- Plugin-Owned Pagination: Receive each tool response and cursor unchanged
Installation
Install the SDK as a dependency:
npm install @rozenite/agent-sdkUsage
import { createAgentClient } from '@rozenite/agent-sdk';
const client = createAgentClient();
const result = await client.withSession(async (session) => {
type RequestsPage = {
items: Array<{ id: string }>;
page: { limit: number; hasMore: boolean; nextCursor?: string };
};
const domains = await session.domains.list();
const tools = await session.tools.list({
domain: 'network',
});
const requests = await session.tools.call<
{ limit: number; cursor?: string },
RequestsPage
>({
domain: 'network',
tool: 'listRequests',
args: { limit: 20 },
});
const nextRequests = requests.page.nextCursor
? await session.tools.call<
{ limit: number; cursor?: string },
RequestsPage
>({
domain: 'network',
tool: 'listRequests',
args: { limit: 20, cursor: requests.page.nextCursor },
})
: undefined;
return { domains, tools, requests, nextRequests };
});
console.log(result);Made with ❤️ at Callstack
rozenite is an open source project and will always remain free to use. If you think it's cool, please star it 🌟.
Callstack is a group of React and React Native geeks, contact us at [email protected] if you need any help with these or just want to say hi!
Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥
