Skip to content

Commit 6b84d71

Browse files
feat: add AG-UI-4K Kotlin Multiplatform SDK
Introduces a comprehensive Kotlin Multiplatform SDK for the Agent User Interaction Protocol (AG-UI) supporting Android, iOS, and JVM platforms. ## Features - Modular architecture with 4 specialized modules (core, client, tools, agent-sdk) - Real-time streaming with SSE support - Type-safe protocol implementation with kotlinx.serialization - Extensible tool execution framework - State management with JSON Patch support - Multiple authentication methods (Bearer, API Key, Basic Auth) ## Modules - **kotlin-core**: Protocol types, events, and message definitions - **kotlin-client**: HTTP transport, SSE parsing, and state management - **kotlin-tools**: Tool execution framework with error handling - **kotlin-agent-sdk**: High-level agent implementations ## Examples - Chat application with Compose Multiplatform UI - Java Android chat app demonstrating interop - Tool executor examples ## Testing - 140+ unit tests across all modules - Platform-specific test coverage - Integration test suites 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 54c7ba0 commit 6b84d71

File tree

246 files changed

+34100
-0
lines changed

Some content is hidden

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

246 files changed

+34100
-0
lines changed

kotlin-sdk/.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# IDE and build files
2+
.idea/
3+
*.iml
4+
*.ipr
5+
*.iws
6+
.vscode/
7+
.fleet/
8+
9+
# Gradle
10+
.gradle/
11+
build/
12+
gradle-app.setting
13+
!gradle-wrapper.jar
14+
.gradletasknamecache
15+
16+
# Local configuration
17+
local.properties
18+
*.local
19+
20+
# OS-specific files
21+
.DS_Store
22+
Thumbs.db
23+
*.swp
24+
*.swo
25+
*~
26+
27+
# Android
28+
*.apk
29+
*.ap_
30+
*.aab
31+
*.dex
32+
*.class
33+
captures/
34+
.externalNativeBuild
35+
.cxx
36+
37+
# iOS
38+
*.mode1v3
39+
*.mode2v3
40+
*.moved-aside
41+
*.pbxuser
42+
*.perspectivev3
43+
**/*.xcworkspace/xcuserdata/
44+
**/*.xcodeproj/xcuserdata/
45+
*.xccheckout
46+
*.xcscmblueprint
47+
DerivedData/
48+
*.hmap
49+
*.ipa
50+
*.dSYM.zip
51+
*.dSYM
52+
53+
# Kotlin
54+
*.kotlin_module
55+
.kotlin/
56+
57+
# Logs
58+
*.log
59+
logs/
60+
61+
# Testing
62+
*.exec
63+
*.ec
64+
test-results/
65+
reports/
66+
67+
# Claude-specific files
68+
CLAUDE.md
69+
claude.json
70+
.claude/
71+
72+
# Documentation build output
73+
docs/api/
74+
dokka/
75+
76+
# Maven/Publishing
77+
target/
78+
pom.xml.tag
79+
pom.xml.releaseBackup
80+
pom.xml.versionsBackup
81+
pom.xml.next
82+
release.properties
83+
84+
# JVM crash logs
85+
hs_err_pid*
86+
87+
# Temporary files
88+
tmp/
89+
temp/
90+
*.tmp
91+
*.bak
92+
*.backup
93+
94+
# Package files
95+
*.jar
96+
!gradle/wrapper/gradle-wrapper.jar
97+
*.war
98+
*.ear
99+
*.zip
100+
*.tar.gz
101+
*.rar
102+
103+
# Virtual machine crash logs
104+
hs_err_pid*

kotlin-sdk/CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
### Performance Improvements
2+
- Up to 2x faster compilation with K2 compiler
3+
- Reduced memory usage in streaming scenarios
4+
- Smaller binary sizes due to better optimization
5+
- Improved coroutine performance with latest kotlinx.coroutines# Changelog
6+
7+
All notable changes to ag-ui-4k will be documented in this file.
8+
9+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11+
12+
## [0.1.0] - 2025-06-14
13+
14+
### Added
15+
- Initial release of ag-ui-4k client library
16+
- Core AG-UI protocol implementation for Kotlin Multiplatform
17+
- HttpAgent client with SSE support for connecting to AG-UI agents
18+
- Event-driven streaming architecture using Kotlin Flows
19+
- Full type safety with sealed classes for events and messages
20+
- Support for Android, iOS, and JVM platforms
21+
- Comprehensive event types (lifecycle, messages, tools, state)
22+
- State management with snapshots and deltas
23+
- Tool integration for human-in-the-loop workflows
24+
- Cancellation support through coroutines
25+
- Built with Kotlin 2.1.21 and K2 compiler
26+
- Powered by Ktor 3.1.3 for networking
27+
- Uses kotlinx.serialization 1.8.1 for JSON handling
28+
- Comprehensive documentation and examples
29+
- GitHub Actions CI/CD workflow
30+
- Detekt static code analysis

kotlin-sdk/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Mark Fogle
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)