New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@hanzo/agent

Package Overview
Dependencies
Maintainers
9
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hanzo/agent

Agentic (cowork/code) UI surface for Hanzo AI — conversation/agent-run view with tool calls, file & diff panels, a task list, and the composer. Built on @hanzo/gui primitives + the headless @hanzo/ai client. Powers hanzo.app's Claude cowork/code experienc

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
7
133.33%
Maintainers
9
Weekly downloads
 
Created
Source

@hanzo/agent

The cowork/code agentic UI surface for Hanzo AI — a conversation/agent-run view with tool calls, file & diff panels, a task list, reasoning, and the composer. The richer counterpart to a plain chat surface. Powers hanzo.app's Claude cowork/code experience and the Hanzo desktop app.

Built on:

Install

npm install @hanzo/agent @hanzo/ai @hanzo/gui react

@hanzo/ai, @hanzo/gui, and react are peer dependencies — the host app provides them (and the @hanzo/gui theme/provider).

Quick start

import { createAiClient } from '@hanzo/ai'
import { AgentRun, useAgentRun } from '@hanzo/agent'

const client = createAiClient({ getToken: () => session.accessToken })

export function Cowork() {
  const { state, send, stop } = useAgentRun({
    client,
    model: 'enso',
    system: 'You are a coding agent.',
    tools: [
      {
        type: 'function',
        function: {
          name: 'read_file',
          description: 'Read a file from the workspace.',
          parameters: {
            type: 'object',
            properties: { path: { type: 'string' } },
            required: ['path'],
          },
        },
      },
    ],
  })

  return <AgentRun run={state} onSend={send} onStop={stop} />
}

useAgentRun owns the presented run state, streams chat.completion.chunk deltas (text + incremental tool_calls) into turns, and exposes send/stop. AgentRun is a pure view, so you can also drive it from your own state.

Components

The top-level AgentRun composes these; each is exported and usable on its own:

ComponentPurpose
AgentRunTask panel + transcript + composer. The full surface.
MessageList / MessageBubbleThe scrollable transcript and a single turn.
ComposerGrowing text area + Send (Enter submits, Shift+Enter newline).
TaskListThe agent's plan / checklist with per-item status.
ToolCall / ToolCallListA tool invocation: name + status, expandable args/result.
FilePanel / FilePanelListA file the agent touched (diff or contents).
FileDiffUnified-diff renderer with +/- coloring.
CodeBlockMonospace code surface with optional gutter and header.
ReasoningCollapsible chain-of-thought.
DisclosureThe expand/collapse primitive the others build on.
StatusDot / StatusBadgeRun-status indicators.

Model

The presented state is plain data (src/types.ts), derived from @hanzo/ai's wire types:

  • AgentRunState — { turns, tasks?, running }
  • AgentTurn — a user or assistant turn: text, reasoning, tools, files, error, status
  • ToolInvocation — { id, name, arguments, result?, status }
  • FileChange — { path, kind, diff?, contents?, language?, additions?, deletions? }
  • Task — { id, title, status }

toolInvocationFromCall(toolCall) maps an @hanzo/ai ToolCall to a pending ToolInvocation.

Note on @hanzo/chat

This package does not depend on @hanzo/chat: that published package is the commerce/checkout surface (@hanzo/card / @hanzo/platform / @hanzo/workbench), not a conversation list. The transcript here is built directly on @hanzo/gui.

Develop

npm install
npm run typecheck   # tsc --noEmit
npm test            # vitest
npm run build       # tsup -> dist (ESM + CJS + d.ts)

License

BSD-3-Clause © Hanzo AI, Inc.

Keywords

hanzo

FAQs

Package last updated on 30 Sep 2026

Related posts