Skip to content

Implement Java SDK#1

Open
bettercallsaulj wants to merge 7 commits intomainfrom
dev_java_sdk
Open

Implement Java SDK#1
bettercallsaulj wants to merge 7 commits intomainfrom
dev_java_sdk

Conversation

@bettercallsaulj
Copy link
Collaborator

No description provided.

RahulHere added 7 commits January 22, 2026 22:09
- Remove C++ files: .clang-format, cmake/, CMakeLists.txt, Makefile,
  src/, include/, examples/, tests/, build.sh
- Remove C++ CI workflow (pr-format-check.yml)
- Update submodule from gopher-mcp to gopher-orch (commit 6b45ffbb)
- Update .gitignore for Java development
Build script to compile gopher-orch native library for JNI/JNA integration.

Features:
- Submodule update with custom SSH host support (GITHUB_SSH_HOST)
- CMake build with Release configuration
- Library installation to native/lib and native/include
- --clean flag to clean build artifacts while preserving _deps
Java SDK for gopher-orch providing AI agent orchestration with native
C++ performance through JNA bindings.

Features:
- Java 8+ compatibility
- Maven build system with JNA and Gson dependencies
- GopherAgent class with builder pattern configuration
- Try-with-resources support (AutoCloseable)
- Typed exceptions (AgentException, ApiKeyException, etc.)
- JUnit 5 tests
Example demonstrating GopherAgent usage with local MCP servers:
- ClientExampleJson.java: Example using JSON server configuration
- client_example_json_run.sh: Script to start MCP servers and run example
- server3001/server3002: Mock MCP servers for testing
Add unit tests to verify that Java can correctly call C++ functions
through JNA FFI bindings.

Tests include:
- GopherOrchLibraryTest: Direct FFI layer tests
  - Library availability check
  - Agent creation functions (by JSON, by API key)
  - Error handling functions
  - Null pointer handling
- GopherAgentIntegrationTest: High-level integration tests
  - Agent lifecycle (create, dispose, try-with-resources)
  - Multiple agent instances
  - Run after dispose throws exception
  - Shutdown and reinit

Integration tests that require agent creation are skipped when
API keys are not available, using JUnit 5 Assumptions.
Adds Spotless with google-java-format for consistent code style.

Changes:
- Add spotless-maven-plugin 2.43.0 to pom.xml
- Configure google-java-format 1.19.2 with AOSP style
- Update README.md with mvn spotless:apply and mvn spotless:check commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant