Skip to content

Commit 6b1134c

Browse files
update from workm8/ag-ui-4j
1 parent f79bcee commit 6b1134c

File tree

216 files changed

+18879
-1125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+18879
-1125
lines changed

.DS_Store

6 KB
Binary file not shown.

sdks/.DS_Store

6 KB
Binary file not shown.

sdks/community/.DS_Store

6 KB
Binary file not shown.

sdks/community/java/.DS_Store

8 KB
Binary file not shown.

sdks/community/java/CLAUDE.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Development Commands
6+
7+
### Build Commands
8+
- **Full build**: `mvn clean compile` - Compiles all modules
9+
- **Run tests**: `mvn test` - Executes unit tests across all modules
10+
- **Full verification**:
11+
- `mvn clean verify` - Runs complete build with tests and quality checks
12+
- **Coverage analysis**: `mvn clean test -Pcoverage` - Runs tests with JaCoCo coverage reports
13+
- **Code quality**: `mvn sonar:sonar` - Runs SonarCloud analysis (requires configuration)
14+
15+
### Testing Commands
16+
- **Unit tests only**: `mvn surefire:test` - Runs unit tests using Surefire plugin
17+
- **Integration tests**: `mvn failsafe:integration-test` - Runs integration tests using Failsafe plugin
18+
- **Test a specific module**: `mvn test -pl packages/core` - Tests only the core module
19+
20+
### Package Management
21+
- **Package without tests**: `mvn package -DskipTests` - Fast packaging
22+
- **Deploy to GitHub Packages**: `mvn deploy` - Deploys artifacts to GitHub Packages repository
23+
24+
## Project Architecture
25+
26+
AG-UI-4J is an Agent User Interaction Protocol for Java that provides a framework for building AI agent interactions with streaming event-based communication.
27+
28+
### Module Structure
29+
30+
- **packages/core**: Core interfaces and models (`Agent`, `BaseMessage`, events)
31+
- **packages/client**: Client library for consuming agent services
32+
- **packages/http**: HTTP utilities and communication layer
33+
- **packages/server**: Server-side implementation components
34+
- **integrations/spring-ai**: Spring AI integration with `SpringAIAgent`
35+
- **integrations/langchain4j**: LangChain4j integration with `Langchain4jAgent`
36+
- **servers/spring**: Spring Boot server implementation
37+
- **clients/ok-http**: OkHttp client implementation
38+
- **utils/json**: JSON utilities with Jackson mixins
39+
- **examples/**: Working examples for Spring AI and LangChain4j
40+
41+
### Core Architecture Patterns
42+
43+
#### Agent Pattern
44+
The `Agent` interface (packages/core/src/main/java/com/agui/core/agent/Agent.java:49) defines the contract:
45+
```java
46+
CompletableFuture<Void> runAgent(RunAgentParameters parameters, AgentSubscriber subscriber);
47+
```
48+
49+
All agents implement this interface for asynchronous execution with real-time event streaming.
50+
51+
#### Event-Driven Communication
52+
The system uses streaming events for real-time updates:
53+
- **Text events**: `TextMessageStartEvent`, `TextMessageContentEvent`, `TextMessageEndEvent`
54+
- **Tool events**: `ToolCallStartEvent`, `ToolCallArgsEvent`, `ToolCallEndEvent`, `ToolCallResultEvent`
55+
- **Run lifecycle**: `RunStartedEvent`, `RunFinishedEvent`, `RunErrorEvent`
56+
- **Thinking events**: `ThinkingStartEvent`, `ThinkingEndEvent` with content events
57+
58+
#### Integration Strategy
59+
- **SpringAIAgent**: Uses Spring AI's reactive streaming with `ChatClient` and `ToolCallback`
60+
- **Langchain4jAgent**: Integrates with `StreamingChatModel` and `StreamingChatResponseHandler`
61+
- Both agents extend `LocalAgent` base class for common functionality
62+
63+
#### Message System
64+
Unified message types across all integrations:
65+
- `SystemMessage`, `UserMessage`, `AssistantMessage`, `DeveloperMessage`, `ToolMessage`
66+
- Message mappers convert between ag-ui-4j format and integration-specific formats
67+
68+
### Build Profiles
69+
- **local** (default): Skips Javadoc and source generation for faster development
70+
- **github-actions**: Enables full documentation generation for CI/CD
71+
- **coverage**: Activates JaCoCo for code coverage analysis
72+
73+
### Java Version
74+
- **Source/Target**: Java 17 (minimum)
75+
- **Recommended**: Java 21 LTS
76+
77+
### Key Dependencies
78+
- **Spring AI**: Chat models, tools, and advisors integration
79+
- **LangChain4j**: Streaming chat models and tool execution
80+
- **Jackson**: JSON serialization with custom mixins
81+
- **JUnit 5**: Testing framework
82+
- **AssertJ**: Fluent assertions for tests
83+
- **Maven**: Build and dependency management

sdks/community/java/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ Then create a pull request on GitHub with:
172172

173173
```java
174174
// Package structure example
175-
io.workm8.agui4j.core.* // Core functionality
176-
io.workm8.agui4j.client.* // Client libraries
177-
io.workm8.agui4j.http.* // HTTP utilities
178-
io.workm8.agui4j.spring.* // Spring integrations
179-
io.workm8.agui4j.util.* // Utility classes
175+
com.ag-ui.core.* // Core functionality
176+
com.ag-ui.client.* // Client libraries
177+
com.ag-ui.http.* // HTTP utilities
178+
com.ag-ui.spring.* // Spring integrations
179+
com.ag-ui.util.* // Utility classes
180180
```
181181

182182
### Error Handling

sdks/community/java/SECURITY.md

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# Security Policy
2+
3+
## 🛡️ Our Commitment to Security
4+
5+
The AG-UI-4J project takes security seriously. We appreciate the security research community's efforts in helping us maintain the security of our project and protecting our users.
6+
7+
## 📋 Supported Versions
8+
9+
We provide security updates for the following versions of AG-UI-4J:
10+
11+
| Version | Supported | Notes |
12+
| ------- | ------------------ | ------------------------ |
13+
| 1.0.x | ✅ Yes | Current stable release |
14+
| < 1.0 | ❌ No | Development versions |
15+
16+
**Note:** As this project is currently in development (pre-1.0), security updates will be applied to the main branch. Once we reach stable releases, this table will be updated with our long-term support policy.
17+
18+
## 🚨 Reporting Security Vulnerabilities
19+
20+
**Please DO NOT report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
21+
22+
Instead, please report security vulnerabilities responsibly through one of these methods:
23+
24+
### Primary Method: GitHub Security Advisories (Recommended)
25+
1. Navigate to the [Security Advisories page](https://github.com/Work-m8/ag-ui-4j/security/advisories)
26+
2. Click "Report a vulnerability"
27+
3. Fill out the vulnerability report form
28+
4. Submit the report
29+
30+
### Alternative Method: Direct Email
31+
If you cannot use GitHub Security Advisories, email us directly:
32+
- **Email:** [[email protected]](mailto:[email protected])
33+
- **Subject:** `[SECURITY] AG-UI-4J Vulnerability Report`
34+
35+
## 📝 What to Include in Your Report
36+
37+
To help us understand and resolve the issue quickly, please include as much of the following information as possible:
38+
39+
### Required Information
40+
- **Description** of the vulnerability
41+
- **Steps to reproduce** the issue
42+
- **Affected versions** of AG-UI-4J
43+
- **Impact assessment** (what an attacker could achieve)
44+
45+
### Additional Helpful Information
46+
- **Proof of concept** code or screenshots
47+
- **Suggested fix** if you have one
48+
- **CVSS score** if you've calculated one
49+
- **Related CVE numbers** if applicable
50+
- **Your preferred contact method** for follow-up
51+
52+
### Example Report Template
53+
```
54+
**Vulnerability Type:** [e.g., SQL Injection, XSS, Authentication Bypass]
55+
**Affected Component:** [e.g., packages/http, packages/client]
56+
**Affected Versions:** [e.g., All versions, 1.0.0-1.0.5]
57+
**Severity:** [e.g., Critical, High, Medium, Low]
58+
59+
**Description:**
60+
[Detailed description of the vulnerability]
61+
62+
**Steps to Reproduce:**
63+
1. [Step 1]
64+
2. [Step 2]
65+
3. [Step 3]
66+
67+
**Impact:**
68+
[What an attacker could achieve]
69+
70+
**Proof of Concept:**
71+
[Code snippet, screenshots, or detailed explanation]
72+
73+
**Suggested Fix:**
74+
[If you have suggestions for fixing the issue]
75+
```
76+
77+
## ⏱️ Response Timeline
78+
79+
We are committed to responding to security reports promptly:
80+
81+
| Timeline | Action |
82+
|----------|--------|
83+
| **Within 24 hours** | Initial acknowledgment of your report |
84+
| **Within 72 hours** | Preliminary assessment and triage |
85+
| **Within 7 days** | Detailed response with our findings |
86+
| **Within 30 days** | Resolution or detailed timeline for complex issues |
87+
88+
## 🔒 Security Update Process
89+
90+
### Our Process
91+
1. **Validation** - We verify and reproduce the reported vulnerability
92+
2. **Assessment** - We assess the impact and assign a severity level
93+
3. **Development** - We develop and test a fix
94+
4. **Review** - Internal security review of the fix
95+
5. **Release** - We release the security update
96+
6. **Disclosure** - We publish details after users have had time to update
97+
98+
### Severity Levels
99+
We use the following severity classification:
100+
101+
- **Critical** - Immediate threat to data integrity or system security
102+
- **High** - Significant security risk that should be addressed quickly
103+
- **Medium** - Moderate security risk with limited impact
104+
- **Low** - Minor security improvement or hardening opportunity
105+
106+
## 📢 Security Announcements
107+
108+
Security updates and announcements will be published through:
109+
110+
- **GitHub Security Advisories** - Primary announcement method
111+
- **GitHub Releases** - Security releases will be clearly marked
112+
- **CHANGELOG.md** - Security fixes will be documented
113+
- **Repository README** - Critical security notices when applicable
114+
115+
## 🛠️ Security Best Practices for Users
116+
117+
### For Developers Using AG-UI-4J
118+
119+
1. **Keep Dependencies Updated**
120+
```bash
121+
mvn dependency:display-plugin-updates
122+
mvn versions:display-dependency-updates
123+
```
124+
125+
2. **Use Dependency Scanning**
126+
```bash
127+
mvn org.owasp:dependency-check-maven:check
128+
```
129+
130+
3. **Follow Secure Coding Practices**
131+
- Validate all inputs
132+
- Use parameterized queries
133+
- Implement proper authentication and authorization
134+
- Handle errors securely (don't expose sensitive information)
135+
136+
4. **Regular Security Audits**
137+
- Review your application's security posture regularly
138+
- Keep AG-UI-4J updated to the latest version
139+
- Monitor security advisories
140+
141+
### For AG-UI-4J Contributors
142+
143+
1. **Code Review Requirements**
144+
- All code changes require review by at least one maintainer
145+
- Security-sensitive changes require additional security review
146+
147+
2. **Dependency Management**
148+
- New dependencies must be justified and reviewed
149+
- Dependencies should be kept to minimum necessary versions
150+
- Regular dependency updates via Dependabot
151+
152+
3. **Testing Requirements**
153+
- Security-related changes require comprehensive tests
154+
- Include negative test cases (invalid inputs, edge cases)
155+
156+
## 🔍 Known Security Considerations
157+
158+
### Current Security Features
159+
- **Input Validation** - [Describe current validation mechanisms]
160+
- **Authentication** - [Describe authentication methods if applicable]
161+
- **Authorization** - [Describe authorization controls if applicable]
162+
- **Data Protection** - [Describe data protection measures]
163+
164+
### Security Roadmap
165+
As the project evolves, we plan to implement:
166+
- Comprehensive input validation framework
167+
- Security testing automation
168+
- Regular security audits
169+
- Penetration testing for major releases
170+
171+
## 🏆 Security Hall of Fame
172+
173+
We recognize and thank security researchers who have responsibly disclosed vulnerabilities:
174+
175+
<!-- This section will be populated as we receive and resolve security reports -->
176+
*No security reports have been received yet. Be the first to help us improve our security!*
177+
178+
## 📚 Additional Resources
179+
180+
### Security Tools and Standards
181+
- [OWASP Top 10](https://owasp.org/www-project-top-ten/)
182+
- [OWASP Java Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Java_Security_Cheat_Sheet.html)
183+
- [CWE (Common Weakness Enumeration)](https://cwe.mitre.org/)
184+
- [CVSS Calculator](https://www.first.org/cvss/calculator/3.1)
185+
186+
### Related Documentation
187+
- [Contributing Guidelines](CONTRIBUTING.md)
188+
- [Code of Conduct](CODE_OF_CONDUCT.md)
189+
- [Project Documentation](docs/)
190+
191+
## 📞 Contact Information
192+
193+
### Security Team
194+
- **Primary Contact:** Pascal Wilbrink ([[email protected]](mailto:[email protected]))
195+
- **GitHub:** [@pascalwilbrink](https://github.com/pascalwilbrink)
196+
197+
### General Questions
198+
For general security questions (not vulnerability reports):
199+
- **GitHub Discussions:** [AG-UI-4J Discussions](https://github.com/Work-m8/ag-ui-4j/discussions)
200+
- **GitHub Issues:** [Create a question issue](https://github.com/Work-m8/ag-ui-4j/issues/new?template=question.yml)
201+
202+
---
203+
204+
**Thank you for helping keep AG-UI-4J and our community safe!** 🙏
205+
206+
*Last updated: August 9 2025*

sdks/community/java/clients/ok-http/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
---
77

8-
This package contains the [Abstract Agent](./src/main/java/io/workm8/agui4j/client/agent/AbstractAgent.java).
8+
This package contains the [Abstract Agent](./src/main/java/com/agui/client/agent/AbstractAgent.java).
99

1010
### Dependency
1111

1212
```xml
1313
<dependency>
14-
<groupId>io.workm8.agui4j</groupId>
14+
<groupId>com.ag-ui</groupId>
1515
<artifactId>client</artifactId>
1616
<version>4.12.0</version>
1717
</dependency>

sdks/community/java/clients/ok-http/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
7-
<groupId>io.workm8.agui4j</groupId>
7+
<groupId>com.ag-ui</groupId>
88
<artifactId>ag-ui</artifactId>
99
<version>0.0.1</version>
1010
<relativePath>../../pom.xml</relativePath>
@@ -13,8 +13,8 @@
1313
<artifactId>ok-http</artifactId>
1414
<version>${okhttp.version}</version>
1515

16-
<name>AG-UI-4J Ok-http</name>
17-
<description>AG-UI-4J Ok-http Client</description>
16+
<name>AG-UI Ok-http</name>
17+
<description>AG-UI Ok-http Client</description>
1818

1919
<properties>
2020
<okhttp.version>4.12.0</okhttp.version>
@@ -24,12 +24,12 @@
2424

2525
<dependencies>
2626
<dependency>
27-
<groupId>io.workm8.agui4j</groupId>
27+
<groupId>com.ag-ui</groupId>
2828
<artifactId>http</artifactId>
2929
<version>${ag-ui.version}</version>
3030
</dependency>
3131
<dependency>
32-
<groupId>io.workm8.agui4j</groupId>
32+
<groupId>com.ag-ui</groupId>
3333
<artifactId>json</artifactId>
3434
<version>${ag-ui.version}</version>
3535
</dependency>
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
package io.workm8.agui4j.okhttp;
1+
package com.agui.okhttp;
22

3+
import com.agui.core.agent.RunAgentInput;
4+
import com.agui.core.event.BaseEvent;
5+
import com.agui.json.ObjectMapperFactory;
36
import com.fasterxml.jackson.databind.ObjectMapper;
4-
5-
import io.workm8.agui4j.core.agent.RunAgentInput;
6-
import io.workm8.agui4j.core.event.BaseEvent;
7-
import io.workm8.agui4j.http.BaseHttpClient;
8-
import io.workm8.agui4j.json.ObjectMapperFactory;
7+
import com.agui.http.BaseHttpClient;
98
import okhttp3.*;
109

1110
import java.io.BufferedReader;
@@ -27,7 +26,7 @@
2726
* Key features:
2827
* <ul>
2928
* <li>Server-Sent Events (SSE) support for real-time event streaming</li>
30-
* <li>JSON serialization/deserialization using Jackson with agui4j mixins</li>
29+
* <li>JSON serialization/deserialization using Jackson with agui mixins</li>
3130
* <li>Cancellation support through both CompletableFuture and AtomicBoolean tokens</li>
3231
* <li>Infinite read timeout for long-lived streaming connections</li>
3332
* <li>Automatic HTTP connection management and cleanup</li>
@@ -78,7 +77,7 @@ public class HttpClient implements BaseHttpClient {
7877
* <p>
7978
* This constructor initializes the OkHttp client with optimized settings
8079
* for streaming connections and configures Jackson ObjectMapper with
81-
* agui4j-specific mixins for proper event serialization.
80+
* agui-specific mixins for proper event serialization.
8281
* <p>
8382
* The OkHttp client is configured with:
8483
* <ul>

0 commit comments

Comments
 (0)