@oculusmind-ai/agents
v0.0.1
Published
Client for OculusMind.AI agents over the A2A protocol.
Maintainers
Readme
@oculusmind-ai/agents
TypeScript/JavaScript client for OculusMind.AI agents over the A2A protocol. Reference implementation for the OculusMind Agents SDK.
Runs on Node 18+, Bun, Deno, and modern browsers (global fetch, no runtime
dependencies).
Install
npm install @oculusmind-ai/agentsUse
import { OculusMindAgents, StaticTokenProvider } from "@oculusmind-ai/agents";
const client = new OculusMindAgents({
agent: "uno",
tokenProvider: new StaticTokenProvider(process.env.OCULUSMIND_TOKEN!, {
// Optional: get a heads-up before your 7-day token lapses.
onTokenExpiring: (secondsLeft) =>
console.warn(`OculusMind token expires in ${Math.round(secondsLeft / 3600)}h`),
}),
// baseUrl defaults to production; use the beta host to test:
// baseUrl: 'https://api-beta.oculusmind.ai',
});
// One-shot
const reply = await client.send("What is the weather in Austin?");
console.log(reply.text);
// Streaming
for await (const event of client.stream("Draft a haiku about Texas")) {
if (event.kind === "text") process.stdout.write(event.text);
}
// Capabilities
console.log(await client.agentCard());Get OCULUSMIND_TOKEN from the Integrations page
— see ../../docs/AUTHENTICATION.md, including the
plan for automatic token refresh via ApiKeyTokenProvider.
Errors
TokenExpiredError— no valid token (expired, or a 401 after one retry). Mint a new one at the Integrations page.UsageLimitError— your daily usage budget is spent.
Develop
npm install
npm run typecheck
npm test # builds, then runs node --testApache-2.0.
