@automatey-org/agent-core
v0.1.3
Published
Framework-agnostic Vercel AI SDK ReAct streaming loop: text + reasoning + tools + metrics. The one agent loop shared by the CLI, web, and extension.
Maintainers
Readme
@automatey-org/agent-core
The one framework-agnostic Vercel AI SDK ReAct streaming loop — shared by the Automatey CLI, the web app, and the browser extension. No React, no DOM, no provider construction. Just the turn loop, a stable callback contract, and types.
import { Agent } from '@automatey-org/agent-core';
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
const model = createOpenAICompatible({ name: 'vllm', baseURL, apiKey })('nvidia/…');
const agent = new Agent({
model,
tools, // Record<string, Tool> (Vercel AI SDK ToolSet)
systemPrompt,
maxSteps: 8,
modelLabel: 'Nemotron',
extractReasoningTag: 'think', // optional: pull <think>…</think> into reasoning
});
await agent.run('hello', {
onToken: (t) => …, // answer text delta
onReasoning: (t) => …, // live reasoning delta
onToolCall: (name, input) => …,
onToolResult: (name, output) => …,
onStatus: (s) => …, // 'thinking' | 'generating' | 'tool' | 'done'
onMetrics: (m) => …, // { model, durationMs, firstTokenMs, *Tokens }
signal, // AbortSignal
});Design
- Provider-agnostic: pass an already-built model. Provider construction
(Nemotron thinking budget, OpenAI, Anthropic) lives in
@automatey-org/nemotron. - Minimal core, optional features: the
<tag>reasoning extraction is opt-in (extractReasoningTag); everything else is the smallest viable loop. - Vercel AI SDK v7:
streamText+stopWhen: stepCountIs(n), unifiedfullStream(text-delta,reasoning-delta,tool-call,tool-result,finish-step).aiis a peer dependency so there is one SDK instance.
Peer dependency: ai >= 7.
