New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

agenttrace-ai-sdk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agenttrace-ai-sdk

Vercel AI SDK adapter for agenttrace-react. Visualise AI SDK agent execution traces, tool calls, and human-in-the-loop approval gates as a live React UI.

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
7
-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

agenttrace-ai-sdk

Vercel AI SDK adapter for agenttrace-react — visualise AI SDK agent execution traces, tool calls, and human-in-the-loop approval gates as a live React UI.

npm version npm downloads license

Install

npm install agenttrace-react agenttrace-ai-sdk
# or
pnpm add agenttrace-react agenttrace-ai-sdk

Use cases

  • Rendering a live execution trace for a Vercel AI SDK agent run
  • Visualising tool calls from useChat() as structured trace nodes
  • Surfacing approval-like tool results as human-in-the-loop gates
  • Building oversight UIs for AI SDK-powered workflows

Peer dependencies

  • agenttrace-react
  • ai
  • react

Exports

  • useAiSdkTrace(messages) — consumes AI SDK UI messages and returns a live AgentRun
  • aiSdkMessagesToAgentRun(messages) — converts a full message array to an AgentRun snapshot
  • aiSdkMessageToTraceEvents(message) — maps a single AI SDK message to TraceEvent[]

Usage

import { useChat } from '@ai-sdk/react'
import { TraceProvider, TraceTree, TraceNode, ApprovalGate } from 'agenttrace-react'
import { useAiSdkTrace } from 'agenttrace-ai-sdk'

export function AiSdkTraceView() {
  const { messages } = useChat()
  const run = useAiSdkTrace(messages)

  return (
    <TraceProvider run={run}>
      <TraceTree>
        {({ node }) => (
          <TraceNode node={node}>
            {({ name, status, type }) => (
              <div data-status={status} data-type={type}>
                {name}: {status}
                <ApprovalGate>
                  {({ approve, reject, context }) => (
                    <div>
                      <p>{context.description}</p>
                      <button onClick={approve}>Approve</button>
                      <button onClick={reject}>Reject</button>
                    </div>
                  )}
                </ApprovalGate>
              </div>
            )}
          </TraceNode>
        )}
      </TraceTree>
    </TraceProvider>
  )
}

How it works

  • Designed for AI SDK UI messages from hooks like useChat() and useCompletion()
  • Maps tool call parts into tool trace nodes with input and output
  • Maps approval-like tool or data parts into ApprovalRequested and ApprovalResolved events
  • Returns a live AgentRun compatible with agenttrace-react's TraceProvider

Repository

github.com/nedbpowell/agenttrace-react

License

MIT

Keywords

react

FAQs

Package last updated on 22 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts