agentleFS
Microsoft AzureKnown publisherAzure/LogicAppsUX/libs/a2a-core/CLAUDE.md

LogicAppsUX / a2a-core

CLAUDE.md114 starsChanged 5 months agoMITView on GitHub

React SDK for building chat interfaces that connect to AI agents using the A2A (Agent-to-Agent) protocol. Package: @microsoft/logic-apps-chat Uses Zustand for chat state: IndexedDB storage via idb: - Message history - Session state - Offline support Uses Zod for runtime validation: Minimal external dependencies: - @fluentui/react-components - UI framework - eventemitter3 - Events - idb - IndexedDB - immer - Immutability - marked - Markdown - prismjs - Highlighting - zod - Validation - zustand - State Read libs/a2a-core/src/graphify-out/GRAPH_REPORT.md for…

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Protocol compliance: Follow A2A specification

    line 152
  2. Distinctive:

    Offline support: Consider IndexedDB persistence

    line 155
  3. Distinctive:

    Accessibility: Ensure chat is screen-reader friendly

    line 156
  4. Very specific:

    Read libs/a2a-core/src/graphify-out/GRAPH_REPORT.md for structural context (god nodes, communities, surprising connections).

    line 160

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md
<!-- AUTO-GENERATED from docs/ai-setup/packages/a2a-core.md. DO NOT EDIT directly. -->

A2A Core (Logic Apps Chat SDK)

React SDK for building chat interfaces that connect to AI agents using the A2A (Agent-to-Agent) protocol.

Package: @microsoft/logic-apps-chat

Purpose

  • A2A protocol client - Connect to A2A-compatible AI agents
  • React components - Pre-built chat UI components
  • State management - Zustand-based chat state
  • Message streaming - Real-time response handling
  • Persistence - IndexedDB message storage

Commands

pnpm run build        # Build library
pnpm run dev          # Watch mode
pnpm run test         # Run tests
pnpm run test:ui      # Tests with Vitest UI
pnpm run test:coverage # Coverage report
pnpm run typecheck    # TypeScript validation

Architecture

Entry Point

Multiple entry points:

  • dist/index.js - Core SDK
  • dist/react/index.js - React components
  • dist/react/styles.css - Component styles

Structure

/src
  /core/              - A2A protocol implementation
    /client/          - A2A client
    /types/           - Protocol types
    /events/          - Event emitter
  /react/             - React integration
    /components/      - Chat components
    /hooks/           - React hooks
    /store/           - Zustand store
  /utils/             - Utilities

Core SDK

A2A Client

import { A2AClient } from '@microsoft/logic-apps-chat'

const client = new A2AClient({
  agentUrl: 'https://agent.example.com',
  onMessage: (message) => console.log(message),
})

await client.sendMessage('Hello!')

Message Types

interface Message {
  id: string
  role: 'user' | 'assistant'
  content: string
  timestamp: Date
  streaming?: boolean
}

React Components

ChatProvider

import { ChatProvider, ChatWindow } from '@microsoft/logic-apps-chat/react'

<ChatProvider agentUrl="https://...">
  <ChatWindow />
</ChatProvider>

Available Components

  • ChatWindow - Full chat interface
  • MessageList - Message display
  • MessageInput - User input
  • Message - Individual message
  • CodeBlock - Code display with syntax highlighting

State Management

Uses Zustand for chat state:

import { useChatStore } from '@microsoft/logic-apps-chat/react'

const { messages, sendMessage, isLoading } = useChatStore()

Persistence

IndexedDB storage via idb:

  • Message history
  • Session state
  • Offline support

Validation

Uses Zod for runtime validation:

import { MessageSchema } from '@microsoft/logic-apps-chat'

const validated = MessageSchema.parse(rawMessage)

Technologies

  • React 19 - Latest React features
  • Zustand - State management
  • Zod - Schema validation
  • Immer - Immutable updates
  • marked - Markdown rendering
  • Prism.js - Syntax highlighting
  • IndexedDB (idb) - Persistence
  • EventEmitter3 - Event handling

Testing

pnpm run test              # Run all tests
pnpm run test:coverage     # With coverage
pnpm run test:ui           # Vitest UI

Dependencies

Minimal external dependencies:

  • @fluentui/react-components - UI framework
  • eventemitter3 - Events
  • idb - IndexedDB
  • immer - Immutability
  • marked - Markdown
  • prismjs - Highlighting
  • zod - Validation
  • zustand - State

Development Tips

  1. Protocol compliance: Follow A2A specification
  2. Streaming: Handle partial message updates
  3. Error recovery: Implement retry logic (p-retry)
  4. Offline support: Consider IndexedDB persistence
  5. Accessibility: Ensure chat is screen-reader friendly

Graphify

Read libs/a2a-core/src/graphify-out/GRAPH_REPORT.md for structural context (god nodes, communities, surprising connections).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.