@squasher-ai/agent
v0.1.1
Published
Official @squasher-ai/agent package for Squasher.
Readme
@squasher-ai/agent
Agent telemetry SDK for Squasher.
Capture AI agent sessions, spans, tool calls, and LLM generations from a server-side agent runtime.
Install
npm install @squasher-ai/agentSetup
import { init } from "@squasher-ai/agent";
init({
apiKey: process.env.SQUASHER_API_KEY!,
projectId: process.env.SQUASHER_PROJECT_ID!,
agentId: "support-bot",
workflowId: "triage-and-reply",
});Capture Agent Events
import {
captureGeneration,
captureSessionEnd,
captureSessionStart,
captureToolCall,
flush,
} from "@squasher-ai/agent";
await captureSessionStart({ sessionId: "sess_123", runId: "run_123" });
await captureToolCall("db.lookup", {
sessionId: "sess_123",
traceId: "trace_123",
status: "ok",
input: { id: "err_123" },
output: { rows: 1 },
});
await captureGeneration("Drafted customer reply", {
sessionId: "sess_123",
traceId: "trace_123",
provider: "openrouter",
model: "openai/gpt-4o-mini",
});
await captureSessionEnd({ sessionId: "sess_123", status: "completed" });
await flush();Docs: https://docs.squasher.ai Homepage: https://squasher.ai
